# HG changeset patch # User Matti Laitinen # Date 1265896258 -7200 # Node ID 818e61de6cd1e25c3bc67db12ac14762984569bc Add initial version of Crash Analyser cmdline under EPL diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Attributes/PropCat.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Attributes/PropCat.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace CrashDebuggerLib.Attributes +{ + public class PropCat : Attribute + { + #region Enumerations + public enum TFormatType + { + EFormatAsString = 0, + EFormatAsDecimal, + EFormatAsHex, + EFormatAsHexWithoutPrefix, + EFormatAsYesNo, + EFormatRecurseInto + } + #endregion + + #region Constructors + public PropCat( string aCategory ) + : this( aCategory, string.Empty ) + { + } + + public PropCat( string aCategory, string aTitle ) + : this( aCategory, aTitle, TFormatType.EFormatAsString ) + { + } + + public PropCat( string aCategory, TFormatType aFormatType ) + : this( aCategory, string.Empty, aFormatType ) + { + } + + public PropCat( string aCategory, string aTitle, TFormatType aFormatType ) + : this( aCategory, aTitle, aFormatType, string.Empty ) + { + } + + public PropCat( string aCategory, string aTitle, TFormatType aFormatType, string aNumericalFormat ) + { + iCategory = aCategory; + iTitle = aTitle; + iFormatType = aFormatType; + iNumericalFormat = aNumericalFormat; + } + #endregion + + #region Properties + public string Category + { + get { return iCategory; } + } + + public string Title + { + get { return iTitle; } + } + + public string NumericalFormat + { + get + { + string ret = iNumericalFormat; + // + if ( String.IsNullOrEmpty( ret ) ) + { + switch ( FormatType ) + { + case TFormatType.EFormatAsDecimal: + ret = "d"; + break; + case TFormatType.EFormatAsHex: + ret = "x"; + break; + } + } + // + return ret; + } + } + + public TFormatType FormatType + { + get { return iFormatType; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly string iCategory; + private readonly string iTitle; + private readonly string iNumericalFormat; + private readonly TFormatType iFormatType; + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/CrashDebuggerInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/CrashDebuggerInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,304 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using CrashDebuggerLib.Structures.Chunk; +using CrashDebuggerLib.Structures.CodeSeg; +using CrashDebuggerLib.Structures.Cpu; +using CrashDebuggerLib.Structures.DebugMask; +using CrashDebuggerLib.Structures.Fault; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Library; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.Scheduler; +using CrashDebuggerLib.Structures.Thread; +using CrashDebuggerLib.Structures.UserContextTable; +using CrashDebuggerLib.Threading; +using SymbianDebugLib.Engine; +using SymbianStructuresLib.Debug.Symbols; +using SymbianUtils; + +namespace CrashDebuggerLib.Structures +{ + public class CrashDebuggerInfo : DisposableObject, IEnumerable + { + #region Constructors + public CrashDebuggerInfo( DbgEngine aDebugEngine ) + { + iDebugEngine = aDebugEngine; + iDebugEngineView = aDebugEngine.CreateView( "CrashDebugger" ); + // + iTheCurrentProcess = new DProcess( this ); + iTheCurrentThread = new DThread( this ); + iCodeSegs = new CodeSegCollection( this ); + iInfoCpu = new CpuInfo( this ); + iInfoFault = new FaultInfo( this ); + iInfoScheduler = new SchedulerInfo( this ); + iInfoDebugMask = new DebugMaskInfo( this ); + // + MakeEmptyContainers(); + } + #endregion + + #region API + public void Clear() + { + iTheCurrentProcess = new DProcess( this ); + iTheCurrentThread = new DThread( this ); + iCodeSegs.Clear(); + iInfoCpu.Clear(); + iInfoFault.Clear(); + iInfoScheduler.Clear(); + iInfoDebugMask.Clear(); + + iUserContextTableManager = new UserContextTableManager(); + iAsyncOperationManager.Clear(); + + MakeEmptyContainers(); + } + + public DObjectCon ContainerByType( DObject.TObjectType aType ) + { + DObjectCon ret = null; + // + foreach ( DObjectCon container in iContainers ) + { + if ( container.Type == aType ) + { + ret = container; + break; + } + } + // + if ( ret == null ) + { + throw new ArgumentException( "Bad container type: " + aType ); + } + // + return ret; + } + + public DObject ObjectByAddress( uint aAddress ) + { + DObject ret = null; + // + foreach ( DObjectCon container in iContainers ) + { + DObject conObject = container[ aAddress ]; + if ( conObject != null ) + { + ret = conObject; + break; + } + } + // + return ret; + } + + public DThread ThreadByAddress( uint aAddress ) + { + DObjectCon con = ContainerByType( DObject.TObjectType.EThread ); + DObject ret = con[ aAddress ]; + return ( ret != null )? ret as DThread : null; + } + + public DProcess ProcessByAddress( uint aAddress ) + { + DObjectCon con = ContainerByType( DObject.TObjectType.EProcess ); + DObject ret = con[ aAddress ]; + return ( ret != null ) ? ret as DProcess : null; + } + + public DChunk ChunkByAddress( uint aAddress ) + { + DObjectCon con = ContainerByType( DObject.TObjectType.EChunk ); + DObject ret = con[ aAddress ]; + return ( ret != null ) ? ret as DChunk : null; + } + + public DLibrary LibraryByAddress( uint aAddress ) + { + DObjectCon con = ContainerByType( DObject.TObjectType.ELibrary ); + DObject ret = con[ aAddress ]; + return ( ret != null ) ? ret as DLibrary : null; + } + + public CodeSegEntry CodeSegByAddress( uint aAddress ) + { + return iCodeSegs[ aAddress ]; + } + #endregion + + #region Properties + public DProcess TheCurrentProcess + { + get { return iTheCurrentProcess; } + } + + public DThread TheCurrentThread + { + get { return iTheCurrentThread; } + } + + public CpuInfo InfoCpu + { + get { return iInfoCpu; } + } + + public FaultInfo InfoFault + { + get { return iInfoFault; } + } + + public SchedulerInfo InfoScheduler + { + get { return iInfoScheduler; } + } + + public DebugMaskInfo InfoDebugMask + { + get { return iInfoDebugMask; } + } + + public CodeSegCollection CodeSegs + { + get { return iCodeSegs; } + } + + public DObjectCon this[ DObject.TObjectType aType ] + { + get + { + return ContainerByType( aType ); + } + } + + public DbgEngine DebugEngine + { + get { return iDebugEngine; } + } + #endregion + + #region Internal methods + internal UserContextTableManager UserContextTableManager + { + get { return iUserContextTableManager; } + } + + internal Symbol LookUpSymbol( uint aAddress ) + { + Symbol symbol = null; + // + if ( iDebugEngineView != null ) + { + symbol = iDebugEngineView.Symbols[ aAddress ]; + } + // + return symbol; + } + + internal AsyncOperationManager AsyncOperationManager + { + get { return iAsyncOperationManager; } + } + + internal bool IsCurrentThread( DThread aThread ) + { + return ( aThread.KernelAddress == TheCurrentThread.KernelAddress && TheCurrentThread.KernelAddress != 0 ); + } + + internal bool IsCurrentProcess( DProcess aProcess ) + { + return ( aProcess.KernelAddress == TheCurrentProcess.KernelAddress && TheCurrentProcess.KernelAddress != 0 ); + } + + private void MakeEmptyContainers() + { + iContainers.Clear(); + // + for ( int i = 0; i < (int) DObject.TObjectType.ENumObjectTypes; i++ ) + { + DObject.TObjectType type = (DObject.TObjectType) i; + DObjectCon container = new DObjectCon( this, type ); + iContainers.Add( container ); + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iDebugEngineView != null ) + { + iDebugEngineView.Dispose(); + iDebugEngineView = null; + } + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( DObjectCon entry in iContainers ) + { + yield return entry; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( DObjectCon entry in iContainers ) + { + yield return entry; + } + } + #endregion + + #region Data members + private DbgEngineView iDebugEngineView; + private DProcess iTheCurrentProcess; + private DThread iTheCurrentThread; + private readonly CodeSegCollection iCodeSegs; + private readonly CpuInfo iInfoCpu; + private readonly FaultInfo iInfoFault; + private readonly SchedulerInfo iInfoScheduler; + private readonly DebugMaskInfo iInfoDebugMask; + private readonly DbgEngine iDebugEngine; + private List iContainers = new List(); + private UserContextTableManager iUserContextTableManager = new UserContextTableManager(); + private AsyncOperationManager iAsyncOperationManager = new AsyncOperationManager(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/CrashDebuggerLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/CrashDebuggerLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,179 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA} + Library + Properties + CrashDebuggerLib + CrashDebuggerLib + + + 2.0 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1} + SymbianParserLib + + + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3} + SymbianStackLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/CrashDebuggerParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/CrashDebuggerParser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianParserLib.Engine; +using SymbianParserLib.Elements; +using CrashDebuggerLib.Parsers.State; +using CrashDebuggerLib.Structures; + +namespace CrashDebuggerLib.Parsers +{ + public class CrashDebuggerParser : AsyncTextFileReader + { + #region Constructors + public CrashDebuggerParser( CrashDebuggerInfo aCrashDebugger, string aFileName ) + : base( aFileName ) + { + iCrashDebugger = aCrashDebugger; + // + iCommandParser.ParagraphComplete += new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler( CommandParser_ParagraphComplete ); + PrepareCommandParser(); + + // We need to preserve white space + TrimLine = false; + } + #endregion + + #region API + public void ParseCrashData() + { + base.AsyncRead(); + } + #endregion + + #region Properties + public CrashDebuggerInfo CrashDebugger + { + get { return iCrashDebugger; } + } + #endregion + + #region Internal methods + private void PrepareCommandParser() + { + StateFactory.RegisterCommands( iCommandParser ); + } + #endregion + + #region Internal constants + #endregion + + #region Event handlers + void CommandParser_ParagraphComplete( SymbianParserLib.BaseStructures.ParserElementBase aElement ) + { + TState state = (TState) aElement.Tag; + State.State nextState = StateFactory.Create( state, this ); + // + if ( iStateObject != null ) + { + iStateObject.Finalise(); + iStateObject = null; + } + // + if ( nextState == null ) + { + throw new ArgumentException( "Invalid state: " + state ); + } + // + iStateObject = nextState; + iCurrentState = state; + // +#if DEBUG + System.Diagnostics.Debug.WriteLine( "SWITCHING STATE: => " + iStateObject.GetType().ToString() ); +#endif + } + #endregion + + #region From AsyncTextFileReader + protected override void HandleReadStarted() + { + iCrashDebugger.Clear(); + base.HandleReadStarted(); + } + + protected override void HandleReadCompleted() + { + try + { + if ( iStateObject != null ) + { + iStateObject.Finalise(); + iStateObject = null; + } + + // Start the async op queue + iCrashDebugger.AsyncOperationManager.Start(); + } + finally + { + base.HandleReadCompleted(); + } + + System.Diagnostics.Debug.WriteLine( "TOTAL REGEX TICKS - " + SymbianParserLib.RegExTranslators.TheTickCounter.TickCount.ToString( "d12" ) ); + } + + protected override void HandleFilteredLine( string aLine ) + { + string line = aLine; + bool consumed = iCommandParser.OfferLine( ref line ); + if ( !consumed && iStateObject != null ) + { + ParserEngine stateParser = iStateObject.ParserEngine; + stateParser.OfferLine( ref line ); + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Internal LUT + #endregion + + #region Data members + private readonly CrashDebuggerInfo iCrashDebugger; + private ParserEngine iCommandParser = new ParserEngine(); + private State.State iStateObject = null; + private TState iCurrentState = TState.EStateIdle; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Parsers.State.Implementation.Helpers; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal abstract class StateContainerBase : State + { + #region Constructors + protected StateContainerBase( CrashDebuggerParser aParser ) + : base( aParser ) + { + DObject temp = CreateNewObject(); + iObjectType = temp.Type; + } + #endregion + + #region API + public override void Prepare() + { + DObjectCon container = CrashDebugger.ContainerByType( iObjectType ); + // + ParserLine l1 = ParserLine.NewSymFormat( "Container %d at %08x contains %d %S:\r\n" ); + l1[ 0 ].SetTargetProperty( container, "Index" ); + l1[ 1 ].SetTargetProperty( container, "KernelAddress" ); + l1[ 2 ].SetTargetProperty( container, "ExpectedCount" ); + l1.ElementComplete += new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler( ContainerCountInfoComplete ); + // + ParserParagraph para = new ParserParagraph( "CONTAINER [" + container.TypeDescription + "]" ); + para.Add( l1 ); + ParserEngine.Add( para ); + // + CreateEntryDetector(); + } + + public override void Finalise() + { + } + #endregion + + #region Abstract API + protected abstract DObject CreateNewObject(); + + protected virtual bool IsObjectReadyForSaving( DObject aObject ) + { + bool ret = ( aObject.KernelAddress != 0 ); + return ret; + } + + protected virtual void CreateEntryParagraphs( DObject aObject ) + { + string name = "ENTRY [" + Container.TypeDescription + "]"; + ParserParagraph para = iHelperDObject.CreateMonitorObjectParagraph( name, aObject ); + ParserEngine.Add( para ); + } + + protected virtual void CreateEntryParser() + { + // Remove all the old entries + ParserEngine.Reset(); + + // Save last thread if it looks valid + if ( iCurrentObject != null ) + { + bool ready = IsObjectReadyForSaving( iCurrentObject ); + if ( ready ) + { + Container.Add( iCurrentObject ); + iCurrentObject = null; + } + } + + // Create a new object which will contain the next set of parser data + iCurrentObject = CreateNewObject(); + + // Use the helper to prepare next paragraphs + CreateEntryParagraphs( iCurrentObject ); + + // Catch the next new entry + CreateEntryDetector(); + } + + protected virtual void CreateEntryDetector() + { + string containerType = Container.TypeDescription; + ParserParagraph para = iHelperDObject.CreateEntryDetector( containerType, new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler( NewElementDetected ) ); + ParserEngine.Add( para ); + } + #endregion + + #region Properties + protected DObjectCon Container + { + get { return CrashDebugger.ContainerByType( iObjectType ); } + } + + protected DObject.TObjectType ObjectType + { + get + { + return iObjectType; + } + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + void NewElementDetected( SymbianParserLib.BaseStructures.ParserElementBase aElement ) + { + CreateEntryParser(); + } + + void ContainerCountInfoComplete( SymbianParserLib.BaseStructures.ParserElementBase aElement ) + { + } + #endregion + + #region Data members + private DObject iCurrentObject = null; + private HelperDObject iHelperDObject = new HelperDObject(); + private readonly DObject.TObjectType iObjectType; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerChangeNotifiers.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerChangeNotifiers.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.ChangeNotifier; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerChangeNotifiers : StateContainerBase + { + #region Constructors + public StateContainerChangeNotifiers( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DChangeNotifier( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerChunks.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerChunks.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Chunk; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerChunks : StateContainerBase + { + #region Constructors + public StateContainerChunks( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DChunk( CrashDebugger ); + } + #endregion + + #region Internal methods + protected override void CreateEntryParagraphs( DObject aObject ) + { + DChunk chunk = (DChunk) aObject; + iHelper.CreateMonitorChunk( ParserEngine, "ENTRY [" + Container.TypeDescription + "]", chunk ); + } + #endregion + + #region Event handlers + #endregion + + #region Data members + private Helpers.HelperDChunk iHelper = new CrashDebuggerLib.Parsers.State.Implementation.Helpers.HelperDChunk(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerCodeSegs.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerCodeSegs.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Fault; +using CrashDebuggerLib.Structures.CodeSeg; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerCodeSegs : State + { + #region Constructors + public StateContainerCodeSegs( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + public override void Prepare() + { + PrepareEntryParser(); + } + + public override void Finalise() + { + + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void PrepareEntryParser() + { + ParserParagraph para = new ParserParagraph( "CODE SEGS" ); + // + ParserLine l1 = ParserLine.NewSymFormat( "\r\nCodeSeg at %08x:\r\n" ); + ParserLine l2 = ParserLine.NewSymFormat( " FileName: %S\r\n" ); + ParserLine l3 = ParserLine.NewSymFormat( " RunAddress: %08x\r\n" ); + + para.ElementComplete += new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler( ParagraphComplete ); + // + para.Add( l1, l2, l3 ); + ParserEngine.Add( para ); + } + #endregion + + #region Event handlers + void ParagraphComplete( SymbianParserLib.BaseStructures.ParserElementBase aElement ) + { + ParserParagraph para = (ParserParagraph) aElement; + // + ParserField fAddress = para[ 0 ][ 0 ]; + ParserField fFileName = para[ 1 ][ 0 ]; + ParserField fRunAddress = para[ 2 ][ 0 ]; + // + uint address = fAddress.AsUint; + string fName = fFileName.AsString; + uint runAddress = fRunAddress.AsUint; + // + CodeSegEntry entry = new CodeSegEntry( CrashDebugger, address, fName ); + entry.RunAddress = runAddress; + CrashDebugger.CodeSegs.Add( entry ); + + // Remove completed entry, add a new one + ParserEngine.Remove( para ); + PrepareEntryParser(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerConditionalVariables.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerConditionalVariables.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.ConditionalVariable; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerConditionalVariables : StateContainerBase + { + #region Constructors + public StateContainerConditionalVariables( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DCondVar( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerLibraries.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerLibraries.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Library; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerLibraries : StateContainerBase + { + #region Constructors + public StateContainerLibraries( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DLibrary( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerLogicalChannels.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerLogicalChannels.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.LogicalChannel; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerLogicalChannels : StateContainerBase + { + #region Constructors + public StateContainerLogicalChannels( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DLogicalChannel( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerLogicalDevices.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerLogicalDevices.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.LogicalDevice; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerLogicalDevices : StateContainerBase + { + #region Constructors + public StateContainerLogicalDevices( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DLogicalDevice( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerMessageQueues.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerMessageQueues.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.MessageQueue; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerMessageQueues : StateContainerBase + { + #region Constructors + public StateContainerMessageQueues( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DMsgQueue( CrashDebugger ); + } + + protected override void CreateEntryParagraphs( DObject aObject ) + { + string name = "ENTRY [" + Container.TypeDescription + "]"; + iHelperDMsgQueue.CreateMonitorMessageQueue( ParserEngine, name, aObject as DMsgQueue ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + private Helpers.HelperDMsgQueue iHelperDMsgQueue = new CrashDebuggerLib.Parsers.State.Implementation.Helpers.HelperDMsgQueue(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerMutexes.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerMutexes.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Mutex; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerMutexes : StateContainerBase + { + #region Constructors + public StateContainerMutexes( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DMutex( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerPhysicalDevices.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerPhysicalDevices.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.PhysicalDevice; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerPhysicalDevices : StateContainerBase + { + #region Constructors + public StateContainerPhysicalDevices( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DPhysicalDevice( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerProcesses.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerProcesses.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Thread; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerProcesses : State + { + #region Constructors + public StateContainerProcesses( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + public override void Prepare() + { + DObjectCon container = CrashDebugger.ContainerByType( DObject.TObjectType.EProcess ); + // + ParserLine l1 = ParserLine.NewSymFormat( "Container %d at %08x contains %d %S:\r\n" ); + l1[ 0 ].SetTargetProperty( container, "Index" ); + l1[ 1 ].SetTargetProperty( container, "KernelAddress" ); + l1[ 2 ].SetTargetProperty( container, "ExpectedCount" ); + l1.ElementComplete += new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler( HeaderLine_ElementComplete ); + // + ParserParagraph para = new ParserParagraph( "CONTAINER [" + container.TypeDescription + "]" ); + para.Add( l1 ); + ParserEngine.Add( para ); + } + + public override void Finalise() + { + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void PrepareEntryParser() + { + // Junk the old paragraphs + ParserEngine.Reset(); + + // Get a handle to our destination container + DObjectCon container = CrashDebugger.ContainerByType( DObject.TObjectType.EProcess ); + + // Save last thread if it looks valid + if ( iCurrentObject != null && iCurrentObject.KernelAddress != 0 ) + { + bool alreadyExists = container.Contains( iCurrentObject ); + if ( !alreadyExists ) + { + container.Add( iCurrentObject ); + } + // + iCurrentObject = null; + } + + // Create a new object which will contain the next set of parser data + iCurrentObject = new DProcess( CrashDebugger ); + + // Use the helper to prepare next paragraphs + iHelper.CreateMonitorProcess( ParserEngine, "ENTRY [" + container.TypeDescription + "]", iCurrentObject, new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler( ProcessChunksComplete_ElementHandler ) ); + } + #endregion + + #region Event handlers + void ProcessChunksComplete_ElementHandler( SymbianParserLib.BaseStructures.ParserElementBase aElement ) + { + PrepareEntryParser(); + } + + void HeaderLine_ElementComplete( SymbianParserLib.BaseStructures.ParserElementBase aElement ) + { + PrepareEntryParser(); + } + #endregion + + #region Data members + private DProcess iCurrentObject = null; + private Helpers.HelperDProcess iHelper = new CrashDebuggerLib.Parsers.State.Implementation.Helpers.HelperDProcess(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerPropertyRefs.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerPropertyRefs.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.PropertyRef; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerPropertyRefs : StateContainerBase + { + #region Constructors + public StateContainerPropertyRefs( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DPropertyRef( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerSemaphores.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerSemaphores.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Semaphore; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerSemaphores : StateContainerBase + { + #region Constructors + public StateContainerSemaphores( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DSemaphore( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerServers.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerServers.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Server; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerServers : StateContainerBase + { + #region Constructors + public StateContainerServers( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DServer( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerSessions.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerSessions.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Session; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerSessions : StateContainerBase + { + #region Constructors + public StateContainerSessions( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DSession( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerThreads.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerThreads.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Thread; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerThreads : State + { + #region Constructors + public StateContainerThreads( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + public override void Prepare() + { + DObjectCon container = CrashDebugger.ContainerByType( DObject.TObjectType.EThread ); + // + ParserLine l1 = ParserLine.NewSymFormat( "Container %d at %08x contains %d %S:\r\n" ); + l1[ 0 ].SetTargetProperty( container, "Index" ); + l1[ 1 ].SetTargetProperty( container, "KernelAddress" ); + l1[ 2 ].SetTargetProperty( container, "ExpectedCount" ); + l1.ElementComplete += new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler( HeaderLine_ElementComplete ); + // + ParserParagraph para = new ParserParagraph( "CONTAINER [" + container.TypeDescription + "]" ); + para.Add( l1 ); + ParserEngine.Add( para ); + } + + public override void Finalise() + { + + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void PrepareEntryParser() + { + // Junk the old paragraphs + ParserEngine.Reset(); + + // Get a handle to our destination container + DObjectCon container = CrashDebugger.ContainerByType( DObject.TObjectType.EThread ); + + // Save last thread if it looks valid + if ( iCurrentObject != null && iCurrentObject.KernelAddress != 0 ) + { + bool alreadyExists = container.Contains( iCurrentObject ); + if ( !alreadyExists ) + { + container.Add( iCurrentObject ); + } + // + iCurrentObject = null; + } + + // Create a new object which will contain the next set of parser data + iCurrentObject = new DThread( CrashDebugger ); + + // Use the helper to prepare next paragraphs + iHelper.CreateMonitorThread( ParserEngine, "ENTRY [" + container.TypeDescription + "]", iCurrentObject, new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler( PC_Register_ElementComplete ) ); + } + #endregion + + #region Event handlers + void PC_Register_ElementComplete( SymbianParserLib.BaseStructures.ParserElementBase aElement ) + { + PrepareEntryParser(); + } + + void HeaderLine_ElementComplete( SymbianParserLib.BaseStructures.ParserElementBase aElement ) + { + PrepareEntryParser(); + } + #endregion + + #region Data members + private DThread iCurrentObject = null; + private Helpers.HelperDThread iHelper = new CrashDebuggerLib.Parsers.State.Implementation.Helpers.HelperDThread(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerTimers.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerTimers.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Timer; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerTimers : StateContainerBase + { + #region Constructors + public StateContainerTimers( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DTimer( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerUndertakers.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Containers/StateContainerUndertakers.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Undertaker; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateContainerUndertakers : StateContainerBase + { + #region Constructors + public StateContainerUndertakers( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StateContainerBase + protected override DObject CreateNewObject() + { + return new DUndertaker( CrashDebugger ); + } + #endregion + + #region Internal methods + #endregion + + #region Event handlers + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperDChunk.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperDChunk.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Chunk; +using CrashDebuggerLib.Structures.CodeSeg; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; +using SymbianParserLib.BaseStructures; + +namespace CrashDebuggerLib.Parsers.State.Implementation.Helpers +{ + internal class HelperDChunk : HelperDObject + { + #region Constructors + public HelperDChunk() + { + } + #endregion + + #region API + public void CreateMonitorChunk( ParserEngine aEngine, string aName, DChunk aChunk ) + { + ParserParagraph para0 = base.CreateMonitorObjectParagraph( aName, aChunk ); + aEngine.Add( para0 ); + ParserParagraph para1 = CreateChunkMultiple( aName, aChunk ); + aEngine.Add( para1 ); + + // TODO: add support for older memory models? + } + #endregion + + #region Call-back methods + #endregion + + #region Internal methods + private ParserParagraph CreateChunkMultiple( string aName, DChunk aChunk ) + { + ParserParagraph para = new ParserParagraph( aName ); + // + ParserLine l1 = ParserLine.NewSymFormat( "Owning Process %08x OS ASIDS %08x\r\n" ); + l1.SetTargetProperties( aChunk, "OwningProcessAddress", "OSAsids" ); + // + ParserLine l2 = ParserLine.NewSymFormat( "Size %x, MaxSize %x, Base %08x\r\n" ); + l2.SetTargetProperties( aChunk, "Size", "MaxSize", "Base" ); + // + ParserLine l3 = ParserLine.NewSymFormat( "Attrib %x, StartPos %x\r\n" ); + l3.SetTargetProperties( aChunk, "Attributes", "StartPos" ); + // + ParserLine l4 = ParserLine.NewSymFormat( "Type %d\r\n" ); + l4.SetTargetProperty( aChunk, "ChunkType" ); + // + ParserLine l5 = ParserLine.NewSymFormat( "PTE: %08x, PDE: %08x\r\n" ); + l5.SetTargetProperties( aChunk.Permissions, "Pte", "Pde" ); + // + ParserLine l6 = ParserLine.NewSymFormat( "PageTables=%08x, PageBitMap=%08x\r\n" ); + l6.SetTargetProperties( aChunk, "PageTables", "PageBitMap" ); + + para.Add( l1, l2, l3, l4, l5, l6 ); + return para; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperDMsgQueue.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperDMsgQueue.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.MessageQueue; +using CrashDebuggerLib.Structures.CodeSeg; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; +using SymbianParserLib.BaseStructures; + +namespace CrashDebuggerLib.Parsers.State.Implementation.Helpers +{ + internal class HelperDMsgQueue : HelperDObject + { + #region Constructors + public HelperDMsgQueue() + { + } + #endregion + + #region API + public void CreateMonitorMessageQueue( ParserEngine aEngine, string aName, DMsgQueue aQueue ) + { + ParserParagraph para0 = base.CreateMonitorObjectParagraph( aName, aQueue ); + aEngine.Add( para0 ); + ParserParagraph para1 = CreateMessageQueueCommon( aName, aQueue ); + aEngine.Add( para1 ); + } + #endregion + + #region Call-back methods + public void SetMessageQueueState( ParserLine aLine, ParserFieldName aFieldName, string aState ) + { + System.Diagnostics.Debug.Assert( aLine.Tag is DMsgQueue ); + DMsgQueue queue = (DMsgQueue) aLine.Tag; + DMsgQueue.TQueueState state = DMsgQueue.StateByString( aState ); + queue.State = state; + } + #endregion + + #region Internal methods + private ParserParagraph CreateMessageQueueCommon( string aName, DMsgQueue aQueue ) + { + ParserParagraph para = new ParserParagraph( aName ); + // + ParserLine l1 = ParserLine.NewSymFormat( "StartOfPool %08x, EndOfPool %08x\r\n" ); + l1.SetTargetProperties( aQueue.PoolInfo, "Start", "End" ); + // + ParserLine l2 = ParserLine.NewSymFormat( "FirstFullSlot %08x, FirstFreeSlot %08x\r\n" ); + l2.SetTargetProperties( aQueue.SlotInfo, "FirstFull", "FirstFree" ); + // + ParserLine l3 = ParserLine.NewSymFormat( "MaxMsgLength %d\r\n" ); + l3.SetTargetProperties( aQueue, "MaxMessageLength" ); + // + ParserLine l4 = ParserLine.NewSymFormat( "MessageQueue state %S" ); + l4.Tag = aQueue; + l4.SetTargetMethod( this, "SetMessageQueueState" ); + // + ParserLine l5 = ParserLine.NewSymFormat( "ThreadWaitingForData %08x, DataAvailStatPtr %08x\r\n" ); + l5.SetTargetProperties( new object[] { aQueue.WaitData, aQueue.WaitData.RequestStatus }, "WaitingThreadAddress", "Address" ); + // + ParserLine l6 = ParserLine.NewSymFormat( "ThreadWaitingForSpace %08x, SpaceAvailStatPtr %08x\r\n" ); + l6.SetTargetProperties( new object[] { aQueue.WaitSpace, aQueue.WaitSpace.RequestStatus }, "WaitingThreadAddress", "Address" ); + + para.Add( l1, l2, l3, l4, l5, l6 ); + return para; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperDObject.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperDObject.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.CodeSeg; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; +using SymbianParserLib.BaseStructures; + +namespace CrashDebuggerLib.Parsers.State.Implementation.Helpers +{ + internal class HelperDObject + { + #region Constructors + public HelperDObject() + { + } + #endregion + + #region API + public ParserParagraph CreateEntryDetector( string aObjectName, ParserElementBase.ElementCompleteHandler aNewEntryHandler ) + { + ParserParagraph para = new ParserParagraph( "MONITOR_ENTRY_DETECTOR" ); + + // If the "new entry handler" object is utilised, the client wishes to detect when a new entry is created. + // This detection will act as a transient call-back to the client - and won't be used to gather any specific + // information besides that a new entry has been detected. Furthermore, the entry will be non-consuming and + // dequeue itself once it "fires" since it's purpose has then been served. + if ( aNewEntryHandler == null ) + { + throw new ArgumentException( "aNewEntryHandler cannot be NULL" ); + } + + ParserLine newEntryLine = ParserLine.NewSymFormat( aObjectName.ToUpper() + " at %08x VPTR=%08x AccessCount=%d Owner=%08x\r\n" ); + newEntryLine.ElementComplete += new ParserElementBase.ElementCompleteHandler( aNewEntryHandler ); + newEntryLine.DequeueIfComplete = true; + newEntryLine.NeverConsumesLine = true; + para.Add( newEntryLine ); + return para; + } + + public ParserParagraph CreateMonitorObjectParagraph( string aName, DObject aObject ) + { + ParserParagraph para = new ParserParagraph( aName ); + + // This is a real line that will gather and save information for the client... + ParserLine l1 = ParserLine.NewSymFormat( "%S at %08x VPTR=%08x AccessCount=%d Owner=%08x\r\n" ); + l1.SetTargetProperties( aObject, "", "KernelAddress", "VTable", "AccessCount", "OwnerAddress" ); + l1[ 0 ].SetTargetObject(); + // + ParserLine l2 = ParserLine.NewSymFormat( "Full name %S\r\n" ); + l2.SetTargetProperties( aObject, "Name" ); + // + para.Add( l1, l2 ); + return para; + } + #endregion + + #region Call-back methods + #endregion + + #region Internal methods + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperDProcess.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperDProcess.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.CodeSeg; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; +using SymbianParserLib.BaseStructures; + +namespace CrashDebuggerLib.Parsers.State.Implementation.Helpers +{ + internal class HelperDProcess : HelperDObject + { + #region Constructors + public HelperDProcess() + { + } + #endregion + + #region API + public void CreateMonitorProcess( ParserEngine aEngine, string aName, DProcess aProcess ) + { + CreateMonitorProcess( aEngine, aName, aProcess, null ); + } + + public void CreateMonitorProcess( ParserEngine aEngine, string aName, DProcess aProcess, ParserElementBase.ElementCompleteHandler aLastFieldHandler ) + { + ParserParagraph para0 = base.CreateMonitorObjectParagraph( aName, aProcess ); + aEngine.Add( para0 ); + ParserParagraph para1 = CreateMonitorProcessCommon( aName, aProcess ); + aEngine.Add( para1 ); + ParserParagraph para2 = CreateMonitorProcessCodeSegs( aName + "_CodeSegs", aProcess ); + aEngine.Add( para2 ); + ParserParagraph para3 = CreateMonitorProcessMemModelMultiple( aName + "_MemModel_Multiple", aProcess, aLastFieldHandler ); + aEngine.Add( para3 ); + + // TODO: add support for older memory models? + } + #endregion + + #region Call-back methods + public void AddCodeSegToProcess( ParserParagraph aParagraph, ParserFieldName aParameterName, uint aParameterValue ) + { + System.Diagnostics.Debug.Assert( aParagraph.Tag is DProcess ); + DProcess process = (DProcess) aParagraph.Tag; + ProcessCodeSegCollection codeSegs = process.CodeSegments; + // + if ( aParameterName == "lib" ) + { + int count = codeSegs.Count; + if ( count > 0 ) + { + ProcessCodeSeg lastEntry = codeSegs[ count - 1 ]; + lastEntry.LibraryAddress = aParameterValue; + } + } + else if ( aParameterName == "seg" ) + { + ProcessCodeSeg entry = new ProcessCodeSeg( process.CrashDebugger ); + entry.CodeSegAddress = aParameterValue; + codeSegs.Add( entry ); + } + } + + public void AddChunkToProcess( ParserParagraph aParagraph, ParserFieldName aParameterName, uint aParameterValue ) + { + System.Diagnostics.Debug.Assert( aParagraph.Tag is DProcess ); + DProcess process = (DProcess) aParagraph.Tag; + ProcessChunkCollection chunks = process.Chunks; + // + ProcessChunk chunk = new ProcessChunk( process.CrashDebugger, aParameterValue, 0 ); + chunks.Add( chunk ); + } + + public void SetChunkAccessCount( ParserParagraph aParagraph, ParserFieldName aParameterName, int aParameterValue ) + { + System.Diagnostics.Debug.Assert( aParagraph.Tag is DProcess ); + DProcess process = (DProcess) aParagraph.Tag; + ProcessChunkCollection chunks = process.Chunks; + // + int count = chunks.Count; + if ( count > 0 ) + { + ProcessChunk lastEntry = chunks[ count - 1 ]; + lastEntry.AccessCount = aParameterValue; + } + } + #endregion + + #region Internal methods + private ParserParagraph CreateMonitorProcessCommon( string aName, DProcess aProcess ) + { + ParserParagraph para = new ParserParagraph( aName ); + // + ParserLine l1 = ParserLine.NewSymFormat( "ExitInfo %d,%d,%lS\r\n" ); + l1.SetTargetProperties( aProcess.ExitInfo, "Type", "Reason", "Category" ); + // + ParserLine l2 = ParserLine.NewSymFormat( "Flags %08x, Handles %08x, Attributes %08x\r\n" ); + l2.SetTargetProperties( aProcess, "Flags", "Handles", "Attributes" ); + // + ParserLine l3 = ParserLine.NewSymFormat( "DataBssChunk %08x, CodeSeg %08x\r\n" ); + l3.SetTargetProperties( aProcess, "DataBssStackChunkAddress", "CodeSegAddress" ); + // + ParserLine l4 = ParserLine.NewSymFormat( "DllLock %08x, Process Lock %08x SID %08x\r\n" ); + l4.SetTargetProperties( new object[] { aProcess.LockInfo, aProcess.LockInfo, aProcess }, "DllMutexAddress", "ProcessMutexAddress", "SID" ); + // + ParserLine l5 = ParserLine.NewSymFormat( "TempCodeSeg %08x CodeSeg %08x Capability %08x %08x\r\n" ); + l5.SetTargetProperties( new object[] { aProcess, aProcess, aProcess.Capabilities, aProcess.Capabilities }, "TempCodeSegAddress", "CodeSegAddress", "HighDWord", "LowDWord" ); + // + ParserLine l6 = ParserLine.NewSymFormat( "Id=%d" ); + l6.SetTargetProperties( aProcess, "Id" ); + + para.Add( l1, l2, l3, l4, l5, l6 ); + return para; + } + + private ParserParagraph CreateMonitorProcessCodeSegs( string aName, DProcess aProcess ) + { + ParserParagraph para = new ParserParagraph( aName ); + para.Tag = aProcess; + + // Loop body - construct this first as we use it for the header line + ParserLine l2 = ParserLine.NewSymFormat( "%2d: seg=%08x lib=%08x\r\n" ); + l2[ 0 ].SetTargetObject(); + l2.SetTargetMethod( this, "AddCodeSegToProcess" ); + + // Loop header + ParserLine l1 = ParserLine.NewSymFormat( "CodeSegs: Count=%d\r\n" ); + l1.SetTargetMethod( l2, "SetRepetitions" ); + + para.Add( l1, l2 ); + return para; + } + + private ParserParagraph CreateMonitorProcessMemModelMultiple( string aName, DProcess aProcess, ParserElementBase.ElementCompleteHandler aLastFieldHandler ) + { + ParserParagraph para = new ParserParagraph( aName ); + para.Tag = aProcess; + if ( aLastFieldHandler != null ) + { + para.ElementComplete += new ParserElementBase.ElementCompleteHandler( aLastFieldHandler ); + } + + // Misc + ParserLine l0 = ParserLine.NewSymFormat( "OS ASID=%d, LPD=%08x, GPD=%08x\r\n" ); + l0.SetTargetProperties( aProcess, "OSASID", "LPD", "GPD" ); + + // Loop body - construct this first as we use it for the header line + ParserLine l2 = ParserLine.NewSymFormat( "%d: Chunk %08x, access count %d\r\n" ); + l2[ 0 ].SetTargetObject(); + l2[ 1 ].SetTargetMethod( this, "AddChunkToProcess" ); + l2[ 2 ].SetTargetMethod( this, "SetChunkAccessCount" ); + + // Loop header + ParserLine l1 = ParserLine.NewSymFormat( "ChunkCount=%d ChunkAlloc=%d\r\n" ); + l1[ 0 ].SetTargetMethod( l2, "SetRepetitions" ); + + para.Add( l0, l1, l2 ); + return para; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperDThread.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperDThread.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.CodeSeg; +using CrashDebuggerLib.Structures.Thread; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; +using SymbianParserLib.BaseStructures; + +namespace CrashDebuggerLib.Parsers.State.Implementation.Helpers +{ + internal class HelperDThread : HelperDObject + { + #region Constructors + public HelperDThread() + { + } + #endregion + + #region API + public void CreateMonitorThread( ParserEngine aEngine, string aName, DThread aThread ) + { + CreateMonitorThread( aEngine, aName, aThread, null ); + } + + public void CreateMonitorThread( ParserEngine aEngine, string aName, DThread aThread, ParserElementBase.ElementCompleteHandler aLastFieldHandler ) + { + // Create DObject paragraph + ParserParagraph para0 = base.CreateMonitorObjectParagraph( aName, aThread ); + aEngine.Add( para0 ); + + // Create MState paragraphs + ParserParagraph para1 = new ParserParagraph( aName + "_MSTATE" ); + para1.Tag = aThread; + aEngine.Add( para1 ); + CreateThreadMState( para1, DThread.TThreadState.ECreated, "CREATED", false ); + CreateThreadMState( para1, DThread.TThreadState.EDead, "DEAD", false ); + CreateThreadMState( para1, DThread.TThreadState.EReady, "READY", false ); + CreateThreadMState( para1, DThread.TThreadState.EWaitSemaphore, "WAITSEM", true ); + CreateThreadMState( para1, DThread.TThreadState.EWaitSemaphoreSuspended, "WAITSEMS", true ); + CreateThreadMState( para1, DThread.TThreadState.EWaitMutex, "WAITMUTEX", true ); + CreateThreadMState( para1, DThread.TThreadState.EWaitMutexSuspended, "WAITMUTXS", true ); + CreateThreadMState( para1, DThread.TThreadState.EHoldMutexPending, "HOLDMUTXP", true ); + CreateThreadMState( para1, DThread.TThreadState.EWaitCondVar, "WAITCONDVAR", true ); + CreateThreadMState( para1, DThread.TThreadState.EWaitCondVarSuspended, "WAITCONDVRS", true ); + CreateThreadMState( para1, DThread.TThreadState.EUnknown, "??", true ); + + // Create common thread paragraph + ParserParagraph para2 = CreateThreadCommon( aName, aThread ); + aEngine.Add( para2 ); + + // Create NThread paragraphs + iHelper.CreateMonitorNThread( aEngine, aName + "_NTHREAD", aThread.NThread, aLastFieldHandler ); + + // TODO: add support for older memory models? + } + #endregion + + #region Call-back methods + void ThreadMState_ElementComplete( ParserElementBase aElement ) + { + ParserLine line = (ParserLine) aElement; + ParserParagraph paragraph = line.Paragraph; + System.Diagnostics.Debug.Assert( paragraph.Tag is DThread ); + DThread thread = (DThread) paragraph.Tag; + DThread.TThreadState state = (DThread.TThreadState) line.Tag; + thread.MState = state; + } + + public void SetThreadMStateWaitObject( ParserParagraph aParagraph, ParserLine aLine, ParserFieldName aParameterName, uint aWaitObjectAddress ) + { + System.Diagnostics.Debug.Assert( aParagraph.Tag is DThread ); + DThread thread = (DThread) aParagraph.Tag; + thread.WaitObj = aWaitObjectAddress; + } + #endregion + + #region Internal methods + private void CreateThreadMState( ParserParagraph aParagraph, DThread.TThreadState aState, string aMStateName, bool aCapturesWaitObject ) + { + StringBuilder format = new StringBuilder( "Thread MState" ); + format.Append( " " + aMStateName ); + // + if ( aCapturesWaitObject ) + { + format.Append( " %8x" ); + } + // + string finalFormat = format.ToString(); + ParserLine l1 = null; + // + if ( aCapturesWaitObject ) + { + l1 = ParserLine.NewSymFormat( finalFormat ); + } + else + { + l1 = ParserLine.New( finalFormat ); + } + + l1.Tag = aState; + l1.ElementComplete += new ParserElementBase.ElementCompleteHandler( ThreadMState_ElementComplete ); + // + if ( aCapturesWaitObject ) + { + l1[ 0 ].SetTargetMethod( this, "SetThreadMStateWaitObject" ); + } + // + aParagraph.Add( l1 ); + } + + private ParserParagraph CreateThreadCommon( string aName, DThread aThread ) + { + ParserParagraph para = new ParserParagraph( aName ); + // + ParserLine l1 = ParserLine.NewSymFormat( "Default priority %d WaitLink Priority %d\r\n" ); + l1.SetTargetProperties( aThread.Priorities, "Default", "WaitLink" ); + // + ParserLine l2 = ParserLine.NewSymFormat( "ExitInfo %d,%d,%lS\r\n" ); + l2.SetTargetProperties( aThread.ExitInfo, "Type", "Reason", "Category" ); + // + ParserLine l3 = ParserLine.NewSymFormat( "Flags %08x, Handles %08x\r\n" ); + l3.SetTargetProperties( aThread, "Flags", "Handles" ); + // + ParserLine l4 = ParserLine.NewSymFormat( "Supervisor stack base %08x size %x\r\n" ); + l4.SetTargetProperties( aThread.StackInfoSupervisor, "BaseAddress", "Size" ); + // + ParserLine l5 = ParserLine.NewSymFormat( "User stack base %08x size %x\r\n" ); + l5.SetTargetProperties( aThread.StackInfoUser, "BaseAddress", "Size" ); + // + ParserLine l6 = ParserLine.NewSymFormat( "Id=%d, Alctr=%08x, Created alctr=%08x, Frame=%08x\r\n" ); + l6.SetTargetProperties( new object[] { aThread, aThread.AllocatorInfo, aThread.AllocatorInfo, aThread }, "Id", "Allocator", "CreatedAllocator", "Frame" ); + // + ParserLine l7 = ParserLine.NewSymFormat( "Trap handler=%08x, ActiveScheduler=%08x, Exception handler=%08x\r\n" ); + l7.SetTargetProperties( aThread.Handlers, "TrapHandler", "ActiveScheduler", "ExceptionHandler" ); + // + ParserLine l8 = ParserLine.NewSymFormat( "TempObj=%08x TempAlloc=%08x IpcCount=%08x\r\n" ); + l8.SetTargetProperties( new object[] { aThread.Temporaries, aThread.Temporaries, aThread }, "TempObj", "TempAlloc", "IpcCount" ); + // + para.Add( l1, l2, l3, l4, l5, l6, l7, l8 ); + return para; + } + #endregion + + #region Data members + private HelperNThread iHelper = new HelperNThread(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperNThread.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperNThread.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,183 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.CodeSeg; +using CrashDebuggerLib.Structures.Register; +using CrashDebuggerLib.Structures.Thread; +using CrashDebuggerLib.Structures.NThread; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; +using SymbianParserLib.BaseStructures; + +namespace CrashDebuggerLib.Parsers.State.Implementation.Helpers +{ + internal class HelperNThread + { + #region Constructors + public HelperNThread() + { + } + #endregion + + #region API + public void CreateMonitorNThread( ParserEngine aEngine, string aName, NThread aThread ) + { + CreateMonitorNThread( aEngine, aName, aThread, null ); + } + + public void CreateMonitorNThread( ParserEngine aEngine, string aName, NThread aThread, ParserElementBase.ElementCompleteHandler aLastFieldHandler ) + { + // Create MState lines + ParserParagraph para0 = new ParserParagraph( aName + "_NSTATE" ); + para0.Tag = aThread; + CreateThreadNState( para0, aThread, "READY", false ); + CreateThreadNState( para0, aThread, "SUSPENDED", false ); + CreateThreadNState( para0, aThread, "WAITFSEM", true ); + CreateThreadNState( para0, aThread, "SLEEP", false ); + CreateThreadNState( para0, aThread, "BLOCKED", false ); + CreateThreadNState( para0, aThread, "DEAD", false ); + CreateThreadNState( para0, aThread, "WAITDFC", false ); + CreateThreadNState( para0, aThread, "??", true ); + aEngine.Add( para0 ); + + ParserParagraph para1 = CreateThreadCommon( aName, aThread ); + aEngine.Add( para1 ); + + CreateRegisterParagraphs( aEngine, aThread, aLastFieldHandler ); + + // TODO: add support for older memory models? + } + #endregion + + #region Call-back methods + public void SetThreadNStateWaitObject( ParserParagraph aParagraph, ParserFieldName aParameterName, uint aWaitObjectAddress ) + { + System.Diagnostics.Debug.Assert( aParagraph.Tag is NThread ); + NThread thread = (NThread) aParagraph.Tag; + thread.WaitObj = aWaitObjectAddress; + } + #endregion + + #region Event handlers + void NThreadState_ElementComplete( ParserElementBase aElement ) + { + ParserLine line = (ParserLine) aElement; + System.Diagnostics.Debug.Assert( line.Tag is NThread.TNThreadState ); + NThread.TNThreadState state = (NThread.TNThreadState) line.Tag; + ParserParagraph paragraph = line.Paragraph; + System.Diagnostics.Debug.Assert( paragraph.Tag is NThread ); + NThread thread = (NThread) paragraph.Tag; + thread.NState = state; + } + #endregion + + #region Internal methods + private void CreateThreadNState( ParserParagraph aParagraph, NThread aThread, string aNStateName, bool aCapturesWaitObject ) + { + StringBuilder format = new StringBuilder( "NThread @ %8x Pri %d NState " + aNStateName ); + // + if ( aCapturesWaitObject ) + { + format.Append( " %8x" ); + } + format.Append( "\r\n" ); + // + // + string finalFormat = format.ToString(); + NThread.TNThreadState state = NThread.NStateFromString( aNStateName ); + ParserLine l1 = ParserLine.NewSymFormat( finalFormat ); + l1.Tag = state; + // + l1[ 0 ].SetTargetProperty( aThread, "Address" ); + l1[ 1 ].SetTargetProperty( aThread, "Priority" ); + // + if ( aCapturesWaitObject ) + { + l1[ 2 ].SetTargetMethod( this, "SetThreadNStateWaitObject" ); + } + // + l1.ElementComplete += new ParserElementBase.ElementCompleteHandler( NThreadState_ElementComplete ); + aParagraph.Add( l1 ); + } + + private ParserParagraph CreateThreadCommon( string aName, NThread aThread ) + { + ParserParagraph para = new ParserParagraph( aName ); + // + ParserLine l1 = ParserLine.NewSymFormat( "Next=%08x Prev=%08x Att=%02x\r\n" ); + l1.SetTargetProperties( new object[] { aThread.LinkedListInfo, aThread.LinkedListInfo, aThread }, "Next", "Previous", "Attributes" ); + // + ParserLine l2 = ParserLine.NewSymFormat( "HeldFM=%08x WaitFM=%08x AddrSp=%08x\r\n" ); + l2.SetTargetProperties( new object[] { aThread.MutexInfo, aThread.MutexInfo, aThread }, "HeldAddress", "WaitAddress", "AddressSpace" ); + // + ParserLine l3 = ParserLine.NewSymFormat( "Time=%d Timeslice=%d ReqCount=%d\r\n" ); + l3.SetTargetProperties( new object[] { aThread.TimeInfo, aThread.TimeInfo, aThread.CountInfo }, "Time", "Timeslice", "RequestSemaphoreCount" ); + // + ParserLine l4 = ParserLine.NewSymFormat( "LastStartTime=%08x TotalCpuTime=%lx Tag=%08x\r\n" ); + l4.SetTargetProperties( aThread.TimeInfo, "LastStartTime", "TotalCpuTime", "Tag" ); + // + ParserLine l5 = ParserLine.NewSymFormat( "ReturnValue=%d, UCT=%d\r\n" ); + l5.SetTargetProperties( aThread, "ReturnValue", "UserContextType" ); + // + ParserLine l6 = ParserLine.NewSymFormat( "SuspendCount=%d CsCount=%d CsFunction=%08x\r\n" ); + l6.SetTargetProperties( aThread.CountInfo, "SuspendCount", "CsCount", "CsFunctionRaw" ); + // + ParserLine l7 = ParserLine.NewSymFormat( "SavedSP=%08x ExtraContext=%08x ExtraContextSize=%08x\r\n" ); + l7.SetTargetProperties( new object[] { aThread, aThread.ExtraContextInfo, aThread.ExtraContextInfo }, "SavedSP", "ExtraContext", "ExtraContextSizeRaw" ); + // + para.Add( l1, l2, l3, l4, l5, l6, l7 ); + return para; + } + + private void CreateRegisterParagraphs( ParserEngine aEngine, NThread aThread, ParserElementBase.ElementCompleteHandler aLastFieldHandler ) + { + { + ParserParagraph para = new ParserParagraph( "NTHREAD_REGS1" ); + para.SetTargetMethod( aThread.Registers, "Add" ); + ParserLine l1 = ParserLine.NewSymFormat( "FPEXC %08x\r\n" ); + ParserLine l2 = ParserLine.NewSymFormat( "CAR %08x\r\n" ); + ParserLine l3 = ParserLine.NewSymFormat( "DACR %08x\r\n" ); + para.Add( l1, l2, l3 ); + aEngine.Add( para ); + } + + { + ParserParagraph para = new ParserParagraph( "NTHREAD_REGS2" ); + para.SetTargetMethod( aThread.Registers, "Add" ); + ParserLine l1 = ParserLine.NewSymFormat( "R13_USR %08x R14_USR %08x SPSR_SVC %08x\r\n" ); + ParserLine l2 = ParserLine.NewSymFormat( " R4 %08x R5 %08x R6 %08x R7 %08x\r\n" ); + ParserLine l3 = ParserLine.NewSymFormat( " R8 %08x R9 %08x R10 %08x R11 %08x\r\n" ); + ParserLine l4 = ParserLine.NewSymFormat( " PC %08x\r\n" ); + // + if ( aLastFieldHandler != null ) + { + l4[ 0 ].ElementComplete += new ParserElementBase.ElementCompleteHandler( aLastFieldHandler ); + } + // + para.Add( l1, l2, l3, l4 ); + aEngine.Add( para ); + } + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperStack.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Helpers/HelperStack.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.CodeSeg; +using CrashDebuggerLib.Structures.Thread; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; +using SymbianParserLib.BaseStructures; + +namespace CrashDebuggerLib.Parsers.State.Implementation.Helpers +{ + internal class HelperStack + { + #region Constructors + public HelperStack() + { + } + #endregion + + #region API + public void CreateStackParagraphs( ParserEngine aEngine, DThread aThread ) + { + ParserParagraph p1 = PrepareUserStack( aThread.StackInfoUser ); + ParserParagraph p2 = PrepareSupervisorStack( aThread.StackInfoSupervisor ); + // + aEngine.Add( p1, p2 ); + } + #endregion + + #region Internal constants + private const string KParagraphUser = "STACK_USER"; + #endregion + + #region Call-back methods + void NoUserStackCallBack( ParserElementBase aElement ) + { + // Called back when a thread has no user stack - in which case, dump the + // user-stack items as they will prevent us gathering the supervisor info. + ParserLine line = (ParserLine) aElement; + ParserParagraph para = line.Paragraph; + // + foreach ( ParserLine l in para ) + { + l.IsDisabled = true; + } + } + + void DisableUserStackParagraph( ParserElementBase aElement ) + { + // Called back when the first supervisor stack item fires. We + // must disable all items in the user-paragraph so that they don't + // intercept things like the current stack pointer. + ParserLine line = (ParserLine) aElement; + ParserParagraph para = line.Paragraph; + ParserEngine engine = (ParserEngine) para.Parent; + // + foreach ( ParserParagraph paragraph in engine ) + { + if ( paragraph.Name == KParagraphUser ) + { + paragraph.IsDisabled = true; + break; + } + } + } + + void SetFirstStackBytesStartingAddress( ParserField aField, uint aValue ) + { + ThreadStackInfo stackInfo = (ThreadStackInfo) aField.Tag; + ThreadStackData stackData = stackInfo.Data; + stackData.SetStartingAddress( aValue ); + } + #endregion + + #region Internal methods + private ParserParagraph PrepareUserStack( ThreadStackInfo aStackInfo ) + { + ParserParagraph para = new ParserParagraph( KParagraphUser ); + // + ParserLine l0 = ParserLine.New( "No user-mode stack" ); + l0.ElementComplete += new ParserElementBase.ElementCompleteHandler( NoUserStackCallBack ); + // + ParserLine l1 = ParserLine.NewSymFormat( "User stack base at %08x, size == %x\r\n" ); + l1.SetTargetProperties( aStackInfo, "BaseAddress", "Size" ); + // + ParserLine l2 = ParserLine.NewSymFormat( "Stack pointer == %08x\r\n" ); + l2.SetTargetProperties( aStackInfo, "StackPointer" ); + // + // Not needed - ParserLine l3 = ParserLine.NewSymFormat( "Stack mapped at %08x\r\n" ); + //l3.SetTargetProperties( aStackInfo.Data, "MappedAddress" ); + + // Collect the raw stack bytes + ParserLine l4 = ParserLine.NewSymFormat( "%08x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x" ); + l4.IsNeverEnding = true; + l4.DisableWhenComplete = false; + l4.SetTargetMethod( aStackInfo.Data, "Add" ); + + // Record the starting address of the stack data + l4[ 0 ].SetTargetMethod( this, "SetFirstStackBytesStartingAddress" ); + l4[ 0 ].Tag = aStackInfo; + // + para.Add( l0, l1, l2, l4 ); + return para; + } + + private ParserParagraph PrepareSupervisorStack( ThreadStackInfo aStackInfo ) + { + ParserParagraph para = new ParserParagraph( "STACK_SUPERVISOR" ); + // + ParserLine l1 = ParserLine.NewSymFormat( "Supervisor stack base at %08x, size == %x\r\n" ); + l1.ElementComplete += new ParserElementBase.ElementCompleteHandler( DisableUserStackParagraph ); + l1.SetTargetProperties( aStackInfo, "BaseAddress", "Size" ); + // + ParserLine l2 = ParserLine.NewSymFormat( "Stack pointer == %08x\r\n" ); + l2.SetTargetProperties( aStackInfo, "StackPointer" ); + + // Collect the raw stack bytes + ParserLine l3 = ParserLine.NewSymFormat( "%08x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x" ); + l3.IsNeverEnding = true; + l3.DisableWhenComplete = false; + l3.SetTargetMethod( aStackInfo.Data, "Add" ); + + // Record the starting address of the stack data + l3[ 0 ].SetTargetMethod( this, "SetFirstStackBytesStartingAddress" ); + l3[ 0 ].Tag = aStackInfo; + // + para.Add( l1, l2, l3 ); + return para; + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoCpu.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoCpu.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,179 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using SymbianParserLib.BaseStructures; +using CrashDebuggerLib.Structures.Cpu; +using CrashDebuggerLib.Structures.Register; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateInfoCpu : State + { + #region Constructors + public StateInfoCpu( CrashDebuggerParser aParser ) + : base( aParser ) + { + iInfo = aParser.CrashDebugger.InfoCpu; + } + #endregion + + #region API + public override void Prepare() + { + PrepareMandatoryParagraph(); + } + + public override void Finalise() + { + + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void SwitchBank( ParserParagraph aPara, ParserLine aLine ) + { + } + + private void AddRegister( ParserParagraph aPara, ParserField aField, ParserFieldName aFieldName, uint aValue ) + { + RegisterCollection.TType type = (RegisterCollection.TType) aPara.Tag; + string regName = aFieldName.Name; + + // USR registers are a bit tricky since they are largely shared. Only R13 and R14 are + // really USR specific. + if ( type == RegisterCollection.TType.ETypeUser ) + { + ArmRegister reg = new ArmRegister( regName, aValue ); + // + switch ( reg.RegType ) + { + default: + type = RegisterCollection.TType.ETypeCommonBank; + break; + case TArmRegisterType.EArmReg_SP: + case TArmRegisterType.EArmReg_LR: + break; + } + } + + RegisterCollection regCollection = iInfo[ type ]; + regCollection.Add( regName, aValue ); + } + + private void PrepareMandatoryParagraph() + { + { + ParserParagraph para = CreateParagraph( "MODE_USR:", RegisterCollection.TType.ETypeUser ); + // + ParserLine l2 = ParserLine.NewSymFormat( " R0=%08x R1=%08x R2=%08x R3=%08x\r\n" ); + ParserLine l3 = ParserLine.NewSymFormat( " R4=%08x R5=%08x R6=%08x R7=%08x\r\n" ); + ParserLine l4 = ParserLine.NewSymFormat( " R8=%08x R9=%08x R10=%08x R11=%08x\r\n" ); + ParserLine l5 = ParserLine.NewSymFormat( "R12=%08x R13=%08x R14=%08x R15=%08x\r\n" ); + para.Add( l2, l3, l4, l5 ); + ParserEngine.Add( para ); + } + + { + ParserParagraph para = CreateParagraph( string.Empty, RegisterCollection.TType.ETypeCommonBank ); + ParserLine l2 = ParserLine.NewSymFormat( "CPSR=%08x\r\n" ); + para.Add( l2 ); + ParserEngine.Add( para ); + } + + { + ParserParagraph para = CreateParagraph( "MODE_FIQ:", RegisterCollection.TType.ETypeFastInterrupt ); + // + ParserLine l2 = ParserLine.NewSymFormat( " R8=%08x R9=%08x R10=%08x R11=%08x\r\n" ); + ParserLine l3 = ParserLine.NewSymFormat( "R12=%08x R13=%08x R14=%08x SPSR=%08x\r\n" ); + para.Add( l2, l3 ); + ParserEngine.Add( para ); + } + + { + ParserParagraph para = CreateParagraph( "MODE_IRQ:", RegisterCollection.TType.ETypeInterrupt ); + ParserLine l2 = ParserLine.NewSymFormat( "R13=%08x R14=%08x SPSR=%08x\r\n" ); + para.Add( l2 ); + ParserEngine.Add( para ); + } + + { + ParserParagraph para = CreateParagraph( "MODE_SVC:", RegisterCollection.TType.ETypeSupervisor ); + ParserLine l2 = ParserLine.NewSymFormat( "R13=%08x R14=%08x SPSR=%08x\r\n" ); + para.Add( l2 ); + ParserEngine.Add( para ); + } + + { + ParserParagraph para = CreateParagraph( "MODE_ABT:", RegisterCollection.TType.ETypeAbort ); + ParserLine l2 = ParserLine.NewSymFormat( "R13=%08x R14=%08x SPSR=%08x\r\n" ); + para.Add( l2 ); + ParserEngine.Add( para ); + } + + { + ParserParagraph para = CreateParagraph( "MODE_UND:", RegisterCollection.TType.ETypeUndefined ); + ParserLine l2 = ParserLine.NewSymFormat( "R13=%08x R14=%08x SPSR=%08x\r\n" ); + para.Add( l2 ); + ParserEngine.Add( para ); + } + + { + ParserParagraph para = CreateParagraph( string.Empty, RegisterCollection.TType.ETypeGeneral ); + ParserLine l2 = ParserLine.NewSymFormat( "DACR %08x\r\n" ); + ParserLine l3 = ParserLine.NewSymFormat( "CAR %08x\r\n" ); + ParserLine l4 = ParserLine.NewSymFormat( "MMUID %08x\r\n" ); + ParserLine l5 = ParserLine.NewSymFormat( "MMUCR %08x\r\n" ); + ParserLine l6 = ParserLine.NewSymFormat( "AUXCR %08x\r\n" ); + ParserLine l7 = ParserLine.NewSymFormat( "FPEXC %08x\r\n" ); + ParserLine l8 = ParserLine.NewSymFormat( "CTYPE %08x\r\n" ); + para.Add( l2, l3, l4, l5, l6, l7, l8 ); + ParserEngine.Add( para ); + } + } + + private ParserParagraph CreateParagraph( string aName, RegisterCollection.TType aType ) + { + RegisterCollection registers = CrashDebugger.InfoCpu[ aType ]; + // + ParserParagraph para = new ParserParagraph( aName ); + para.Tag = aType; + para.SetTargetMethod( this, "AddRegister" ); + // + if ( aName.Length > 0 ) + { + ParserLine header = ParserLine.New( aName + "\r\n" ); + header.SetTargetMethod( this, "SwitchBank" ); + } + return para; + } + #endregion + + #region Data members + private readonly CpuInfo iInfo; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoDebugMask.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoDebugMask.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.DebugMask; +using SymbianParserLib.Elements; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateInfoDebugMask : State + { + #region Constructors + public StateInfoDebugMask( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + public override void Prepare() + { + PrepareMandatoryParagraph(); + } + + public override void Finalise() + { + System.Diagnostics.Debug.Assert( ParserEngine.Count == 1 ); // paragraphs + ParserParagraph para = ParserEngine[ 0 ]; + System.Diagnostics.Debug.Assert( para.Count == 8 ); // lines + + // Go through each line and pull out the debug mask. + for ( int i = 0; i < 4; i++ ) + { + int baseIndex = ( i * 2 ); + + // Get lines and check that each has one field + ParserLine line1 = para[ baseIndex ]; + System.Diagnostics.Debug.Assert( line1.Count == 1 ); + System.Diagnostics.Debug.Assert( line1[ 0 ].IsUint ); + ParserLine line2 = para[ baseIndex + 1 ]; + System.Diagnostics.Debug.Assert( line2.Count == 1 ); + System.Diagnostics.Debug.Assert( line2[ 0 ].IsUint ); + // + uint val1 = line1[ 0 ].AsUint; + uint val2 = line2[ 0 ].AsUint; + ulong combined = val1 + ( val2 << 32 ); + // + CrashDebugger.InfoDebugMask.SetValueByWordIndex( combined, baseIndex ); + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void PrepareMandatoryParagraph() + { + ParserParagraph para = new ParserParagraph( "Debug_Mask_Info" ); + // + ParserLine l1 = ParserLine.NewSymFormat( "DebugMask[0] = %08x\r\n" ); + ParserLine l2 = ParserLine.NewSymFormat( "DebugMask[1] = %08x\r\n" ); + ParserLine l3 = ParserLine.NewSymFormat( "DebugMask[2] = %08x\r\n" ); + ParserLine l4 = ParserLine.NewSymFormat( "DebugMask[3] = %08x\r\n" ); + ParserLine l5 = ParserLine.NewSymFormat( "DebugMask[4] = %08x\r\n" ); + ParserLine l6 = ParserLine.NewSymFormat( "DebugMask[5] = %08x\r\n" ); + ParserLine l7 = ParserLine.NewSymFormat( "DebugMask[6] = %08x\r\n" ); + ParserLine l8 = ParserLine.NewSymFormat( "DebugMask[7] = %08x\r\n" ); + para.Add( l1, l2, l3, l4, l5, l6, l7, l8 ); + ParserEngine.Add( para ); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoFault.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoFault.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Fault; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateInfoFault : State + { + #region Constructors + public StateInfoFault( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + public override void Prepare() + { + PrepareMandatoryParagraph(); + PrepareOptionalParagraph(); + } + + public override void Finalise() + { + + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void PrepareMandatoryParagraph() + { + ParserParagraph para = new ParserParagraph( "FaultInfo"); + // + ParserLine l1 = ParserLine.NewSymFormat( "Fault Category: %S Fault Reason: %08x\r\n" ); + l1.SetTargetProperties( CrashDebugger.InfoFault, "Category", "Reason" ); + // + ParserLine l2 = ParserLine.NewSymFormat( "ExcId %08x CodeAddr %08x DataAddr %08x Extra %08x\r\n" ); + l2.SetTargetProperties( CrashDebugger.InfoFault, "ExceptionId", "CodeAddress", "DataAddress", "ExtraInfo" ); + // + para.Add( l1, l2 ); + ParserEngine.Add( para ); + } + + private void PrepareOptionalParagraph() + { + ParserParagraph para = new ParserParagraph( "CpuFaultInfo" ); + para.SetTargetMethod( CrashDebugger.InfoFault.Registers, "Add", TValueStoreMethodArguments.EValueStoreMethodArgumentNameAsString, TValueStoreMethodArguments.EValueStoreMethodArgumentValue ); + // + ParserLine l1 = ParserLine.NewSymFormat( "Exc %1d Cpsr=%08x FAR=%08x FSR=%08x\r\n" ); + l1[ 0 ].SetTargetProperties( CrashDebugger.InfoFault, "ExcCode" ); + // + ParserLine l2 = ParserLine.NewSymFormat( " R0=%08x R1=%08x R2=%08x R3=%08x\r\n" ); + ParserLine l3 = ParserLine.NewSymFormat( " R4=%08x R5=%08x R6=%08x R7=%08x\r\n" ); + ParserLine l4 = ParserLine.NewSymFormat( " R8=%08x R9=%08x R10=%08x R11=%08x\r\n" ); + ParserLine l5 = ParserLine.NewSymFormat( "R12=%08x R13=%08x R14=%08x R15=%08x\r\n" ); + ParserLine l6 = ParserLine.NewSymFormat( "R13Svc=%08x R14Svc=%08x SpsrSvc=%08x\r\n" ); + // + para.Add( l1, l2, l3, l4, l5, l6 ); + ParserEngine.Add( para ); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoScheduler.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoScheduler.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using SymbianParserLib.BaseStructures; +using CrashDebuggerLib.Structures.Scheduler; +using CrashDebuggerLib.Structures.Register; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateInfoScheduler : State + { + #region Constructors + public StateInfoScheduler( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + public override void Prepare() + { + PrepareMandatoryParagraph(); + } + + public override void Finalise() + { + + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void PrepareMandatoryParagraph() + { + { + SchedulerInfo info = CrashDebugger.InfoScheduler; + + ParserParagraph para = new ParserParagraph( "SCHEDULER_INFO" ); + // + ParserLine l1 = ParserLine.NewSymFormat( "SCHEDULER @%08x: CurrentThread %08x\r\n" ); + l1.SetTargetProperties( info, "Address", "CurrentNThreadAddress" ); + // + ParserLine l2 = ParserLine.NewSymFormat( "RescheduleNeeded=%02x DfcPending=%02x KernCSLocked=%08x\r\n" ); + l2.SetTargetProperties( info, "RescheduleNeeded", "DfcPending", "KernCSLocked" ); + // + ParserLine l3 = ParserLine.NewSymFormat( "DFCS: next %08x prev %08x\r\n" ); + l3.SetTargetProperties( info.DFCs, "Next", "Previous" ); + // + ParserLine l4 = ParserLine.NewSymFormat( "ProcessHandler=%08x, AddressSpace=%08x\r\n" ); + l4.SetTargetProperties( info, "ProcessHandlerAddress", "AddressSpace" ); + // + ParserLine l5 = ParserLine.NewSymFormat( "SYSLOCK: HoldingThread %08x iWaiting %08x\r\n" ); + l5.SetTargetProperties( info.SysLockInfo, "HoldingThreadAddress", "WaitingThreadAddress" ); + // + ParserLine l6 = ParserLine.NewSymFormat( "Extras 0: %08x 1: %08x 2: %08x 3: %08x\r\n" ); + l6.SetTargetMethod( info.ExtraRegisters, "Add" ); + // + ParserLine l7 = ParserLine.NewSymFormat( "Extras 4: %08x 5: %08x 6: %08x 7: %08x\r\n" ); + l7.SetTargetMethod( info.ExtraRegisters, "Add" ); + // + ParserLine l8 = ParserLine.NewSymFormat( "Extras 8: %08x 9: %08x A: %08x B: %08x\r\n" ); + l8.SetTargetMethod( info.ExtraRegisters, "Add" ); + // + ParserLine l9 = ParserLine.NewSymFormat( "Extras C: %08x D: %08x E: %08x F: %08x\r\n" ); + l9.SetTargetMethod( info.ExtraRegisters, "Add" ); + // + para.Add( l1, l2, l3, l4, l5, l6, l7, l8, l9 ); + ParserEngine.Add( para ); + } + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoUserContextTable.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoUserContextTable.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using SymbianParserLib.BaseStructures; +using CrashDebuggerLib.Structures.Scheduler; +using CrashDebuggerLib.Structures.Register; +using CrashDebuggerLib.Structures.UserContextTable; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateInfoUserContextTable : State + { + #region Constructors + public StateInfoUserContextTable( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + public override void Prepare() + { + ParserParagraph para = new ParserParagraph( "USERCONTEXTTABLE_INFO" ); + + // The format of the actual entry specification is the same for each + // line + StringBuilder lineFormat = new StringBuilder( ); + int count = UserContextTable.EntryCount; + for( int i=0; i iLines = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Stacks/StateThreadStacks.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Stacks/StateThreadStacks.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using SymbianParserLib.BaseStructures; +using CrashDebuggerLib.Structures.CodeSeg; +using CrashDebuggerLib.Structures.Thread; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Threading; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateThreadStacks : State + { + #region Constructors + public StateThreadStacks( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + public override void Prepare() + { + // First, we need to know which thread we're dealing with + // so that means we must look for the thread info + ParserParagraph para = new ParserParagraph( "STACK_THREAD_INFO" ); + // + ParserLine l1 = ParserLine.NewSymFormat( "STACK DATA for thread at %8x" ); + l1.SetTargetMethod( this, "SetThreadAddress" ); + para.Add( l1 ); + ParserEngine.Add( para ); + } + + public override void Finalise() + { + if ( iCurrentThread != null ) + { + if ( iCurrentThread.OwningProcess != null ) + { + iCurrentThread.OwningProcess.PrepareDebugView(); + } + // + iCurrentThread.StackInfoUser.Data.BuildCallStackAsync(); + iCurrentThread.StackInfoSupervisor.Data.BuildCallStackAsync(); + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void SetThreadAddress( uint aAddress ) + { + // Look for the thread which we're about to process... + iCurrentThread = CrashDebugger.ThreadByAddress( aAddress ); + if ( iCurrentThread != null ) + { + // Next we must start to process code segments for this + // thread. These lines contain additional information about + // the run address of the code segments, relative to the process. + ParserParagraph para = new ParserParagraph( "STACK_THREAD_INFO_CODESEGS" ); + // + ParserLine l1 = ParserLine.NewSymFormat( "CodeSeg[%03d/%03d] @ %08x - %08X-%08X %S" ); + l1.ElementComplete += new ParserElementBase.ElementCompleteHandler( CodeSegmentLineComplete ); + // + para.Add( l1 ); + ParserEngine.Add( para ); + } + } + + void CodeSegmentLineComplete( ParserElementBase aElement ) + { + System.Diagnostics.Debug.Assert( iCurrentThread != null ); + ParserLine line = (ParserLine) aElement; + // + int index = line[ 0 ].AsInt; + int count = line[ 1 ].AsInt; + uint codeSegAddress = line[ 2 ].AsUint; + uint startAddress = line[ 3 ].AsUint; + uint endAddress = line[ 4 ].AsUint; + string fileName = line[ 5 ].AsString; + // + DProcess process = iCurrentThread.OwningProcess; + if ( process != null ) + { + ProcessCodeSegCollection codeSegs = process.CodeSegments; + ProcessCodeSeg codeSeg = codeSegs[ codeSegAddress ]; + // + if ( codeSeg == null ) + { + // The code seg is not directly part of the process handle list + // but it is some how mapped into the process? + // + // Try looking up the underlying code seg entry details from + // the crash debugger data itself. It should be part of the code + // seg listing so this should always work. + codeSeg = new ProcessCodeSeg( CrashDebugger, codeSegAddress, 0 ); + process.CodeSegments.Add( codeSeg ); + } + // + codeSeg.ProcessLocalRunAddress = startAddress; + codeSeg.Size = ( endAddress - startAddress ); + } + // + int remaining = count - index; + if ( remaining == 0 ) + { + // Queue up stack data... + iHelperStack.CreateStackParagraphs( ParserEngine, iCurrentThread ); + } + else + { + // So that we capture the next line + aElement.SetRepetitions( 1 ); + } + } + #endregion + + #region Data members + private DThread iCurrentThread = null; + private Helpers.HelperStack iHelperStack = new CrashDebuggerLib.Parsers.State.Implementation.Helpers.HelperStack(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/TheCurrentXXX/StateTheCurrentProcess.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/TheCurrentXXX/StateTheCurrentProcess.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using CrashDebuggerLib.Parsers.State.Implementation.Helpers; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateTheCurrentProcess : State + { + #region Constructors + public StateTheCurrentProcess( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + public override void Prepare() + { + // TODO: + // TheCurrentProcess=c801c078 + // TheCurrentAddressSpace=c801c078 + + iHelper.CreateMonitorProcess( ParserEngine, "TheCurrentProcess", CrashDebugger.TheCurrentProcess ); + } + + public override void Finalise() + { + DObjectCon container = CrashDebugger[ DObject.TObjectType.EProcess ]; + if ( container.Contains( CrashDebugger.TheCurrentProcess ) == false ) + { + container.Add( CrashDebugger.TheCurrentProcess ); + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + private HelperDProcess iHelper = new HelperDProcess(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/TheCurrentXXX/StateTheCurrentThread.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/TheCurrentXXX/StateTheCurrentThread.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianParserLib.Elements; +using CrashDebuggerLib.Parsers.State.Implementation.Helpers; + +namespace CrashDebuggerLib.Parsers.State.Implementation +{ + internal class StateTheCurrentThread : State + { + #region Constructors + public StateTheCurrentThread( CrashDebuggerParser aParser ) + : base( aParser ) + { + } + #endregion + + #region API + public override void Prepare() + { + // TODO: + // TheCurrentThread=c8041a00 + + iHelper.CreateMonitorThread( ParserEngine, "TheCurrentThread", CrashDebugger.TheCurrentThread ); + } + + public override void Finalise() + { + DObjectCon container = CrashDebugger[ DObject.TObjectType.EThread ]; + if ( container.Contains( CrashDebugger.TheCurrentThread ) == false ) + { + container.Add( CrashDebugger.TheCurrentThread ); + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + private HelperDThread iHelper = new HelperDThread(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/StateBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/StateBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures; + +namespace CrashDebuggerLib.Parsers.State +{ + internal abstract class State + { + #region Constructors + protected State( CrashDebuggerParser aParser ) + { + iParser = aParser; + } + #endregion + + #region API + public abstract void Prepare(); + + public virtual void Finalise() + { + } + #endregion + + #region Properties + public ParserEngine ParserEngine + { + get { return iParserEngine; } + set { iParserEngine = value; } + } + + public CrashDebuggerParser Parser + { + get { return iParser; } + } + + public CrashDebuggerInfo CrashDebugger + { + get { return Parser.CrashDebugger; } + } + #endregion + + #region Data members + private ParserEngine iParserEngine = new ParserEngine(); + private readonly CrashDebuggerParser iParser; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/StateFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/StateFactory.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using SymbianParserLib.Engine; +using CrashDebuggerLib.Structures.Fault; +using SymbianParserLib.Elements; +using CrashDebuggerLib.Parsers.State.Implementation; + +namespace CrashDebuggerLib.Parsers.State +{ + internal static class StateFactory + { + #region API + public static State Create( TState aState, CrashDebuggerParser aParser ) + { + CreateDictionary(); + // + State ret = null; + if ( iDictionary.ContainsKey( aState ) ) + { + ret = CreateState( aState, aParser ); + if ( ret != null ) + { + ret.Prepare(); + } + } + // + return ret; + } + + public static void RegisterCommands( ParserEngine aEngine ) + { + CreateDictionary(); + // + foreach ( KeyValuePair keyVP in iDictionary ) + { + string[] commandIds = keyVP.Value.CommandIdentifiers; + foreach ( string commandId in commandIds ) + { + // Create paragraph and associate the state type with the tag so that + // we know what type of object to create later on when the line fires. + ParserParagraph command = new ParserParagraph( commandId ); + command.Tag = keyVP.Key; + + // Create line to match + ParserLine line = ParserLine.New( commandId ); + + // Make sure that the paragraph and line don't disable themselves whenever + // they see a matching line. Some of these objects are needed more than once! + command.DisableWhenComplete = false; + line.DisableWhenComplete = false; + // + command.Add( line ); + aEngine.Add( command ); + } + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private static void CreateDictionary() + { + if ( iDictionary.Count == 0 ) + { + // State table + iDictionary.Add( TState.EStateInfoFault, + new TStateMapplet( "*** CMD: Fault_Info", typeof( StateInfoFault ) ) ); + iDictionary.Add( TState.EStateInfoCpu, + new TStateMapplet( "*** CMD: Cpu_Info", typeof( StateInfoCpu ) ) ); + iDictionary.Add( TState.EStateInfoDebugMask, + new TStateMapplet( "*** CMD: Debug_Mask_Info", typeof( StateInfoDebugMask ) ) ); + iDictionary.Add( TState.EStateInfoScheduler, + new TStateMapplet( "*** CMD: Scheduler_Info", typeof( StateInfoScheduler ) ) ); + + // For compatibility reasons catch either of these entries + iDictionary.Add( TState.EStateInfoUserContextTable, + new TStateMapplet( typeof( StateInfoUserContextTable ), + "*** CMD: UserContextTable_Info", + "*** CMD: UserContextTables" ) ); + + // Other entries... + iDictionary.Add( TState.EStateTheCurrentProcess, + new TStateMapplet( "*** CMD: The_Current_Process", typeof( StateTheCurrentProcess ) ) ); + iDictionary.Add( TState.EStateTheCurrentThread, + new TStateMapplet( "*** CMD: The_Current_Thread", typeof( StateTheCurrentThread ) ) ); + iDictionary.Add( TState.EStateContainerCodeSegs, + new TStateMapplet( "*** CMD: container[CODESEG]", typeof( StateContainerCodeSegs ) ) ); + iDictionary.Add( TState.EStateContainerThread, + new TStateMapplet( "*** CMD: container[THREAD]", typeof( StateContainerThreads ) ) ); + iDictionary.Add( TState.EStateContainerProcess, + new TStateMapplet( "*** CMD: container[PROCESS]", typeof( StateContainerProcesses ) ) ); + iDictionary.Add( TState.EStateContainerChunk, + new TStateMapplet( "*** CMD: container[CHUNK]", typeof( StateContainerChunks ) ) ); + iDictionary.Add( TState.EStateContainerLibrary, + new TStateMapplet( "*** CMD: container[LIBRARY]", typeof( StateContainerLibraries ) ) ); + iDictionary.Add( TState.EStateContainerSemaphore, + new TStateMapplet( "*** CMD: container[SEMAPHORE]", typeof( StateContainerSemaphores ) ) ); + iDictionary.Add( TState.EStateContainerMutex, + new TStateMapplet( "*** CMD: container[MUTEX]", typeof( StateContainerMutexes ) ) ); + iDictionary.Add( TState.EStateContainerTimer, + new TStateMapplet( "*** CMD: container[TIMER]", typeof( StateContainerTimers ) ) ); + iDictionary.Add( TState.EStateContainerServer, + new TStateMapplet( "*** CMD: container[SERVER]", typeof( StateContainerServers ) ) ); + iDictionary.Add( TState.EStateContainerSession, + new TStateMapplet( "*** CMD: container[SESSION]", typeof( StateContainerSessions ) ) ); + iDictionary.Add( TState.EStateContainerLogicalDevice, + new TStateMapplet( "*** CMD: container[LOGICAL DEVICE]", typeof( StateContainerLogicalDevices ) ) ); + iDictionary.Add( TState.EStateContainerPhysicalDevice, + new TStateMapplet( "*** CMD: container[PHYSICAL DEVICE]", typeof( StateContainerPhysicalDevices ) ) ); + iDictionary.Add( TState.EStateContainerLogicalChannel, + new TStateMapplet( "*** CMD: container[LOGICAL CHANNEL]", typeof( StateContainerLogicalChannels ) ) ); + iDictionary.Add( TState.EStateContainerChangeNotifier, + new TStateMapplet( "*** CMD: container[CHANGE NOTIFIER]", typeof( StateContainerChangeNotifiers ) ) ); + iDictionary.Add( TState.EStateContainerUndertaker, + new TStateMapplet( "*** CMD: container[UNDERTAKER]", typeof( StateContainerUndertakers ) ) ); + iDictionary.Add( TState.EStateContainerMessageQueue, + new TStateMapplet( "*** CMD: container[MESSAGE QUEUE]", typeof( StateContainerMessageQueues ) ) ); + iDictionary.Add( TState.EStateContainerPropertyRef, + new TStateMapplet( "*** CMD: container[PROPERTY REF]", typeof( StateContainerPropertyRefs ) ) ); + iDictionary.Add( TState.EStateContainerConditionalVariable, + new TStateMapplet( "*** CMD: container[CONDITION VARIABLE]", typeof( StateContainerConditionalVariables ) ) ); + iDictionary.Add( TState.EStateThreadStacks, + new TStateMapplet( "*** CMD: Stack_Data[", typeof( StateThreadStacks ) ) ); + } + } + + private static State CreateState( TState aState, CrashDebuggerParser aParser ) + { + TStateMapplet maplet = iDictionary[ aState ]; + State ret = maplet.CreateInstance( aParser ); + return ret; + } + #endregion + + #region Data members + private static Dictionary iDictionary = new Dictionary(); + #endregion + } + + #region Internal structure + internal class TStateMapplet + { + #region Constructors + public TStateMapplet( Type aType, params string[] aCommandIdentifiers ) + { + iCommandIdentifiers = aCommandIdentifiers; + iType = aType; + } + + public TStateMapplet( string aCommandIdentifier, Type aType ) + { + iCommandIdentifiers = new string[] { aCommandIdentifier }; + iType = aType; + } + #endregion + + #region API + public State CreateInstance( CrashDebuggerParser aParser ) + { + State state = null; + // + Binder binder = null; + BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.CreateInstance; + object[] args = { aParser }; + object ret = iType.InvokeMember( string.Empty, bindingFlags, binder, null, args ); + if ( ret != null ) + { + state = (State) ret; + } + // + return state; + } + #endregion + + #region Properties + public string[] CommandIdentifiers + { + get { return iCommandIdentifiers; } + } + #endregion + + #region Data members + private readonly string[] iCommandIdentifiers; + private readonly Type iType; + #endregion + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/StateTypes.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/StateTypes.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianParserLib.Engine; +using SymbianParserLib.Elements; + +namespace CrashDebuggerLib.Parsers.State +{ + internal enum TState + { + EStateIdle = 0, + EStateInfoFault, + EStateInfoCpu, + EStateInfoDebugMask, + EStateInfoScheduler, + EStateInfoUserContextTable, + EStateTheCurrentProcess, + EStateTheCurrentThread, + EStateContainerCodeSegs, + EStateContainerThread, + EStateContainerProcess, + EStateContainerChunk, + EStateContainerLibrary, + EStateContainerSemaphore, + EStateContainerMutex, + EStateContainerTimer, + EStateContainerServer, + EStateContainerSession, + EStateContainerLogicalDevice, + EStateContainerPhysicalDevice, + EStateContainerLogicalChannel, + EStateContainerChangeNotifier, + EStateContainerUndertaker, + EStateContainerMessageQueue, + EStateContainerPropertyRef, + EStateContainerConditionalVariable, + EStateThreadStacks, + EStateDone + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Platform/Constants.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Platform/Constants.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace CrashDebuggerLib.Platform +{ + public static class ProcessNames + { + public const string KKernel = "ekern.exe"; + } + + public static class NKernSizes + { + public const int KSizeOf_Pointer = 4; + public const int KSizeOf_Byte = 1; + public const int KSizeOf_TInt = 4; + public const int KSizeOf_SDblQueLink = KSizeOf_Pointer + KSizeOf_Pointer; // sizeof( SDblQueLink.iPrev ) + sizeof( SDblQueLink.iNext ) + public const int KSizeOf_TPriListLink = KSizeOf_SDblQueLink + ( 4 * KSizeOf_Byte ); // iPriority, iSpare1, iSpare2, iSpare3 + } + + public static class NKernOffsets + { + public const int KOffsetOf_iRequestSemaphore_In_NThread = NKernSizes.KSizeOf_TPriListLink + + NKernSizes.KSizeOf_Pointer + // NFastMutex* iHeldFastMutex + NKernSizes.KSizeOf_Pointer + // NFastMutex* iWaitFastMutex + NKernSizes.KSizeOf_Pointer + // TAny* iAddressSpace + NKernSizes.KSizeOf_TInt + // TInt iTime + NKernSizes.KSizeOf_TInt // TInt iTimeslice + ; + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "CrashDebuggerLib" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Symbian" )] +[assembly: AssemblyProduct( "CrashDebuggerLib" )] +[assembly: AssemblyCopyright( "Copyright © Symbian 2008" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "d54dc760-c34c-48f6-b8fe-761ed54cf9b9" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/ChangeNotifier/DChangeNotifier.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/ChangeNotifier/DChangeNotifier.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.ChangeNotifier +{ + public class DChangeNotifier : DObject + { + #region Constructors + public DChangeNotifier( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.EChangeNotifier ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Chunk/ChunkCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Chunk/ChunkCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.Chunk +{ + public class ChunkCollection : IEnumerable + { + #region Constructors + public ChunkCollection() + { + } + #endregion + + #region API + public void Add( DChunk aChunk ) + { + iEntries.Add( aChunk ); + } + #endregion + + #region Properties + public DChunk this[ int aIndex ] + { + get { return iEntries[ aIndex ]; } + } + + public int Count + { + get { return iEntries.Count; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return new ChunkEnumerator( this ); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return new ChunkEnumerator( this ); + } + #endregion + + #region Data members + private List iEntries = new List(); + #endregion + } + + #region Internal enumerator + internal class ChunkEnumerator : IEnumerator + { + #region Constructors + public ChunkEnumerator( ChunkCollection aList ) + { + iList = aList; + } + #endregion + + #region IEnumerator Members + public void Reset() + { + iCurrentIndex = -1; + } + + public object Current + { + get + { + return iList[ iCurrentIndex ]; + } + } + + public bool MoveNext() + { + return ( ++iCurrentIndex < iList.Count ); + } + #endregion + + #region From IEnumerator + DChunk IEnumerator.Current + { + get { return iList[ iCurrentIndex ]; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly ChunkCollection iList; + private int iCurrentIndex = -1; + #endregion + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Chunk/ChunkPermissions.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Chunk/ChunkPermissions.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.Chunk +{ + public class ChunkPermissions + { + #region Constructors + public ChunkPermissions() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint Pte + { + get { return iPtePermissions; } + set { iPtePermissions = value; } + } + + public uint Pde + { + get { return iPdePermissions; } + set { iPdePermissions = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iPtePermissions = 0; + private uint iPdePermissions = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Chunk/DChunk.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Chunk/DChunk.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,194 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.Process; + +namespace CrashDebuggerLib.Structures.Chunk +{ + public class DChunk : DObject + { + #region Enumerations + [System.ComponentModel.TypeConverter( typeof( SymbianParserLib.TypeConverters.SymbianEnumConverter ) )] + public enum TChunkType + { + EUnknown = -1, + + // these never change or move or anything + EKernelData = 0, // Supervisor,Rw,Cacheable + EKernelStack = 1, // Supervisor,Rw,Cacheable + EKernelCode = 2, // Supervisor,Rw,Cacheable + EDll = 3, // User,Ro,Cacheable + EUserCode = 4, + + // This changes on a PDE basis when the file server runs + ERamDrive = 5, // Supervisor,Rw,Cacheable + + // these change on PDE basis when run + EUserData = 6, + EDllData = 7, + EUserSelfModCode = 8, + + ESharedKernelSingle = 9, // Must be same value as TChunkCreateInfo::ESharedKernelSingle + ESharedKernelMultiple = 10, // Must be same value as TChunkCreateInfo::ESharedKernelMultiple + + ESharedIo = 11, + ESharedKernelMirror = 12, + } + + [Flags, System.ComponentModel.TypeConverter( typeof( SymbianParserLib.TypeConverters.SymbianEnumConverter ) )] + public enum TChunkAttributes : uint + { + // Basic range + //ENormal = 0x00000000, // Commented out because it conflicts with EAddressLocal + EDoubleEnded = 0x00000001, + EDisconnected = 0x00000002, + EConstructed = 0x00000004, + EMemoryNotOwned = 0x00000008, + + // From Multiple Memory Model + EPrivate = 0x80000000, + ECode = 0x40000000, + EAddressAllocDown = 0x20000000, + + EAddressLocal = 0x00000000, + EAddressShared = 0x01000000, + EAddressUserGlobal = 0x02000000, + EAddressKernel = 0x03000000, + EAddressFixed = 0x04000000, + + EMapTypeMask = 0x00c00000, + EMapTypeLocal = 0x00000000, + EMapTypeGlobal = 0x00400000, + EMapTypeShared = 0x00800000, + } + #endregion + + #region Constructors + public DChunk( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.EChunk ) + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint OwningProcessAddress + { + get { return iOwningProcessAddress; } + set { iOwningProcessAddress = value; } + } + + public DProcess OwningProcess + { + get { return CrashDebugger.ProcessByAddress( OwningProcessAddress ); } + } + + public uint OSAsids + { + get { return iOsAsids; } + set { iOsAsids = value; } + } + + public uint Size + { + get { return iSize; } + set { iSize = value; } + } + + public uint MaxSize + { + get { return iMaxSize; } + set { iMaxSize = value; } + } + + public uint Base + { + get { return iBase; } + set { iBase = value; } + } + + public TChunkAttributes Attributes + { + get { return iAttributes; } + set { iAttributes = value; } + } + + public uint StartPos + { + get { return iStartPos; } + set { iStartPos = value; } + } + + public TChunkType ChunkType + { + get { return iChunkType; } + set { iChunkType = value; } + } + + public ChunkPermissions Permissions + { + get { return iPermissions; } + } + + public uint PageTables + { + get { return iPageTables; } + set { iPageTables = value; } + } + + public uint PageBitMap + { + get { return iPageBitMap; } + set { iPageBitMap = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iOwningProcessAddress = 0; + private uint iOsAsids = 0; + private uint iSize = 0; + private uint iMaxSize = 0; + private uint iBase = 0; + private TChunkAttributes iAttributes = TChunkAttributes.EAddressLocal; + private uint iStartPos = 0; + private TChunkType iChunkType = TChunkType.EUnknown; + private ChunkPermissions iPermissions = new ChunkPermissions(); + private uint iPageTables = 0; + private uint iPageBitMap = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/CodeSeg/CodeSegCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/CodeSeg/CodeSegCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.CodeSeg +{ + public class CodeSegCollection : CrashDebuggerAware, IEnumerable + { + #region Constructors + public CodeSegCollection( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger ) + { + } + #endregion + + #region API + public void Clear() + { + iEntries.Clear(); + } + + public void Add( CodeSegEntry aEntry ) + { + iEntries.Add( aEntry ); + } + #endregion + + #region Properties + public CodeSegEntry this[ int aIndex ] + { + get { return iEntries[ aIndex ]; } + } + + public CodeSegEntry this[ uint aAddress ] + { + get + { + CodeSegEntry ret = iEntries.Find( delegate( CodeSegEntry aEntry ) { return aEntry.KernelAddress == aAddress; } ); + return ret; + } + } + + public int Count + { + get { return iEntries.Count; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return new CodeSegEnumerator( this ); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return new CodeSegEnumerator( this ); + } + #endregion + + #region Data members + private List iEntries = new List(); + #endregion + } + + #region Internal enumerator + internal class CodeSegEnumerator : IEnumerator + { + #region Constructors + public CodeSegEnumerator( CodeSegCollection aList ) + { + iList = aList; + } + #endregion + + #region IEnumerator Members + public void Reset() + { + iCurrentIndex = -1; + } + + public object Current + { + get + { + return iList[ iCurrentIndex ]; + } + } + + public bool MoveNext() + { + return ( ++iCurrentIndex < iList.Count ); + } + #endregion + + #region From IEnumerator + CodeSegEntry IEnumerator.Current + { + get { return iList[ iCurrentIndex ]; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly CodeSegCollection iList; + private int iCurrentIndex = -1; + #endregion + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/CodeSeg/CodeSegEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/CodeSeg/CodeSegEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.CodeSeg +{ + public class CodeSegEntry : CrashDebuggerAware + { + #region Constructors + public CodeSegEntry( CrashDebuggerInfo aCrashDebugger ) + : this( aCrashDebugger, 0, string.Empty ) + { + } + + public CodeSegEntry( CrashDebuggerInfo aCrashDebugger, uint aAddress, string aFileName ) + : base( aCrashDebugger ) + { + KernelAddress = aAddress; + FileName = aFileName; + } + #endregion + + #region API + #endregion + + #region Properties + public uint KernelAddress + { + get { return iKernelAddress; } + set { iKernelAddress = value; } + } + + public uint RunAddress + { + get { return iRunAddress; } + set { iRunAddress = value; } + } + + public uint RunAddressEnd + { + get { return RunAddress + Size; } + } + + public uint Size + { + get { return iSize; } + set { iSize = value; } + } + + public string FileName + { + get { return iFileName; } + set { iFileName = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( RunAddress.ToString( "x8" ) ); + if ( Size != 0 ) + { + ret.Append( "-" ); + ret.Append( RunAddressEnd.ToString( "x8" ) ); + } + ret.Append( " " ); + ret.Append( FileName ); + // + return ret.ToString(); + } + #endregion + + #region Data members + private uint iKernelAddress = 0; + private uint iRunAddress = 0; + private uint iSize = 0; + private string iFileName = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Common/Capability.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Common/Capability.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,230 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.Common +{ + public class Capability + { + #region Enumerations + [Flags, System.ComponentModel.TypeConverter( typeof( SymbianParserLib.TypeConverters.SymbianEnumConverter ) )] + public enum TCapability : ulong + { + ECapabilityNone = 0x00000000000, + ECapabilityTCB = 0x00000000001, + ECapabilityCommDD = 0x00000000002, + ECapabilityPowerMgmt = 0x00000000004, + ECapabilityMultimediaDD = 0x00000000008, + ECapabilityReadDeviceData = 0x00000000010, + ECapabilityWriteDeviceData = 0x00000000020, + ECapabilityDRM = 0x00000000040, + ECapabilityTrustedUI = 0x00000000080, + ECapabilityProtServ = 0x00000000100, + ECapabilityDiskAdmin = 0x00000000200, + ECapabilityNetworkControl = 0x00000000400, + ECapabilityAllFiles = 0x00000000800, + ECapabilitySwEvent = 0x00000001000, + ECapabilityNetworkServices = 0x00000002000, + ECapabilityLocalServices = 0x00000004000, + ECapabilityReadUserData = 0x00000008000, + ECapabilityLocation = 0x00000010000, + ECapabilityWriteUserData = 0x00000020000, + ECapabilitySurroundingsDD = 0x00000040000, + ECapabilityUserEnvironment = 0x00000080000, + } + #endregion + + #region Constructors + public Capability() + : this( TCapability.ECapabilityNone ) + { + } + + public Capability( TCapability aCapability ) + { + iCaps = aCapability; + } + + public Capability( long aValue ) + { + TCapability cap = (TCapability) aValue; + iCaps = cap; + } + #endregion + + #region API + public void Add( TCapability aCapability ) + { + ulong addVal = (ulong) aCapability; + ulong curVal = (ulong) iCaps; + ulong combin = addVal | curVal; + // + iCaps = (TCapability) combin; + } + + public void Remove( TCapability aCapability ) + { + ulong remVal = (ulong) aCapability; + ulong combin = (ulong) iCaps; + combin &= remVal; + // + iCaps = (TCapability) combin; + } + + /* + public static string ToString( TCapability aCapability ) + { + + string ret = KCapabilityNames[ (int) aCapability ]; + return ret; + }*/ + #endregion + + #region Properties + public uint LowDWord + { + get + { + ulong val = (ulong) iCaps; + ulong masked = val & 0x00000000FFFFFFFF; + uint ret = (uint) masked; + return ret; + } + set + { + ulong val = HighDWord | value; + iCaps = (TCapability) val; + } + } + + public uint HighDWord + { + get + { + ulong val = (ulong) iCaps; + ulong masked = val & 0xFFFFFFFF00000000; + uint ret = (uint) ( masked >> 8 ); + return ret; + } + set + { + ulong val = ( value << 8 ) | LowDWord; + iCaps = (TCapability) val; + } + } + + public ulong RawValue + { + get { return (ulong) iCaps; } + set { iCaps = (TCapability) value; } + } + + public TCapability Value + { + get { return iCaps; } + set { iCaps = value; } + } + #endregion + + #region Internal methods + /*private static long MakeValue( TCapability aCapability ) + { + int shiftAmount = (int) aCapability; + long ret = 1L << shiftAmount; + return ret; + } + + private static void ValidateCapability( TCapability aCapability ) + { + if ( aCapability < 0 || aCapability >= TCapability.ECapability_Limit ) + { + throw new ArgumentException( "Capability is out of range: " + aCapability.ToString() ); + } + }*/ + #endregion + + #region Internal constants + private const int KMaxBitIndex = 64; + private static readonly string[] KCapabilityNames = new string[] + { + "TCB", + "CommDD", + "PowerMgmt", + "MultimediaDD", + "ReadDeviceData", + "WriteDeviceData", + "DRM", + "TrustedUI", + "ProtServ", + "DiskAdmin", + "NetworkControl", + "AllFiles", + "SwEvent", + "NetworkServices", + "LocalServices", + "ReadUserData", + "WriteUserData", + "Location", + "SurroundingsDD", + "UserEnvironment", + }; + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + for( int i=0; i 0 ) + { + ret.Append( ", " ); + } + // + ret.Append( name ); + } + + /* + TCapability cap = (TCapability) i; + long mask = MakeValue( cap ); + long remainder = ( iValue & mask ); + if ( remainder != 0 ) + { + string name = ToString( cap ); + } + */ + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private TCapability iCaps = TCapability.ECapabilityNone; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Common/CrashDebuggerAware.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Common/CrashDebuggerAware.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace CrashDebuggerLib.Structures.Common +{ + public class CrashDebuggerAware + { + #region Constructors + public CrashDebuggerAware( CrashDebuggerInfo aCrashDebugger ) + { + iCrashDebugger = aCrashDebugger; + } + #endregion + + #region API + #endregion + + #region Properties + public CrashDebuggerInfo CrashDebugger + { + get { return iCrashDebugger; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private readonly CrashDebuggerInfo iCrashDebugger; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Common/ExitInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Common/ExitInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.Common +{ + public class ExitInfo + { + #region Enumerations + public enum TExitType + { + /** + The thread or process has ended as a result of a kill, + i.e. Kill() has been called on the RThread or RProcess handle. + Or a thread was ended as a result of calling User::Exit(). + */ + EExitKill, + + /** + The thread or process has ended as a result of a terminate, + i.e. Terminate() has been called on the RThread or RProcess handle. + */ + EExitTerminate, + + /** + The thread or process has been panicked. + */ + EExitPanic, + + /** + The thread or process is alive. + */ + EExitPending + } + #endregion + + #region Constructors + public ExitInfo() + { + } + #endregion + + #region API + #endregion + + #region Properties + public TExitType Type + { + get { return iType; } + set { iType = value; } + } + + public string Category + { + get { return iCategory; } + set { iCategory = value; } + } + + public int Reason + { + get { return iReason; } + set { iReason = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + if ( Type == TExitType.EExitPending ) + { + ret.Append( "[Pending]" ); + } + else + { + switch ( Type ) + { + case TExitType.EExitKill: + ret.Append( "[Kill]" ); + break; + case TExitType.EExitPanic: + ret.Append( "[Panic]" ); + break; + case TExitType.EExitTerminate: + ret.Append( "[Terminate]" ); + break; + } + + ret.AppendFormat( " {0}-{1}", Category, Reason ); + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private TExitType iType = TExitType.EExitPending; + private int iReason = 0; + private string iCategory = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Common/LinkedListInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Common/LinkedListInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.Common +{ + public class LinkedListInfo + { + #region Constructors + public LinkedListInfo() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint Next + { + get { return iNext; } + set { iNext = value; } + } + + public uint Previous + { + get { return iPrevious; } + set { iPrevious = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iNext = 0; + private uint iPrevious = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Common/RequestStatus.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Common/RequestStatus.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.Common +{ + public class RequestStatus + { + #region Constructors + public RequestStatus() + { + } + + public RequestStatus( uint aAddress ) + { + iAddress = aAddress; + } + #endregion + + #region API + #endregion + + #region Properties + public uint Address + { + get { return iAddress; } + set { iAddress = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iAddress = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/ConditionalVariable/DCondVar.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/ConditionalVariable/DCondVar.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.ConditionalVariable +{ + public class DCondVar : DObject + { + #region Constructors + public DCondVar( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.ECondVar ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Cpu/CpuInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Cpu/CpuInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Register; +using CrashDebuggerLib.Structures.Common; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashDebuggerLib.Structures.Cpu +{ + public class CpuInfo : RegisterSet + { + #region Constructors + public CpuInfo( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger ) + { + } + #endregion + + #region API + public RegisterCollection GetRegisters() + { + RegisterCollection.TType bankType = CPSRBankType; + RegisterCollection bank = this[ bankType ]; + // + RegisterCollection ret = new RegisterCollection( CrashDebugger, bankType ); + foreach ( RegisterEntry entry in bank ) + { + ret.Add( entry.OriginalName, entry.Value ); + } + + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void TryToUpdateRegister( ArmRegister aObjectToUpdate, RegisterCollection aSource ) + { + RegisterEntry entry = aSource[ aObjectToUpdate.RegType ]; + if ( entry != null ) + { + aObjectToUpdate.Value = entry.Value; + } + } + #endregion + + #region Internal constants + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/DebugMask/DebugMaskInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/DebugMask/DebugMaskInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,186 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Register; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.DebugMask +{ + public class DebugMaskInfo : CrashDebuggerAware + { + #region Enumerations + public enum TDebugMaskArea : byte + { + EAreaKernelDebug = 63, // Bits 0 -> 63 + EAreaKernelConfig = 127, // Bits 64 -> 127 + EAreaFileSystem = 191, // Bits 128 -> 191 + EAreaLicensee = 255, // Bits 192 -> 255 + } + + [Flags] + public enum TDebugMaskKernel : ulong + { + KHARDWARE = 0x00000001, + KBOOT = 0x00000002, + KSERVER = 0x00000004, + KMMU = 0x00000008, + KSEMAPHORE = 0x00000010, + KSCHED = 0x00000020, + KPROC = 0x00000040, + KEXEC = 0x00000080, + KDEBUGGER = 0x00000100, + KTHREAD = 0x00000200, + KDLL = 0x00000400, + KIPC = 0x00000800, + KPBUS1 = 0x00001000, + KPBUS2 = 0x00002000, + KPBUSDRV = 0x00004000, + KPOWER = 0x00008000, + KTIMING = 0x00010000, + KEVENT = 0x00020000, + KOBJECT = 0x00040000, + KDFC = 0x00080000, + KEXTENSION = 0x00100000, + KSCHED2 = 0x00200000, + KLOCDRV = 0x00400000, + KFAIL = 0x00800000, + KTHREAD2 = 0x01000000, + KDEVICE = 0x02000000, + KMEMTRACE = 0x04000000, + KDMA = 0x08000000, + KMMU2 = 0x10000000, + KNKERN = 0x20000000, + KSCRATCH = 0x40000000, + KPANIC = 0x80000000, + KUSB = 1u << 32, + KUSBPSL = 1u << 33, + KNETWORK1 = 1u << 34, + KNETWORK2 = 1u << 35, + KSOUND1 = 1u << 36, + KREALTIME = 1u << 63, + KPAGING = 1u << 62, + KLOCDPAGING = 1u << 61 + } + + [Flags] + public enum TDebugMaskKernelConfig : ulong + { + KALLTHREADSSYSTEM = 0x00000001, + KTESTFAST = 0x00000002, + KTESTLATENCY = 0x00000004 + } + #endregion + + #region Constructors + public DebugMaskInfo( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger ) + { + } + #endregion + + #region API + public void Clear() + { + iDebugMaskFileSystem = 0; + iDebugMaskKernel = TDebugMaskKernel.KPANIC; + iDebugMaskKernelConfig = 0; + iDebugMaskReservedForLicensees = 0; + } + + public void SetValueByWordIndex( ulong aValue, int aWord ) + { + uint areaByte = ( (byte) aWord ) * 32u; + TDebugMaskArea area = TDebugMaskArea.EAreaKernelDebug; + if ( areaByte < (byte) TDebugMaskArea.EAreaKernelDebug ) + { + area = TDebugMaskArea.EAreaKernelDebug; + } + else if ( areaByte < (byte) TDebugMaskArea.EAreaKernelConfig ) + { + area = TDebugMaskArea.EAreaKernelConfig; + } + else if ( areaByte < (byte) TDebugMaskArea.EAreaFileSystem ) + { + area = TDebugMaskArea.EAreaFileSystem; + } + else if ( areaByte < (byte) TDebugMaskArea.EAreaLicensee ) + { + area = TDebugMaskArea.EAreaLicensee; + } + SetValueByArea( aValue, area ); + } + + public void SetValueByArea( ulong aValue, TDebugMaskArea aArea ) + { + switch ( aArea ) + { + default: + case TDebugMaskArea.EAreaKernelDebug: + DebugMaskKernel = (TDebugMaskKernel) aValue; + break; + case TDebugMaskArea.EAreaKernelConfig: + DebugMaskKernelConfig = (TDebugMaskKernelConfig) aValue; + break; + case TDebugMaskArea.EAreaFileSystem: + iDebugMaskFileSystem = aValue; + break; + case TDebugMaskArea.EAreaLicensee: + iDebugMaskReservedForLicensees = aValue; + break; + } + } + #endregion + + #region Properties + public TDebugMaskKernel DebugMaskKernel + { + get { return iDebugMaskKernel; } + set { iDebugMaskKernel = value; } + } + + public TDebugMaskKernelConfig DebugMaskKernelConfig + { + get { return iDebugMaskKernelConfig; } + set { iDebugMaskKernelConfig = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private TDebugMaskKernel iDebugMaskKernel = TDebugMaskKernel.KPANIC; + private TDebugMaskKernelConfig iDebugMaskKernelConfig = 0; + private ulong iDebugMaskFileSystem = 0; + private ulong iDebugMaskReservedForLicensees = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Fault/FaultInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Fault/FaultInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Register; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.Fault +{ + public class FaultInfo : CrashDebuggerAware + { + #region Enumerations + public enum TFaultType + { + EFaultPanic = 0, + EFaultException + } + #endregion + + #region Constructors + public FaultInfo( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger ) + { + iRegisters = new RegisterCollection( aCrashDebugger, RegisterCollection.TType.ETypeGeneral ); + } + #endregion + + #region API + public void Clear() + { + iCategory = string.Empty; + iReason = 0; + iCodeAddress = 0; + iDataAddress = 0; + iExceptionId = 0; + iExtraInfo = 0; + iExcCode = 0; + iRegisters.Clear(); + } + #endregion + + #region Properties + public string Category + { + get { return iCategory; } + set { iCategory = value; } + } + + public uint Reason + { + get { return iReason; } + set { iReason = value; } + } + + public uint CodeAddress + { + get { return iCodeAddress; } + set { iCodeAddress = value; } + } + + public uint DataAddress + { + get { return iDataAddress; } + set { iDataAddress = value; } + } + + public int ExcCode + { + get { return iExcCode; } + set { iExcCode = value; } + } + + public uint ExceptionId + { + get { return iExceptionId; } + set { iExceptionId = value; } + } + + public uint ExtraInfo + { + get { return iExtraInfo; } + set { iExtraInfo = value; } + } + + public RegisterCollection Registers + { + get { return iRegisters; } + } + + public TFaultType FaultType + { + get + { + TFaultType ret = TFaultType.EFaultPanic; + // + if ( Category == KExceptionFaultReason ) + { + ret = TFaultType.EFaultException; + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + private const string KExceptionFaultReason = "Exception"; + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private string iCategory = string.Empty; + private uint iReason = 0; + private uint iCodeAddress = 0; + private uint iDataAddress = 0; + private uint iExceptionId = 0; + private uint iExtraInfo = 0; + private int iExcCode = 0; + private readonly RegisterCollection iRegisters; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/KernelObjects/DBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/KernelObjects/DBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.KernelObjects +{ + public class DBase : CrashDebuggerAware + { + #region Constructors + public DBase( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger ) + { + } + #endregion + + #region API + public virtual string ToClipboard() + { + return "@ 0x" + KernelAddress.ToString( "x8" ); + } + #endregion + + #region Properties + public uint KernelAddress + { + get { return iKernelAddress; } + set { iKernelAddress = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return iKernelAddress.ToString("x8"); + } + #endregion + + #region Data members + private uint iKernelAddress = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/KernelObjects/DObject.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/KernelObjects/DObject.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,287 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace CrashDebuggerLib.Structures.KernelObjects +{ + public class DObject : DBase + { + #region Enumerations + public enum TObjectType + { + EThread=0, + EProcess, + EChunk, + ELibrary, + ESemaphore, + EMutex, + ETimer, + EServer, + ESession, + ELogicalDevice, + EPhysicalDevice, + ELogicalChannel, + EChangeNotifier, + EUndertaker, + EMsgQueue, + EPropertyRef, + ECondVar, + ENumObjectTypes, // number of DObject-derived types + EObjectTypeAny=-1 + } + #endregion + + #region Constructors + public DObject( CrashDebuggerInfo aCrashDebugger, TObjectType aType ) + : base( aCrashDebugger ) + { + iType = aType; + } + #endregion + + #region API + public static string AsClassName( TObjectType aType ) + { + string ret = "Unknown"; + // + switch ( aType ) + { + case DObject.TObjectType.EThread: + ret = "DThread"; + break; + case DObject.TObjectType.EProcess: + ret = "DProcess"; + break; + case DObject.TObjectType.EChunk: + ret = "DChunk"; + break; + case DObject.TObjectType.ELibrary: + ret = "DLibrary"; + break; + case DObject.TObjectType.ESemaphore: + ret = "DSemaphore"; + break; + case DObject.TObjectType.EMutex: + ret = "DMutex"; + break; + case DObject.TObjectType.ETimer: + ret = "DTimer"; + break; + case DObject.TObjectType.EServer: + ret = "DServer"; + break; + case DObject.TObjectType.ESession: + ret = "DSession"; + break; + case DObject.TObjectType.ELogicalDevice: + ret = "DLogicalDevice"; + break; + case DObject.TObjectType.EPhysicalDevice: + ret = "DPhysicalDevice"; + break; + case DObject.TObjectType.ELogicalChannel: + ret = "DLogicalChannel"; + break; + case DObject.TObjectType.EChangeNotifier: + ret = "DChangeNotifier"; + break; + case DObject.TObjectType.EUndertaker: + ret = "DUndertaker"; + break; + case DObject.TObjectType.EMsgQueue: + ret = "DMsgQueue"; + break; + case DObject.TObjectType.EPropertyRef: + ret = "DPropertyRef"; + break; + case DObject.TObjectType.ECondVar: + ret = "DCondVar"; + break; + default: + break; + } + + return ret; + } + + public static string AsTypeDescription( TObjectType aType ) + { + string ret = "Unknown"; + // + switch ( aType ) + { + case DObject.TObjectType.EThread: + ret = "Thread"; + break; + case DObject.TObjectType.EProcess: + ret = "Process"; + break; + case DObject.TObjectType.EChunk: + ret = "Chunk"; + break; + case DObject.TObjectType.ELibrary: + ret = "Library"; + break; + case DObject.TObjectType.ESemaphore: + ret = "Semaphore"; + break; + case DObject.TObjectType.EMutex: + ret = "Mutex"; + break; + case DObject.TObjectType.ETimer: + ret = "Timer"; + break; + case DObject.TObjectType.EServer: + ret = "Server"; + break; + case DObject.TObjectType.ESession: + ret = "Session"; + break; + case DObject.TObjectType.ELogicalDevice: + ret = "Logical Device"; + break; + case DObject.TObjectType.EPhysicalDevice: + ret = "Physical Device"; + break; + case DObject.TObjectType.ELogicalChannel: + ret = "Logical Channel"; + break; + case DObject.TObjectType.EChangeNotifier: + ret = "Change Notifier"; + break; + case DObject.TObjectType.EUndertaker: + ret = "Undertaker"; + break; + case DObject.TObjectType.EMsgQueue: + ret = "Message Queue"; + break; + case DObject.TObjectType.EPropertyRef: + ret = "Property Ref"; + break; + case DObject.TObjectType.ECondVar: + ret = "Condition Variable"; + break; + default: + break; + } + + return ret; + } + #endregion + + #region Properties + public TObjectType Type + { + get { return iType; } + } + + public uint VTable + { + get { return iVTable; } + set { iVTable = value; } + } + + public int AccessCount + { + get { return iAccessCount; } + set { iAccessCount = value; } + } + + public uint OwnerAddress + { + get { return iOwnerAddress; } + set { iOwnerAddress = value; } + } + + public DObject Owner + { + get + { + DObject ret = CrashDebugger.ObjectByAddress( OwnerAddress ); + return ret; + } + } + + public string Name + { + get { return iName; } + set { iName = value; } + } + + public string ClassName + { + get + { + string ret = AsClassName( iType ); + return ret; + } + } + + public string TypeDescription + { + get + { + string ret = AsTypeDescription( iType ); + return ret; + } + } + + public bool Tagged + { + get { return iTagged; } + set { iTagged = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From DBase + public override string ToClipboard() + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( TypeDescription.ToUpper() + " [" + Name + "] " + base.ToClipboard() ); + ret.AppendFormat( " VTable: 0x{0:x8} Owner: 0x{1:x8}, AccessCount: {2}", VTable, OwnerAddress, AccessCount ); + // + return ret.ToString(); + } + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region Data members + private readonly TObjectType iType; + private uint iVTable = 0; + private int iAccessCount = 0; + private uint iOwnerAddress = 0; + private string iName = string.Empty; + private bool iTagged = true; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/KernelObjects/DObjectCon.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/KernelObjects/DObjectCon.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace CrashDebuggerLib.Structures.KernelObjects +{ + public class DObjectCon : DBase, IEnumerable + { + #region Constructors + public DObjectCon( CrashDebuggerInfo aCrashDebugger, DObject.TObjectType aType ) + : base( aCrashDebugger ) + { + iType = aType; + } + #endregion + + #region API + internal void Add( DObject aObject ) + { + if ( aObject.Type != Type ) + { + throw new ArgumentException( "Object is not of the correct type" ); + } + + // Add it to the address-based index. + iObjectsInOriginalOrder.Add( aObject.KernelAddress, aObject ); + + try + { + // Must munge in the address, because name is not sufficiently unique. For example + // there can be dead threads or processes (or anything really) with the same name + // but since one is dead and the other is not, then they have different addresses. + string sortedByName = string.Format( "{0}_{1:x8}", aObject, aObject.KernelAddress ); + iObjectsInSortedOrder.Add( sortedByName, aObject ); + } + catch ( Exception ) + { + // Keep the two synchronised... + iObjectsInOriginalOrder.Remove( aObject.KernelAddress ); + } + } + + public bool Contains( DObject aObject ) + { + bool exists = iObjectsInOriginalOrder.ContainsKey( aObject.KernelAddress ); + return exists; + } + #endregion + + #region Properties + public int Count + { + get { return iObjectsInSortedOrder.Count; } + } + + public int ExpectedCount + { + get { return iExpectedCount; } + set { iExpectedCount = value; } + } + + public int Index + { + get { return iIndex; } + set { iIndex = value; } + } + + public DObject this[ uint aAddress ] + { + get + { + DObject ret = null; + iObjectsInOriginalOrder.TryGetValue( aAddress, out ret ); + return ret; + } + } + + public DObject.TObjectType Type + { + get { return iType; } + } + + public string TypeDescription + { + get + { + string ret = DObject.AsTypeDescription( iType ); + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( KeyValuePair pair in iObjectsInSortedOrder ) + { + yield return pair.Value; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair pair in iObjectsInSortedOrder ) + { + yield return pair.Value; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "[{0:d4}] {1} objects", Count, TypeDescription ); + return ret.ToString(); + } + #endregion + + #region Data members + private readonly DObject.TObjectType iType; + private int iIndex = 0; + private int iExpectedCount = 0; + private Dictionary iObjectsInOriginalOrder = new Dictionary(); + private SortedList iObjectsInSortedOrder = new SortedList(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Library/DLibrary.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Library/DLibrary.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.Library +{ + public class DLibrary : DObject + { + #region Constructors + public DLibrary( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.ELibrary ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/LogicalChannel/DLogicalChannel.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/LogicalChannel/DLogicalChannel.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.LogicalChannel +{ + public class DLogicalChannel : DObject + { + #region Constructors + public DLogicalChannel( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.ELogicalChannel ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/LogicalDevice/DLogicalDevice.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/LogicalDevice/DLogicalDevice.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.LogicalDevice +{ + public class DLogicalDevice : DObject + { + #region Constructors + public DLogicalDevice( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.ELogicalDevice ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/MessageQueue/DMsgQueue.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/MessageQueue/DMsgQueue.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.Process; + +namespace CrashDebuggerLib.Structures.MessageQueue +{ + public class DMsgQueue : DObject + { + #region Enumerations + [System.ComponentModel.TypeConverter( typeof( SymbianParserLib.TypeConverters.SymbianEnumConverter ) )] + public enum TQueueState + { + EUnknown = -1, + EEmpty, + EPartial, + EFull + } + #endregion + + #region Constructors + public DMsgQueue( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.EMsgQueue ) + { + iWaitSpaceInfo = new MsgQueueWaitInfo( MsgQueueWaitInfo.TType.EWaitTypeSpace, CrashDebugger ); + iWaitDataInfo = new MsgQueueWaitInfo( MsgQueueWaitInfo.TType.EWaitTypeData, CrashDebugger ); + } + #endregion + + #region API + public static TQueueState StateByString( string aState ) + { + TQueueState ret = TQueueState.EUnknown; + // + switch ( aState.ToUpper() ) + { + case "EMPTY": + ret = TQueueState.EEmpty; + break; + case "PARTIAL": + ret = TQueueState.EPartial; + break; + case "FULL": + ret = TQueueState.EFull; + break; + default: + break; + } + // + return ret; + } + #endregion + + #region Properties + public MsgQueuePoolInfo PoolInfo + { + get { return iPoolInfo; } + } + + public MsgQueueSlotInfo SlotInfo + { + get { return iSlotInfo; } + } + + public int MaxMessageLength + { + get { return iMaxMessageLength; } + set { iMaxMessageLength = value; } + } + + public TQueueState State + { + get { return iState; } + set { iState = value; } + } + + public string StateString + { + get + { + string ret = "Unknown"; + // + switch ( iState ) + { + default: + case TQueueState.EUnknown: + break; + case TQueueState.EEmpty: + ret = "Empty"; + break; + case TQueueState.EPartial: + ret = "Partial"; + break; + case TQueueState.EFull: + ret = "Full"; + break; + } + // + return ret; + } + } + + public MsgQueueWaitInfo WaitSpace + { + get { return iWaitSpaceInfo; } + } + + public MsgQueueWaitInfo WaitData + { + get { return iWaitDataInfo; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private readonly MsgQueueWaitInfo iWaitSpaceInfo; + private readonly MsgQueueWaitInfo iWaitDataInfo; + private MsgQueuePoolInfo iPoolInfo = new MsgQueuePoolInfo(); + private MsgQueueSlotInfo iSlotInfo = new MsgQueueSlotInfo(); + private int iMaxMessageLength = 0; + private TQueueState iState = TQueueState.EUnknown; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/MessageQueue/MsgQueuePoolInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/MessageQueue/MsgQueuePoolInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.MessageQueue +{ + public class MsgQueuePoolInfo + { + #region Constructors + public MsgQueuePoolInfo() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint Start + { + get { return iStart; } + set { iStart = value; } + } + + public uint End + { + get { return iEnd; } + set { iEnd = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iStart = 0; + private uint iEnd = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/MessageQueue/MsgQueueSlotInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/MessageQueue/MsgQueueSlotInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.MessageQueue +{ + public class MsgQueueSlotInfo + { + #region Constructors + public MsgQueueSlotInfo() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint FirstFull + { + get { return iFirstFull; } + set { iFirstFull = value; } + } + + public uint FirstFree + { + get { return iFirstFree; } + set { iFirstFree = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iFirstFull = 0; + private uint iFirstFree = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/MessageQueue/MsgQueueWaitInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/MessageQueue/MsgQueueWaitInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Thread; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.MessageQueue +{ + public class MsgQueueWaitInfo + { + #region Enumerations + public enum TType + { + EWaitTypeSpace = 0, + EWaitTypeData + } + #endregion + + #region Constructors + public MsgQueueWaitInfo( TType aType, CrashDebuggerInfo aCrashDebugger ) + { + iType = aType; + iCrashDebugger = aCrashDebugger; + } + #endregion + + #region API + #endregion + + #region Properties + public uint WaitingThreadAddress + { + get { return iWaitingThreadAddress; } + set { iWaitingThreadAddress = value; } + } + + public DThread WaitingThread + { + get { return iCrashDebugger.ThreadByAddress( WaitingThreadAddress ); } + } + + public RequestStatus RequestStatus + { + get { return iRequestStatus; } + set { iRequestStatus = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private readonly TType iType; + private readonly CrashDebuggerInfo iCrashDebugger; + private uint iWaitingThreadAddress = 0; + private RequestStatus iRequestStatus = new RequestStatus(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Mutex/DMutex.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Mutex/DMutex.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.Process; + +namespace CrashDebuggerLib.Structures.Mutex +{ + public class DMutex : DObject + { + #region Constructors + public DMutex( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.EMutex ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/NThread/NThread.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/NThread/NThread.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,442 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.Thread; +using CrashDebuggerLib.Structures.Register; +using CrashDebuggerLib.Structures.UserContextTable; +using CrashDebuggerLib.Attributes; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Arm.Registers; +using SymbianUtils.DataBuffer; + +namespace CrashDebuggerLib.Structures.NThread +{ + public class NThread : CrashDebuggerAware + { + #region Enumerations + [System.ComponentModel.TypeConverter( typeof( SymbianParserLib.TypeConverters.SymbianEnumConverter ) )] + public enum TNThreadState + { + EUnknown = -1, // Catch all + EReady = 0, + ESuspended, + EWaitFastSemaphore, + ESleep, + EBlocked, + EDead, + EWaitDfc + } + + public enum TWaitType + { + EWaitTypeNotWaiting = 0, + EWaitTypeUserWaitForRequest, + EWaitTypeUserWaitForAnyRequest + } + #endregion + + #region Constructors + public NThread( CrashDebuggerInfo aCrashDebugger, DThread aParentThread ) + : base( aCrashDebugger ) + { + iParentThread = aParentThread; + iRegisters = new RegisterCollection( aCrashDebugger, RegisterCollection.TType.ETypeGeneral, aParentThread.OwningProcess ); + } + #endregion + + #region API + public static TNThreadState NStateFromString( string aState ) + { + NThread.TNThreadState ret = NThread.TNThreadState.EUnknown; + // + switch ( aState.ToUpper() ) + { + case "READY": + ret = NThread.TNThreadState.EReady; + break; + case "SUSPENDED": + ret = NThread.TNThreadState.ESuspended; + break; + case "WAITFSEM": + ret = NThread.TNThreadState.EWaitFastSemaphore; + break; + case "SLEEP": + ret = NThread.TNThreadState.ESleep; + break; + case "BLOCKED": + ret = NThread.TNThreadState.EBlocked; + break; + case "DEAD": + ret = NThread.TNThreadState.EDead; + break; + case "WAITDFC": + ret = NThread.TNThreadState.EWaitDfc; + break; + default: + case "??": + ret = NThread.TNThreadState.EUnknown; + break; + } + // + return ret; + } + + public RegisterCollection GetRegisters( RegisterCollection.TType aType ) + { + RegisterCollection ret = null; + + // Are we the currently executing thread? + bool isCurrent = iParentThread.IsCurrent; + + // If we're dealing with the current thread, and we need to supply + // user-land registers, then we'll try to work with the user context + // tables so long as we are executing in supervisor mode. + if ( aType == RegisterCollection.TType.ETypeUser ) + { + ret = GetUserContextRegisters(); + } + else + { + // Trying to get non-user registers + Cpu.CpuInfo cpuInfo = CrashDebugger.InfoCpu; + // + if ( isCurrent ) + { + // Just go entirely with current CPU registers + ret = cpuInfo.GetRegisters(); + } + else + { + // Best we can do :( + ret = new RegisterCollection( Registers, aType, iParentThread.OwningProcess ); + + if ( aType == RegisterCollection.TType.ETypeSupervisor ) + { + // We know R13_SP because we explicitly are given it + ret[ TArmRegisterType.EArmReg_SP ].Value = SavedSP; + + // TODO: We also need to get CPSR from somewhere. We just make it + // up at the moment, which is really bad... + ret[ TArmRegisterType.EArmReg_CPSR ].Value = ret[ TArmRegisterType.EArmReg_SPSR ]; + } + } + } + // + return ret; + } + #endregion + + #region Properties + [PropCat("State")] + public TNThreadState NState + { + get { return iNState; } + set { iNState = value; } + } + + [PropCat( "Summary", PropCat.TFormatType.EFormatAsHex )] + public uint Address + { + get { return iAddress; } + set { iAddress = value; } + } + + public uint RequestSemaphoreAddress + { + get + { + uint ret = Address; + ret += (uint) CrashDebuggerLib.Platform.NKernOffsets.KOffsetOf_iRequestSemaphore_In_NThread; + return ret; + } + } + + public uint WaitObj + { + get { return iWaitObj; } + set { iWaitObj = value; } + } + + [PropCat( "Summary" )] + public int Priority + { + get { return iPriority; } + set { iPriority = value; } + } + + [PropCat( "State", PropCat.TFormatType.EFormatAsHex )] + public uint Attributes + { + get { return iAttributes; } + set { iAttributes = value; } + } + + [PropCat( "Summary", "Address space" )] + public uint AddressSpace + { + get { return iAddressSpace; } + set { iAddressSpace = value; } + } + + [PropCat( "Summary", "Supervisor stack pointer", PropCat.TFormatType.EFormatAsHex )] + public uint SavedSP + { + get { return iSavedSP; } + set { iSavedSP = value; } + } + + [PropCat( "Misc", "Return Value" )] + public int ReturnValue + { + get { return iReturnValue; } + set { iReturnValue = value; } + } + + [PropCat( "Summary", "Is user thread", PropCat.TFormatType.EFormatAsYesNo )] + public bool IsUserThread + { + get { return iParentThread.IsUserThread; } + } + + [PropCat( "State", "Is the current thread", PropCat.TFormatType.EFormatAsYesNo )] + public bool IsCurrent + { + get { return iParentThread.IsCurrent; } + } + + public bool HaveUserContext + { + get + { + bool haveUserContext = true; + // + switch ( UserContextType ) + { + case TUserContextType.EContextNone: + case TUserContextType.EContextUndefined: + case TUserContextType.EContextKernel: + haveUserContext = false; + break; + default: + break; + } + // + return haveUserContext; + } + } + + [PropCat( "State", "User context type" )] + public TUserContextType UserContextType + { + get { return iUserContextType; } + set { iUserContextType = value; } + } + + [PropCat( "Linked List Info", PropCat.TFormatType.EFormatRecurseInto )] + public LinkedListInfo LinkedListInfo + { + get { return iLinkedListInfo; } + } + + [PropCat( "Mutex Info", PropCat.TFormatType.EFormatRecurseInto )] + public NThreadMutexInfo MutexInfo + { + get { return iMutexInfo; } + } + + [PropCat( "Timing Info", PropCat.TFormatType.EFormatRecurseInto )] + public NThreadTimeInfo TimeInfo + { + get { return iTimeInfo; } + set { iTimeInfo = value; } + } + + [PropCat( "Count Info", PropCat.TFormatType.EFormatRecurseInto )] + public NThreadCountInfo CountInfo + { + get { return iCountInfo; } + set { iCountInfo = value; } + } + + public NThreadExtraContextInfo ExtraContextInfo + { + get { return iExtraContextInfo; } + set { iExtraContextInfo = value; } + } + + public RegisterCollection Registers + { + get { return iRegisters; } + } + + public TWaitType WaitType + { + get + { + TWaitType ret = TWaitType.EWaitTypeNotWaiting; + // + RegisterEntry linkReg = Registers[ "R14_USR" ]; + Symbol symbol = linkReg.Symbol; + if ( symbol != null ) + { + if ( symbol.Name.Contains( "User::WaitForAnyRequest" ) ) + { + ret = TWaitType.EWaitTypeUserWaitForAnyRequest; + } + else if ( symbol.Name.Contains( "User::WaitForRequest(TRequestStatus&)" ) ) + { + ret = TWaitType.EWaitTypeUserWaitForRequest; + } + } + // + return ret; + } + } + #endregion + + #region Internal methods + // + // This property returns the return address of the instruction + // to resume executing when this thread finishes executing within + // the context of an exception handler (typically SVC) + // + internal uint UserReturnAddress + { + get + { + uint retAddr = 0; + // + switch ( UserContextType ) + { + case TUserContextType.EContextNone: + case TUserContextType.EContextUndefined: + case TUserContextType.EContextKernel: + throw new NotSupportedException(); + default: + { + Thread.ThreadStackData superStackData = iParentThread.StackInfoSupervisor.Data; + SymbianUtils.DataBuffer.Entry.DataBufferUint uintEntry = superStackData.LastRawDataEntry; + retAddr = uintEntry.Uint; + } + break; + } + // + return retAddr; + } + } + + private RegisterCollection GetUserContextRegisters() + { + bool isCurrent = IsCurrent; + RegisterCollection ret = new RegisterCollection( Registers, RegisterCollection.TType.ETypeUser, iParentThread.OwningProcess ); + + // User-land CPSR is stored in SPSR_SVC + RegisterEntry spsr = Registers[ TArmRegisterType.EArmReg_SPSR ]; + ret[ TArmRegisterType.EArmReg_CPSR ].Value = spsr.Value; + + // Get the context table that we'll need to work out the reg positions + UserContextTable.UserContextTable table = CrashDebugger.UserContextTableManager[ UserContextType ]; + + // Get SP and stack data for supervisor thread + uint sp = SavedSP; + ThreadStackData spData = iParentThread.StackInfoSupervisor.Data; + if ( spData.Info.Data.Size > 0 ) + { + // This is the user side address that will be branched back to once we exit SVC mode... + uint retAddr = UserReturnAddress; + ret[ TArmRegisterType.EArmReg_PC ].Value = retAddr; + + // Now try to get the register values off of the supervisor stack + DataBuffer superStackData = spData.Data; + foreach ( ArmRegister reg in ret ) + { + if ( UserContextTable.UserContextTable.IsSupported( reg.RegType ) ) + { + UserContextTableEntry uctEntry = table[ reg.RegType ]; + if ( uctEntry.IsAvailable( isCurrent ) ) + { + ArmRegister savedSp = new ArmRegister( TArmRegisterType.EArmReg_SP, sp ); + uint newValue = uctEntry.Process( savedSp, superStackData ); + reg.Value = newValue; + } + } + } + } + + // Getting context of current thread? Some values can be fetched directly + // from the registers if they are not available from the stack. + if ( isCurrent && table[ TArmRegisterType.EArmReg_SP ].Type == UserContextTableEntry.TType.EOffsetFromSp ) + { + RegisterCollection userRegs = CrashDebugger.InfoCpu[ RegisterCollection.TType.ETypeUser ]; + // + ret[ TArmRegisterType.EArmReg_SP ].Value = userRegs[ TArmRegisterType.EArmReg_SP ]; + ret[ TArmRegisterType.EArmReg_LR ].Value = userRegs[ TArmRegisterType.EArmReg_LR ]; + } + + return ret; + } + #endregion + + #region Internal constants + #endregion + + #region Clipboard Support + public string ToClipboard() + { + StringBuilder ret = new StringBuilder(); + // + ret.AppendFormat( "NThread Address: 0x{0:x8}, NState: {1}" + System.Environment.NewLine, Address, NState ); + // + return ret.ToString(); + } + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private readonly RegisterCollection iRegisters; + private readonly DThread iParentThread; + + private uint iWaitObj = 0;// object on which this thread is waiting + private uint iAddress = 0; + private int iPriority = 0; + private uint iAttributes = 0; + private uint iAddressSpace = 0; + private uint iSavedSP = 0; + private int iReturnValue = 0; + + private TNThreadState iNState = TNThreadState.EDead; + private TUserContextType iUserContextType = TUserContextType.EContextNone; + + private NThreadMutexInfo iMutexInfo = new NThreadMutexInfo(); + private NThreadCountInfo iCountInfo = new NThreadCountInfo(); + private LinkedListInfo iLinkedListInfo = new LinkedListInfo(); + private NThreadTimeInfo iTimeInfo = new NThreadTimeInfo(); + private NThreadExtraContextInfo iExtraContextInfo = new NThreadExtraContextInfo(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/NThread/NThreadCountInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/NThread/NThreadCountInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.NThread +{ + public class NThreadCountInfo + { + #region Enumerations + public enum TCsFunctionType + { + EDoNothing = 0, + ESuspendNTimes, + EExitPending = -1, + EExitInProgress = -2 + } + #endregion + + #region Constructors + public NThreadCountInfo() + { + } + #endregion + + #region API + #endregion + + #region Properties + public int RequestSemaphoreCount + { + get { return iRequestSemaphoreCount; } + set { iRequestSemaphoreCount = value; } + } + + public int SuspendCount + { + get { return iSuspendCount; } + set { iSuspendCount = value; } + } + + public int CsCount + { + get { return iCsCount; } + set { iCsCount = value; } + } + + public int CsFunction + { + get { return iCsFunction; } + set { iCsFunction = value; } + } + + public uint CsFunctionRaw + { + get { return (uint) iCsFunction; } + set { iCsFunction = (int) value; } + } + + public int CsFunctionSuspendCount + { + get + { + int ret = 0; + // + if ( CsFunctionType != TCsFunctionType.ESuspendNTimes ) + { + throw new ArgumentException( "CsFunction is not \'Suspend N Times\'" ); + } + // + ret = iCsFunction; + return ret; + } + } + + public TCsFunctionType CsFunctionType + { + get + { + TCsFunctionType ret = TCsFunctionType.EDoNothing; + // + if ( CsFunction > 0 ) + { + ret = TCsFunctionType.ESuspendNTimes; + } + else if ( CsFunction == -1 ) + { + ret = TCsFunctionType.EExitPending; + } + else if ( CsFunction == -2 ) + { + ret = TCsFunctionType.EExitInProgress; + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private int iRequestSemaphoreCount = 0; + private int iSuspendCount = 0; // -how many times we have been suspended + private int iCsCount = 0; // critical section count + private int iCsFunction = 0; // what to do on leaving CS: +n=suspend n times, 0=nothing, -1=exit + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/NThread/NThreadExtraContextInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/NThread/NThreadExtraContextInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.NThread +{ + public class NThreadExtraContextInfo + { + #region Enumerations + public enum TExtraContextType + { + ENone = 0, + EDynamicallyAllocated, + EStaticallyAllocated, + } + #endregion + + #region Constructors + public NThreadExtraContextInfo() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint ExtraContext + { + get { return iExtraContext; } + set { iExtraContext = value; } + } + + public int ExtraContextSize + { + get { return iExtraContextSize; } + set { iExtraContextSize = value; } + } + + public uint ExtraContextSizeRaw + { + get { return (uint) iExtraContextSize; } + set { iExtraContextSize = (int) value; } + } + + public TExtraContextType ExtraContextType + { + get + { + TExtraContextType ret = TExtraContextType.ENone; + // + if ( ExtraContextSize > 0 ) + { + ret = TExtraContextType.EDynamicallyAllocated; + } + else if ( ExtraContextSize < 0 ) + { + ret = TExtraContextType.EStaticallyAllocated; + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iExtraContext = 0; // coprocessor context + private int iExtraContextSize = 0; // +ve=dynamically allocated, 0=none, -ve=statically allocated + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/NThread/NThreadMutexInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/NThread/NThreadMutexInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.NThread +{ + public class NThreadMutexInfo + { + #region Constructors + public NThreadMutexInfo() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint WaitAddress + { + get { return iWaitAddress; } + set { iWaitAddress = value; } + } + + public uint HeldAddress + { + get { return iHeldAddress; } + set { iHeldAddress = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iWaitAddress = 0; // fast mutex on which this thread is blocked + private uint iHeldAddress = 0; // fast mutex held by this thread + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/NThread/NThreadTimeInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/NThread/NThreadTimeInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Attributes; + +namespace CrashDebuggerLib.Structures.NThread +{ + public class NThreadTimeInfo + { + #region Constructors + public NThreadTimeInfo() + { + } + #endregion + + #region API + #endregion + + #region Properties + [PropCat( "Timing Info" )] + public int Time + { + get { return iTime; } + set { iTime = value; } + } + + [PropCat( "Timing Info" )] + public int Timeslice + { + get { return iTimeslice; } + set { iTimeslice = value; } + } + + [PropCat( "Timing Info", "Last start time", PropCat.TFormatType.EFormatAsHex )] + public uint LastStartTime + { + get { return iLastStartTime; } + set { iLastStartTime = value; } + } + + [PropCat( "Timing Info", "Total CPU time" )] + public ulong TotalCpuTime + { + get { return iTotalCpuTime; } + set { iTotalCpuTime = value; } + } + + [PropCat( "Timing Info", PropCat.TFormatType.EFormatAsHex )] + public uint Tag + { + get { return iTag; } + set { iTag = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private int iTime = 0; // Time remaining + private int iTimeslice = 0; // Timeslice for this thread + private uint iLastStartTime = 0; // Last start of execution timestamp + private ulong iTotalCpuTime = 0; // Total time spent running, in hi-res timer ticks + private uint iTag; // User defined set of bits which is ANDed with a mask when the thread is scheduled, and indicates if a DFC should be scheduled. + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/PhysicalDevice/DPhysicalDevice.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/PhysicalDevice/DPhysicalDevice.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.PhysicalDevice +{ + public class DPhysicalDevice : DObject + { + #region Constructors + public DPhysicalDevice( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.EPhysicalDevice ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Process/DProcess.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Process/DProcess.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,273 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.Chunk; +using CrashDebuggerLib.Structures.CodeSeg; + +namespace CrashDebuggerLib.Structures.Process +{ + public class DProcess : DObject + { + #region Enumerations + [Flags, System.ComponentModel.TypeConverter( typeof( SymbianParserLib.TypeConverters.SymbianEnumConverter ) )] + public enum TProcessFlags : uint + { + EProcessFlagNone = 0x00000000, + EProcessFlagSystemCritical = 0x00000004, // process panic reboots entire system + EProcessFlagSystemPermanent = 0x00000008, // process exit of any kind reboots entire system + EProcessFlagPriorityControl = 0x40000000, + EProcessFlagJustInTime = 0x80000000, + } + + [Flags, System.ComponentModel.TypeConverter( typeof( SymbianParserLib.TypeConverters.SymbianEnumConverter ) )] + public enum TProcessAttributes : uint + { + ENone = 0x00000000, + EPrivate = 0x00000002, + EResumed = 0x00010000, + EBeingLoaded = 0x08000000, + ESupervisor = 0x80000000, + } + #endregion + + #region Constructors + public DProcess( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.EProcess ) + { + } + #endregion + + #region API + public CodeSegDefinitionCollection GetCodeSegDefinitions() + { + CodeSegDefinitionCollection ret = new CodeSegDefinitionCollection(); + // + foreach ( ProcessCodeSeg codeSeg in CodeSegments ) + { + CodeSegDefinition codeSegDef = new CodeSegDefinition(); + codeSegDef.Set( codeSeg.ProcessLocalRunAddress, codeSeg.ProcessLocalRunAddressEnd ); + codeSegDef.FileName = codeSeg.FileName; + ret.Add( codeSegDef ); + } + // + return ret; + } + + internal void PrepareDebugView() + { + iDebugEngineView = base.CrashDebugger.DebugEngine.CreateView( string.Format( "DProcess [{0}]", base.Name ) ); + } + + internal Symbol LookUpSymbol( uint aAddress ) + { + Symbol ret = null; + // + if ( iDebugEngineView != null ) + { + ret = iDebugEngineView.Symbols[ aAddress ]; + } + else + { + ret = base.CrashDebugger.LookUpSymbol( aAddress ); + } + // + return ret; + } + #endregion + + #region Properties + public ExitInfo ExitInfo + { + get { return iExitInfo; } + } + + public TProcessFlags Flags + { + get { return iFlags; } + set { iFlags = value; } + } + + public uint Handles + { + get { return iHandles; } + set { iHandles = value; } + } + + public TProcessAttributes Attributes + { + get { return iAttributes; } + set { iAttributes = value; } + } + + public uint DataBssStackChunkAddress + { + get { return iDataBssStackChunkAddress; } + set { iDataBssStackChunkAddress = value; } + } + + public DChunk DataBssStackChunk + { + get { return CrashDebugger.ChunkByAddress( DataBssStackChunkAddress ); } + } + + public uint CodeSegAddress + { + get { return iCodeSegAddress; } + set + { + iCodeSegAddress = value; + + // If the address specified isn't already part of the + // list of codesegs for the process, then add it. + if ( !CodeSegments.Contains( value ) ) + { + ProcessCodeSeg codeSeg = new ProcessCodeSeg( CrashDebugger, value, 0 ); + CodeSegments.Add( codeSeg ); + } + } + } + + public CodeSegEntry CodeSeg + { + get { return CrashDebugger.CodeSegByAddress( CodeSegAddress ); } + } + + public uint TempCodeSegAddress + { + get { return iTempCodeSegAddress; } + set { iTempCodeSegAddress = value; } + } + + public CodeSegEntry TempCodeSeg + { + get { return CrashDebugger.CodeSegByAddress( TempCodeSegAddress ); } + } + + public ProcessLockInfo LockInfo + { + get { return iLockInfo; } + } + + public uint SID + { + get { return iSID; } + set { iSID = value; } + } + + public ProcessCodeSegCollection CodeSegments + { + get { return iCodeSegs; } + } + + public ProcessPageDir PageDirInfo + { + get { return iPageDirInfo; } + } + + public ProcessChunkCollection Chunks + { + get { return iChunks; } + } + + public long Id + { + get { return iId; } + set { iId = value; } + } + + public Capability Capabilities + { + get { return iCapability; } + } + + public int OSASID + { + get { return iOSASID; } + set { iOSASID = value; } + } + + public uint LPD + { + get { return iLPD; } + set { iLPD = value; } + } + + public uint GPD + { + get { return iGPD; } + set { iGPD = value; } + } + + public bool IsCurrent + { + get + { + bool ret = CrashDebugger.IsCurrentProcess( this ); + return ret; + } + } + + internal DbgEngineView DbgEngineView + { + get { return iDebugEngineView; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iHandles = 0; + private int iOSASID = 0; + private uint iCodeSegAddress = 0; + private uint iDataBssStackChunkAddress = 0; + private uint iTempCodeSegAddress = 0; + private uint iSID = 0; + private long iId = 0; + private uint iLPD = 0; + private uint iGPD = 0; + private DbgEngineView iDebugEngineView = null; + private ExitInfo iExitInfo = new ExitInfo(); + private Capability iCapability = new Capability(); + private TProcessFlags iFlags = TProcessFlags.EProcessFlagNone; + private ProcessPageDir iPageDirInfo = new ProcessPageDir(); + private ProcessLockInfo iLockInfo = new ProcessLockInfo(); + private TProcessAttributes iAttributes = TProcessAttributes.ENone; + private ProcessChunkCollection iChunks = new ProcessChunkCollection(); + private ProcessCodeSegCollection iCodeSegs = new ProcessCodeSegCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Process/ProcessChunk.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Process/ProcessChunk.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,185 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Chunk; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.Process +{ + public class ProcessChunk : CrashDebuggerAware + { + #region Constructors + public ProcessChunk( CrashDebuggerInfo aCrashDebugger, uint aChunkAddress, int aAccessCount ) + : base( aCrashDebugger ) + { + iChunkAddress = aChunkAddress; + iAccessCount = aAccessCount; + } + #endregion + + #region API + #endregion + + #region Properties + public uint ChunkAddress + { + get { return iChunkAddress; } + set { iChunkAddress = value; } + } + + public Chunk.DChunk Chunk + { + get { return CrashDebugger.ChunkByAddress( ChunkAddress ); } + } + + public int AccessCount + { + get { return iAccessCount; } + set { iAccessCount = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iChunkAddress = 0; + private int iAccessCount = 0; + #endregion + } + + public class ProcessChunkCollection : IEnumerable + { + #region Constructors + public ProcessChunkCollection() + { + } + #endregion + + #region API + public void Add( ProcessChunk aChunk ) + { + iEntries.Add( aChunk ); + } + #endregion + + #region Properties + public ProcessChunk this[ int aIndex ] + { + get { return iEntries[ aIndex ]; } + } + + public int Count + { + get { return iEntries.Count; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return new ProcessChunkEnumerator( this ); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return new ProcessChunkEnumerator( this ); + } + #endregion + + #region Data members + private List iEntries = new List(); + #endregion + } + + #region Internal enumerator + internal class ProcessChunkEnumerator : IEnumerator + { + #region Constructors + public ProcessChunkEnumerator( ProcessChunkCollection aList ) + { + iList = aList; + } + #endregion + + #region IEnumerator Members + public void Reset() + { + iCurrentIndex = -1; + } + + public object Current + { + get + { + return iList[ iCurrentIndex ]; + } + } + + public bool MoveNext() + { + return ( ++iCurrentIndex < iList.Count ); + } + #endregion + + #region From IEnumerator + ProcessChunk IEnumerator.Current + { + get { return iList[ iCurrentIndex ]; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly ProcessChunkCollection iList; + private int iCurrentIndex = -1; + #endregion + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Process/ProcessCodeSeg.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Process/ProcessCodeSeg.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,284 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.CodeSeg; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.Library; + +namespace CrashDebuggerLib.Structures.Process +{ + public class ProcessCodeSeg : CrashDebuggerAware + { + #region Constructors + public ProcessCodeSeg( CrashDebuggerInfo aCrashDebugger ) + : this( aCrashDebugger, 0, 0 ) + { + } + + public ProcessCodeSeg( CrashDebuggerInfo aCrashDebugger, uint aCodeSegAddress, uint aLibraryAddress ) + : base( aCrashDebugger ) + { + iCodeSegAddress = aCodeSegAddress; + iLibraryAddress = aLibraryAddress; + } + #endregion + + #region API + #endregion + + #region Properties + public uint CodeSegAddress + { + get { return iCodeSegAddress; } + set + { + iCodeSegAddress = value; + CodeSegEntry entry = CodeSeg; + } + } + + public CodeSegEntry CodeSeg + { + get { return CrashDebugger.CodeSegByAddress( CodeSegAddress ); } + } + + public string FileName + { + get + { + string ret = string.Empty; + if ( CodeSeg != null ) + { + ret = CodeSeg.FileName; + } + return ret; + } + } + + public uint LibraryAddress + { + get { return iLibraryAddress; } + set { iLibraryAddress = value; } + } + + public DLibrary Library + { + get { return CrashDebugger.LibraryByAddress( LibraryAddress ); } + } + + public uint Size + { + get + { + uint ret = 0; + // + if ( CodeSeg != null ) + { + ret = CodeSeg.Size; + } + // + return ret; + } + set + { + if ( CodeSeg != null ) + { + CodeSeg.Size = value; + } + } + } + + public uint ProcessLocalRunAddress + { + get { return iProcessLocalRunAddress; } + set { iProcessLocalRunAddress = value; } + } + + public uint ProcessLocalRunAddressEnd + { + get + { + uint ret = ProcessLocalRunAddress + Size; + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( ProcessLocalRunAddress.ToString( "x8" ) ); + if ( Size != 0 ) + { + ret.Append( "-" ); + ret.Append( ProcessLocalRunAddressEnd.ToString( "x8" ) ); + } + ret.Append( " " ); + if ( CodeSeg != null ) + { + ret.Append( CodeSeg.FileName ); + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private uint iCodeSegAddress = 0; + private uint iLibraryAddress = 0; + private uint iProcessLocalRunAddress = 0; + #endregion + } + + public class ProcessCodeSegCollection : IEnumerable + { + #region Constructors + public ProcessCodeSegCollection() + { + } + #endregion + + #region API + public void Add( ProcessCodeSeg aCodeSeg ) + { + if ( !Contains( aCodeSeg.CodeSegAddress ) ) + { + iEntries.Add( aCodeSeg ); + } + } + + public bool Contains( uint aAddress ) + { + ProcessCodeSeg ret = this[ aAddress ]; + bool found = ( ret != null ); + return found; + } + #endregion + + #region Properties + public ProcessCodeSeg this[ int aIndex ] + { + get { return iEntries[ aIndex ]; } + } + + public ProcessCodeSeg this[ uint aAddress ] + { + get + { + ProcessCodeSeg ret = iEntries.Find( delegate( ProcessCodeSeg aEntry ) { return aEntry.CodeSegAddress == aAddress; } ); + return ret; + } + } + + public int Count + { + get { return iEntries.Count; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return new ProcessCodeSegEnumerator( this ); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return new ProcessCodeSegEnumerator( this ); + } + #endregion + + #region Data members + private List iEntries = new List(); + #endregion + } + + #region Internal enumerator + internal class ProcessCodeSegEnumerator : IEnumerator + { + #region Constructors + public ProcessCodeSegEnumerator( ProcessCodeSegCollection aList ) + { + iList = aList; + } + #endregion + + #region IEnumerator Members + public void Reset() + { + iCurrentIndex = -1; + } + + public object Current + { + get + { + return iList[ iCurrentIndex ]; + } + } + + public bool MoveNext() + { + return ( ++iCurrentIndex < iList.Count ); + } + #endregion + + #region From IEnumerator + ProcessCodeSeg IEnumerator.Current + { + get { return iList[ iCurrentIndex ]; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly ProcessCodeSegCollection iList; + private int iCurrentIndex = -1; + #endregion + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Process/ProcessLockInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Process/ProcessLockInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Mutex; + +namespace CrashDebuggerLib.Structures.Process +{ + public class ProcessLockInfo + { + #region Constructors + public ProcessLockInfo() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint ProcessMutexAddress + { + get { return iProcessMutexAddress; } + set { iProcessMutexAddress = value; } + } + + public uint DllMutexAddress + { + get { return iDllMutexAddress; } + set { iDllMutexAddress = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iProcessMutexAddress = 0; + private uint iDllMutexAddress = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Process/ProcessPageDir.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Process/ProcessPageDir.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Mutex; + +namespace CrashDebuggerLib.Structures.Process +{ + public class ProcessPageDir + { + #region Constructors + public ProcessPageDir() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint Local + { + get { return iLocalPageDir; } + set { iLocalPageDir = value; } + } + + public uint Global + { + get { return iGloalPageDir; } + set { iGloalPageDir = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iLocalPageDir = 0; + private uint iGloalPageDir = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/PropertyRef/DPropertyRef.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/PropertyRef/DPropertyRef.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.PropertyRef +{ + public class DPropertyRef : DObject + { + #region Constructors + public DPropertyRef( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.EPropertyRef ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Register/RegisterCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Register/RegisterCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,400 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.Process; + +namespace CrashDebuggerLib.Structures.Register +{ + public class RegisterCollection : CrashDebuggerAware, IEnumerable, IARCBackingStore, IComparer + { + #region Enumerations + public enum TType + { + // Special cases + ETypeGeneral = -1, // CPU specific + ETypeCommonBank = 0, // R00 -> R07 inclusive + + // Linked into to CPSR values + ETypeUser = 0x10, // 0b10000 + ETypeFastInterrupt = 0x11, // 0b10001 + ETypeInterrupt = 0x12, // 0b10010 + ETypeSupervisor = 0x13, // 0b10011 + ETypeAbort = 0x17, // 0b10111 + ETypeUndefined = 0x1B, // 0b11011 + + // Not used in Symbian OS + ETypeSystem = 0x1F // 0b11111 + } + #endregion + + #region Constructors + internal RegisterCollection( CrashDebuggerInfo aCrashDebugger, TType aType ) + : this( aCrashDebugger, aType, null, null ) + { + } + + internal RegisterCollection( CrashDebuggerInfo aCrashDebugger, TType aType, DProcess aProcess ) + : this( aCrashDebugger, aType, aProcess, null ) + { + } + + internal RegisterCollection( RegisterCollection aCopy, TType aType, DProcess aProcess ) + : this( aCopy.CrashDebugger, aType, aProcess, null ) + { + foreach ( RegisterEntry entry in aCopy ) + { + Add( entry.OriginalName, entry.Value ); + } + } + + internal RegisterCollection( CrashDebuggerInfo aCrashDebugger, TType aType, DProcess aProcess, RegisterCollection aLinkedWith ) + : base( aCrashDebugger ) + { + iType = aType; + iProcess = aProcess; + + iEntries = new ArmRegisterCollection(); + iEntries.BackingStore = this as IARCBackingStore; + + iLinkedWith = aLinkedWith; + } + #endregion + + #region API + public RegisterEntry Add( string aName, uint aValue ) + { + ArmRegister added = iEntries.Add( aName, aValue ); + RegisterEntry ret = added as RegisterEntry; + return ret; + } + + public void AddMany( params TArmRegisterType[] aTypes ) + { + foreach ( TArmRegisterType reg in aTypes ) + { + string name = ArmRegister.GetTypeName( reg ); + Add( name, 0 ); + } + } + + public bool Exists( string aName ) + { + // Need this to map the specified name into a common name. + // I.e. convert R14_USR to R14 + RegisterEntry temp = new RegisterEntry( this, aName, 0 ); + + // First try concrete entries + bool ret = iEntries.Contains( temp.Name ); + if ( !ret && iLinkedWith != null ) + { + // Try linked + ret = iLinkedWith.Exists( temp.Name ); + } + + return ret; + } + + public void Clear() + { + iEntries.Clear(); + } + + public static string BankName( TType aType ) + { + string ret = string.Empty; + // + switch ( aType ) + { + default: + case TType.ETypeGeneral: + case TType.ETypeCommonBank: + ret = string.Empty; + break; + case TType.ETypeAbort: + ret = "ABT"; + break; + case TType.ETypeFastInterrupt: + ret = "FIQ"; + break; + case TType.ETypeInterrupt: + ret = "IRQ"; + break; + case TType.ETypeSupervisor: + ret = "SVC"; + break; + case TType.ETypeSystem: + ret = "SYS"; + break; + case TType.ETypeUndefined: + ret = "UND"; + break; + case TType.ETypeUser: + ret = "USR"; + break; + } + // + return ret; + } + #endregion + + #region Properties + public string Name + { + get { return iName; } + set { iName = value; } + } + + public RegisterEntry this[ string aName ] + { + get + { + RegisterEntry ret = new RegisterEntry( this, aName, 0 ); + + // First try concrete entries in this object + if ( iEntries.Contains( ret.Name ) ) + { + ret = (RegisterEntry) iEntries[ ret.Name ]; + } + else if ( iLinkedWith != null && iLinkedWith.Exists( ret.Name ) ) + { + // Try linked entries + ret = iLinkedWith[ ret.Name ]; + } + else + { + // Not found + Add( aName, 0 ); + } + // + return ret; + } + } + + public RegisterEntry this[ TArmRegisterType aType ] + { + get + { + RegisterEntry ret = new RegisterEntry( this, aType ); + return this[ ret.Name ]; + } + } + + public int Count + { + get + { + int ret = iEntries.Count; + // + if ( iLinkedWith != null ) + { + ret += iLinkedWith.Count; + } + // + return ret; + } + } + #endregion + + #region Operators + public static implicit operator ArmRegisterCollection( RegisterCollection aSelf ) + { + return aSelf.iEntries; + } + #endregion + + #region Internal methods + public void Dump() + { + System.Diagnostics.Debug.WriteLine( "REGISTERS [" + iType + "]" ); + System.Diagnostics.Debug.WriteLine( string.Empty ); + // + string regs = this.ToString(); + System.Diagnostics.Debug.WriteLine( regs ); + } + + internal Symbol LookUpSymbol( uint aAddress ) + { + Symbol ret = null; + // + if ( iProcess != null ) + { + ret = iProcess.LookUpSymbol( aAddress ); + } + else + { + ret = base.CrashDebugger.LookUpSymbol( aAddress ); + } + // + return ret; + } + #endregion + + #region IArmRegisterBackingStore Members + void IARCBackingStore.ARCBSClear() + { + // Nothing to do - our entries are derived from ArmRegister and + // are owned by iEntries. + } + + void IARCBackingStore.ARCBSRemove( ArmRegister aRegister ) + { + // Nothing to do - our entries are derived from ArmRegister and + // are owned by iEntries. + } + + ArmRegister IARCBackingStore.ARCBSCreate( TArmRegisterType aType, string aName, uint aValue ) + { + RegisterEntry entry = null; + // + if ( aType == TArmRegisterType.EArmReg_CPSR ) + { + // CPSR is a bit special... + entry = new RegisterEntryCPSR( this, aValue ); + } + else + { + entry = new RegisterEntry( this, aName, aValue ); + entry.RegType = aType; + } + // + return entry; + } + #endregion + + #region From IComparer + public int Compare( RegisterEntry aLeft, RegisterEntry aRight ) + { + int ret = -1; + + // Try to order the registers so that Rnn register names come first + // then CPSR, then the other stuff. + TArmRegisterType leftType = aLeft.RegType; + TArmRegisterType rightType = aRight.RegType; + // + if ( leftType != TArmRegisterType.EArmReg_Other && rightType == TArmRegisterType.EArmReg_Other ) + { + // Left is smaller since it's a standard register + ret = -1; + } + else if ( leftType == TArmRegisterType.EArmReg_Other && rightType != TArmRegisterType.EArmReg_Other ) + { + // Right is smaller since it's a standard register + ret = 1; + } + else if ( leftType == TArmRegisterType.EArmReg_Other && rightType == TArmRegisterType.EArmReg_Other ) + { + // Must compare names since both are non-standard registers + ret = aLeft.OriginalName.CompareTo( aRight.OriginalName ); + } + else + { + // Registers are not non-standard, compare based upon numerical value + if ( leftType == rightType ) + { + ret = 0; + } + else if ( leftType > rightType ) + { + ret = 1; + } + } + // + return ret; + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + SortedList entries = new SortedList(); + + // Get specific entries - we always take all of these + foreach ( ArmRegister reg in iEntries ) + { + entries.Add( reg.Name, (RegisterEntry) reg ); + } + + // And also common entries + if ( iLinkedWith != null ) + { + foreach( RegisterEntry reg in iLinkedWith ) + { + // Make sure that the concrete entries override + // any common values + if ( entries.ContainsKey( reg.Name ) == false ) + { + entries.Add( reg.Name, reg ); + } + } + } + + // For some reason, sorted list isn't actually sorting the entries + // by key properly. We must do this ourselves... Ugh :( + List ret = new List(); + foreach ( KeyValuePair pair in entries ) + { + ret.Add( pair.Value ); + } + ret.Sort( this ); + + // Now we can iterate... + foreach ( RegisterEntry entry in ret ) + { + yield return entry; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + IEnumerator self = (IEnumerator) this; + System.Collections.IEnumerator ret = (System.Collections.IEnumerator) self; + return ret; + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + foreach ( RegisterEntry entry in this ) + { + ret.AppendLine( entry.ToString() ); + } + // + string text = ret.ToString(); + return text; + } + #endregion + + #region Data members + private readonly TType iType; + private readonly DProcess iProcess; + private readonly RegisterCollection iLinkedWith; + private readonly ArmRegisterCollection iEntries; + private string iName = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Register/RegisterEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Register/RegisterEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Debug.Symbols; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashDebuggerLib.Structures.Register +{ + public class RegisterEntry : ArmRegister + { + #region Constructors + internal RegisterEntry( RegisterCollection aParent, TArmRegisterType aType ) + : base( aType ) + { + iParent = aParent; + } + + internal RegisterEntry( RegisterCollection aParent, string aName, uint aValue ) + : base( aName, aValue ) + { + iParent = aParent; + } + #endregion + + #region API + #endregion + + #region Properties + public string SymbolString + { + get + { + Symbol symbol = Symbol; + if ( symbol != null ) + { + return symbol.Name; + } + return "0x" + Value.ToString( "x8" ); + } + } + + public Symbol Symbol + { + get + { + if ( iSymbol == null ) + { + uint address = this.Value; + iSymbol = iParent.LookUpSymbol( address ); + } + return iSymbol; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( base.ToString() ); + Symbol symbol = Symbol; + if ( symbol != null ) + { + ret.Append( " " + symbol.Name ); + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private readonly RegisterCollection iParent; + private Symbol iSymbol = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Register/RegisterEntryCPSR.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Register/RegisterEntryCPSR.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Debug.Symbols; +using CrashDebuggerLib.Structures.KernelObjects; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashDebuggerLib.Structures.Register +{ + public class RegisterEntryCPSR : RegisterEntry + { + #region Constructors + internal RegisterEntryCPSR( RegisterCollection aParent, uint aValue ) + : base( aParent, ArmRegister.GetTypeName( TArmRegisterType.EArmReg_CPSR ), aValue ) + { + } + #endregion + + #region API + public RegisterCollection.TType CurrentBank + { + get + { + RegisterCollection.TType type = RegisterCollection.TType.ETypeUser; + // + uint maskedCPSR = Value & KMaskValue; + type = (RegisterCollection.TType) maskedCPSR; + // + return type; + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + private const uint KMaskValue = 0x1F; + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.Append( base.ToString() ); + return ret.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Register/RegisterSet.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Register/RegisterSet.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,202 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Register; +using CrashDebuggerLib.Structures.Common; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashDebuggerLib.Structures.Register +{ + public class RegisterSet : CrashDebuggerAware + { + #region Constructors + internal RegisterSet( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger ) + { + Clear(); + } + #endregion + + #region API + public void Clear() + { + iBanks.Clear(); + + // General regs don't share a bank - they're just a dumping + // ground for CPU specific entries. + AddBank( RegisterCollection.TType.ETypeGeneral ); + + // The rest use banking. CPSR goes in the common bank. + RegisterCollection common = new RegisterCollection( CrashDebugger, RegisterCollection.TType.ETypeCommonBank ); + iBanks.Add( RegisterCollection.TType.ETypeCommonBank, common ); + common.AddMany( TArmRegisterType.EArmReg_CPSR, + TArmRegisterType.EArmReg_00, + TArmRegisterType.EArmReg_01, + TArmRegisterType.EArmReg_02, + TArmRegisterType.EArmReg_03, + TArmRegisterType.EArmReg_04, + TArmRegisterType.EArmReg_05, + TArmRegisterType.EArmReg_06, + TArmRegisterType.EArmReg_07 ); + + // These are all fairly normal. They have their own SP, LR and SPSR + // The others are common. + AddBank( RegisterCollection.TType.ETypeUser, common ); + AddBank( RegisterCollection.TType.ETypeAbort, common ); + AddBank( RegisterCollection.TType.ETypeInterrupt, common ); + AddBank( RegisterCollection.TType.ETypeSupervisor, common ); + AddBank( RegisterCollection.TType.ETypeSystem, common ); + AddBank( RegisterCollection.TType.ETypeUndefined, common ); + + // FIQ is special - it has shadows of R8->12 + AddBank( RegisterCollection.TType.ETypeFastInterrupt, common, + TArmRegisterType.EArmReg_08, + TArmRegisterType.EArmReg_09, + TArmRegisterType.EArmReg_10, + TArmRegisterType.EArmReg_11, + TArmRegisterType.EArmReg_12 + ); + } + + public bool Available( RegisterCollection.TType aType ) + { + bool ret = iBanks.ContainsKey( aType ); + return ret; + } + #endregion + + #region Properties + public RegisterEntryCPSR CPSR + { + get + { + RegisterEntryCPSR cpsr = (RegisterEntryCPSR) this[ RegisterCollection.TType.ETypeCommonBank, TArmRegisterType.EArmReg_CPSR ]; + return cpsr; + } + } + + public RegisterCollection.TType CPSRBankType + { + get { return CPSR.CurrentBank; } + } + + public RegisterEntry CurrentSP + { + get + { + RegisterCollection.TType bank = CPSRBankType; + RegisterEntry ret = this[ bank, TArmRegisterType.EArmReg_SP ]; + return ret; + } + } + + public RegisterEntry CurrentLR + { + get + { + RegisterCollection.TType bank = CPSRBankType; + RegisterEntry ret = this[ bank, TArmRegisterType.EArmReg_LR ]; + return ret; + } + } + + public RegisterCollection this[ RegisterCollection.TType aBank ] + { + get + { + RegisterCollection ret = iBanks[ aBank ]; + return ret; + } + } + + public RegisterEntry this[ RegisterCollection.TType aBank, string aName ] + { + get + { + RegisterCollection bank = this[ aBank ]; + return bank[ aName ]; + } + } + + public RegisterEntry this[ RegisterCollection.TType aBank, TArmRegisterType aType ] + { + get + { + RegisterCollection bank = this[ aBank ]; + return bank[ aType ]; + } + } + #endregion + + #region Internal methods + private RegisterCollection AddBank( RegisterCollection.TType aType ) + { + return AddBank( aType, null ); + } + + private RegisterCollection AddBank( RegisterCollection.TType aType, RegisterCollection aLinkedWith ) + { + TArmRegisterType[] empty = new TArmRegisterType[] { }; + return AddBank( aType, aLinkedWith, empty ); + } + + private RegisterCollection AddBank( RegisterCollection.TType aType, RegisterCollection aLinkedWith, params TArmRegisterType[] aExtraRegs ) + { + RegisterCollection bank = new RegisterCollection( CrashDebugger, aType, null, aLinkedWith ); + iBanks.Add( aType, bank ); + + // Create bank specific registers + string bankName = RegisterCollection.BankName( aType ); + if ( bankName != string.Empty ) + { + bankName = "_" + bankName; + } + + bank.Add( "R13" + bankName, 0 ); + bank.Add( "R14" + bankName, 0 ); + bank.Add( "SPSR" + bankName, 0 ); + + // Create custom registers + foreach( TArmRegisterType custom in aExtraRegs ) + { + string name = ArmRegister.GetTypeName( custom ) + bankName; + bank.Add( name, 0 ); + } + + return bank; + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private Dictionary iBanks = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Scheduler/SchedulerInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Scheduler/SchedulerInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Register; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.NThread; +using CrashDebuggerLib.Structures.Thread; + +namespace CrashDebuggerLib.Structures.Scheduler +{ + public class SchedulerInfo : CrashDebuggerAware + { + #region Constructors + public SchedulerInfo( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger ) + { + iExtraRegisters = new RegisterCollection( aCrashDebugger, RegisterCollection.TType.ETypeGeneral ); + } + #endregion + + #region API + public void Clear() + { + iAddress = 0; + iCurrentNThreadAddress = 0; + iRescheduleNeeded = 0; + iDfcPending = 0; + iKernCSLocked = 0; + iDFCs = new LinkedListInfo(); + iProcessHandlerAddress = 0; + iAddressSpace = 0; + iSysLockInfo = new SchedulerSysLockInfo(); + iExtraRegisters.Clear(); + } + #endregion + + #region Properties + public uint Address + { + get { return iAddress; } + set { iAddress = value; } + } + + public uint CurrentNThreadAddress + { + get { return iCurrentNThreadAddress; } + set { iCurrentNThreadAddress = value; } + } + + public NThread.NThread CurrentNThread + { + get + { + NThread.NThread ret = null; + // + DObjectCon threads = CrashDebugger.ContainerByType( DObject.TObjectType.EThread ); + foreach ( DObject obj in threads ) + { + DThread thread = (DThread) obj; + NThread.NThread nThread = thread.NThread; + if ( nThread.Address == CurrentNThreadAddress ) + { + ret = nThread; + break; + } + } + // + return ret; + } + } + + public uint RescheduleNeeded + { + get { return iRescheduleNeeded; } + set { iRescheduleNeeded = value; } + } + + public uint DfcPending + { + get { return iDfcPending; } + set { iDfcPending = value; } + } + + public uint KernCSLocked + { + get { return iKernCSLocked; } + set { iKernCSLocked = value; } + } + + public LinkedListInfo DFCs + { + get { return iDFCs; } + } + + public uint ProcessHandlerAddress + { + get { return iProcessHandlerAddress; } + set { iProcessHandlerAddress = value; } + } + + public uint AddressSpace + { + get { return iAddressSpace; } + set { iAddressSpace = value; } + } + + public SchedulerSysLockInfo SysLockInfo + { + get { return iSysLockInfo; } + } + + public RegisterCollection ExtraRegisters + { + get { return iExtraRegisters; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iAddress; + private uint iCurrentNThreadAddress; + private uint iRescheduleNeeded; + private uint iDfcPending; + private uint iKernCSLocked; + private LinkedListInfo iDFCs = new LinkedListInfo(); + private uint iProcessHandlerAddress; + private uint iAddressSpace; + private SchedulerSysLockInfo iSysLockInfo = new SchedulerSysLockInfo(); + private readonly RegisterCollection iExtraRegisters; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Scheduler/SchedulerSysLockInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Scheduler/SchedulerSysLockInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Register; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.Scheduler +{ + public class SchedulerSysLockInfo + { + #region Constructors + public SchedulerSysLockInfo() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint HoldingThreadAddress + { + get { return iHoldingThreadAddress; } + set { iHoldingThreadAddress = value; } + } + + public uint WaitingThreadAddress + { + get { return iWaitingThreadAddress; } + set { iWaitingThreadAddress = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iHoldingThreadAddress; + private uint iWaitingThreadAddress; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Semaphore/DSemaphore.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Semaphore/DSemaphore.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.Semaphore +{ + public class DSemaphore : DObject + { + #region Constructors + public DSemaphore( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.ESemaphore ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Server/DServer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Server/DServer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.Server +{ + public class DServer : DObject + { + #region Constructors + public DServer( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.EServer ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Session/DSession.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Session/DSession.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.Session +{ + public class DSession : DObject + { + #region Constructors + public DSession( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.ESession ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/DThread.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/DThread.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,353 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.NThread; +using SymbianStructuresLib.Debug.Symbols; + +namespace CrashDebuggerLib.Structures.Thread +{ + public class DThread : DObject + { + #region Enumerations + [System.ComponentModel.TypeConverter( typeof( SymbianParserLib.TypeConverters.SymbianEnumConverter ) )] + public enum TThreadState + { + EUnknown = -1, + ECreated = 0, + EDead, + EReady, + EWaitSemaphore, + EWaitSemaphoreSuspended, + EWaitMutex, + EWaitMutexSuspended, + EHoldMutexPending, + EWaitCondVar, + EWaitCondVarSuspended, + } + + [Flags, System.ComponentModel.TypeConverter( typeof( SymbianParserLib.TypeConverters.SymbianEnumConverter ) )] + public enum TThreadFlags + { + EThreadFlagNone = 0x00000000, + EThreadFlagProcessCritical = 0x00000001, // thread panic panics process + EThreadFlagProcessPermanent = 0x00000002, // thread exit of any kind causes process to exit (=main) + EThreadFlagSystemCritical = 0x00000004, // thread panic reboots entire system + EThreadFlagSystemPermanent = 0x00000008, // thread exit of any kind reboots entire system + EThreadFlagOriginal = 0x00000010, + EThreadFlagLastChance = 0x00000020, + EThreadFlagRealtime = 0x00000040, // thread will be panicked when using some non-realtime functions + EThreadFlagRealtimeTest = 0x00000080 // non-realtime functions only warn rather than panic + } + + public enum TThreadWaitType + { + EThreadWaitingUnknown = 0, + EThreadWaitingReady, + EThreadWaitingOnSemaphore, + EThreadWaitingOnMutex, + EThreadWaitingOnDfc, + EThreadWaitingOnResumption, + EThreadWaitingOnRequestSemaphore, + EThreadWaitingOnRequestSemaphoreInsideSchedulerWaitLoop + } + #endregion + + #region Constructors + public DThread( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.EThread ) + { + iNThread = new CrashDebuggerLib.Structures.NThread.NThread( aCrashDebugger, this ); + iStackInfoSupervisor = new ThreadStackInfo( aCrashDebugger, this, ThreadStackInfo.TType.ETypeSupervisor ); + iStackInfoUser = new ThreadStackInfo( aCrashDebugger, this, ThreadStackInfo.TType.ETypeUser ); + } + #endregion + + #region API + #endregion + + #region Properties + public TThreadState MState + { + get { return iState; } + set { iState = value; } + } + + public uint WaitObj + { + get { return iStateWaitObjectAddress; } + set { iStateWaitObjectAddress = value; } + } + + public TThreadFlags Flags + { + get { return iFlags; } + set { iFlags = value; } + } + + public uint Handles + { + get { return iHandles; } + set { iHandles = value; } + } + + public long Id + { + get { return iId; } + set { iId = value; } + } + + public ThreadAllocatorInfo AllocatorInfo + { + get { return iAllocatorInfo; } + } + + public uint Frame + { + get { return iFrame; } + set { iFrame = value; } + } + + public ThreadPriorities Priorities + { + get { return iPriorities; } + } + + public ExitInfo ExitInfo + { + get { return iExitInfo; } + } + + public ThreadStackInfo StackInfoUser + { + get { return iStackInfoUser; } + } + + public ThreadStackInfo StackInfoSupervisor + { + get { return iStackInfoSupervisor; } + } + + public ThreadHandlers Handlers + { + get { return iHandlers; } + } + + public ThreadTemporaries Temporaries + { + get { return iTemporaries; } + } + + public uint IpcCount + { + get { return iIpcCount; } + set { iIpcCount = value; } + } + + public DProcess OwningProcess + { + get + { + DProcess ret = null; + // + DObject owner = Owner; + if ( owner != null && owner is DProcess ) + { + ret = (DProcess) owner; + } + // + return ret; + } + } + + public NThread.NThread NThread + { + get { return iNThread; } + } + + public bool HasActiveScheduler + { + get + { + return ( iHandlers.ActiveScheduler != 0 ); + } + } + + public TThreadWaitType WaitType + { + get + { + TThreadWaitType waitType = TThreadWaitType.EThreadWaitingUnknown; + // + if ( NThread.NState == CrashDebuggerLib.Structures.NThread.NThread.TNThreadState.EWaitDfc ) + { + waitType = TThreadWaitType.EThreadWaitingOnDfc; + } + else if ( NThread.NState == CrashDebuggerLib.Structures.NThread.NThread.TNThreadState.EReady ) + { + waitType = TThreadWaitType.EThreadWaitingReady; + } + else if ( NThread.NState == CrashDebuggerLib.Structures.NThread.NThread.TNThreadState.ESuspended ) + { + waitType = TThreadWaitType.EThreadWaitingOnResumption; + } + else if ( NThread.NState == CrashDebuggerLib.Structures.NThread.NThread.TNThreadState.EBlocked ) + { + bool blockdOnSemaphore = IsBlockedOnSemaphore; + if ( blockdOnSemaphore ) + { + waitType = TThreadWaitType.EThreadWaitingOnSemaphore; + } + } + else if ( NThread.NState == CrashDebuggerLib.Structures.NThread.NThread.TNThreadState.EWaitFastSemaphore ) + { + // Check that the fast semaphore is definitely the NThread's request semaphore. + uint nThreadRequestSemaphoreAddress = NThread.RequestSemaphoreAddress; + if ( NThread.WaitObj != 0 && NThread.WaitObj == nThreadRequestSemaphoreAddress ) + { + CrashDebuggerLib.Structures.NThread.NThread.TWaitType nThreadWaitType = NThread.WaitType; + // + if ( nThreadWaitType == CrashDebuggerLib.Structures.NThread.NThread.TWaitType.EWaitTypeUserWaitForAnyRequest ) + { + if ( HasActiveScheduler ) + { + waitType = TThreadWaitType.EThreadWaitingOnRequestSemaphoreInsideSchedulerWaitLoop; + } + else + { + waitType = TThreadWaitType.EThreadWaitingOnRequestSemaphore; + } + } + else if ( nThreadWaitType == CrashDebuggerLib.Structures.NThread.NThread.TWaitType.EWaitTypeUserWaitForRequest ) + { + waitType = TThreadWaitType.EThreadWaitingOnRequestSemaphore; + } + } + } + // + return waitType; + } + } + + public bool IsUserThread + { + get + { + bool ret = false; + // + DProcess parent = OwningProcess; + if ( parent != null ) + { + string name = parent.Name.ToLower(); + ret = ( name != Platform.ProcessNames.KKernel.ToLower() ); + } + // + return ret; + } + } + + public bool IsCurrent + { + get + { + bool ret = CrashDebugger.IsCurrentThread( this ); + return ret; + } + } + #endregion + + #region Internal methods + private bool IsBlockedOnSemaphore + { + get + { + bool ret = false; + // + if ( NThread.NState == CrashDebuggerLib.Structures.NThread.NThread.TNThreadState.EBlocked ) + { + Register.RegisterEntry linkReg = NThread.Registers[ "R14_USR" ]; + if ( linkReg.Symbol != null ) + { + string symbolText = linkReg.Symbol.Name; + if ( symbolText.Contains( "RSemaphore::Wait" ) || symbolText.Contains( "RCriticalSection::Wait" ) ) + { + ret = true; + } + else if ( symbolText.Contains( "Exec::SemaphoreWait" ) ) + { + ret = true; + } + } + } + // + return ret; + } + } + #endregion + + #region Internal constants + #endregion + + #region From DBase + public override string ToClipboard() + { + StringBuilder ret = new StringBuilder(); + // + ret.AppendLine( base.ToClipboard() ); + ret.AppendFormat( "MState: {0}, Id: {1}, ExitInfo: {2}" + System.Environment.NewLine, MState, Id, ExitInfo ); + ret.AppendLine( iNThread.ToClipboard() ); + ret.AppendLine( iStackInfoUser.ToClipboard() ); + ret.AppendLine( iStackInfoSupervisor.ToClipboard() ); + // + return ret.ToString(); + } + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private readonly NThread.NThread iNThread; + private readonly ThreadStackInfo iStackInfoSupervisor; + private readonly ThreadStackInfo iStackInfoUser; + + private TThreadState iState = TThreadState.EUnknown; + private TThreadFlags iFlags = TThreadFlags.EThreadFlagNone; + + private uint iStateWaitObjectAddress = 0; + private uint iHandles = 0; + private long iId = 0; + private uint iFrame = 0; + private uint iIpcCount = 0; + + private ThreadAllocatorInfo iAllocatorInfo = new ThreadAllocatorInfo(); + private ThreadPriorities iPriorities = new ThreadPriorities(); + private ExitInfo iExitInfo = new ExitInfo(); + private ThreadHandlers iHandlers = new ThreadHandlers(); + private ThreadTemporaries iTemporaries = new ThreadTemporaries(); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadAllocatorInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadAllocatorInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.Thread +{ + public class ThreadAllocatorInfo + { + #region Constructors + public ThreadAllocatorInfo() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint Allocator + { + get { return iAllocator; } + set { iAllocator = value; } + } + + public uint CreatedAllocator + { + get { return iCreatedAllocator; } + set { iCreatedAllocator = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iAllocator = 0; + private uint iCreatedAllocator = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadHandlers.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadHandlers.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.Thread +{ + public class ThreadHandlers + { + #region Constructors + public ThreadHandlers() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint ActiveScheduler + { + get { return iActiveScheduler; } + set { iActiveScheduler = value; } + } + + public uint TrapHandler + { + get { return iTrapHandler; } + set { iTrapHandler = value; } + } + + public uint ExceptionHandler + { + get { return iExceptionHandler; } + set { iExceptionHandler = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iActiveScheduler = 0; + private uint iTrapHandler = 0; + private uint iExceptionHandler = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadPriorities.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadPriorities.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.Thread +{ + public class ThreadPriorities + { + #region Constructors + public ThreadPriorities() + { + } + #endregion + + #region API + #endregion + + #region Properties + public int Default + { + get { return iDefault; } + set { iDefault = value; } + } + + public int WaitLink + { + get { return iWaitLink; } + set { iWaitLink = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private int iDefault = 0; + private int iWaitLink = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadStackBuilder.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadStackBuilder.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Threading; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.CodeSegments; +using SymbianUtils.DataBuffer; +using SymbianUtils.DataBuffer.Entry; +using SymbianUtils.DataBuffer.Primer; +using SymbianDebugLib.Engine; +using SymbianUtils.Utilities; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.CodeSeg; +using CrashDebuggerLib.Structures.Register; +using CrashDebuggerLib.Structures.Cpu; +using SymbianStackLib.Engine; +using SymbianStackLib.Data.Output; + +namespace CrashDebuggerLib.Structures.Thread +{ + internal class ThreadStackBuilder : AsyncOperation + { + #region Constructors + public ThreadStackBuilder( ThreadStackData aInfo ) + { + iInfo = aInfo; + this.DoWork += new System.ComponentModel.DoWorkEventHandler( ThreadStackBuilder_DoWork ); + } + #endregion + + #region API + public void BuildSync() + { + PrimeStackEngine(); + iStackEngine.ReconstructSync(); + } + #endregion + + #region Properties + public bool CallStackConstructed + { + get + { + return iIsReady; + } + } + + public StackOutputData CallStackElements + { + get + { + StackOutputData ret = new StackOutputData(); + // + if ( iStackEngine != null ) + { + ret = iStackEngine.DataOutput; + } + // + return ret; + } + } + #endregion + + #region Internal methods + private void PrimeStackEngine() + { + // Create new engine (resets old data) + iStackEngine = new StackEngine( iInfo.CrashDebugger.DebugEngine ); + + // Not yet ready + iIsReady = false; + + // Get the data source + DThread thread = iInfo.Info.Thread; + string threadName = thread.Name.ToLower(); + // + DataBuffer dataSource = iInfo.Data; + if ( dataSource.Count > 0 ) + { + // Prime stack engine with data & current stack pointer + iStackEngine.Primer.Prime( dataSource ); + iStackEngine.AddressInfo.Pointer = iInfo.Info.StackPointer; + + // Set us up so we know when the process finishes + iStackEngine.EventHandler += new StackEngine.StackEngineEventHandler( StackEngine_EventHandler ); + + // Set up registers. First update them taking into account the + // curent CPU regs. + RegisterCollection.TType requiredType = RegisterCollection.TType.ETypeUser; + if ( iInfo.Info.Type == ThreadStackInfo.TType.ETypeSupervisor ) + { + requiredType = RegisterCollection.TType.ETypeSupervisor; + } + + RegisterCollection registers = thread.NThread.GetRegisters( requiredType ); + iStackEngine.Registers = registers; + + // Get code segs + DProcess process = thread.OwningProcess; + if ( process != null ) + { + iStackEngine.CodeSegments = process.GetCodeSegDefinitions(); + } + } + else + { + } + } + + void ThreadStackBuilder_DoWork( object sender, System.ComponentModel.DoWorkEventArgs aArgs ) + { + PrimeStackEngine(); + + // Only reconstruct if we have some data + if ( iStackEngine.DataSource.Count > 0 ) + { + iStackEngine.ReconstructSync(); + } + } + #endregion + + #region Stack Engine event handler + private void StackEngine_EventHandler( StackEngine.TEvent aEvent, StackEngine aEngine ) + { + if ( aEvent == StackEngine.TEvent.EStackBuildingComplete ) + { + iIsReady = true; + } + } + #endregion + + #region Data members + private readonly ThreadStackData iInfo; + private StackEngine iStackEngine = null; + private bool iIsReady = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadStackData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadStackData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Utilities; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.Process; +using CrashDebuggerLib.Structures.CodeSeg; +using CrashDebuggerLib.Structures.Register; +using SymbianStackLib.Engine; +using SymbianStackLib.Data.Output; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Arm.Registers; +using SymbianUtils.DataBuffer; +using SymbianUtils.DataBuffer.Entry; +using SymbianUtils.DataBuffer.Primer; + +namespace CrashDebuggerLib.Structures.Thread +{ + public class ThreadStackData : CrashDebuggerAware + { + #region Constructors + public ThreadStackData( CrashDebuggerInfo aCrashDebugger, ThreadStackInfo aInfo ) + : base( aCrashDebugger ) + { + iInfo = aInfo; + iStackBuilder = new ThreadStackBuilder( this); + } + #endregion + + #region API + public void Add( uint aValue ) + { + byte val = (byte) aValue; + iDataSource.Add( val ); + } + + public void BuildCallStackSync() + { + if ( iStackBuilder.IsBusy ) + { + // Wait for it + while ( iStackBuilder.IsBusy ) + { + System.Threading.Thread.Sleep( 100 ); + } + } + else + { + iStackBuilder.BuildSync(); + } + } + + public void BuildCallStackAsync() + { + if ( iStackBuilder.IsBusy ) + { + throw new ArgumentException( "Stack builder is busy!" ); + } + + // Request call back when queue spot available. If it's the current + // thread then we jump it to the start of the queue + CrashDebugger.AsyncOperationManager.Queue( iStackBuilder, Info.Thread.IsCurrent ); + } + #endregion + + #region String Conversion Support + public string CallStackToString() + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( CallStackElements.ToString() ); + // + return ret.ToString(); + } + #endregion + + #region Properties + public int Size + { + get { return iDataSource.Count; } + } + + public StackOutputData CallStackElements + { + get + { + if ( !iStackBuilder.CallStackConstructed ) + { + BuildCallStackSync(); + } + // + return iStackBuilder.CallStackElements; + } + } + #endregion + + #region Internal methods + internal void SetStartingAddress( uint aAddress ) + { + if ( iDataSource.AddressOffset == 0 ) + { + iDataSource.AddressOffset = aAddress; + } + } + + internal DataBuffer Data + { + get { return iDataSource; } + } + + internal ThreadStackInfo Info + { + get { return iInfo; } + } + + internal DataBufferUint LastRawDataEntry + { + get + { + if ( Size < 4 ) + { + throw new ArgumentException(); + } + // + DataBufferUint ret = null; + // + foreach ( DataBufferUint entry in iDataSource.GetUintEnumerator() ) + { + // The enumerator works from bottom up, so just return the first one. + ret = entry; + break; + } + // + return ret; + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private readonly ThreadStackInfo iInfo; + private readonly ThreadStackBuilder iStackBuilder; + private DataBuffer iDataSource = new DataBuffer(); + private StackOutputData iDataOutput = new StackOutputData(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadStackInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadStackInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; +using CrashDebuggerLib.Structures.Process; + +namespace CrashDebuggerLib.Structures.Thread +{ + public class ThreadStackInfo : CrashDebuggerAware + { + #region Enumerations + public enum TType + { + ETypeSupervisor = 0, + ETypeUser + } + #endregion + + #region Constructors + public ThreadStackInfo( CrashDebuggerInfo aCrashDebugger, DThread aThread, TType aType ) + : base( aCrashDebugger ) + { + iType = aType; + iThread = aThread; + iData = new ThreadStackData( aCrashDebugger, this ); + } + #endregion + + #region API + #endregion + + #region Properties + public TType Type + { + get { return iType; } + } + + public uint BaseAddress + { + get { return iBaseAddress; } + set { iBaseAddress = value; } + } + + public uint Size + { + get { return iSize; } + set { iSize = value; } + } + + public uint StackPointer + { + get { return iStackPointer; } + set { iStackPointer = value; } + } + + public ThreadStackData Data + { + get { return iData; } + } + + public DThread Thread + { + get { return iThread; } + } + + public DProcess Process + { + get + { + DThread thread = this.Thread; + return thread.OwningProcess; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region Clipboard Support + public string ToClipboard() + { + StringBuilder ret = new StringBuilder(); + // + string type = "Supervisor"; + if ( iType == TType.ETypeUser ) + { + type = "User"; + } + // + ret.AppendFormat( "{0} Stack @ 0x{1:x8}, Stack Pointer: 0x{2:x8}" + System.Environment.NewLine, type.ToUpper(), BaseAddress, StackPointer ); + ret.AppendLine( iData.CallStackToString() ); + // + return ret.ToString(); + } + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private readonly TType iType; + private uint iBaseAddress = 0; + private uint iSize = 0; + private uint iStackPointer = 0; + private readonly DThread iThread; + private readonly ThreadStackData iData; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadTemporaries.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Thread/ThreadTemporaries.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; + +namespace CrashDebuggerLib.Structures.Thread +{ + public class ThreadTemporaries + { + #region Constructors + public ThreadTemporaries() + { + } + #endregion + + #region API + #endregion + + #region Properties + public uint TempObj + { + get { return iTempObj; } + set { iTempObj = value; } + } + + public uint TempAlloc + { + get { return iTempAlloc; } + set { iTempAlloc = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private uint iTempObj = 0; + private uint iTempAlloc = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Timer/DTimer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Timer/DTimer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.Timer +{ + public class DTimer : DObject + { + #region Constructors + public DTimer( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.ETimer ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Undertaker/DUndertaker.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Undertaker/DUndertaker.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashDebuggerLib.Structures.KernelObjects; +using CrashDebuggerLib.Structures.Common; + +namespace CrashDebuggerLib.Structures.Undertaker +{ + public class DUndertaker : DObject + { + #region Constructors + public DUndertaker( CrashDebuggerInfo aCrashDebugger ) + : base( aCrashDebugger, TObjectType.EUndertaker ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/UserContextTable/UserContextTable.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/UserContextTable/UserContextTable.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,247 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashDebuggerLib.Structures.UserContextTable +{ + internal class UserContextTable : IEnumerable + { + #region Enumerations + public enum TArmRegisterIndex + { + EArmR0 = 0, + EArmR1 = 1, + EArmR2 = 2, + EArmR3 = 3, + EArmR4 = 4, + EArmR5 = 5, + EArmR6 = 6, + EArmR7 = 7, + EArmR8 = 8, + EArmR9 = 9, + EArmR10 = 10, + EArmR11 = 11, + EArmR12 = 12, + EArmSp = 13, + EArmLr = 14, + EArmPc = 15, + EArmFlags = 16, + EArmDacr = 17 + } + #endregion + + #region Constructors + public UserContextTable( TUserContextType aType ) + { + iType = aType; + // + List entries = new List(); + int count = EntryCount; + for ( int i = 0; i < count; i++ ) + { + UserContextTableEntry entry = new UserContextTableEntry(); + entries.Add( entry ); + } + // + iEntries = entries.ToArray(); + } + #endregion + + #region API + public static bool IsSupported( TArmRegisterType aType ) + { + bool ret = false; + // + switch ( aType ) + { + case TArmRegisterType.EArmReg_00: + case TArmRegisterType.EArmReg_01: + case TArmRegisterType.EArmReg_02: + case TArmRegisterType.EArmReg_03: + case TArmRegisterType.EArmReg_04: + case TArmRegisterType.EArmReg_05: + case TArmRegisterType.EArmReg_06: + case TArmRegisterType.EArmReg_07: + case TArmRegisterType.EArmReg_08: + case TArmRegisterType.EArmReg_09: + case TArmRegisterType.EArmReg_10: + case TArmRegisterType.EArmReg_11: + case TArmRegisterType.EArmReg_12: + case TArmRegisterType.EArmReg_SP: + case TArmRegisterType.EArmReg_LR: + case TArmRegisterType.EArmReg_PC: + case TArmRegisterType.EArmReg_CPSR: + case TArmRegisterType.EArmReg_DACR: + ret = true; + break; + default: + break; + } + // + return ret; + } + #endregion + + #region Properties + public UserContextTableEntry this[ TArmRegisterIndex aIndex ] + { + get + { + int index = (int) aIndex; + UserContextTableEntry ret = iEntries[ index ]; + return ret; + } + } + + public UserContextTableEntry this[ TArmRegisterType aReg ] + { + get + { + // Have to map to our internal type + TArmRegisterIndex reg = Map( aReg ); + return this[ reg ]; + } + } + + public static int EntryCount + { + get + { + Array vals = Enum.GetValues( typeof( TArmRegisterIndex ) ); + int count = vals.Length; + return count; + } + } + + public TUserContextType Type + { + get { return iType; } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + foreach ( UserContextTableEntry entry in iEntries ) + { + ret.AppendFormat( "[{0:x2}, {1:x2}]", (int) entry.Type, (int) entry.Offset ); + } + // + return ret.ToString(); + } + #endregion + + #region Internal methods + private static TArmRegisterIndex Map( TArmRegisterType aReg ) + { + TArmRegisterIndex ret = TArmRegisterIndex.EArmR0; + // + switch ( aReg ) + { + case TArmRegisterType.EArmReg_00: + ret = TArmRegisterIndex.EArmR0; + break; + case TArmRegisterType.EArmReg_01: + ret = TArmRegisterIndex.EArmR1; + break; + case TArmRegisterType.EArmReg_02: + ret = TArmRegisterIndex.EArmR2; + break; + case TArmRegisterType.EArmReg_03: + ret = TArmRegisterIndex.EArmR3; + break; + case TArmRegisterType.EArmReg_04: + ret = TArmRegisterIndex.EArmR4; + break; + case TArmRegisterType.EArmReg_05: + ret = TArmRegisterIndex.EArmR5; + break; + case TArmRegisterType.EArmReg_06: + ret = TArmRegisterIndex.EArmR6; + break; + case TArmRegisterType.EArmReg_07: + ret = TArmRegisterIndex.EArmR7; + break; + case TArmRegisterType.EArmReg_08: + ret = TArmRegisterIndex.EArmR8; + break; + case TArmRegisterType.EArmReg_09: + ret = TArmRegisterIndex.EArmR9; + break; + case TArmRegisterType.EArmReg_10: + ret = TArmRegisterIndex.EArmR10; + break; + case TArmRegisterType.EArmReg_11: + ret = TArmRegisterIndex.EArmR11; + break; + case TArmRegisterType.EArmReg_12: + ret = TArmRegisterIndex.EArmR12; + break; + case TArmRegisterType.EArmReg_SP: + ret = TArmRegisterIndex.EArmSp; + break; + case TArmRegisterType.EArmReg_LR: + ret = TArmRegisterIndex.EArmLr; + break; + case TArmRegisterType.EArmReg_PC: + ret = TArmRegisterIndex.EArmPc; + break; + case TArmRegisterType.EArmReg_CPSR: + ret = TArmRegisterIndex.EArmFlags; + break; + case TArmRegisterType.EArmReg_DACR: + ret = TArmRegisterIndex.EArmDacr; + break; + default: + throw new NotSupportedException(); + } + // + return ret; + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( UserContextTableEntry entry in iEntries ) + { + yield return entry; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( UserContextTableEntry entry in iEntries ) + { + yield return entry; + } + } + #endregion + + #region Data members + private readonly TUserContextType iType; + private readonly UserContextTableEntry[] iEntries; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/UserContextTable/UserContextTableEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/UserContextTable/UserContextTableEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianUtils.DataBuffer; +using SymbianUtils.DataBuffer.Entry; + +namespace CrashDebuggerLib.Structures.UserContextTable +{ + internal class UserContextTableEntry + { + #region Enumerations + public enum TType + { + EUndefined, /**< register is not available */ + EOffsetFromSp, /**< iOffset is offset from stack pointer */ + EOffsetFromStackTop, /**< iOffset is offset from stack top */ + ESpPlusOffset, /**< value = SP + offset */ + } + #endregion + + #region Constructors + public UserContextTableEntry() + { + } + #endregion + + #region API + public bool IsAvailable( bool aIsCurrentThread ) + { + bool ret = false; + // + switch ( Type ) + { + case TType.EOffsetFromSp: + // Not allowed when it's the current thread + ret = ( !aIsCurrentThread ); + break; + case TType.EOffsetFromStackTop: + // Always allowed + ret = true; + break; + case TType.ESpPlusOffset: + // Not allowed when it's the current thread + ret = ( !aIsCurrentThread ); + break; + default: + case TType.EUndefined: + break; + } + // + return ret; + } + + public uint Process( ArmRegister aSp, DataBuffer aStackData ) + { + uint ret = 0; + // + switch ( Type ) + { + case TType.EUndefined: + throw new NotSupportedException(); + case TType.EOffsetFromSp: + ret = UpdateUsingOffsetFromSp( aSp, aStackData ); + break; + case TType.EOffsetFromStackTop: + ret = UpdateUsingOffsetFromStackTop( aSp, aStackData ); + break; + case TType.ESpPlusOffset: + ret = UpdateUsingSpPlusOffset( aSp, aStackData ); + break; + } + // + return ret; + } + #endregion + + #region Properties + public TType Type + { + get { return iType; } + set { iType = value; } + } + + public byte Offset + { + get { return iOffset; } + set { iOffset = value; } + } + + public uint OffsetAsDWord + { + get { return (uint) Offset * 4; } + } + #endregion + + #region Internal methods + private uint UpdateUsingOffsetFromSp( ArmRegister aSp, DataBuffer aStackData ) + { + uint sp = aSp; + uint offset = OffsetAsDWord; + uint fetchAddr = offset + sp; + DataBufferUint val = aStackData[ fetchAddr ]; + return val; + } + + private uint UpdateUsingOffsetFromStackTop( ArmRegister aSp, DataBuffer aStackData ) + { + uint stackTop = aStackData.Last.Address + 1; + uint offset = OffsetAsDWord; + uint fetchAddr = stackTop - offset; + DataBufferUint val = aStackData[ fetchAddr ]; + return val; + } + + private uint UpdateUsingSpPlusOffset( ArmRegister aSp, DataBuffer aStackData ) + { + uint sp = aSp; + uint offset = OffsetAsDWord; + uint val = offset + sp; + return val; + } + #endregion + + #region Data members + private TType iType = TType.EUndefined; + private byte iOffset = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/UserContextTable/UserContextTableManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/UserContextTable/UserContextTableManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace CrashDebuggerLib.Structures.UserContextTable +{ + // + // Return table of pointers to user context tables. + // + // Each user context table is an array of UserContextTableEntry objects, one per + // ARM CPU register, in the order defined in TArmRegisters. + // + // The master table contains pointers to the user context tables in the order + // defined in TUserContextType. There are as many user context tables as + // scenarii leading a user thread to switch to privileged mode. + // + internal class UserContextTableManager + { + #region Constructors + public UserContextTableManager() + { + Array vals = Enum.GetValues( typeof( TUserContextType ) ); + foreach ( object val in vals ) + { + TUserContextType value = (TUserContextType) val; + iTables.Add( new UserContextTable( value ) ); + } + } + #endregion + + #region API + public void Dump() + { + int i =0; + foreach ( UserContextTable table in iTables ) + { + TUserContextType type = (TUserContextType) i; + string text = table.ToString(); + System.Diagnostics.Debug.WriteLine( string.Format( "Table[{0:d2}] = {1} {2}", i, text, type ) ); + i++; + } + } + #endregion + + #region Properties + public int Count + { + get { return iTables.Count; } + } + + public UserContextTable this[ TUserContextType aType ] + { + get + { + UserContextTable ret = null; + // + foreach ( UserContextTable table in iTables ) + { + if ( table.Type == aType ) + { + ret = table; + break; + } + } + // + if ( ret == null ) + { + throw new ArgumentException(); + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private List iTables = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/UserContextTable/UserContextType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/UserContextTable/UserContextType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace CrashDebuggerLib.Structures.UserContextTable +{ + [System.ComponentModel.TypeConverter( typeof( SymbianParserLib.TypeConverters.SymbianEnumConverter ) )] + public enum TUserContextType + { + EContextNone = 0, /**< Thread has no user context */ + EContextException = 1, /**< Hardware exception while in user mode */ + EContextUndefined = 2, + EContextUserInterrupt =3, /**< Preempted by interrupt taken in user mode */ + EContextUserInterruptDied = 4, /**< Killed while preempted by interrupt taken in user mode */ + EContextSvsrInterrupt1 = 5, /**< Preempted by interrupt taken in executive call handler */ + EContextSvsrInterrupt1Died = 6, /**< Killed while preempted by interrupt taken in executive call handler */ + EContextSvsrInterrupt2 = 7, /**< Preempted by interrupt taken in executive call handler */ + EContextSvsrInterrupt2Died = 8, /**< Killed while preempted by interrupt taken in executive call handler */ + EContextWFAR = 9, /**< Blocked on User::WaitForAnyRequest() */ + EContextWFARDied = 10, /**< Killed while blocked on User::WaitForAnyRequest() */ + EContextExec = 11, /**< Slow executive call */ + EContextKernel = 12 /**< Kernel side context (for kernel threads) */ + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Threading/AsyncOperation.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Threading/AsyncOperation.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.ComponentModel; + +namespace CrashDebuggerLib.Threading +{ + [System.ComponentModel.DesignerCategory( "code" )] + internal class AsyncOperation : BackgroundWorker + { + #region Constructors + public AsyncOperation() + { + } + #endregion + + #region API + #endregion + + #region Properties + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private object iTag = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Threading/AsyncOperationManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Threading/AsyncOperationManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.ComponentModel; + +namespace CrashDebuggerLib.Threading +{ + // + // Serialises asynchronous requests - mainly because the symbol engine doesn't much + // like having dynamically loaded codesegments unloaded underneath it - i.e. it doesn't + // work multithreaded! + // + internal class AsyncOperationManager + { + #region Constructors + public AsyncOperationManager() + { + } + #endregion + + #region API + public void Clear() + { + lock ( this ) + { + iStarted = false; + iQueue.Clear(); + } + } + + public void Start() + { + lock ( this ) + { + iStarted = true; + StartNextOperation(); + } + } + + public void Queue( AsyncOperation aOperation ) + { + Queue( aOperation, false ); + } + + public void Queue( AsyncOperation aOperation, bool aHighPriority ) + { + lock ( this ) + { + if ( aHighPriority ) + { + iQueue.Insert( 0, aOperation ); + } + else + { + iQueue.Add( aOperation ); + } + } + + //System.Diagnostics.Debug.WriteLine( "[AOP] - Add - Queue now contains " + iQueue.Count + " entries..." ); + StartNextOperation(); + } + #endregion + + #region Event handlers + void Operation_RunWorkerCompleted( object aSender, RunWorkerCompletedEventArgs aArgs ) + { + lock ( this ) + { + AsyncOperation op = (AsyncOperation) aSender; + op.RunWorkerCompleted -= new RunWorkerCompletedEventHandler( Operation_RunWorkerCompleted ); + iPendingOperation = false; + } + // + StartNextOperation(); + //System.Diagnostics.Debug.WriteLine( "[AOP] - Fin -Queue now contains " + iQueue.Count + " entries..." ); + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void StartNextOperation() + { + lock ( this ) + { + if ( iStarted ) + { + if ( iQueue.Count > 0 && !iPendingOperation ) + { + AsyncOperation op = iQueue[ 0 ]; + iQueue.RemoveAt( 0 ); + // + op.RunWorkerCompleted += new RunWorkerCompletedEventHandler( Operation_RunWorkerCompleted ); + iPendingOperation = true; + op.RunWorkerAsync( op ); + // + //System.Diagnostics.Debug.WriteLine( "[AOP] - Start - Starting op with " + iQueue.Count + " remaining..." ); + } + else + { + System.Diagnostics.Debug.WriteLine( "[AOP] - Start - Is empty!" ); + } + } + else + { + System.Diagnostics.Debug.WriteLine( "[AOP] - Start - Queue is disabled!" ); + } + } + } + #endregion + + #region Data members + private List iQueue = new List(); + private bool iPendingOperation = false; + private bool iStarted = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElement.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElement.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,795 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Reflection; +using System.Collections.Generic; +using SymbianUtils; +using SymbianDebugLib.Engine; +using CrashItemLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Base.DataBinding; + +namespace CrashItemLib.Crash.Base +{ + public abstract class CIElement : IEnumerable + { + #region Delegates & events + public delegate void CIElementEventHandler( CIElement aElement ); + public delegate void CIMultiElementEventHandler( CIElement aSelf, CIElement aOther ); + + public event CIMultiElementEventHandler ChildAdded = null; + #endregion + + #region Enumerations + internal enum TAutoPopulateType + { + EAutoPopulateDisabled = 0, + EAutoPopulateEnabled + } + + public enum TChildSearchType + { + EDirectChildrenOnly = 0, + EEntireHierarchy + } + #endregion + + #region Constructors + internal CIElement( int aId ) + : this( aId, false ) + { + // NB: to be called only by the container itself since everything else + // must specify a valid container object + System.Diagnostics.Debug.Assert( this is CIContainer ); + } + + internal CIElement( CIContainer aContainer ) + : this( aContainer, TAutoPopulateType.EAutoPopulateDisabled ) + { + } + + internal CIElement( CIContainer aContainer, CIElement aParent ) + : this( aContainer ) + { + iParent = aParent; + } + + internal CIElement( CIContainer aContainer, TAutoPopulateType aDataBindingAutoPopulate ) + : this( aContainer.GetNextElementId(), aDataBindingAutoPopulate == TAutoPopulateType.EAutoPopulateEnabled ) + { + iContainer = aContainer; + } + + internal CIElement( CIContainer aContainer, CIElement aParent, TAutoPopulateType aDataBindingAutoPopulate ) + : this( aContainer, aDataBindingAutoPopulate ) + { + iParent = aParent; + } + + private CIElement( long aId, bool aDataBindingAutoPopulate ) + { + iId = new CIElementId( aId ); + iDataBindingModel = new CIDBModel( this, aDataBindingAutoPopulate ); + } + #endregion + + #region API - Framework Properties + public virtual string Name + { + get { return string.Empty; } + set { } + } + + public virtual CIElementId Id + { + get { return iId; } + set + { + iId = value; + IsIdExplicit = true; + } + } + #endregion + + #region API - Children + public virtual int Count + { + get + { + int ret = 0; + // + lock ( iSyncLock ) + { + if ( iChildren != null ) + { + ret = iChildren.Count; + } + } + // + return ret; + } + } + + public bool HasChildren + { + get + { + bool ret = false; + // + lock ( iSyncLock ) + { + if ( iChildren != null ) + { + ret = ( iChildren.Count > 0 ); + } + } + // + return ret; + } + } + + public virtual void AddChild( CIElement aChild ) + { + if ( aChild != null ) + { + // If we have been restricted to a specific + // type of child element, then check aChild against + // it... + Type t = aChild.GetType(); + ValidateChildType( t ); + + lock ( iSyncLock ) + { + if ( iChildren == null ) + { + iChildren = new CIElementList( Container ); + iChildren.IsInContainer = this.IsInContainer; + } + + if ( aChild.Parent == null ) + { + aChild.Parent = this; + } + + iChildren.Add( aChild ); + } + + OnElementAddedToSelf( aChild ); + } + } + + public virtual void AddChildren( CIElement[] aChildren ) + { + for ( int i = aChildren.Length - 1; i >= 0; i-- ) + { + AddChild( aChildren[ i ] ); + } + } + + public virtual void RemoveChild( CIElement aChild ) + { + if ( aChild == null ) + { + throw new ArgumentException( "Child is null" ); + } + + if ( HasChildren && iChildren.Count > 0 ) + { + lock ( iSyncLock ) + { + iChildren.Remove( aChild ); + } + } + } + + public virtual void RemoveChildren( Type aType ) + { + if ( HasChildren && iChildren.Count > 0 ) + { + lock ( iSyncLock ) + { + int count = iChildren.Count; + for ( int i = count - 1; i >= 0; i-- ) + { + CIElement child = iChildren[ i ]; + if ( aType.IsAssignableFrom( aType ) ) + { + iChildren.Remove( child ); + } + } + } + } + } + + public virtual void Clear() + { + lock ( iSyncLock ) + { + if ( iChildren != null ) + { + iChildren.Clear(); + } + } + } + + public virtual bool Contains( CIElement aElement ) + { + return Contains( aElement.Id ); + } + + public virtual bool Contains( CIElementId aId ) + { + bool ret = false; + // + lock ( iSyncLock ) + { + if ( iChildren != null ) + { + ret = iChildren.Contains( aId ); + } + } + // + return ret; + } + + public CIElement this[ CIElementId aId ] + { + get + { + CIElement ret = null; + // + lock ( iSyncLock ) + { + if ( Contains( aId ) ) + { + System.Diagnostics.Debug.Assert( iChildren != null ); + ret = iChildren[ aId ]; + } + } + // + return ret; + } + } + + public CIElement this[ int aIndex ] + { + get + { + CIElement ret = null; + // + lock ( iSyncLock ) + { + if ( iChildren != null ) + { + ret = iChildren[ aIndex ]; + } + } + // + return ret; + } + } + + public CIElement ChildByType( Type aType ) + { + CIElement ret = null; + // + lock ( iSyncLock ) + { + foreach ( CIElement element in this ) + { + if ( aType.IsAssignableFrom( element.GetType() ) ) + { + ret = element; + break; + } + } + } + // + return ret; + } + + public CIElementList ChildrenByType() where T: CIElement + { + CIElementList ret = ChildrenByType( TChildSearchType.EDirectChildrenOnly ); + return ret; + } + + public CIElementList ChildrenByType( Predicate aPredicate ) where T : CIElement + { + CIElementList ret = ChildrenByType( TChildSearchType.EDirectChildrenOnly, aPredicate ); + return ret; + } + + public CIElementList ChildrenByType( TChildSearchType aType ) where T : CIElement + { + return ChildrenByType( aType, null ); + } + + public CIElementList ChildrenByType( TChildSearchType aType, Predicate aPredicate ) where T : CIElement + { + CIElementList ret = new CIElementList( Container ); + GetChildrenByType( ret, aType, aPredicate ); + return ret; + } + + internal CIElementList Children + { + get + { + CIElementList ret = null; + // + lock ( iSyncLock ) + { + ret = iChildren; + // + if ( ret == null ) + { + ret = new CIElementList( Container ); + } + } + // + return ret; + } + } + #endregion + + #region API - Data Binding framework + public virtual void PrepareColumns() + { + DataBindingModel.ClearColumns(); + DataBindingModel.TryAutoPopulateColumns( this ); + } + + public virtual void PrepareRows() + { + DataBindingModel.ClearRows(); + DataBindingModel.TryAutoPopulateCells( this ); + } + #endregion + + #region API - Parentage + public bool HasParent + { + get + { + lock ( iSyncLock ) + { + return iParent != null; + } + } + } + + public virtual CIElement Parent + { + get + { + lock ( iSyncLock ) + { + return iParent; + } + } + internal set + { + lock ( iSyncLock ) + { + iParent = value; + } + } + } + #endregion + + #region Properties + public virtual bool IsInContainer + { + get + { + lock ( iSyncLock ) + { + return ( iFlags & TFlags.EFlagsIsInContainer ) == TFlags.EFlagsIsInContainer; + } + } + internal set + { + // Don't allow it to change if we're locked down. + if ( IsFinalized == false ) + { + bool oldValue = IsInContainer; + if ( oldValue != value ) + { + // Set new flag value + lock ( iSyncLock ) + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsInContainer; + } + else + { + iFlags &= ~TFlags.EFlagsIsInContainer; + } + } + + // Fire internal call that reflects new state. This notifies the + // container about our registration status and in turn, the container + // can notify it's observers about our presence/remove within container. + OnIsInContainerChanged(); + + // Ensure children are also in/out of container + lock ( iSyncLock ) + { + if ( iChildren != null ) + { + iChildren.IsInContainer = value; + } + } + } + } + } + } + + public bool IsIdExplicit + { + get + { + lock ( iSyncLock ) + { + return ( iFlags & TFlags.EFlagsIdWasExplicitlySet ) == TFlags.EFlagsIdWasExplicitlySet; + } + } + private set + { + lock ( iSyncLock ) + { + if ( value ) + { + iFlags |= TFlags.EFlagsIdWasExplicitlySet; + } + else + { + iFlags &= ~TFlags.EFlagsIdWasExplicitlySet; + } + } + } + } + + public virtual CIEngine Engine + { + get { return Container.Engine; } + } + + public CIContainer Container + { + get + { + lock ( iSyncLock ) + { + return iContainer; + } + } + internal set + { + lock ( iSyncLock ) + { + iContainer = value; + } + } + } + + public CIDBModel DataBindingModel + { + get { return iDataBindingModel; } + } + + protected bool IsToBeFinalizedLast + { + get + { + lock ( iSyncLock ) + { + return ( iFlags & TFlags.EFlagsIsToBeFinalizedLast ) == TFlags.EFlagsIsToBeFinalizedLast; + } + } + set + { + lock ( iSyncLock ) + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsToBeFinalizedLast; + } + else + { + iFlags &= ~TFlags.EFlagsIsToBeFinalizedLast; + } + } + } + } + + internal bool IsFinalized + { + get + { + lock ( iSyncLock ) + { + return ( iFlags & TFlags.EFlagsIsFinalized ) == TFlags.EFlagsIsFinalized; + } + } + set + { + lock ( iSyncLock ) + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsFinalized; + } + else + { + iFlags &= ~TFlags.EFlagsIsFinalized; + } + } + } + } + #endregion + + #region Internal methods + internal void Trace( string aMessage ) + { + Container.Engine.Trace( aMessage ); + } + + internal void Trace( string aFormat, params object[] aParams ) + { + Container.Engine.Trace( aFormat, aParams ); + } + + protected void AddSupportedChildType( Type aType ) + { + lock ( iSyncLock ) + { + if ( iSupportedChildTypes == null ) + { + iSupportedChildTypes = new List(); + } + iSupportedChildTypes.Add( aType ); + } + } + + private void ValidateChildType( Type aType ) + { + lock ( iSyncLock ) + { + if ( iSupportedChildTypes != null ) + { + StringBuilder typeNames = new StringBuilder(); + // + foreach ( Type t in iSupportedChildTypes ) + { + typeNames.Append( t.ToString() + ", " ); + // + if ( aType == t || aType.IsSubclassOf( t ) ) + { + return; + } + } + // + string names = typeNames.ToString(); + if ( names.Length > 2 ) + { + names = names.Substring( 0, names.Length - 2 ); + } + // + throw new ArgumentException( "Child is not of type: [" + names + "]" ); + } + } + } + + internal virtual void GetChildrenByType( CIElementList aList, TChildSearchType aType, Predicate aPredicate ) where T : CIElement + { + // Get all direct children, and if recusion enabled, then fetch the + // entire tree. + Type t = typeof( T ); + foreach ( CIElement element in Children ) + { + if ( t.IsAssignableFrom( element.GetType() ) ) + { + // Get entry of correct type + T objectEntry = (T) ( (object) element ); + + // Check whether it is suitable for inclusion via our predicate + bool addEntry = true; + if ( aPredicate != null ) + { + addEntry = aPredicate( objectEntry ); + } + + // Is it okay to take the entry? + if ( addEntry ) + { + aList.Add( objectEntry ); + } + } + + // Get the element's children + if ( aType == TChildSearchType.EEntireHierarchy ) + { + element.GetChildrenByType( aList, aType, aPredicate ); + } + } + } + #endregion + + #region Internal flags + [Flags] + private enum TFlags : short + { + EFlagsNone = 0, + EFlagsIsInContainer = 1, + EFlagsIdWasExplicitlySet = 2, + EFlagsIsReadOnly = 4, + EFlagsIsToBeFinalizedLast = 8, + EFlagsIsFinalized = 16, + } + #endregion + + #region Internal framework methods + /// + /// Called when the element is to finish its construction. At this point + /// it is assumed that the crash container data structure is largely fully + /// populated. This function call should typically perform any final + /// post-processing, such as looking up symbols etc. + /// + /// + internal virtual void OnFinalize( CIElementFinalizationParameters aParams ) + { + } + + internal void DoFinalizeElements( CIElementFinalizationParameters aParams, Queue aCallBackLast, bool aForceFinalize, IEnumerable aElements ) + { + foreach( CIElement element in aElements ) + { + if ( element.IsToBeFinalizedLast ) + { + aCallBackLast.Enqueue( element ); + } + // + element.DoFinalize( aParams, aCallBackLast, aForceFinalize ); + } + } + + internal virtual void DoFinalize( CIElementFinalizationParameters aParams, Queue aCallBackLast, bool aForceFinalize ) + { + lock ( iSyncLock ) + { + // Finalize children + if ( iChildren != null ) + { + DoFinalizeElements( aParams, aCallBackLast, aForceFinalize, iChildren ); + } + } + + // Finalize ourself + if ( ( aForceFinalize || IsToBeFinalizedLast == false ) && IsFinalized == false ) + { + try + { + OnFinalize( aParams ); + } + finally + { + IsFinalized = true; + } + } + } + + /// + /// Called by CIElement.AddChild() whenever a new element is + /// added as a child of this element. + /// + /// Notify the container that a child entry was added + /// so that it can notify any elements that listen to + /// all additions to the container (direct or indirect). + /// + protected virtual void OnElementAddedToSelf( CIElement aElement ) + { + // aElement inherits our container state + bool inContainer = IsInContainer; + + // Doing this will fire an added/removed event in accordance + // with what our state currently is and what it has just become. + aElement.IsInContainer = inContainer; + + // Report event + if ( ChildAdded != null ) + { + ChildAdded( this, aElement ); + } + } + + protected virtual void OnIsInContainerChanged() + { + // If we're now in the container, either directly or indirectly (we don't care) + // then make sure we notify the container so that it can inform other elements + // that may be listening. + // + // Because "IsInContainer" cascades changes to our children, they will also + // notify the container themselves in due course. + // + // Obviously don't cascade when the container itself changes its state. + if ( this != Container ) + { + if ( IsInContainer ) + { + Container.OnContainerElementRegistered( this ); + } + else + { + Container.OnContainerElementUnregistered( this ); + } + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + lock ( iSyncLock ) + { + CIElementList children = iChildren; + if ( iChildren == null ) + { + children = new CIElementList( Container ); + } + return children.GetEnumerator(); + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + lock ( iSyncLock ) + { + CIElementList children = iChildren; + if ( iChildren == null ) + { + children = new CIElementList( Container ); + } + return children.GetEnumerator(); + } + } + #endregion + + #region Data members + private readonly CIDBModel iDataBindingModel; + private object iSyncLock = new object(); + private CIElement iParent = null; + private List iSupportedChildTypes = null; + private CIContainer iContainer; + private CIElementList iChildren; + private CIElementId iId = new CIElementId(); + private TFlags iFlags = TFlags.EFlagsNone; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementAttributes.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementAttributes.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; + +namespace CrashItemLib.Crash.Base +{ + [AttributeUsage( AttributeTargets.Constructor)] + internal class CIElementAttributeMandatory : Attribute + { + #region Constructors + public CIElementAttributeMandatory() + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementDictionary.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementDictionary.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,240 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.ComponentModel; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Container; +using SymbianStructuresLib.Uids; + +namespace CrashItemLib.Crash.Base +{ + public class CIElementDictionary : CIElement, IEnumerable where T: CIElement + { + #region Constructors + public CIElementDictionary( CIContainer aContainer ) + : base( aContainer ) + { + } + #endregion + + #region API + [Browsable( false )] + [EditorBrowsable( EditorBrowsableState.Never )] + public override void AddChild( CIElement aChild ) + { + throw new NotSupportedException( "Use Add() instead" ); + } + + [Browsable(false )] + [EditorBrowsable( EditorBrowsableState.Never )] + public override void AddChildren( CIElement[] aChildren ) + { + throw new NotSupportedException( "Use Add() instead" ); + } + + [Browsable(false )] + [EditorBrowsable( EditorBrowsableState.Never )] + public override void RemoveChild( CIElement aChild ) + { + throw new NotSupportedException( "Use Remove() instead" ); + } + + public override void Clear() + { + base.Clear(); + iDictionary.Clear(); + } + + public virtual bool Contains( T aEntry ) + { + CIElement element = CheckValid( aEntry ); + return iDictionary.ContainsKey( element.Id ); + } + + public override bool Contains( CIElement aElement ) + { + return this.Contains( aElement.Id ); + } + + public override bool Contains( CIElementId aId ) + { + return iDictionary.ContainsKey( aId ); + } + + public virtual bool Add( T aEntry ) + { + CIElement element = CheckValid( aEntry ); + + bool needsAdd = iDictionary.ContainsKey( element.Id ) == false; + if ( needsAdd ) + { + iDictionary.Add( element.Id, aEntry ); + + // Treat as though it was added as a child + base.OnElementAddedToSelf( element ); + } + + return needsAdd; + } + + public virtual void AddRange( IEnumerable aEnumerable ) + { + foreach ( T t in aEnumerable ) + { + Add( t ); + } + } + + public virtual void AddRange( T[] aArray ) + { + AddRange( (IEnumerable) aArray ); + } + + public virtual void Remove( T aEntry ) + { + CIElement element = CheckValid( aEntry ); + if ( iDictionary.ContainsKey( element.Id ) ) + { + iDictionary.Remove( element.Id ); + } + } + + public override bool IsInContainer + { + get { return base.IsInContainer; } + internal set + { + base.IsInContainer = value; + // + foreach ( KeyValuePair kvp in iDictionary ) + { + CIElement element = kvp.Value as CIElement; + if ( element != null ) + { + element.IsInContainer = value; + } + } + } + } + #endregion + + #region Properties + public new int Count + { + get { return iDictionary.Count; } + } + + public new T this[ CIElementId aId ] + { + get + { + T ret = default(T); + // + if ( iDictionary.ContainsKey( aId ) ) + { + ret = iDictionary[ aId ]; + } + // + return ret; + } + } + #endregion + + #region From CIElement + internal override void DoFinalize( CIElementFinalizationParameters aParams, Queue aCallBackLast, bool aForceFinalize ) + { + DoFinalizeElements( aParams, aCallBackLast, aForceFinalize, this ); + base.DoFinalize( aParams, aCallBackLast, aForceFinalize ); + } + + internal override void GetChildrenByType( CIElementList aList, TChildSearchType aType, Predicate aPredicate ) + { + // Get all direct children, and if recusion enabled, then fetch the + // entire tree. + Type t = typeof( ChildType ); + foreach( T entry in this ) + { + CIElement element = entry; + // + if ( t.IsAssignableFrom( element.GetType() ) ) + { + // Get entry of correct type + ChildType objectEntry = (ChildType) ( (object) element ); + + // Check whether it is suitable for inclusion via our predicate + bool addEntry = true; + if ( aPredicate != null ) + { + addEntry = aPredicate( objectEntry ); + } + + // Is it okay to take the entry? + if ( addEntry ) + { + aList.Add( objectEntry ); + } + } + + // Get the element's children + if ( aType == TChildSearchType.EEntireHierarchy ) + { + element.GetChildrenByType( aList, aType, aPredicate ); + } + } + } + #endregion + + #region Internal methods + protected virtual CIElement CheckValid( T aEntry ) + { + CIElement element = aEntry as CIElement; + if ( element == null ) + { + throw new NotSupportedException( "CIElementDictionary can only contain CIElement derived objects" ); + } + return element; + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( KeyValuePair kvp in iDictionary ) + { + yield return kvp.Value; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair kvp in iDictionary ) + { + yield return kvp.Value; + } + } + #endregion + + #region Data members + private SortedDictionary iDictionary = new SortedDictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementFinalizationParameters.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementFinalizationParameters.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianUtils; +using SymbianStructuresLib.CodeSegments; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Engine; + +namespace CrashItemLib.Crash.Base +{ + internal sealed class CIElementFinalizationParameters : DisposableObject + { + #region Constructors + public CIElementFinalizationParameters( CIEngine aEngine ) + { + iEngine = aEngine; + + // We create a (default) debug engine view that is not associated with any particular process-relative + // view of the symbols etc. In other words, it can resolve XIP-only content. + iDebugEngineView = aEngine.DebugEngine.CreateView( "CIEngine Global Debug Engine View" ); + } + + public CIElementFinalizationParameters( CIEngine aEngine, string aName, CodeSegDefinitionCollection aCodeSegments ) + { + iEngine = aEngine; + iDebugEngineView = aEngine.DebugEngine.CreateView( aName, aCodeSegments ); + } + #endregion + + #region API + #endregion + + #region Properties + public CIEngine Engine + { + get { return iEngine; } + } + + public DbgEngine DebugEngine + { + get { return iEngine.DebugEngine; } + } + + public DbgEngineView DebugEngineView + { + get { return iDebugEngineView; } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iDebugEngineView != null ) + { + iDebugEngineView.Dispose(); + iDebugEngineView = null; + } + } + } + #endregion + + #region Data members + private readonly CIEngine iEngine; + private DbgEngineView iDebugEngineView = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementId.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementId.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash.Messages; + +namespace CrashItemLib.Crash.Base +{ + public class CIElementId : IComparable + { + #region Constructors + public CIElementId() + : this( KDefaultValue ) + { + } + + public CIElementId( long aId ) + { + iId = aId; + } + + public CIElementId( CIElementId aId ) + { + iId = aId.Id; + } + #endregion + + #region API + #endregion + + #region Properties + public long Id + { + get { return iId; } + set { iId = value; } + } + #endregion + + #region Operators + public static implicit operator long( CIElementId aElement ) + { + return aElement.Id; + } + + public static implicit operator CIElementId( long aValue ) + { + return new CIElementId( aValue ); + } + + public static implicit operator string( CIElementId aElement ) + { + return aElement.ToString(); + } + #endregion + + #region From System.Object + public override string ToString() + { + return iId.ToString(); + } + #endregion + + #region From IComparable + public int CompareTo( CIElementId aOther ) + { + int ret = 1; + // + if ( aOther != null ) + { + ret = iId.CompareTo( aOther.Id ); + } + // + return ret; + } + #endregion + + #region Internal constants + private const long KDefaultValue = -1; + #endregion + + #region Data members + private long iId = KDefaultValue; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementIdProvider.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementIdProvider.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash.Messages; + +namespace CrashItemLib.Crash.Base +{ + internal class CIElementIdProvider + { + #region Constructors + public CIElementIdProvider() + : this( KInitialStartingValue ) + { + } + + public CIElementIdProvider( int aInitialValue ) + { + iNextValue = aInitialValue; + } + #endregion + + #region Internal constants + // Assumption: Symbian OS process and thread ids should be less than this value + internal const int KInitialStartingValue = 50000; + #endregion + + #region API + public int GetNextId() + { + return ++iNextValue; + } + #endregion + + #region Properties + #endregion + + #region Constants + #endregion + + #region Operators + #endregion + + #region Data members + private int iNextValue = KInitialStartingValue; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/CIElementList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Container; +using SymbianStructuresLib.Uids; + +namespace CrashItemLib.Crash.Base +{ + public class CIElementList : CIElementDictionary, IEnumerable where T : CIElement + { + #region Constructors + public CIElementList( CIContainer aContainer ) + : base( aContainer ) + { + } + #endregion + + #region API + public void Sort( Comparison aComparisonFunction ) + { + iList.Sort( aComparisonFunction ); + } + + public override void Clear() + { + base.Clear(); + iList.Clear(); + } + + /// + /// Add the specified element to this list + /// + /// + /// true if the item was added to the list, false if the item was not added (for example, it already exists) + public override bool Add( T aEntry ) + { + bool added = base.Add( aEntry ); + if ( added ) + { + iList.Add( aEntry ); + } + return added; + } + + public override void Remove( T aEntry ) + { + base.Remove( aEntry ); + iList.Remove( aEntry ); + } + + public void RemoveAt( int aIndex ) + { + iList.RemoveAt( aIndex ); + } + + public virtual T[] ToArray() + { + return iList.ToArray(); + } + #endregion + + #region Properties + public new T this[ int aIndex ] + { + get { return iList[ aIndex ]; } + } + #endregion + + #region Internal methods + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( T element in iList ) + { + yield return element; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( T element in iList ) + { + yield return element; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "[{0}] {1} item{2}", typeof( T ).Name, iList.Count, iList.Count == 0 || iList.Count > 1 ? "s" : string.Empty ); + return ret.ToString(); + } + #endregion + + #region Data members + private List iList = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/DataBinding/CIDBAttributes.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/DataBinding/CIDBAttributes.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Drawing; + +namespace CrashItemLib.Crash.Base.DataBinding +{ + [AttributeUsage( AttributeTargets.Method | AttributeTargets.Property )] + public class CIDBAttributeCell : Attribute + { + #region Enumerations + public enum TOptions + { + ENone = 0, + EAutoExpand + } + #endregion + + #region Constructors + public CIDBAttributeCell( TOptions aOptions ) + { + if ( aOptions == TOptions.ENone ) + { + throw new ArgumentException( "Options cannot be \'none\'" ); + } + + iOptions = aOptions; + } + + public CIDBAttributeCell( string aCaption, int aOrder ) + : this( aCaption, aOrder, string.Empty ) + { + } + + public CIDBAttributeCell( string aCaption, int aOrder, object aDefaultValue ) + : this( aCaption, aOrder, string.Empty, aDefaultValue ) + { + } + + public CIDBAttributeCell( string aCaption, int aOrder, string aFormat ) + : this( aCaption, aOrder, aFormat, null ) + { + } + + public CIDBAttributeCell( string aCaption, int aOrder, string aFormat, object aDefaultValue ) + { + iCaption = aCaption; + iOrder = aOrder; + iFormat = aFormat; + iDefaultValue = aDefaultValue; + } + + public CIDBAttributeCell( string aCaption, int aOrder, Color aForeColor ) + : this( aCaption, aOrder ) + { + iForeColor = aForeColor; + } + + public CIDBAttributeCell( string aCaption, int aOrder, Color aForeColor, Color aBackColor ) + : this( aCaption, aOrder, aForeColor ) + { + iBackColor = aBackColor; + } + #endregion + + #region API + #endregion + + #region Properties + public string Caption + { + get { return iCaption; } + } + + public string Format + { + get { return iFormat; } + } + + public int Order + { + get { return iOrder; } + } + + public Color ForeColor + { + get { return iForeColor; } + } + + public Color BackColor + { + get { return iBackColor; } + } + + public object DefaultValue + { + get { return iDefaultValue; } + } + + public TOptions Options + { + get { return iOptions; } + } + #endregion + + #region Data members + private TOptions iOptions = TOptions.ENone; + private readonly string iCaption; + private readonly int iOrder; + private readonly Color iForeColor; + private readonly Color iBackColor; + private readonly string iFormat; + private readonly object iDefaultValue = null; + #endregion + } + + [AttributeUsage( AttributeTargets.Class, AllowMultiple=true ) ] + public class CIDBAttributeColumn : Attribute + { + #region Constructors + public CIDBAttributeColumn( string aCaption, int aOrder ) + { + iCaption = aCaption; + iOrder = aOrder; + } + + public CIDBAttributeColumn( string aCaption, int aOrder, int aWidth ) + : this( aCaption, aOrder ) + { + iWidth = aWidth; + + // Apply width information + iWidthSet = true; + } + + public CIDBAttributeColumn( string aCaption, int aOrder, bool aTakesUpSlack ) + : this( aCaption, aOrder, CIDBColumn.KDefaultWidth ) + { + iTakesUpSlack = aTakesUpSlack; + + // Don't apply width information + iWidthSet = false; + } + #endregion + + #region API + #endregion + + #region Properties + public string Caption + { + get { return iCaption; } + } + + public int Order + { + get { return iOrder; } + } + + public bool WidthSet + { + get + { + return iWidthSet; + } + } + + public int Width + { + get { return iWidth; } + } + + public bool TakesUpSlack + { + get { return iTakesUpSlack; } + } + #endregion + + #region Data members + private readonly string iCaption; + private readonly int iOrder; + private readonly int iWidth; + private readonly bool iWidthSet; + private readonly bool iTakesUpSlack; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/DataBinding/CIDBCell.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/DataBinding/CIDBCell.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,174 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Drawing; + +namespace CrashItemLib.Crash.Base.DataBinding +{ + public class CIDBCell + { + #region Constructors + public CIDBCell() + { + iColors.Add( System.Drawing.Color.Black ); + iColors.Add( System.Drawing.Color.Transparent ); + } + + public CIDBCell( string aCaption ) + : this() + { + iCaption = aCaption; + } + + public CIDBCell( string aCaption, Color aForeColor ) + : this() + { + iCaption = aCaption; + ForeColor = aForeColor; + } + + public CIDBCell( Color aForeColor, Color aBackColor ) + : this( string.Empty, aForeColor, aBackColor ) + { + } + + public CIDBCell( string aCaption, Color aForeColor, Color aBackColor ) + : this( aCaption, aForeColor, aBackColor, string.Empty ) + { + } + + public CIDBCell( string aCaption, Color aForeColor, Color aBackColor, string aFormat ) + : this() + { + Caption = aCaption; + ForeColor = aForeColor; + BackColor = aBackColor; + Format = aFormat; + } + #endregion + + #region API + #endregion + + #region Properties + public string Caption + { + get { return iCaption; } + set { iCaption = value; } + } + + public string Format + { + get { return iFormat; } + set { iFormat = value; } + } + + public Color ForeColor + { + get + { + bool set = IsSet( KColIndexFore ); + Color ret = Color( KColIndexFore ); + + // Get color from row if we've not been explicitly set + if ( !set && Row != null ) + { + ret = Row.ForeColor; + } + // + return ret; + } + set + { + SetColor( value, KColIndexFore ); + } + } + + public Color BackColor + { + get + { + bool set = IsSet( KColIndexBack ); + Color ret = Color( KColIndexBack ); + + // Get color from row if we've not been explicitly set + if ( !set && Row != null ) + { + ret = Row.BackColor; + } + // + return ret; + } + set + { + SetColor( value, KColIndexBack ); + } + } + + public CIDBRow Row + { + get { return iRow; } + internal set { iRow = value; } + } + + public CIElement Element + { + get { return Row.Element; } + } + #endregion + + #region From System.Object + public override string ToString() + { + return Caption; + } + #endregion + + #region Internal constants + private const int KColIndexFore = 0; + private const int KColIndexBack = 1; + #endregion + + #region Internal methods + private bool IsSet( int aIndex ) + { + return iColorsSet[ aIndex ]; + } + + private Color Color( int aIndex ) + { + return iColors[ aIndex ]; + } + + private void SetColor( Color aColor, int aIndex ) + { + iColors[ aIndex ] = aColor; + iColorsSet[ aIndex ] = true; + } + #endregion + + #region Data members + private CIDBRow iRow = null; + private string iCaption = string.Empty; + private string iFormat = string.Empty; + private bool[] iColorsSet = new bool[ 2 ] { false, false }; + private List iColors = new List( 2 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/DataBinding/CIDBColumn.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/DataBinding/CIDBColumn.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash.Messages; + +namespace CrashItemLib.Crash.Base.DataBinding +{ + public class CIDBColumn + { + #region Constructors + public CIDBColumn() + { + } + + public CIDBColumn( string aCaption ) + { + iCaption = aCaption; + } + #endregion + + #region API + #endregion + + #region Properties + public string Caption + { + get { return iCaption; } + set { iCaption = value; } + } + + public int Width + { + get + { + int ret = iWidth; + return ret; + } + set { iWidth = value; } + } + + public bool WidthSet + { + get { return iWidthSet; } + set { iWidthSet = value; } + } + + public bool TakesUpSlack + { + get { return iTakesUpSlack; } + set { iTakesUpSlack = value; } + } + + public CIElement Element + { + get { return Model.Element; } + } + + internal CIDBModel Model + { + get { return iModel; } + set { iModel = value; } + } + #endregion + + #region Constants + public const int KDefaultWidth = 24; + #endregion + + #region Data members + private bool iTakesUpSlack = false; + private int iWidth = KDefaultWidth; + private bool iWidthSet = false; + private string iCaption = string.Empty; + private CIDBModel iModel = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/DataBinding/CIDBModel.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/DataBinding/CIDBModel.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,303 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Reflection; +using System.ComponentModel; + +namespace CrashItemLib.Crash.Base.DataBinding +{ + public class CIDBModel : IEnumerable + { + #region Constructors + public CIDBModel( CIElement aElement, bool aAutoPopulate ) + { + iElement = aElement; + iAutoPopulate = aAutoPopulate; + } + #endregion + + #region API + public void Add( CIDBColumn aColumn ) + { + aColumn.Model = this; + iColumns.Add( aColumn ); + } + + public void Add( CIDBRow aRow ) + { + aRow.Model = this; + iRows.Add( aRow ); + } + + public void Add( params CIDBCell[] aCells ) + { + CIDBRow row = new CIDBRow( aCells ); + Add( row ); + } + + public void ClearRows() + { + iRows.Clear(); + } + + public void ClearColumns() + { + iColumns.Clear(); + } + + public void TryAutoPopulateColumns( CIElement aElement ) + { + Type customAttributeType = typeof( CIDBAttributeColumn ); + Type thisObjectType = aElement.GetType(); + + object[] attribs = thisObjectType.GetCustomAttributes( customAttributeType, true ); + if ( attribs != null && attribs.Length > 0 ) + { + ExtractAttributeColumns( attribs, aElement ); + } + } + + public void TryAutoPopulateCells( CIElement aElement ) + { + if ( AutoPopulate ) + { + SortedDictionary rows = new SortedDictionary(); + + Type customAttributeType = typeof( CIDBAttributeCell ); + Type thisObjectType = aElement.GetType(); + + // Get properties featuring the CIDBAttribute + PropertyInfo[] propertyInfo = thisObjectType.GetProperties(); + foreach ( PropertyInfo p in propertyInfo ) + { + object[] attribs = p.GetCustomAttributes( customAttributeType, true ); + if ( attribs != null && attribs.Length > 0 ) + { + object propertyValue = p.GetValue( aElement, null ); + ExtractAttributeCells( p.ToString(), aElement, attribs, propertyValue, rows ); + } + } + + // Same, but get methods featuring the CIDBAttribute + MethodInfo[] methodInfo = thisObjectType.GetMethods(); + foreach ( MethodInfo m in methodInfo ) + { + object[] attribs = m.GetCustomAttributes( customAttributeType, true ); + if ( attribs != null && attribs.Length > 0 ) + { + // We only support this attribute on methods that don't contain + // any arguments + int paramCount = m.GetParameters().Length; + if ( paramCount != 0 ) + { + throw new NotSupportedException( "Method: " + m.ToString() + " has CIDBAttribute but non-empty parameter list -> Not supported" ); + } + + // Get property value + object propertyValue = m.Invoke( aElement, null ); + ExtractAttributeCells( m.ToString(), aElement, attribs, propertyValue, rows ); + } + } + + // Since the list is already sorted for us, just add the items in order + foreach ( KeyValuePair kvp in rows ) + { + this.Add( kvp.Value ); + } + } + } + #endregion + + #region Properties + public bool AutoPopulate + { + get { return iAutoPopulate; } + } + + public CIElement Element + { + get { return iElement; } + } + + public List Columns + { + get { return iColumns; } + } + + public List Rows + { + get { return iRows; } + } + #endregion + + #region Internal methods + private void ExtractAttributeColumns( object[] aColumnAttributes, CIElement aElement ) + { + bool foundColumnAttributes = false; + SortedDictionary columns = new SortedDictionary(); + + foreach ( object obj in aColumnAttributes ) + { + if ( obj is CIDBAttributeColumn ) + { + CIDBAttributeColumn attribute = (CIDBAttributeColumn) obj; + + // Make a column + CIDBColumn col = new CIDBColumn( attribute.Caption ); + col.Width = attribute.Width; + col.WidthSet = attribute.WidthSet; + col.TakesUpSlack = attribute.TakesUpSlack; + + if ( columns.ContainsKey( attribute.Order ) ) + { + throw new Exception( string.Format( "Column: [{0}] in element: [{1}] specifies order: {2} which is already in use", + attribute.Caption, aElement, attribute.Order ) ); + } + + columns.Add( attribute.Order, col ); + foundColumnAttributes = true; + } + } + + // Since the list is already sorted for us, just add the items in order + foreach ( KeyValuePair kvp in columns ) + { + this.Add( kvp.Value ); + } + + // We'll override the auto populate feature if we find a valid + // column attribute + iAutoPopulate = foundColumnAttributes; + } + + private void ExtractAttributeCells( string aEntityName, CIElement aElement, object[] aCIDBAttributeEntries, object aValue, SortedDictionary aRows ) + { + foreach ( object obj in aCIDBAttributeEntries ) + { + if ( obj is CIDBAttributeCell ) + { + CIDBAttributeCell attribute = (CIDBAttributeCell) obj; + + // If the property is an 'auto expand' entry, then don't look at this + // property, but instead look at the object itself + if ( attribute.Options == CIDBAttributeCell.TOptions.EAutoExpand ) + { + // The object must be an element + CIElement element = aValue as CIElement; + if ( element == null ) + { + throw new ArgumentException( "CIDBAttributeCell(TOptions.EAutoExpand) may only be applied to CIElement objects" ); + } + + TryAutoPopulateCells( element ); + } + else + { + // Whether or not to create a row + bool makeRow = true; + + // Convert attribute value to string. If the object is an enum, we'll check if it has + // a System.ComponentModel.Description attached to it, and use that in preference to a raw + // value. + string defaultValueString = ( attribute.DefaultValue != null ) ? attribute.DefaultValue.ToString() : null; + string propertyValueString = aValue.ToString(); + if ( aValue.GetType().BaseType == typeof( Enum ) ) + { + // Check if it supports System.ComponentModel.Description + FieldInfo fi = aValue.GetType().GetField( propertyValueString ); + if ( fi != null ) + { + DescriptionAttribute[] attributes = (DescriptionAttribute[]) fi.GetCustomAttributes( typeof( DescriptionAttribute ), false ); + if ( attributes != null && attributes.Length > 0 ) + { + propertyValueString = attributes[ 0 ].Description; + } + } + } + else if ( attribute.Format.Length > 0 && aValue is IFormattable ) + { + string formatSpec = attribute.Format; + IFormattable formattable = (IFormattable) aValue; + propertyValueString = formattable.ToString( formatSpec, null ); + + // Also get the default value if available + bool defaultIsFormattable = attribute.DefaultValue is IFormattable; + if ( attribute.DefaultValue != null && defaultIsFormattable ) + { + formattable = (IFormattable) attribute.DefaultValue; + defaultValueString = formattable.ToString( formatSpec, null ); + } + } + + // If the value of the property is the same as the default, then don't + // show it. + if ( defaultValueString != null ) + { + makeRow = ( defaultValueString.CompareTo( propertyValueString ) != 0 ); + } + + // Make a row + if ( makeRow ) + { + CIDBRow row = new CIDBRow(); + row.Add( new CIDBCell( attribute.Caption ) ); + row.Add( new CIDBCell( propertyValueString, attribute.ForeColor, attribute.BackColor, attribute.Format ) ); + + // Add the row if it doesn't exist. If it does, then that implies + // duplicate ordering, which we treat as a programming error. + if ( aRows.ContainsKey( attribute.Order ) ) + { + throw new Exception( string.Format( "Entity: [{0}] in element: [{1}] specifies order: {2} which is already in use", + aEntityName, aElement, attribute.Order ) ); + } + + aRows.Add( attribute.Order, row ); + } + } + } + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( CIDBRow row in iRows ) + { + yield return row; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIDBRow row in iRows ) + { + yield return row; + } + } + #endregion + + #region Data members + private readonly CIElement iElement; + private bool iAutoPopulate = false; + private List iColumns = new List(); + private List iRows = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/DataBinding/CIDBRow.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Base/DataBinding/CIDBRow.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Drawing; + +namespace CrashItemLib.Crash.Base.DataBinding +{ + public class CIDBRow : IEnumerable + { + #region Constructors + public CIDBRow() + { + } + + public CIDBRow( params CIDBCell[] aCells ) + { + iCells.AddRange( aCells ); + } + + public CIDBRow( Color aForeColor ) + : this( aForeColor, Color.Transparent ) + { + } + + public CIDBRow( Color aForeColor, Color aBackColor ) + { + iForeColor = aForeColor; + iBackColor = aBackColor; + } + #endregion + + #region API + public void Add( CIDBCell aCell ) + { + aCell.Row = this; + iCells.Add( aCell ); + } + #endregion + + #region Properties + public int Count + { + get { return iCells.Count; } + } + + public CIDBCell this[ int aIndex ] + { + get { return iCells[ aIndex ]; } + } + + public Color ForeColor + { + get { return iForeColor; } + set { iForeColor = value; } + } + + public Color BackColor + { + get { return iBackColor; } + set { iBackColor = value; } + } + + public CIElement Element + { + get + { + CIElement element = iElement; + // + if ( element == null && Model != null ) + { + element = Model.Element; + } + // + return element; + } + set { iElement = value; } + } + + internal CIDBModel Model + { + get { return iModel; } + set + { + iModel = value; + + // Try to ensure the element points to something + if ( iElement == null ) + { + iElement = Model.Element; + } + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( CIDBCell c in iCells ) + { + yield return c; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIDBCell c in iCells ) + { + yield return c; + } + } + #endregion + + #region Data members + private Color iForeColor = Color.Black; + private Color iBackColor = Color.Transparent; + private List iCells = new List(); + private CIDBModel iModel = null; + private CIElement iElement = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/BinaryData/CIBinaryData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/BinaryData/CIBinaryData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using SymbianUtils.DataBuffer; + +namespace CrashItemLib.Crash.BinaryData +{ + public class CIBinaryData : CIElement + { + #region Constructors + public CIBinaryData( CIContainer aContainer ) + : base( aContainer ) + { + } + #endregion + + #region API + #endregion + + #region Properties + public override string Name + { + get { return iName; } + set { iName = value; } + } + + public DataBuffer DataBuffer + { + get { return iData; } + set { iData = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private string iName = string.Empty; + private DataBuffer iData = new DataBuffer(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/CodeSegs/CICodeSeg.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/CodeSegs/CICodeSeg.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,268 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianStructuresLib.Uids; +using SymbianUtils.DataBuffer; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols; +using SymbianUtils; +using SymbianUtils.Range; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Symbols; + +namespace CrashItemLib.Crash.CodeSegs +{ + public class CICodeSeg : CIElement + { + #region Constructors + public CICodeSeg( CIProcess aProcess ) + : this( aProcess, new CodeSegDefinition() ) + { + } + + public CICodeSeg( CIProcess aProcess, CodeSegDefinition aCodeSegDef ) + : base( aProcess.Container ) + { + iOwningProcess = aProcess; + iCodeSegDef = aCodeSegDef; + } + #endregion + + #region API + public bool Contains( uint aAddress ) + { + bool ret = Range.Contains( aAddress ); + return ret; + } + + internal void Resolve( DbgEngineView aDebugEngineView ) + { + base.Trace( "[CICodeSeg] Resolve() - START - this: {0}", this ); + ResetState(); + + // Check whether we have a symbol already loaded for the code segment's base address + uint baseAddress = this.Base; + // + SymbolCollection col = null; + Symbol symbol = aDebugEngineView.Symbols.Lookup( baseAddress, out col ); + base.Trace( "[CICodeSeg] Resolve() - symbol: {0}, symbolCollection: {1}", symbol, col ); + // + if ( symbol != null ) + { + // This must be valid if we found a symbol + System.Diagnostics.Debug.Assert( col != null ); + } + else + { + // Symbol engine is not aware of the code segment's base address, but we can check by name + // as well... + col = aDebugEngineView.Symbols[ iCodeSegDef ]; + } + + // Update state + IsResolved = ( col != null ); + AssociatedSymbolCollection = col; + + base.Trace( "[CICodeSeg] Resolve() - END - this: {0}, resolved: {1}, iCodeSegDef.FileName: {2}", this, this.IsResolved, iCodeSegDef.FileName ); + } + #endregion + + #region Properties + public override string Name + { + get { return iCodeSegDef.FileName; } + set + { + iCodeSegDef.FileName = value; + } + } + + public uint Base + { + get { return iCodeSegDef.Base; } + set { iCodeSegDef.Base = value; } + } + + public uint Limit + { + get { return iCodeSegDef.Limit; } + set + { + iCodeSegDef.Limit = value; + } + } + + public uint Size + { + get + { + // The address range contains all-inclusive values. + // + // E.g. a range of 0x00 -> 0x10 would include the values...: + // + // 0x00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 0x10 + // + // ...and therefore AddressRange.Size would return 17. + // + // Symbian OS treats the range as non-inclusive, so the value is one too large. + // Hence we subtract one + uint ret = iCodeSegDef.Size - 1; + return ret; + } + } + + public uint Checksum + { + get { return iCodeSegDef.Checksum; } + set { iCodeSegDef.Checksum = value; } + } + + public bool IsResolved + { + get { return iIsResolved; } + private set + { + iIsResolved = value; + base.Trace( "[CICodeSeg] Resolve() - this: {0}, resolved: {1}", this, iIsResolved ); + } + } + + public bool IsMismatched + { + get { return MismatchAddress != KNoSymbolicMismatchAddress; } + } + + public bool IsSpeculative + { + get { return !IsExplicit; } + } + + public bool IsExplicit + { + get { return iIsExplicit; } + internal set { iIsExplicit = value; } + } + + public uint MismatchAddress + { + get { return iMismatchAddress; } + private set { iMismatchAddress = value; } + } + + public AddressRange Range + { + get + { + // We do this so that calling Range.ToString() won't include a file name! + AddressRange ret = new AddressRange( iCodeSegDef ); + return ret; + } + } + + public CIProcess OwningProcess + { + get + { + System.Diagnostics.Debug.Assert( iOwningProcess != null ); + return iOwningProcess; + } + } + + public SymbolCollection AssociatedSymbolCollection + { + get { return iAssociatedSymbolCollection; } + private set + { + iAssociatedSymbolCollection = value; + if ( iAssociatedSymbolCollection != null ) + { + bool misMatch = ( iAssociatedSymbolCollection.BaseAddress != this.Base ); + if ( misMatch ) + { + MismatchAddress = iAssociatedSymbolCollection.BaseAddress; + } + } + } + } + #endregion + + #region Operators + public static implicit operator CodeSegDefinition( CICodeSeg aCodeSeg ) + { + return aCodeSeg.iCodeSegDef; + } + #endregion + + #region Internal constants + private const uint KNoSymbolicMismatchAddress = 0; + #endregion + + #region Internal methods + private void ResetState() + { + IsResolved = false; + MismatchAddress = 0; + } + + private Symbol BaseAddressSymbolAndCollection( DbgViewSymbol aSymbolView, out SymbolCollection aCollection ) + { + Symbol ret = aSymbolView.Lookup( this.Base, out aCollection ); + return ret; + } + #endregion + + #region From CIElement + internal override void OnFinalize( CIElementFinalizationParameters aParams ) + { + try + { + base.OnFinalize( aParams ); + } + finally + { + Resolve( aParams.DebugEngineView ); + } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "{0:x8}-{1:x8} {2}", this.Base, this.Limit, this.Name ); + return ret.ToString(); + } + #endregion + + #region Data members + private readonly CIProcess iOwningProcess; + private bool iIsResolved = false; + private bool iIsExplicit = false; + private uint iMismatchAddress = KNoSymbolicMismatchAddress; + private CodeSegDefinition iCodeSegDef = new CodeSegDefinition(); + private SymbolCollection iAssociatedSymbolCollection = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/CodeSegs/CICodeSegList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/CodeSegs/CICodeSegList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,163 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.CodeSegments; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.DataBuffer; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Processes; + +namespace CrashItemLib.Crash.CodeSegs +{ + public class CICodeSegList : CIElement, IEnumerable + { + #region Constructors + public CICodeSegList( CIProcess aProcess ) + : base( aProcess.Container, aProcess ) + { + base.AddSupportedChildType( typeof( CICodeSeg ) ); + base.AddSupportedChildType( typeof( CrashItemLib.Crash.Messages.CIMessage ) ); + } + + public CICodeSegList( CIProcess aProcess, IEnumerable aEnumerable ) + : this( aProcess ) + { + foreach ( CICodeSeg cs in aEnumerable ) + { + AddChild( cs ); + } + } + #endregion + + #region API + public bool Contains( string aDeviceBinaryFileName ) + { + bool ret = false; + // + string deviceBinaryFileName = aDeviceBinaryFileName.ToUpper(); + foreach ( CICodeSeg codeSeg in this ) + { + string codeSegName = Path.GetFileNameWithoutExtension( codeSeg.Name ).ToUpper(); + if ( deviceBinaryFileName.Contains( codeSegName ) ) + { + ret = true; + break; + } + } + // + return ret; + } + + + internal void DiscardImplicitCodeSegments() + { + int count = base.Count; + for ( int i = count - 1; i >= 0; i-- ) + { + CICodeSeg cs = this[ i ] as CICodeSeg; + if ( cs != null && !cs.IsExplicit ) + { + base.Trace( string.Format( "[CICodeSegList] DiscardImplicitCodeSegments() - dicarding: {0}", cs ) ); + base.RemoveChild( cs ); + } + } + } + #endregion + + #region Properties + public CIProcess OwningProcess + { + get { return (CIProcess) base.Parent; } + } + + public CICodeSeg this[ uint aAddress ] + { + get + { + CICodeSeg ret = null; + // + foreach ( CICodeSeg cs in this ) + { + if ( cs.Contains( aAddress ) ) + { + ret = cs; + break; + } + } + // + return ret; + } + } + #endregion + + #region Operators + public static implicit operator CodeSegDefinitionCollection( CICodeSegList aList ) + { + return aList.iCollection; + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( CIElement element in base.Children ) + { + if ( element is CICodeSeg ) + { + CICodeSeg ret = (CICodeSeg) element; + yield return ret; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIElement element in base.Children ) + { + if ( element is CICodeSeg ) + { + CICodeSeg ret = (CICodeSeg) element; + yield return ret; + } + } + } + #endregion + + #region From CIElement + protected override void OnElementAddedToSelf( CIElement aElement ) + { + System.Diagnostics.Debug.Assert( aElement is CICodeSeg ); + CICodeSeg codeSeg = (CICodeSeg) aElement; + iCollection.Add( codeSeg ); + // + base.OnElementAddedToSelf( aElement ); + } + #endregion + + #region Data members + private CodeSegDefinitionCollection iCollection = new CodeSegDefinitionCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Container/CIContainer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Container/CIContainer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,428 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Events; +using CrashItemLib.Crash.Header; +using CrashItemLib.Crash.InfoHW; +using CrashItemLib.Crash.InfoSW; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Source; +using CrashItemLib.Crash.Summarisable; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Traces; +using CrashItemLib.Crash.Reports; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Engine; +using SymbianDebugLib.Engine; + +namespace CrashItemLib.Crash.Container +{ + public sealed class CIContainer : CIElement, ICISymbolManager + { + #region Enumerations + internal enum TCIElementEventType + { + ECIEventChildAdded = 0, + ECIEventChildRemoved, + } + + public enum TStatus + { + EStatusDefault = 0, + EStatusErrorContainer + } + #endregion + + #region Delegates & events + internal delegate void ElementEventHandler( CIContainer aContainer, CIElement aElement, TCIElementEventType aType ); + internal event ElementEventHandler ElementEvents; + #endregion + + #region Static constructors + internal static CIContainer New( CIEngine aEngine, CISource aSource ) + { + CIContainer ret = new CIContainer( aEngine, aSource ); + return ret; + } + + public static CIContainer NewErrorContainer( CIEngine aEngine, CISource aSource ) + { + CIContainer ret = new CIContainer( aEngine, aSource ); + ret.Status = TStatus.EStatusErrorContainer; + return ret; + } + #endregion + + #region Constructors + private CIContainer( CIEngine aEngine, CISource aSource ) + : base( KRootElementId ) + { + iEngine = aEngine; + + // Immediately set up container association (to point to ourself) + // just incase... + base.Container = this; + + // And indicate, that since we *are* the container, we want all our children + // to automatically be "in it" too. + base.IsInContainer = true; + + // Add source descriptor + CISourceElement source = new CISourceElement( this, aSource ); + AddChild( source ); + + // Add other mandatory elements + AddMandatoryElements(); + } + #endregion + + #region API + public IEnumerable GetSummarisableEnumerator() + { + CIElementList list = base.ChildrenByType(); + return list; + } + #endregion + + #region Constants + public const int KRootElementId = CIElementIdProvider.KInitialStartingValue; + #endregion + + #region Properties + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + + public TStatus Status + { + get { return iStatus; } + set { iStatus = value; } + } + + public string[] FileNames + { + get + { + List files = new List(); + if ( iFileNames != null ) + { + files.AddRange( iFileNames ); + } + return files.ToArray(); + } + } + + public override CIEngine Engine + { + get { return iEngine; } + } + + public CISummarisableEntity PrimarySummary + { + get + { + CISummarisableEntity ret = null; + + // The primary summary is the first summary we can locate + // that relates to a crash. + CISummarisableEntityList summaries = Summaries; + foreach ( CISummarisableEntity entity in summaries ) + { + bool isCrash = entity.IsAbnormalTermination; + if ( isCrash ) + { + // Prefer threads to raw stack items. + if ( ret != null ) + { + // If the 'best match' so far is just a stack, then replace it with whatever + // we've just found. This means we could replace a raw stack with another raw + // stack. We could never replace a thread entity with a stack entity though. + if ( ret.IsAvailable( CISummarisableEntity.TElement.EElementThread ) == false ) + { + ret = entity; + } + } + else + { + ret = entity; + } + } + } + + return ret; + } + } + #endregion + + #region Mandatory elements + public CIHeader Header + { + get { return (CIHeader) ChildByType( typeof( CIHeader ) ); } + } + + public CIEventList Events + { + get { return (CIEventList) ChildByType( typeof( CIEventList ) ); } + } + + public CITraceData Traces + { + get { return (CITraceData) ChildByType( typeof( CITraceData ) ); } + } + + public CISourceElement Source + { + get { return (CISourceElement) ChildByType( typeof( CISourceElement ) ); } + } + + public CISymbolDictionary Symbols + { + get { return (CISymbolDictionary) ChildByType( typeof( CISymbolDictionary ) ); } + } + + public CIMessageDictionary Messages + { + get { return (CIMessageDictionary) ChildByType( typeof( CIMessageDictionary ) ); } + } + + public CISummarisableEntityList Summaries + { + get { return (CISummarisableEntityList) ChildByType( typeof( CISummarisableEntityList ) ); } + } + + public CIRegisterListCollection Registers + { + get + { + return (CIRegisterListCollection) ChildByType( typeof( CIRegisterListCollection ) ); + } + } + + public CIReportInfo ReportInfo + { + get { return (CIReportInfo) ChildByType( typeof( CIReportInfo ) ); } + } + #endregion + + #region Internal methods + internal void RunFinalizers( CIElementFinalizationParameters aParams ) + { + Queue mustBeCalledLast = new Queue(); + base.DoFinalize( aParams, mustBeCalledLast, false ); + + // Now call the elements that are to be finalized last + while ( mustBeCalledLast.Count > 0 ) + { + CIElement child = mustBeCalledLast.Dequeue(); + child.DoFinalize( aParams, mustBeCalledLast, true ); + } + } + + internal int GetNextElementId() + { + return Engine.GetNextElementId(); + } + + private void AddMandatoryElements() + { + Type attribType = typeof( CIElementAttributeMandatory ); + Type[] types = Assembly.GetExecutingAssembly().GetTypes(); + // + foreach( Type t in types) + { + // Get all the constructors for the type + if ( !t.IsAbstract && typeof( CIElement ).IsAssignableFrom( t ) ) + { + ConstructorInfo[] ctors = t.GetConstructors( BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public ); + foreach ( ConstructorInfo ctor in ctors ) + { + // If the specified ctor is decorated with the "mandatory" attribute + // then it must be a mandatory class, so new an instance up... + object[] attribs = ctor.GetCustomAttributes( attribType, false ); + if ( attribs.Length > 0 ) + { + // Check that it has the expected signature. + // We expect mandatory constructors to take only a single parameter + // which is the container itself, i.e. this object + ParameterInfo[] parameters = ctor.GetParameters(); + if ( parameters.Length == 1 && parameters[ 0 ].ParameterType == this.GetType() ) + { + CIElement element = ctor.Invoke( new object[] { this } ) as CIElement; + if ( element != null ) + { + element.Parent = this; + AddChild( element ); + } + } + } + } + } + } + // + AddChild( new CISymbolDictionary( this ) ); + } + + private void CacheFileNames( DbgEngine aDebugEngine ) + { + if ( iFileNames == null ) + { + iFileNames = new List(); + + CISourceElement source = Source; + foreach ( FileInfo file in source.AllFiles ) + { + iFileNames.Add( file.FullName ); + } + + // Meta-data files + SymbianUtils.FileSystem.FSEntity[] entities = aDebugEngine.FileSystemEntities; + foreach ( SymbianUtils.FileSystem.FSEntity e in entities ) + { + if ( e.IsFile ) + { + FileInfo file = ( (SymbianUtils.FileSystem.FSEntityFile) e ).File; + iFileNames.Add( file.FullName ); + } + } + } + } + #endregion + + #region Internal container event propagation + internal void OnContainerElementRegistered( CIElement aElement ) + { + if ( ElementEvents != null ) + { + ElementEvents( this, aElement, TCIElementEventType.ECIEventChildAdded ); + } + } + + internal void OnContainerElementUnregistered( CIElement aElement ) + { + if ( ElementEvents != null ) + { + ElementEvents( this, aElement, TCIElementEventType.ECIEventChildRemoved ); + } + } + #endregion + + #region From ICISymbolManager + public CISymbolDictionary SymbolDictionary + { + get { return this.Symbols; } + } + #endregion + + #region From CIElement + /// + /// Ensure that we only allow single instances of some objects to be added + /// as direct children. + /// + public override void AddChild( CIElement aChild ) + { + bool exception = false; + // + if ( aChild is CIEventList && Events != null ) + { + exception = true; + } + else if ( aChild is CISymbolDictionary && Symbols != null ) + { + exception = true; + } + else if ( aChild is CIMessageDictionary && Messages != null ) + { + exception = true; + } + else if ( aChild is CISourceElement && Source != null ) + { + exception = true; + } + else if ( aChild is CISummarisableEntityList && Summaries != null ) + { + exception = true; + } + else if ( aChild is CIHeader && Header != null ) + { + exception = true; + } + else if ( aChild is CIReportInfo && ReportInfo != null ) + { + exception = true; + } + else + { + // These aren't mandatory, but there should only be one... + int count = -1; + if ( aChild is CIInfoHW ) + { + count = base.ChildrenByType().Count; + } + else if ( aChild is CIInfoSW ) + { + count = base.ChildrenByType().Count; + } + + if ( count > 1 ) + { + throw new ArgumentException( "An instance of the specified object has already been added to the container" ); + } + } + + if ( exception ) + { + throw new ArgumentException( "Can only add a single instance of " + aChild.GetType() + " to the container" ); + } + + base.AddChild( aChild ); + } + + /// + /// Called by CIElement when an object is *directly* added + /// as a child of the container. + /// + protected override void OnElementAddedToSelf( CIElement aElement ) + { + // The master switch that ensures all elements and their children + // are flagged as in the container. + aElement.IsInContainer = true; + } + + internal override void OnFinalize( CIElementFinalizationParameters aParams ) + { + base.OnFinalize( aParams ); + + // Cache file names + CacheFileNames( aParams.DebugEngine ); + } + #endregion + + #region Data members + private readonly CIEngine iEngine; + private object iTag = null; + private TStatus iStatus = TStatus.EStatusDefault; + private List iFileNames = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Container/CIContainerCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Container/CIContainerCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using CrashItemLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.Container +{ + public class CIContainerCollection : IEnumerable + { + #region Constructor & destructor + public CIContainerCollection() + { + } + #endregion + + #region API + public void Add( CIContainer aContainer ) + { + lock ( iEntries ) + { + iEntries.Add( aContainer ); + } + } + + public void RemoveAt( int aIndex ) + { + lock ( iEntries ) + { + iEntries.RemoveAt( aIndex ); + } + } + + public bool Contains( CIContainer aContainer ) + { + lock ( iEntries ) + { + return iEntries.Contains( aContainer ); + } + } + + public void Remove( CIContainer aContainer ) + { + lock ( iEntries ) + { + iEntries.Remove( aContainer ); + } + } + + public void Clear() + { + lock ( iEntries ) + { + iEntries.Clear(); + } + } + #endregion + + #region Properties + public int Count + { + get + { + int ret = 0; + // + lock ( iEntries ) + { + ret = iEntries.Count; + } + // + return ret; + } + } + + public CIContainer this[ int aIndex ] + { + get + { + CIContainer ret = null; + // + lock ( iEntries ) + { + ret = iEntries[ aIndex ]; + } + // + return ret; + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + lock ( iEntries ) + { + foreach ( CIContainer item in iEntries ) + { + yield return item; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + lock ( iEntries ) + { + foreach ( CIContainer item in iEntries ) + { + yield return item; + } + } + } + #endregion + + #region Data members + private List iEntries = new List( 3 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Container/CIContainerFinalizer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Container/CIContainerFinalizer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Threading; +using System.Reflection; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianUtils; +using SymbianUtils.Threading; +using SymbianUtils.FileSystem; +using SymbianUtils.Tracer; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.PluginAPI; +using CrashItemLib.Engine.Interfaces; +using CrashItemLib.Engine.Sources; +using CrashItemLib.Engine; + +namespace CrashItemLib.Crash.Container +{ + internal class CIContainerFinalizer : MultiThreadedProcessor + { + #region Constructors + public CIContainerFinalizer( CIContainerCollection aCollection, CIEngine aEngine ) + : base( aCollection ) + { + iFinalizationParameters = new CIElementFinalizationParameters( aEngine ); + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + protected override bool Process( CIContainer aContainer ) + { + aContainer.RunFinalizers( iFinalizationParameters ); + return true; + } + #endregion + + #region Data members + private readonly CIElementFinalizationParameters iFinalizationParameters; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Container/CIContainerIndex.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Container/CIContainerIndex.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using CrashItemLib.Engine; +using CrashItemLib.Crash.InfoSW; + +namespace CrashItemLib.Crash.Container +{ + sealed internal class CIContainerIndex : IEnumerable< KeyValuePair > + { + #region Constructors + public CIContainerIndex( CIEngine aEngine ) + { + aEngine.CrashObservers += new CIEngine.CIEngineCrashObserver( Engine_CrashObserver ); + } + #endregion + + #region API + public CIContainerCollection DequeueNextContainer() + { + CIContainerCollection ret = null; + // + lock ( iDictionary ) + { + Dictionary.Enumerator enumerator = iDictionary.GetEnumerator(); + bool next = enumerator.MoveNext(); + if ( next ) + { + ret = enumerator.Current.Value; + iDictionary.Remove( enumerator.Current.Key ); + } + } + // + return ret; + } + + public static uint GetRomChecksum( CIContainer aContainer ) + { + uint ret = 0; + + // Find the infosw item in order to obtain the image checksum + CIInfoSW infoSW = aContainer.ChildByType( typeof( CIInfoSW ) ) as CIInfoSW; + if ( infoSW != null ) + { + ret = infoSW.ImageCheckSum; + } + + return ret; + } + #endregion + + #region Properties + public int Count + { + get { return iDictionary.Count; } + } + #endregion + + #region Event handlers + private void Engine_CrashObserver( CIEngine.TCrashEvent aEvent, CIContainer aContainer ) + { + if ( aEvent == CIEngine.TCrashEvent.EEventCrashRemovedAll ) + { + lock ( iDictionary ) + { + iDictionary.Clear(); + } + } + else if ( aEvent == CIEngine.TCrashEvent.EEventCrashRemoved ) + { + RemoveFromDictionary( aContainer ); + } + else if ( aEvent == CIEngine.TCrashEvent.EEventCrashAdded ) + { + AddToDictionary( aContainer ); + } + } + #endregion + + #region Internal methods + private void RemoveFromDictionary( CIContainer aContainer ) + { + uint checksum = GetRomChecksum( aContainer ); + CIContainerCollection collection = null; + // + lock ( iDictionary ) + { + if ( iDictionary.TryGetValue( checksum, out collection ) ) + { + collection.Remove( aContainer ); + + // If the collection is empty, remove the mapping also + if ( collection.Count == 0 ) + { + iDictionary.Remove( checksum ); + } + } + } + } + + private void AddToDictionary( CIContainer aContainer ) + { + uint checksum = GetRomChecksum( aContainer ); + + // Check if there is a collection for this key already + CIContainerCollection collection = null; + lock ( iDictionary ) + { + if ( iDictionary.TryGetValue( checksum, out collection ) == false ) + { + // Nope, collection not yet registers + collection = new CIContainerCollection(); + iDictionary.Add( checksum, collection ); + } + } + + // Now save + collection.Add( aContainer ); + } + #endregion + + #region From IEnumerable< KeyValuePair > + public IEnumerator> GetEnumerator() + { + foreach( KeyValuePair kvp in iDictionary ) + { + yield return kvp; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach( KeyValuePair kvp in iDictionary ) + { + yield return kvp; + } + } + #endregion + + #region Data members + private Dictionary iDictionary = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Container/CIContainerIndexProcessor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Container/CIContainerIndexProcessor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Threading; +using SymbianUtils; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Configurations; +using CrashItemLib.Engine; +using System; +using CrashItemLib.Crash.Messages; + +namespace CrashItemLib.Crash.Container +{ + internal class CIContainerIndexProcessor + { + #region Enumerations + public enum TEvent + { + EEventStarting = 0, + EEventCompleted + } + #endregion + + #region Delegates & events + public delegate void ProcessorEventHandler( TEvent aEvent ); + public event ProcessorEventHandler EventHandler = delegate { }; + #endregion + + #region Constructors + public CIContainerIndexProcessor( CIContainerIndex aIndex, CIEngine aEngine ) + { + iIndex = aIndex; + iEngine = aEngine; + } + #endregion + + #region API + public void Start( TSynchronicity aSynchronicity ) + { + if ( aSynchronicity == TSynchronicity.EAsynchronous ) + { + ThreadPool.QueueUserWorkItem( new WaitCallback( RunWorker ) ); + } + else + { + RunWorker(); + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void RunWorker() + { + RunWorker(null); + } + + private void RunWorker( object aNotUsed ) + { + iEngine.Trace( "[CIContainerIndexProcessor] RunWorker() - START - index groupings: {0}", iIndex.Count ); + + EventHandler( TEvent.EEventStarting ); + + DbgEngine debugEngine = iEngine.DebugEngine; + bool needToPrimeDebugEngine = debugEngine.MetaDataConfig.IsConfigurationDataAvailable; + iEngine.Trace( "[CIContainerIndexProcessor] RunWorker() - needToPrimeDebugEngine: {0}", needToPrimeDebugEngine ); + + // Process the index "buckets" until all are exhausted. + for ( CIContainerCollection collection = iIndex.DequeueNextContainer(); collection != null; collection = iIndex.DequeueNextContainer() ) + { + try + { + if ( collection.Count > 0 ) + { + // Get the rom serial number - all containers in the collection share a common serial + uint serialNumber = CIContainerIndex.GetRomChecksum( collection[ 0 ] ); + iEngine.Trace( "[CIContainerIndexProcessor] RunWorker() - {0} containers for rom checksum: 0x{1:x8}", collection.Count, serialNumber ); + + // Prepare debug engine meta-data as needed. + if ( needToPrimeDebugEngine ) + { + DbgEntityConfigIdentifier identifier = new DbgEntityConfigIdentifier( serialNumber ); + + iEngine.Trace( "[CIContainerIndexProcessor] RunWorker() - synchronously switching debug meta-data config..." ); + debugEngine.ConfigManager.SwitchConfigurationSynchronously( identifier ); + iEngine.Trace( "[CIContainerIndexProcessor] RunWorker() - switch complete." ); + } + + // Process the list of crash item containers in separate threads until all are handled. + // This is quite a heavyweight operation since it also potentially primes the debug engine with + // the needed symbols and then finalizes every associated crash container. + // However, we run this in a separate thread so it will not block the UI. + iEngine.Trace( "[CIContainerIndexProcessor] RunWorker() - running finalizer for {0} items with rom checksum: 0x{1:x8}", collection.Count, serialNumber ); + + // We wait until the finalizer is finished, but we're running in a worker thread so this is OK. + CIContainerFinalizer finalizer = new CIContainerFinalizer( collection, iEngine ); + finalizer.Start( SymbianUtils.TSynchronicity.ESynchronous ); + + iEngine.Trace( "[CIContainerIndexProcessor] RunWorker() - finalization complete for {0} items with rom checksum: 0x{1:x8}", collection.Count, serialNumber ); + } + } + catch (Exception e) + { + iEngine.Trace("Error: RunWorker() hit an unexpected exception!"); + + foreach (CIContainer container in collection) + { + CIMessageError error = new CIMessageError(container, "RunWorker failed"); + error.AddLine("Unexpected exception encountered during container processing - analysis has failed!"); + container.Messages.Add(error); + } + } + } + iEngine.Trace( "[CIContainerIndexProcessor] RunWorker() - Notifying about completion..." ); + + EventHandler( TEvent.EEventCompleted ); + + iEngine.Trace( "[CIContainerIndexProcessor] RunWorker() - END" ); + } + #endregion + + #region Data members + private readonly CIContainerIndex iIndex; + private readonly CIEngine iEngine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Events/CIEvent.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Events/CIEvent.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Utils; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.Events +{ + public class CIEvent : CIElement + { + #region Enumerations + public enum TSpecificType + { + /// + /// Specific type unknown - nothing can be inferred from the 'type' or 'value' fields + /// included as properties of this object. + /// + ETypeUnknown = 0, + + /// + /// The event relates to a key press and therefore the 'value' field includes a + /// text-encoded represenation of the keyboard scan code. + /// + ETypeKey + } + #endregion + + #region Constructors + public CIEvent( CIContainer aContainer ) + : base( aContainer ) + { + } + #endregion + + #region API + #endregion + + #region Properties + public string TypeName + { + get { return iTypeName; } + set { iTypeName = value; } + } + + public object Value + { + get { return iValue; } + set { iValue = value; } + } + + public TSpecificType Type + { + get { return iType; } + set { iType = value; } + } + #endregion + + #region Operators + public static implicit operator CIDBRow( CIEvent aEvent ) + { + CIDBRow row = new CIDBRow(); + + // To ensure that the register and cells are correctly associated + row.Element = aEvent; + row.Add( new CIDBCell( aEvent.TypeName ) ); + + string value = string.Empty; + if ( aEvent.Value != null ) + { + value = aEvent.Value.ToString(); + } + row.Add( new CIDBCell( value ) ); + // + return row; + } + #endregion + + #region Internal methods + #endregion + + #region From CIElement + internal override void OnFinalize( CIElementFinalizationParameters aParams ) + { + try + { + if ( iType == TSpecificType.ETypeKey && ( iValue is int ) ) + { + // Replace generic scan/key code with key name + int keyCode = (int) iValue; + string keyName = keyCode.ToString(); + // + if ( aParams.DebugEngine.KeyBindings.IsKeyBindingTableAvailable ) + { + keyName = aParams.DebugEngine.KeyBindings[ keyCode ]; + } + // + System.Diagnostics.Debug.Assert( keyName != null ); + iValue = keyName; + } + else + { + // No operation required. + } + } + finally + { + base.OnFinalize( aParams ); + } + } + #endregion + + #region Data members + private string iTypeName = string.Empty; + private object iValue = string.Empty; + private TSpecificType iType = TSpecificType.ETypeUnknown; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Events/CIEventList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Events/CIEventList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Utils; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.Events +{ + [CIDBAttributeColumn( "Name", 0 )] + [CIDBAttributeColumn( "Value", 1, true )] + public class CIEventList : CIElement, IEnumerable + { + #region Constructors + [CIElementAttributeMandatory()] + public CIEventList( CIContainer aContainer ) + : base( aContainer ) + { + // Restrict children to events + base.AddSupportedChildType( typeof( CIEvent ) ); + base.AddSupportedChildType( typeof( CrashItemLib.Crash.Messages.CIMessage ) ); + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( CIElement element in base.Children ) + { + if ( element is CIEvent ) + { + CIEvent reg = (CIEvent) element; + yield return reg; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIElement element in base.Children ) + { + if ( element is CIEvent ) + { + CIEvent reg = (CIEvent) element; + yield return reg; + } + } + } + #endregion + + #region From CIElementBase + public override void PrepareRows() + { + DataBindingModel.ClearRows(); + + // Our data binding model is based upon the event object, rather + // than any key-value-pair properties. + foreach ( CIEvent e in this ) + { + DataBindingModel.Add( e ); + } + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/ExitInfo/CIExitInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/ExitInfo/CIExitInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,396 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Registers.Special; +using SymbianUtils.Range; +using SymbianUtils.Enum; +using SymbianStructuresLib.Uids; +using SymbianUtils.DataBuffer; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashItemLib.Crash.ExitInfo +{ + [CIDBAttributeColumn( "Name", 0 )] + [CIDBAttributeColumn( "Value", 1, true )] + public class CIExitInfo : CIElement + { + #region Enumerations + public enum TExitType + { + EExitTypePending = 0, + EExitTypeKill, + EExitTypePanic, + EExitTypeTerminate, + EExitTypeException + } + #endregion + + #region Constructors + public CIExitInfo( CIElement aParent ) + : base( aParent.Container, aParent ) + { + } + #endregion + + #region API + #endregion + + #region Properties + public TExitType Type + { + get + { + TExitType ret = iType; + // + if ( !iTypeWasExplicitlySet && OwningThread != null ) + { + // A client did not specify an explict exit reason, so in this case + // we'll try to work out if we're dealing with an exception based upon + // register values. + // + // We can only do this if the owning object is available. + CIThread thread = OwningThread; + CIThreadRegisterListCollection regs = thread.Registers; + if ( thread.Registers.Contains( TArmRegisterBank.ETypeException ) ) + { + // Best guess + ret = TExitType.EExitTypeException; + } + } + // + return iType; + } + set + { + iTypeWasExplicitlySet = true; + iType = value; + } + } + + public string TypeDescription + { + get + { + switch( Type ) + { + case TExitType.EExitTypeException: + return "Exception"; + case TExitType.EExitTypePending: + return "Pending"; + case TExitType.EExitTypePanic: + return "Panic"; + case TExitType.EExitTypeTerminate: + return "Terminate"; + case TExitType.EExitTypeKill: + return "Kill"; + default: + return "Unknown"; + } + } + } + + public bool IsAbnormalTermination + { + get + { + bool ret = false; + // + switch ( Type ) + { + case TExitType.EExitTypeException: + case TExitType.EExitTypePanic: + case TExitType.EExitTypeTerminate: + ret = true; + break; + default: + case TExitType.EExitTypeKill: + case TExitType.EExitTypePending: + break; + } + // + return ret; + } + } + + public string Category + { + get + { + string ret = iCategory; + // + if ( Type == TExitType.EExitTypeException ) + { + CIRegisterExcCode code = RegisterExcCode; + if ( code != null ) + { + ret = EnumUtils.ToString( ExceptionCode ); + } + } + // + return ret; + } + set { iCategory = value; } + } + + public int Reason + { + get + { + int ret = iReason; + // + if ( Type == TExitType.EExitTypeException ) + { + ret = (int) ExceptionCode; + } + // + return ret; + } + set { iReason = value; } + } + + public CIRegisterFSR RegisterFSR + { + get + { + CIRegisterFSR ret = null; + // + CIRegisterList list = RegListCoProcessor; + if ( list != null && list.Contains( TArmRegisterType.EArmReg_FSR ) ) + { + CIRegister reg = list[ TArmRegisterType.EArmReg_FSR ]; + ret = reg as CIRegisterFSR; + } + // + return ret; + } + } + + public CIRegisterExcCode RegisterExcCode + { + get + { + CIRegisterExcCode ret = null; + // + CIRegisterList list = RegListException; + if ( list != null && list.Contains( TArmRegisterType.EArmReg_EXCCODE ) ) + { + CIRegister reg = list[ TArmRegisterType.EArmReg_EXCCODE ]; + ret = reg as CIRegisterExcCode; + } + // + return ret; + } + } + + public CIRegisterExcCode.TExceptionCode ExceptionCode + { + get + { + if ( Type != TExitType.EExitTypeException ) + { + throw new InvalidOperationException(); + } + + CIRegisterExcCode.TExceptionCode code = CIRegisterExcCode.TExceptionCode.EExceptionCodeUnknown; + CIRegisterExcCode excCode = RegisterExcCode; + // + if ( excCode != null ) + { + code = excCode; + } + // + return code; + } + } + + public string ExceptionDescription + { + get + { + string ret = string.Empty; + // + if ( Type == TExitType.EExitTypeException ) + { + CIRegisterExcCode reg = RegisterExcCode; + if ( reg != null ) + { + ret = reg.ExceptionCodeDescription; + } + } + // + return ret; + } + } + + public CIThread OwningThread + { + get { return base.Parent as CIThread; } + } + + public CIProcess OwningProcess + { + get + { + CIProcess ret = base.Parent as CIProcess; + // + if ( ret == null && OwningThread != null ) + { + ret = OwningThread.OwningProcess; + } + // + return ret; + } + } + #endregion + + #region Internal methods + private CIRegisterList RegListException + { + get + { + System.Diagnostics.Debug.Assert( OwningThread != null ); + // + CIThread thread = (CIThread) OwningThread; + CIThreadRegisterListCollection registers = thread.Registers; + // + if ( registers.Contains( TArmRegisterBank.ETypeException ) ) + { + CIRegisterList list = registers[ TArmRegisterBank.ETypeException ]; + return list; + } + // + return null; + } + } + + private CIRegisterList RegListCoProcessor + { + get + { + System.Diagnostics.Debug.Assert( OwningThread != null ); + // + CIThread thread = (CIThread) OwningThread; + CIThreadRegisterListCollection registers = thread.Registers; + // + if ( registers.Contains( TArmRegisterBank.ETypeCoProcessor ) ) + { + CIRegisterList list = registers[ TArmRegisterBank.ETypeCoProcessor ]; + return list; + } + // + return null; + } + } + #endregion + + #region From CIElement + public override void PrepareRows() + { + DataBindingModel.ClearRows(); + + // Type is common + CIDBRow rowType= new CIDBRow(); + rowType.Add( new CIDBCell( "Type" ) ); + rowType.Add( new CIDBCell( TypeDescription ) ); + DataBindingModel.Add( rowType ); + + // We must prepare them by hand because we show + // different content depending on the type of exit. + if ( Type == TExitType.EExitTypePending ) + { + // Nothing to add + } + else if ( Type == TExitType.EExitTypeException ) + { + string code = ExceptionDescription; + if ( code != string.Empty ) + { + CIDBRow rowExcCode = new CIDBRow(); + rowExcCode.Add( new CIDBCell( "Exception Code" ) ); + rowExcCode.Add( new CIDBCell( code ) ); + DataBindingModel.Add( rowExcCode ); + } + + CIRegisterFSR fsr = RegisterFSR; + if ( fsr != null ) + { + CIDBRow rowFSR = new CIDBRow(); + rowFSR.Add( new CIDBCell( "Fault Type" ) ); + rowFSR.Add( new CIDBCell( fsr.FaultDescription ) ); + DataBindingModel.Add( rowFSR ); + } + } + else + { + // Panic, terminate + CIDBRow rowCategory = new CIDBRow(); + rowCategory.Add( new CIDBCell( "Category" ) ); + rowCategory.Add( new CIDBCell( Category ) ); + DataBindingModel.Add( rowCategory ); + + CIDBRow rowReason = new CIDBRow(); + rowReason.Add( new CIDBCell( "Reason" ) ); + rowReason.Add( new CIDBCell( Reason.ToString() ) ); + DataBindingModel.Add( rowReason ); + + CIDBRow rowFullPanic = new CIDBRow(); + rowFullPanic.Add( new CIDBCell( "In Full" ) ); + rowFullPanic.Add( new CIDBCell( string.Format( "{0}-{1}", Category, Reason ) ) ); + DataBindingModel.Add( rowFullPanic ); + } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + if ( Type == TExitType.EExitTypePending ) + { + ret.Append( "Pending" ); + } + else if ( Type == TExitType.EExitTypeException ) + { + ret.Append( "Exception" ); + } + else + { + ret.AppendFormat( "{0}-{1}", Category, Reason ); + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private int iReason = 0; + private string iCategory = string.Empty; + private bool iTypeWasExplicitlySet = false; + private TExitType iType = TExitType.EExitTypePending; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Header/CIHeader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Header/CIHeader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Utils; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.Header +{ + [CIDBAttributeColumn( "Name", 0 )] + [CIDBAttributeColumn( "Value", 1, true )] + public class CIHeader : CIElement + { + #region Constructors + [CIElementAttributeMandatory()] + public CIHeader( CIContainer aContainer ) + : base( aContainer ) + { + } + #endregion + + #region API + #endregion + + #region Properties + [CIDBAttributeCell( "Time", 0 )] + public DateTime CrashTime + { + get { return iCrashTime; } + set { iCrashTime = value; } + } + + [CIDBAttributeCell( "Up Time", 1, "", "00:00:00" )] + public TimeSpan UpTime + { + get { return iUpTime; } + set { iUpTime = value; } + } + + [CIDBAttributeCell( "File Format", 2, "", "" )] + public CIVersionInfo FileFormatVersion + { + get { return iFileFormatVersion; } + set { iFileFormatVersion = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private DateTime iCrashTime = new DateTime(); + private TimeSpan iUpTime = new TimeSpan(); + private CIVersionInfo iFileFormatVersion = new CIVersionInfo(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/InfoEnvironment/CIInfoEnvironment.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/InfoEnvironment/CIInfoEnvironment.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Utils; +using CrashItemLib.Crash.Container; + + + +namespace CrashItemLib.Crash.InfoEnvironment +{ + [CIDBAttributeColumn( "Name", 0 )] + [CIDBAttributeColumn( "Value", 1, true )] + public class CIInfoEnvironment : CIElement + { + #region Constructors + public CIInfoEnvironment(CIContainer aContainer) + : base( aContainer ) + { + } + #endregion + + #region API + + #endregion + + #region Properties + + [CIDBAttributeCell("Test Set", 1)] + public string TestSet + { + get { return iTestSet; } + set { iTestSet = value; } + } + + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + return iTestSet; + } + #endregion + + + #region Data members + private string iTestSet = string.Empty; + private string iProductCode = string.Empty; + private string iSerialNumber = string.Empty; + private List iVersions = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/InfoHW/CIInfoHW.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/InfoHW/CIInfoHW.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Utils; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.InfoHW +{ + [CIDBAttributeColumn( "Name", 0 )] + [CIDBAttributeColumn( "Value", 1, true )] + public class CIInfoHW : CIElement, IEnumerable + { + #region Constructors + public CIInfoHW( CIContainer aContainer ) + : base( aContainer ) + { + } + #endregion + + #region API + public void ClearVersions() + { + iVersions.Clear(); + } + + public void AddVersion( string aVersionText ) + { + CIVersionInfo version = new CIVersionInfo( aVersionText ); + AddVersion( version ); + } + + public void AddVersion( CIVersionInfo aVersion ) + { + if ( aVersion.IsValid ) + { + iVersions.Add( aVersion ); + } + } + #endregion + + #region Properties + public int VersionCount + { + get { return iVersions.Count; } + } + + [CIDBAttributeCell( "Product Type", 1 )] + public string ProductType + { + get { return iProductType; } + set { iProductType = value; } + } + + [CIDBAttributeCell( "Product Code", 0 )] + public string ProductCode + { + get { return iProductCode; } + set { iProductCode = value; } + } + + [CIDBAttributeCell( "Serial Number", 2 )] + public string SerialNumber + { + get { return iSerialNumber; } + set { iSerialNumber = value; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + return iProductType; + } + #endregion + + #region From CIElement + public override void PrepareRows() + { + base.PrepareRows(); + foreach ( CIVersionInfo ver in iVersions ) + { + DataBindingModel.Add( ver ); + } + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( CIVersionInfo v in iVersions ) + { + yield return v; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIVersionInfo v in iVersions ) + { + yield return v; + } + } + #endregion + + #region Data members + private string iProductType = string.Empty; + private string iProductCode = string.Empty; + private string iSerialNumber = string.Empty; + private List iVersions = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/InfoSW/CIInfoSW.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/InfoSW/CIInfoSW.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Utils; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.InfoSW +{ + [CIDBAttributeColumn( "Name", 0, 100 )] + [CIDBAttributeColumn( "Value", 1, true )] + public class CIInfoSW : CIElement, IEnumerable + { + #region Constructors + public CIInfoSW( CIContainer aContainer ) + : base( aContainer ) + { + } + #endregion + + #region API + public void ClearVersions() + { + iVersions.Clear(); + } + + public void AddVersion( string aVersionText ) + { + CIVersionInfo version = new CIVersionInfo( aVersionText ); + AddVersion( version ); + } + + public void AddVersion( string aName, string aValue ) + { + CIVersionInfo version = new CIVersionInfo( aName, aValue ); + AddVersion( version ); + } + + internal void AddVersion( CIVersionInfo aVersion ) + { + if ( aVersion.IsValid ) + { + iVersions.Add( aVersion ); + } + } + #endregion + + #region Properties + public int VersionCount + { + get { return iVersions.Count; } + } + + [CIDBAttributeCell( "(XIP-ROM) Image Checksum", 3, "x8", 0u )] + public uint ImageCheckSum + { + get { return iImageCheckSum; } + set { iImageCheckSum = value; } + } + + [CIDBAttributeCell( "Image Timestamp", 2 )] + public DateTime ImageTimeStamp + { + get { return iImageTimeStamp; } + set { iImageTimeStamp = value; } + } + + [CIDBAttributeCell( "Platform", 0, "" )] + public string Platform + { + get { return iPlatform; } + set { iPlatform = value; } + } + + [CIDBAttributeCell( "Language", 1, "" )] + public string Language + { + get { return iLanguage; } + set { iLanguage = value; } + } + #endregion + + #region Internal methods + #endregion + + #region From CIElement + public override void PrepareRows() + { + base.PrepareRows(); + + // Need to add the version information + foreach ( CIVersionInfo ver in iVersions ) + { + DataBindingModel.Add( ver ); + } + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( CIVersionInfo v in iVersions ) + { + yield return v; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIVersionInfo v in iVersions ) + { + yield return v; + } + } + #endregion + + #region Data members + private uint iImageCheckSum = 0; + private DateTime iImageTimeStamp = new DateTime(); + private string iPlatform = string.Empty; + private string iLanguage = string.Empty; + private List iVersions = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Memory/CIMemoryInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Memory/CIMemoryInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.Memory +{ + [CIDBAttributeColumn( "Name", 0 )] + [CIDBAttributeColumn( "Value", 1 )] + public class CIMemoryInfo : CIElement + { + #region Type + public enum TType + { + [Description( "Drive" )] + ETypeDrive = 0, + + [Description( "RAM" )] + ETypeRAM + } + #endregion + + #region Constructors + public CIMemoryInfo( CIContainer aContainer ) + : base( aContainer ) + { + } + #endregion + + #region API + #endregion + + #region Properties + public int DriveNumber + { + get { return iDriveNumber; } + set { iDriveNumber = value; } + } + + public string DriveLetter + { + get + { + int driveLetterCharNumber = ( (int) 'A' ) + DriveNumber; + char driveLetter = (char) driveLetterCharNumber; + // + return string.Format( "{0}:", driveLetter ); + } + } + + public ulong Capacity + { + get { return iCapacity; } + set { iCapacity = value; } + } + + public ulong Free + { + get { return iFree; } + set { iFree = value; } + } + + public ulong UID + { + get { return iUID; } + set { iUID = value; } + } + + public string VolumeName + { + get { return iVolumeName; } + set { iVolumeName = value; } + } + + public string Vendor + { + get { return iVendor; } + set { iVendor = value; } + } + + public TType Type + { + get { return iType; } + set { iType = value; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + string ret = SymbianUtils.Enum.EnumUtils.ToString( Type ); + if ( Type == TType.ETypeDrive ) + { + ret = DriveLetter; + } + return ret; + } + #endregion + + #region From CIElement + public override void PrepareRows() + { + DataBindingModel.ClearRows(); + + DataBindingModel.Add( new CIDBRow( new CIDBCell( "Type" ), new CIDBCell( SymbianUtils.Enum.EnumUtils.ToString( this.Type ) ) ) ); + + if ( Type == TType.ETypeDrive ) + { + DataBindingModel.Add( new CIDBRow( new CIDBCell( "Drive Letter" ), new CIDBCell( DriveLetter ) ) ); + if ( VolumeName.Length > 0 ) + { + DataBindingModel.Add( new CIDBRow( new CIDBCell( "Volume" ), new CIDBCell( VolumeName ) ) ); + } + if ( Vendor.Length > 0 ) + { + DataBindingModel.Add( new CIDBRow( new CIDBCell( "Vendor" ), new CIDBCell( Vendor ) ) ); + } + if ( UID != 0 ) + { + DataBindingModel.Add( new CIDBRow( new CIDBCell( "UID" ), new CIDBCell( UID.ToString() ) ) ); + } + } + + DataBindingModel.Add( new CIDBRow( new CIDBCell( "Free" ), new CIDBCell( Free.ToString() ) ) ); + if ( Capacity != 0 ) + { + DataBindingModel.Add( new CIDBRow( new CIDBCell( "Capacity" ), new CIDBCell( Capacity.ToString() ) ) ); + } + } + #endregion + + #region Data members + private int iDriveNumber = 0; + private ulong iCapacity = 0; + private ulong iFree = 0; + private ulong iUID = 0; + private string iVolumeName = string.Empty; + private string iVendor = string.Empty; + private TType iType = TType.ETypeDrive; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Memory/CIMemoryInfoCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Memory/CIMemoryInfoCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using SymbianStructuresLib.Uids; + +namespace CrashItemLib.Crash.Memory +{ + public class CIMemoryInfoCollection : CIElement, IEnumerable + { + #region Constructors + public CIMemoryInfoCollection( CIContainer aContainer ) + : base( aContainer, TAutoPopulateType.EAutoPopulateEnabled ) + { + } + #endregion + + #region API + public override void AddChild( CIElement aChild ) + { + if ( aChild.GetType() != typeof( CIMemoryInfo ) ) + { + throw new ArgumentException( "Child must be a CIMemoryInfo" ); + } + + base.AddChild( aChild ); + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( CIElement element in base.Children ) + { + if ( element is CIMemoryInfo ) + { + CIMemoryInfo ret = (CIMemoryInfo) element; + yield return ret; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIElement element in base.Children ) + { + if ( element is CIMemoryInfo ) + { + CIMemoryInfo ret = (CIMemoryInfo) element; + yield return ret; + } + } + } + #endregion + + #region Data members + private List iEntries = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Messages/CIMessage.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Messages/CIMessage.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,264 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Drawing; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Container; +using System.ComponentModel; +using SymbianUtils.Range; +using SymbianStructuresLib.Uids; +using SymbianUtils.DataBuffer; + +namespace CrashItemLib.Crash.Messages +{ + [CIDBAttributeColumn( "Type", 0 )] + [CIDBAttributeColumn( "Overview", 1, true )] + public class CIMessage : CIElement, IEnumerable + { + #region Enumerations + public enum TType + { + [Description( "Warning" )] + ETypeWarning = 0, + + [Description( "Error" )] + ETypeError, + + [Description( "Message" )] + ETypeMessage, + + [Description( "Other" )] + ETypeOther + } + #endregion + + #region Static constructors + public static CIMessage NewMessage( CIContainer aContainer ) + { + CIMessage ret = new CIMessage( aContainer ); + ret.Type = TType.ETypeMessage; + return ret; + } + + internal static CIMessage Null( CIContainer aContainer ) + { + CIMessage ret = new CIMessage( aContainer ); + ret.Type = TType.ETypeOther; + return ret; + } + #endregion + + #region Constructors + protected CIMessage( CIContainer aContainer ) + : this( aContainer, string.Empty ) + { + } + + protected CIMessage( CIContainer aContainer, string aTitle ) + : base( aContainer ) + { + iTitle = aTitle; + } + #endregion + + #region API + public override void Clear() + { + base.Clear(); + iLines.Clear(); + } + + public void SetLine( string aLine ) + { + iLines.Clear(); + iLines.Add( aLine ); + } + + public void SetLineFormatted( string aFormat, params object[] aArgs ) + { + string line = string.Format( aFormat, aArgs ); + SetLine( line ); + } + + public void AddLine( string aLine ) + { + using ( StringReader reader = new StringReader( aLine ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + iLines.Add( line ); + line = reader.ReadLine(); + } + } + } + + public void AddLineFormatted( string aFormat, params object[] aArgs ) + { + string line = string.Format( aFormat, aArgs ); + AddLine( line ); + } + + public static string TypeToString( TType aType ) + { + return SymbianUtils.Enum.EnumUtils.ToString( aType ); + } + #endregion + + #region Properties + public override string Name + { + get { return Title; } + set { Title = value; } + } + + [Base.DataBinding.CIDBAttributeCell( "Title", 1 )] + public string Title + { + get { return iTitle; } + set { iTitle = value; } + } + + public string Description + { + get { return ToString(); } + set + { + List lines = new List(); + // + using ( StringReader reader = new StringReader( value ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + lines.Add( line ); + line = reader.ReadLine(); + } + } + // + iLines = lines; + } + } + + public string FullText + { + get + { + StringBuilder ret = new StringBuilder(); + // + ret.AppendLine( Title ); + ret.Append( System.Environment.NewLine ); + ret.Append( Description ); + // + return ret.ToString(); + } + } + + public TType Type + { + get { return iType; } + protected set { iType = value; } + } + + [Base.DataBinding.CIDBAttributeCell( "Type", 0 )] + public string TypeName + { + get { return TypeToString( Type ); } + } + + public virtual Font Font + { + get { return iFont; } + set { iFont = value; } + } + + public virtual Color Color + { + get { return iColor; } + set { iColor = value; } + } + + public int LineCount + { + get { return iLines.Count; } + } + #endregion + + #region Operators + public static implicit operator CIDBRow( CIMessage aMessage ) + { + CIDBRow row = new CIDBRow(); + + // To ensure that the register and cells are correctly associated + row.Element = aMessage; + + row.Add( new CIDBCell( aMessage.TypeName ) ); + row.Add( new CIDBCell( aMessage.Title ) ); + // + return row; + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + for ( int i = 0; i < iLines.Count; i++ ) + { + ret.Append( iLines[ i ].Trim() ); + ret.Append( " " ); + } + return ret.ToString(); + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( string s in iLines ) + { + yield return s; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( string s in iLines ) + { + yield return s; + } + } + #endregion + + #region Data members + private TType iType = TType.ETypeWarning; + private Font iFont = new Font( "Tahoma", 8.25f ); + private Color iColor = Color.Black; + private string iTitle = string.Empty; + private List iLines = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Messages/CIMessageDictionary.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Messages/CIMessageDictionary.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Container; +using SymbianStructuresLib.Uids; + +namespace CrashItemLib.Crash.Messages +{ + #region Attributes + [CIDBAttributeColumn( "Type", 0 )] + [CIDBAttributeColumn( "Overview", 1, true )] + #endregion + public class CIMessageDictionary : CIElementList + { + #region Constructors + [CIElementAttributeMandatory()] + public CIMessageDictionary( CIContainer aContainer ) + : base( aContainer ) + { + base.AddSupportedChildType( typeof( CrashItemLib.Crash.Messages.CIMessage ) ); + } + + internal CIMessageDictionary( CIElementList aList ) + : this( aList.Container ) + { + base.AddRange( aList.ToArray() ); + } + #endregion + + #region API + public void AddRange( CIMessageDictionary aFrom ) + { + foreach ( CIMessage msg in aFrom ) + { + if ( !this.Contains( msg ) ) + { + base.Add( msg ); + } + } + } + #endregion + + #region Properties + #endregion + + #region From CIElement + internal override void OnFinalize( CIElementFinalizationParameters aParams ) + { + base.OnFinalize( aParams ); + // + BuildIndex(); + } + + public override void PrepareRows() + { + DataBindingModel.ClearRows(); + + // Our data binding model is based upon the object, rather + // than any key-value-pair properties. + foreach ( CIMessage msg in this ) + { + DataBindingModel.Add( msg ); + } + } + #endregion + + #region Internal methods + private void BuildIndex() + { + CIElementList messages = Container.ChildrenByType( TChildSearchType.EEntireHierarchy ); + foreach ( CIMessage message in messages ) + { + if ( !base.Contains( message.Id ) ) + { + base.Add( message ); + } + } + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Messages/CIMessageError.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Messages/CIMessageError.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Container; +using SymbianUtils.Range; +using SymbianStructuresLib.Uids; +using SymbianUtils.DataBuffer; + +namespace CrashItemLib.Crash.Messages +{ + public class CIMessageError : CIMessage + { + #region Constructors + public CIMessageError( CIContainer aContainer ) + : this( aContainer, string.Empty ) + { + } + + public CIMessageError( CIContainer aContainer, string aTitle ) + : base( aContainer, aTitle ) + { + Type = TType.ETypeError; + Color = System.Drawing.Color.Red; + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region From CIMessage + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Messages/CIMessageWarning.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Messages/CIMessageWarning.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Container; +using SymbianUtils.Range; +using SymbianStructuresLib.Uids; +using SymbianUtils.DataBuffer; + +namespace CrashItemLib.Crash.Messages +{ + public class CIMessageWarning : CIMessage + { + #region Constructors + public CIMessageWarning( CIContainer aContainer ) + : this( aContainer, string.Empty ) + { + } + + public CIMessageWarning( CIContainer aContainer, string aTitle ) + : base( aContainer, aTitle ) + { + Type = TType.ETypeWarning; + Color = System.Drawing.Color.DarkBlue; + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Processes/CIProcess.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Processes/CIProcess.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,416 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Common.FileName; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.CodeSegs; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Summarisable; + +namespace CrashItemLib.Crash.Processes +{ + #region Attributes + [CIDBAttributeColumn( "Name", 0 )] + [CIDBAttributeColumn( "Value", 1, true )] + #endregion + public class CIProcess : CIElement, ICISymbolManager + { + #region Constructors + public CIProcess( CIContainer aContainer ) + : base( aContainer ) + { + base.AddChild( new CISymbolDictionary( aContainer ) ); + } + #endregion + + #region API + public CIThread CreateThread() + { + CIThread ret = new CIThread( this ); + base.AddChild( ret ); + return ret; + } + + public CICodeSeg CreateCodeSeg( string aName, uint aBase, uint aLimit ) + { + CICodeSeg ret = CreateCodeSeg( aName, aBase, aLimit, true ); + return ret; + } + #endregion + + #region Properties + [CIDBAttributeCell( "UIDs", 5 )] + public UidType Uids + { + get { return iUids; } + } + + [CIDBAttributeCell( "Generation", 3 )] + public int Generation + { + get { return iGeneration; } + set { iGeneration = value; } + } + + [CIDBAttributeCell( "Priority", 4, 0 )] + public int Priority + { + get { return iPriority; } + set { iPriority = value; } + } + + [CIDBAttributeCell( "SID", 2, "x8", 0u )] + public uint SID + { + get + { + uint ret = iSID; + // + if ( ret == 0 && iUids.MostSignificant != 0 ) + { + ret = iUids.MostSignificant; + } + // + return ret; + } + set + { + iSID = value; + + // Keep UID3 in line with SID + if ( Uids[ 2 ] != value ) + { + Uids[ 2 ] = value; + } + } + } + + [CIDBAttributeCell( "Name", 1 )] + public override string Name + { + get { return iName; } + set + { + iName = value; + + // Make sure it ends in .exe + if ( !iName.ToLower().EndsWith( KProcessExtension ) ) + { + iName += KProcessExtension; + } + } + } + + public CICodeSegList CodeSegments + { + get + { + CIElementList codeSegs = base.ChildrenByType(); + + // Sort them + Comparison comparer = delegate( CICodeSeg aLeft, CICodeSeg aRight ) + { + return string.Compare( aLeft.Name, aRight.Name, true ); + }; + codeSegs.Sort( comparer ); + + CICodeSegList ret = new CICodeSegList( this, codeSegs ); + return ret; + } + } + + public CIThread[] Threads + { + get + { + CIElementList list = base.ChildrenByType(); + CIThread[] ret = list.ToArray(); + return ret; + } + } + + public CIThread[] ThreadsWhichExitedAbnormally + { + get + { + // We use an anonymous delegate (predicate in this case) to search through + // all the direct children of this object that have crashed. + CIElementList threads = base.ChildrenByType( + delegate(CIThread aThread ) + { + return aThread.IsAbnormalTermination; + } + ); + return threads.ToArray(); + } + } + + public CIThread PrimaryThread + { + get + { + CIThread ret = null; + // + CIElementList threads = this.ChildrenByType(); + if ( threads.Count == 1 ) + { + ret = threads[ 0 ]; + } + else + { + // Assumption: The main thread (at least in symbian OS) is the thread which has + // the closest id to that of the process itself. + CIElementId minDelta = int.MaxValue; + foreach ( CIThread thread in this.GetEnumeratorThreads() ) + { + CIElementId delta = thread.Id - this.Id; + // + if ( delta < minDelta ) + { + ret = thread; + } + if ( delta == 1 ) + { + // Optimisation + break; + } + } + } + // + return ret; + } + } + + public CIThread FirstCrashedThread + { + get + { + CIThread ret = null; + + // Try the primary thread first + CIThread primary = PrimaryThread; + if ( primary != null && primary.IsAbnormalTermination ) + { + ret = primary; + } + else + { + // The primary summary is the first summary we can locate + // that relates to a crash. + foreach ( CIThread thread in this.GetEnumeratorThreads() ) + { + bool isCrash = thread.IsAbnormalTermination; + if ( isCrash ) + { + // Try to find corresponding summarisable entry + ret = thread; + break; + } + } + } + // + return ret; + } + } + + public CISymbolDictionary Symbols + { + get { return base.ChildByType( typeof( CISymbolDictionary ) ) as CISymbolDictionary; } + } + + public bool IsAbnormalTermination + { + get + { + bool ret = false; + // + foreach ( CIThread thread in this.GetEnumeratorThreads() ) + { + if ( thread.IsAbnormalTermination ) + { + ret = true; + break; + } + } + // + return ret; + } + } + #endregion + + #region Enumerators + public IEnumerable GetEnumeratorThreads() + { + return Threads; + } + + public IEnumerable GetEnumeratorCodeSegs() + { + return CodeSegments; + } + #endregion + + #region Internal constants + private const string KProcessExtension = ".exe"; + private const string KUnknownProcessName = "UnknownProcess.exe"; + private const int KBaseOperationMultiplier = 5; + #endregion + + #region Internal methods + private CICodeSeg CreateCodeSeg( string aName, uint aBase, uint aLimit, bool aExplict ) + { + CICodeSeg ret = new CICodeSeg( this ); + ret.Name = aName; + ret.Base = aBase; + ret.Limit = aLimit; + ret.IsExplicit = aExplict; + + // Primary store is the child nodes + base.AddChild( ret ); + + base.Trace( "[CIProcess] CreateCodeSeg() - this: {0}, ret: {1}", this, ret ); + return ret; + } + + private void EnsureCodeSegmentExistsForSymbol( CIElementFinalizationParameters aParams, CISymbol aSymbol ) + { + if ( !aSymbol.IsNull ) + { + Symbol symbol = aSymbol; + SymbolCollection collection = symbol.Collection; + // + string binaryInDevice = PlatformFileNameConstants.Device.KPathWildcardSysBin; + binaryInDevice += Path.GetFileName( collection.FileName.EitherFullNameButDevicePreferred ); + // + CICodeSegList codeSegs = CodeSegments; + bool alreadyExists = codeSegs.Contains( binaryInDevice ); + if ( !alreadyExists ) + { + // Assume no match found - create implicit/speculative code segment + AddressRange newCodeSegRange = collection.SubsumedPrimaryRange; + CICodeSeg newCodeSeg = CreateCodeSeg( binaryInDevice, newCodeSegRange.Min, newCodeSegRange.Max, false ); + + base.Trace( "[CIProcess] EnsureCodeSegmentExistsForSymbol() - creating implicitly identified code seg: " + newCodeSeg.ToString() + " for symbol: " + aSymbol.ToString() ); + + // Resolve it + newCodeSeg.Resolve( aParams.DebugEngineView ); + } + } + } + + private void DiscardImplicitCodeSegments() + { + // Go through each child and see if it's a code seg. If it is, and if + // it is implicit, throw it away + int childCount = base.Count; + for( int i=childCount-1; i>=0; i-- ) + { + CIElement element = base[ i ]; + if ( element is CICodeSeg ) + { + CICodeSeg cs = (CICodeSeg) element; + // + if ( !cs.IsExplicit ) + { + base.Trace( string.Format( "[CIProcess] DiscardImplicitCodeSegments() - dicarded: {0}", cs ) ); + base.RemoveChild( cs ); + } + } + } + } + + private void CreateImplicitCodeSegments( CIElementFinalizationParameters aParams ) + { + CIElementList children = base.ChildrenByType( TChildSearchType.EEntireHierarchy ); + base.Trace( string.Format( "[CIProcess] CreateImplicitCodeSegments() - children count: {1}, {0}", this, children.Count ) ); + // + foreach ( CISymbol symbol in children ) + { + EnsureCodeSegmentExistsForSymbol( aParams, symbol ); + } + } + #endregion + + #region From CIElement + internal override void DoFinalize( CIElementFinalizationParameters aParams, Queue aCallBackLast, bool aForceFinalize ) + { + base.Trace( string.Format( "[CIProcess] DoFinalize() - START - {0}", this ) ); + + // The process' children need to use a process-relative debug engine view in order that they + // can correctly resolve any RAM-loaded code. + // Therefore, rather than use the so-called "global" debug engine view (which only has + // XIP visibility) we create a process-specific set of finalization parameters (for use with + // the process' children) which contain a process-relative view of the world. + using ( CIElementFinalizationParameters processRelativeParameters = new CIElementFinalizationParameters( aParams.Engine, this.Name, this.CodeSegments ) ) + { + // Discard any implicit code segments. These are created automagically when an XIP symbol + // is found. We'll re-create them anyway in a moment after the symbols have been updated. + base.Trace( string.Format( "[CIProcess] DoFinalize() - discarding implicit XIP CodeSegs... - {0}", this ) ); + DiscardImplicitCodeSegments(); + base.Trace( string.Format( "[CIProcess] DoFinalize() - discarded implicit XIP CodeSegs - {0}", this ) ); + + // Tell our children + base.DoFinalize( processRelativeParameters, aCallBackLast, aForceFinalize ); + + // Finally, re-create implicit XIP codesegments + base.Trace( string.Format( "[CIProcess] DoFinalize() - creating implicit XIP CodeSegs... - {0}", this ) ); + CreateImplicitCodeSegments( aParams ); + base.Trace( string.Format( "[CIProcess] DoFinalize() - created implicit XIP CodeSegs - {0}", this ) ); + } + // + base.Trace( string.Format( "[CIProcess] DoFinalize() - END - {0}", this ) ); + } + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region From ICISymbolManager + public CISymbolDictionary SymbolDictionary + { + get { return this.Symbols; } + } + #endregion + + #region Data members + private uint iSID = 0; + private int iPriority = 0; + private int iGeneration = 1; + private UidType iUids = new UidType(); + private string iName = KUnknownProcessName; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/CIRegister.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/CIRegister.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianStructuresLib.Arm.Registers; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Processes; + +namespace CrashItemLib.Crash.Registers +{ + public class CIRegister : CIElement + { + #region Constructors + public CIRegister( CIRegisterList aList, TArmRegisterType aType, uint aValue ) + : this( aList, aType, ArmRegister.GetTypeName( aType ), aValue ) + { + } + + public CIRegister( CIRegisterList aList, TArmRegisterType aType, string aName, uint aValue ) + : base( aList.Container ) + { + iList = aList; + + // Create register and observe when it changes value + iRegister = new ArmRegister( aType, aName, aValue ); + iRegister.Tag = this; + + // Prepare non-resolved symbol. I.e. this saves the address + // but doesn't actually do any symbolic look up at this stage. + ICISymbolManager symbolManager = this.SymbolManager; + CISymbol symbol = symbolManager.SymbolDictionary.Register( iRegister.Value ); + base.AddChild( symbol ); + } + #endregion + + #region API + #endregion + + #region Properties + public override string Name + { + get { return TypeName; } + } + + public TArmRegisterType Type + { + get { return Register.RegType; } + } + + public TArmRegisterBank Bank + { + get { return iList.Bank; } + } + + public string TypeName + { + get { return Register.OriginalName; } + } + + public uint Value + { + get { return Register.Value; } + set + { + // Update register value and also symbol + iRegister.Value = value; + + // Refresh symbol registration + ICISymbolManager symbolManager = this.SymbolManager; + symbolManager.SymbolDictionary.RefreshRegistration( this, value, this.Symbol ); + } + } + + public ArmRegister Register + { + get { return iRegister; } + } + + public CISymbol Symbol + { + get { return base.ChildByType( typeof( CISymbol ) ) as CISymbol; } + } + + public CIThread OwningThread + { + get + { + CIThread ret = null; + // + if ( iList.OwningThread != null ) + { + ret = iList.OwningThread; + } + // + return ret; + } + } + + public CIProcess OwningProcess + { + get + { + CIProcess ret = null; + // + if ( OwningThread != null ) + { + ret = OwningThread.OwningProcess; + } + // + return ret; + } + } + + internal ICISymbolManager SymbolManager + { + get + { + ICISymbolManager ret = base.Container; + // + CIProcess process = this.OwningProcess; + if ( process != null ) + { + ret = process; + } + // + return ret; + } + } + #endregion + + #region Operators + public static implicit operator ArmRegister( CIRegister aRegister ) + { + return aRegister.Register; + } + + public static implicit operator uint( CIRegister aRegister ) + { + return aRegister.Register.Value; + } + + public static implicit operator CIDBRow( CIRegister aRegister ) + { + CIDBRow row = new CIDBRow(); + + // To ensure that the register and cells are correctly associated + row.Element = aRegister; + + row.Add( new CIDBCell( aRegister.TypeName ) ); + row.Add( new CIDBCell( aRegister.Value.ToString("x8") ) ); + row.Add( new CIDBCell( aRegister.Symbol.Name ) ); + // + return row; + } + #endregion + + #region From System.Object + public override string ToString() + { + return iRegister.ToString(); + } + #endregion + + #region From CIElement + internal override void DoFinalize( CIElementFinalizationParameters aParams, Queue aCallBackLast, bool aForceFinalize ) + { + base.DoFinalize( aParams, aCallBackLast, aForceFinalize ); + } + #endregion + + #region Data members + private readonly CIRegisterList iList; + private readonly ArmRegister iRegister; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/CIRegisterList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/CIRegisterList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,305 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Processes; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashItemLib.Crash.Registers +{ + #region Attributes + [CIDBAttributeColumn( "Name", 0 )] + [CIDBAttributeColumn( "Value", 1 )] + [CIDBAttributeColumn( "Symbol", 2, true )] + #endregion + public class CIRegisterList : CIElement, IARCBackingStore, IEnumerable + { + #region Constructors + public CIRegisterList( CIContainer aContainer, TArmRegisterBank aBank ) + : base( aContainer ) + { + iCollection = new ArmRegisterCollection( aBank ); + iCollection.Tag = this; + iCollection.BackingStore = this; + + // Restrict children + base.AddSupportedChildType( typeof( CIRegister ) ); + base.AddSupportedChildType( typeof( CrashItemLib.Crash.Messages.CIMessage ) ); + } + + /// + /// Internal constructor called by CIRegisterListForThread which sets a thread up as a parent + /// of the register list. + /// + internal CIRegisterList( CIContainer aContainer, CIElement aParent, TArmRegisterBank aBank ) + : base( aContainer, aParent ) + { + iCollection = new ArmRegisterCollection( aBank ); + iCollection.Tag = this; + iCollection.BackingStore = this; + + // Restrict children + base.AddSupportedChildType( typeof( CIRegister ) ); + base.AddSupportedChildType( typeof( CrashItemLib.Crash.Messages.CIMessage ) ); + } + #endregion + + #region API + public CIRegister Add( TArmRegisterType aType, uint aValue ) + { + // Will cause a call back to create the entries in iRegisters... + ArmRegister entry = iCollection.Add( aType, aValue ); + // + System.Diagnostics.Debug.Assert( entry.Tag != null && entry.Tag is CIRegister ); + System.Diagnostics.Debug.Assert( iCollection.Count == base.Count ); + // + CIRegister ret = (CIRegister) entry.Tag; + return ret; + } + + public void Add( ArmRegisterCollection aArmRegisterCollection ) + { + // Will cause a call back to create the entries in iRegisters... + iCollection.Copy( aArmRegisterCollection ); + System.Diagnostics.Debug.Assert( iCollection.Count == base.Count ); + } + + public bool Contains( TArmRegisterType aType ) + { + System.Diagnostics.Debug.Assert( iCollection.Count == base.Count ); + return iCollection.Contains( aType ); + } + + public void Remove( TArmRegisterType aType ) + { + iCollection.Remove( aType ); + } + + public override void Clear() + { + // This calls IARCBackingStore.ARCBSClear(), which in turn calls base.Clear(). + iCollection.Clear(); + } + #endregion + + #region Properties + public override int Count + { + get + { + int ret = base.Count; + System.Diagnostics.Debug.Assert( iCollection.Count == ret ); + return iCollection.Count; + } + } + + public bool IsCurrentProcessorMode + { + get + { + bool ret = false; + // + if ( Contains( TArmRegisterType.EArmReg_CPSR ) ) + { + CIRegister cpsr = this[ TArmRegisterType.EArmReg_CPSR ]; + TArmRegisterBank currentBank = ArmRegisterBankUtils.ExtractBank( cpsr.Value ); + // + ret = ( currentBank == Bank ); + } + // + return ret; + } + } + + public override string Name + { + get { return BankName; } + } + + public TArmRegisterBank Bank + { + get { return iCollection.Bank; } + } + + public string BankName + { + get { return ArmRegisterBankUtils.BankAsStringLong( Bank ); } + } + + public string BankAbbreviation + { + get { return ArmRegisterBankUtils.BankAsString( Bank ); } + } + + public CIThread OwningThread + { + get + { + CIThread ret = base.Parent as CIThread; + return ret; + } + } + + public CIProcess OwningProcess + { + get + { + CIProcess ret = null; + // + if ( OwningThread != null ) + { + ret = OwningThread.OwningProcess; + } + // + return ret; + } + } + + public CIRegister[] Registers + { + get + { + CIElementList registers = base.ChildrenByType(); + return registers.ToArray(); + } + } + + public CIRegister this[ TArmRegisterType aType ] + { + get + { + System.Diagnostics.Debug.Assert( iCollection.Count == base.Count ); + ArmRegister reg = iCollection[ aType ]; + System.Diagnostics.Debug.Assert( reg.Tag != null && reg.Tag is CIRegister ); + CIRegister ret = (CIRegister) reg.Tag; + return ret; + } + } + + public CIRegister this[ string aName ] + { + get + { + System.Diagnostics.Debug.Assert( iCollection.Count == base.Count ); + ArmRegister reg = iCollection[ aName ]; + CIRegister ret = (CIRegister) reg.Tag; + return ret; + } + } + #endregion + + #region Operators + public static implicit operator ArmRegisterCollection( CIRegisterList aSelf ) + { + return aSelf.Collection; + } + #endregion + + #region Internal methods + internal ArmRegisterCollection Collection + { + get { return iCollection; } + } + #endregion + + #region IARCBackingStore Members + void IARCBackingStore.ARCBSClear() + { + base.Clear(); + } + + ArmRegister IARCBackingStore.ARCBSCreate( TArmRegisterType aType, string aName, uint aValue ) + { + // Go via factory to deal with special registers... + CIRegister reg = Factory.CIRegisterFactory.New( aType, aValue, aName, this ); + base.AddChild( reg ); + + // Set up two-way association + ArmRegister ret = reg.Register; + ret.Tag = reg; + return ret; + } + + void IARCBackingStore.ARCBSRemove( ArmRegister aRegister ) + { + CIRegister reg = aRegister.Tag as CIRegister; + if ( reg != null ) + { + base.RemoveChild( reg ); + } + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( CIElement element in base.Children ) + { + if ( element is CIRegister ) + { + CIRegister reg = (CIRegister) element; + yield return reg; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIElement element in base.Children ) + { + if ( element is CIRegister ) + { + CIRegister reg = (CIRegister) element; + yield return reg; + } + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return ArmRegisterBankUtils.BankAsString( Bank ); + } + #endregion + + #region From CIElement + public override void PrepareRows() + { + DataBindingModel.ClearRows(); + + // Our data binding model is based upon the register object, rather + // than any key-value-pair properties. + foreach ( CIRegister reg in this ) + { + DataBindingModel.Add( reg ); + } + } + #endregion + + #region Data members + private readonly ArmRegisterCollection iCollection; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/CIRegisterListCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/CIRegisterListCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.ExitInfo; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Registers; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashItemLib.Crash.Registers +{ + public class CIRegisterListCollection : CIElement, IEnumerable + { + #region Constructors + [CIElementAttributeMandatory()] + public CIRegisterListCollection( CIContainer aContainer ) + : this( aContainer, null ) + { + } + + internal CIRegisterListCollection( CIContainer aContainer, CIElement aParent ) + : base( aContainer, aParent ) + { + } + #endregion + + #region API + public void Add( TArmRegisterBank aType ) + { + this[ aType ] = new CIRegisterList( Container, aType ); + } + + public void Add( CIRegisterList aCollection ) + { + // Make sure the dictionary doesn't already contain this bank type! + bool exists = Contains( aCollection.Bank ); + if ( exists ) + { + throw new Exception( aCollection.BankName + " already exists within collection" ); + } + else + { + iRegisters.Add( aCollection.Bank, aCollection ); + + // Register as child also + base.AddChild( aCollection ); + } + } + + public void Add( params TArmRegisterBank[] aTypes ) + { + foreach ( TArmRegisterBank type in aTypes ) + { + Add( type ); + } + } + + public bool Contains( TArmRegisterBank aType ) + { + return iRegisters.ContainsKey( aType ); + } + + public override void Clear() + { + iRegisters.Clear(); + base.Clear(); + } + #endregion + + #region Properties + public virtual uint CPSR + { + get + { + uint ret = 0; + // + CIRegisterList list = CurrentProcessorModeRegisters; + if ( list != null ) + { + ret = list[ TArmRegisterType.EArmReg_CPSR ].Value; + } + else + { + // CPSR is not yet defined + } + // + return ret; + } + set + { + TArmRegisterBank bank = ArmRegisterBankUtils.ExtractBank( value ); + + // Remove CPSR from current register list + CIRegisterList list = CurrentProcessorModeRegisters; + if ( list != null ) + { + list.Remove( TArmRegisterType.EArmReg_CPSR ); + } + + // Now we can add it without fear of creating a duplicate + CIRegisterList cpsrRegList = this[ bank ]; + if ( cpsrRegList != null ) + { + cpsrRegList.Add( TArmRegisterType.EArmReg_CPSR, value ); + } + } + } + + public virtual CIRegisterList CurrentProcessorModeRegisters + { + get + { + // Try to find the bank that contains CPSR (if any) and + // return that. + CIRegisterList ret = null; + // + foreach ( CIRegisterList col in this ) + { + if ( col.Contains( TArmRegisterType.EArmReg_CPSR ) ) + { + // Get CPSR value + ArmRegister cpsr = col[ TArmRegisterType.EArmReg_CPSR ]; + TArmRegisterBank cpsrBank = ArmRegisterBankUtils.ExtractBank( cpsr ); + + // Try to get the corresponding bank (should be the same as col...) + if ( Contains( cpsrBank ) ) + { + CIRegisterList list = this[ cpsrBank ]; + System.Diagnostics.Debug.Assert( list is CIRegisterList ); + ret = (CIRegisterList) list; + } + break; + } + } + // + return ret; + } + } + + public CIRegisterList this[ TArmRegisterBank aType ] + { + get { return iRegisters[ aType ]; } + set + { + if ( iRegisters.ContainsKey( aType ) ) + { + iRegisters[ aType ] = value; + } + else + { + Add( value ); + } + } + } + #endregion + + #region Internal methods + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( KeyValuePair kvp in iRegisters ) + { + yield return kvp.Value; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair kvp in iRegisters ) + { + yield return kvp.Value; + } + } + #endregion + + #region Data members + private Dictionary iRegisters = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Factory/CIRegisterFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Factory/CIRegisterFactory.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Registers.Special; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashItemLib.Crash.Registers.Factory +{ + internal static class CIRegisterFactory + { + public static CIRegister New( TArmRegisterType aType, uint aValue, CIRegisterList aList ) + { + CIRegister ret = New( aType, aValue, ArmRegister.GetTypeName( aType ), aList ); + return ret; + } + + public static CIRegister New( TArmRegisterType aType, uint aValue, string aName, CIRegisterList aList ) + { + CIRegister ret = null; + // + switch ( aType ) + { + case TArmRegisterType.EArmReg_CPSR: + ret = new CIRegisterCPSR( aList, aValue ); + break; + case TArmRegisterType.EArmReg_FSR: + ret = new CIRegisterFSR( aList, aValue ); + break; + case TArmRegisterType.EArmReg_EXCCODE: + ret = new CIRegisterExcCode( aList, aValue ); + break; + default: + ret = new CIRegister( aList, aType, aName, aValue ); + break; + } + // + System.Diagnostics.Debug.Assert( ret.Type == aType ); + System.Diagnostics.Debug.Assert( ret.Value == aValue ); + System.Diagnostics.Debug.Assert( ret.Name == aName ); + // + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Special/CIRegisterCPSR.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Special/CIRegisterCPSR.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,296 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Threads; +using SymbianUtils.Range; +using SymbianStructuresLib.Arm.Registers; +using CrashItemLib.Crash.Registers.Visualization; +using CrashItemLib.Crash.Registers.Visualization.Bits; +using CrashItemLib.Crash.Registers.Visualization.Utilities; + +namespace CrashItemLib.Crash.Registers.Special +{ + public class CIRegisterCPSR : CIRegister, ICIRegisterVisualizerVisitor + { + #region Constructors + public CIRegisterCPSR( CIRegisterList aCollection, uint aValue ) + : base( aCollection, TArmRegisterType.EArmReg_CPSR, aValue ) + { + PrepareMessage(); + // + CIRegisterVisualization modeARMv5 = new CIRegisterVisualization( this, this, KVisMode_ARMv5 ); + this.AddChild( modeARMv5 ); + modeARMv5.Refresh(); + // + CIRegisterVisualization modeARMv6 = new CIRegisterVisualization( this, this, KVisMode_ARMv6 ); + this.AddChild( modeARMv6 ); + modeARMv6.Refresh(); + } + #endregion + + #region API + #endregion + + #region Properties + public TArmRegisterBank ProcessorMode + { + get + { + TArmRegisterBank bank = ArmRegisterBankUtils.ExtractBank( this.Value ); + return bank; + } + } + #endregion + + #region Internal constants + private const string KVisMode_ARMv5 = "CPSR (ARMv5)"; + private const string KVisMode_ARMv6 = "CPSR (ARMv6)"; + #endregion + + #region ICIRegisterVisualizerVisitor Members + void ICIRegisterVisualizerVisitor.Build( CIRegisterVisualization aVisualization ) + { + aVisualization.Clear(); + // + switch ( aVisualization.Description ) + { + default: + case KVisMode_ARMv5: + PrepareVisARMv5( aVisualization ); + break; + case KVisMode_ARMv6: + PrepareVisARMv6( aVisualization ); + break; + } + } + #endregion + + #region Internal constants + private const string KReserved = "Reserved"; + #endregion + + #region Internal methods + private void PrepareMessage() + { + CIMessage message = CIMessage.NewMessage( Container ); + message.Title = "Processor Mode"; + message.Description = string.Format( "CPSR (Current Processor Status Register) indicates that the processor was in [{0}] mode.", + ArmRegisterBankUtils.BankAsStringLong( ProcessorMode ) ); + base.AddChild( message ); + } + + private void PrepareVisARMv5( CIRegisterVisualization aVisualization ) + { + AddBits0To8( aVisualization, true ); + AddEndianness( aVisualization, true ); + + // These bits are always reserved - "########", "########", "111111##", "########" + AddReserved( aVisualization, 10, 15 ); + + // GE[3:0] bits - reserved in ARMv5 - "########", "####1111", "########", "########" + AddReserved( aVisualization, 16, 19 ); + + // These bits are always reserved - "########", "1111####", "########", "########" + AddReserved( aVisualization, 20, 23 ); + + // Jazelle bit + AddJazelle( aVisualization, true ); + + // These bits are always reserved - "#####11#", "########", "########", "########" + AddReserved( aVisualization, 25, 26 ); + + // Reserved bit - Q flag, ARMv5E only. Indicates "overflow and/or saturation has occurred..." + AddQFlag( aVisualization, true ); + + // Condition code flags + AddConditionCodeFlags( aVisualization ); + } + + private void PrepareVisARMv6( CIRegisterVisualization aVisualization ) + { + AddBits0To8( aVisualization, false ); + AddEndianness( aVisualization, false ); + + // These bits are always reserved - "########", "########", "111111##", "########" + AddReserved( aVisualization, 10, 15 ); + + // GE[3:0] bits - reserved in ARMv5 - "########", "####1111", "########", "########" + AddBitRange( aVisualization, 16, 19, "Greater than or Equal (SIMD)" ); + + // These bits are always reserved - "########", "1111####", "########", "########" + AddReserved( aVisualization, 20, 23 ); + + // Jazelle bit + AddJazelle( aVisualization, false ); + + // These bits are always reserved - "#####11#", "########", "########", "########" + AddReserved( aVisualization, 25, 26 ); + + // Reserved bit - Q flag, ARMv5E only. Indicates "overflow and/or saturation has occurred..." + AddQFlag( aVisualization, false ); + + // Condition code flags + AddConditionCodeFlags( aVisualization ); + } + + private void AddBits0To8( CIRegisterVisualization aVisualization, bool aIsIABitReserved ) + { + uint value = aVisualization.Register.Value; + + // Processor mode + CIRegisterVisBitRange rangeProcMode = new CIRegisterVisBitRange( Container, 0, 4, "Processor Mode" ); + rangeProcMode.Interpretation = ArmRegisterBankUtils.BankAsStringLong( ProcessorMode ); + rangeProcMode.ExtractBits( value, "########", "########", "########", "###11111" ); + aVisualization.AddChild( rangeProcMode ); + + // Thumb bit + CIRegisterVisBit thumbBit = CreateYesNoBit( aVisualization, 5, "########", "########", "########", "##1#####", false, "Thumb Mode", "T" ); + aVisualization.AddChild( thumbBit ); + + // FIQ, IRQ bits + CIRegisterVisBitGroup gpIRQs = new CIRegisterVisBitGroup( Container, "Interrupt Disabled Bits" ); + CIRegisterVisBit fiqBit = CreateYesNoBit( aVisualization, 6, "########", "########", "########", "#1######", false, "FIQ Disabled", "F" ); + gpIRQs.Add( fiqBit ); + CIRegisterVisBit irqBit = CreateYesNoBit( aVisualization, 7, "########", "########", "########", "1#######", false, "IRQ Disabled", "I" ); + gpIRQs.Add( irqBit ); + + // Imprecise Abort bit - reserved in non-ARMv5 + CIRegisterVisBit iaBit = CreateYesNoBit( aVisualization, 8, "########", "########", "#######1", "########", aIsIABitReserved, "Imprecise Aborts", "A" ); + gpIRQs.Add( iaBit ); + + aVisualization.AddChild( gpIRQs ); + } + + private void AddEndianness( CIRegisterVisualization aVisualization, bool aIsReserved ) + { + uint value = aVisualization.Register.Value; + + CIRegisterVisBit eBit = CreateBitValue( aVisualization, 9, "###1####", "########", "######1#", "########", aIsReserved, "Endianness", "Big", "Little", "B", "L" ); + aVisualization.AddChild( eBit ); + } + + private void AddJazelle( CIRegisterVisualization aVisualization, bool aIsReserved ) + { + CIRegisterVisBit bit = CreateYesNoBit( aVisualization, 24, "#######1", "########", "########", "########", aIsReserved, "Jazelle", "J" ); + aVisualization.AddChild( bit ); + } + + private void AddQFlag( CIRegisterVisualization aVisualization, bool aIsReserved ) + { + CIRegisterVisBit bit = CreateYesNoBit( aVisualization, 27, "####1###", "########", "########", "########", aIsReserved, "Q-Flag (DSP Saturation/Overflow)", "Q" ); + aVisualization.AddChild( bit ); + } + + private void AddConditionCodeFlags( CIRegisterVisualization aVisualization ) + { + uint value = aVisualization.Register.Value; + + CIRegisterVisBitGroup group = new CIRegisterVisBitGroup( Container ); + + CIRegisterVisBit oBit = CreateYesNoBit( aVisualization, 28, "###1####", "########", "########", "########", false, "Overflow (Condition Code)", "O" ); + group.Add( oBit ); + CIRegisterVisBit cBit = CreateYesNoBit( aVisualization, 29, "##1#####", "########", "########", "########", false, "Carry (Condition Code)", "C" ); + group.Add( cBit ); + CIRegisterVisBit zBit = CreateYesNoBit( aVisualization, 30, "#1######", "########", "########", "########", false, "Zero (Condition Code)", "Z" ); + group.Add( zBit ); + CIRegisterVisBit nBit = CreateYesNoBit( aVisualization, 31, "1#######", "########", "########", "########", false, "Negative (Condition Code)", "N" ); + group.Add( nBit ); + + aVisualization.AddChild( group ); + } + + private CIRegisterVisBitRange AddBitRange( CIRegisterVisualization aVisualization, uint aStart, uint aEnd, string aCategory ) + { + // Make the mask + AddressRange range = new AddressRange( aStart, aEnd ); + StringBuilder mask = new StringBuilder(); + mask.Append( string.Empty.PadLeft( 32, '#' ) ); + for ( int i=31; i>=0; i-- ) + { + if ( range.Contains( i ) ) + { + int index = 31 - i; + mask[ index ] = '1'; + } + } + + // Reserved + uint value = aVisualization.Register.Value; + + CIRegisterVisBitRange bitRange = new CIRegisterVisBitRange( Container, aStart, aEnd, aCategory ); + bitRange.ExtractBits( value, mask.ToString() ); + aVisualization.AddChild( bitRange ); + + return bitRange; + } + + private void AddReserved( CIRegisterVisualization aVisualization, uint aStart, uint aEnd ) + { + CIRegisterVisBitRange range = AddBitRange( aVisualization, aStart, aEnd, KReserved ); + range.IsReserved = true; + } + + private CIRegisterVisBit CreateBitValue( CIRegisterVisualization aVisualization, int aIndex, + string aMaskByte3, string aMaskByte2, string aMaskByte1, string aMaskByte0, + bool aReserved, string aCategory, string aInterpretationSet, string aInterpretationClear, string aBitSetCharacter ) + { + CIRegisterVisBit bit = CreateBitValue( aVisualization, aIndex, aMaskByte3, aMaskByte2, aMaskByte1, aMaskByte0, aReserved, aCategory,aInterpretationSet, aInterpretationClear, aBitSetCharacter, string.Empty ); + return bit; + } + + private CIRegisterVisBit CreateBitValue( CIRegisterVisualization aVisualization, int aIndex, + string aMaskByte3, string aMaskByte2, string aMaskByte1, string aMaskByte0, + bool aReserved, string aCategory, string aInterpretationSet, string aInterpretationClear, string aBitSetCharacter, string aBitClearCharacter ) + { + uint value = aVisualization.Register.Value; + // + CIRegisterVisBit bit = new CIRegisterVisBit( Container, aIndex, VisUtilities.ExtractBit( value, aMaskByte3, aMaskByte2, aMaskByte1, aMaskByte0 ), aCategory, string.Empty ); + bit.IsReserved = aReserved; + bit[ TBit.EBitClear ] = aBitClearCharacter; + bit[ TBit.EBitSet ] = aBitSetCharacter; + // + switch ( bit.Value ) + { + case TBit.EBitSet: + bit.Interpretation = aInterpretationSet; + break; + default: + case TBit.EBitClear: + bit.Interpretation = aInterpretationClear; + break; + } + // + return bit; + } + + private CIRegisterVisBit CreateYesNoBit( CIRegisterVisualization aVisualization, int aIndex, string aMaskByte3, string aMaskByte2, string aMaskByte1, string aMaskByte0, bool aReserved, string aCategory, string aBitSetCharacter ) + { + CIRegisterVisBit bit = CreateBitValue( aVisualization, aIndex, aMaskByte3, aMaskByte2, aMaskByte1, aMaskByte0, aReserved, aCategory, "Yes", "No", aBitSetCharacter ); + return bit; + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Special/CIRegisterExcCode.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Special/CIRegisterExcCode.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,322 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Threads; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashItemLib.Crash.Registers.Special +{ + public class CIRegisterExcCode : CIRegister + { + #region Enumerations + public enum TExceptionCode + { + EExceptionCodeUnknown = -1, + + [Description( "EExcGeneral" )] + EExceptionCodeGeneral = 0, + + [Description( "EExcIntegerDivideByZero" )] + EExceptionCodeIntegerDivideByZero = 1, + + [Description( "EExcSingleStep" )] + EExceptionCodeSingleStep = 2, + + [Description( "EExcBreakPoint" )] + EExceptionCodeBreakPoint = 3, + + [Description( "EExcIntegerOverflow" )] + EExceptionCodeIntegerOverflow = 4, + + [Description( "EExcBoundsCheck" )] + EExceptionCodeBoundsCheck = 5, + + [Description( "EExcInvalidOpCode" )] + EExceptionCodeInvalidOpCode = 6, + + [Description( "EExcDoubleFault" )] + EExceptionCodeDoubleFault = 7, + + [Description( "EExcStackFault" )] + EExceptionCodeStackFault = 8, + + [Description( "EExcAccessViolation" )] + EExceptionCodeAccessViolation = 9, + + [Description( "EExcPrivInstruction" )] + EExceptionCodePrivInstruction = 10, + + [Description( "EExcAlignment" )] + EExceptionCodeAlignment = 11, + + [Description( "EExcPageFault" )] + EExceptionCodePageFault = 12, + + [Description( "EExcFloatDenormal" )] + EExceptionCodeFloatDenormal = 13, + + [Description( "EExcFloatDivideByZero" )] + EExceptionCodeFloatDivideByZero = 14, + + [Description( "EExcFloatInexactResult" )] + EExceptionCodeFloatInexactResult = 15, + + [Description( "EExcFloatInvalidOperation" )] + EExceptionCodeFloatInvalidOperation = 16, + + [Description( "EExcFloatOverflow" )] + EExceptionCodeFloatOverflow = 17, + + [Description( "EExcFloatStackCheck" )] + EExceptionCodeFloatStackCheck = 18, + + [Description( "EExcFloatUnderflow" )] + EExceptionCodeFloatUnderflow = 19, + + [Description( "EExcAbort" )] + EExceptionAbort = 20, + + [Description( "EExcKill" )] + EExceptionCodeKill = 21, + + [Description( "EExcUserInterrupt" )] + EExceptionCodeUserInterrupt = 22, + + [Description( "EExcDataAbort" )] + EExceptionCodeDataAbort = 23, + + [Description( "EExcCodeAbort" )] + EExceptionCodeAbort = 24, + + [Description( "EExcMaxNumber" )] + EExceptionCodeMaxNumber = 25, + + [Description( "EExcInvalidVector" )] + EExceptionCodeInvalidVector = 26, + // + EExceptionCodeLast = EExceptionCodeInvalidVector + } + #endregion + + #region Constructors + public CIRegisterExcCode( CIRegisterList aCollection, uint aValue ) + : base( aCollection, TArmRegisterType.EArmReg_EXCCODE, aValue ) + { + iDescription = CreateMessage(); + base.AddChild( iDescription ); + } + #endregion + + #region API + /// + /// D_EXC is only aware of 3 different exception types. + /// + /// 0 = prefetch abort + /// 1 = data abort + /// 2 = undefined instruction + /// + /// Symbian ELF Core dump does this mapping for us automatically. + /// + public void ExpandToFullExceptionRange() + { + switch ( (TBasicExceptionCode) Value ) + { + case TBasicExceptionCode.EBasicExceptionPrefechAbort: + iExcCode = TExceptionCode.EExceptionCodeAbort; + break; + case TBasicExceptionCode.EBasicExceptionDataAbort: + iExcCode = TExceptionCode.EExceptionCodeDataAbort; + break; + case TBasicExceptionCode.EBasicExceptionUndefinedInstruction: + iExcCode = TExceptionCode.EExceptionCodeInvalidOpCode; + break; + default: + break; + } + + // Prod back updated value to underlying register item + base.Value = (uint) iExcCode; + + // Re-prepare the message + UpdateMessage( iDescription ); + } + #endregion + + #region Properties + public TExceptionCode ExceptionCode + { + get + { + TExceptionCode ret = TExceptionCode.EExceptionCodeUnknown; + // + uint type = base.Value; + if ( type >= (uint) TExceptionCode.EExceptionCodeGeneral && type <= (uint) TExceptionCode.EExceptionCodeLast ) + { + ret = (TExceptionCode) type; + } + // + return ret; + } + } + + public string ExceptionCodeDescription + { + get + { + string type = "Unknown"; + // + switch ( iExcCode ) + { + default: + case TExceptionCode.EExceptionCodeUnknown: + break; + case TExceptionCode.EExceptionCodeGeneral: + type = "General Exception"; + break; + case TExceptionCode.EExceptionCodeIntegerDivideByZero: + type = "Integer Divide by Zero"; + break; + case TExceptionCode.EExceptionCodeSingleStep: + type = "Single Step"; + break; + case TExceptionCode.EExceptionCodeBreakPoint: + type = "Break Point"; + break; + case TExceptionCode.EExceptionCodeIntegerOverflow: + type = "Integer Overflow"; + break; + case TExceptionCode.EExceptionCodeBoundsCheck: + type = "Bounds Check"; + break; + case TExceptionCode.EExceptionCodeInvalidOpCode: + type = "Invalid Op. Code"; + break; + case TExceptionCode.EExceptionCodeDoubleFault: + type = "Double Fault"; + break; + case TExceptionCode.EExceptionCodeStackFault: + type = "Stack Fault"; + break; + case TExceptionCode.EExceptionCodeAccessViolation: + type = "Access Violation"; + break; + case TExceptionCode.EExceptionCodePrivInstruction: + type = "Priv. Instruction"; + break; + case TExceptionCode.EExceptionCodeAlignment: + type = "Alignment Fault"; + break; + case TExceptionCode.EExceptionCodePageFault: + type = "Page Fault"; + break; + case TExceptionCode.EExceptionCodeFloatDenormal: + type = "Float Denormal"; + break; + case TExceptionCode.EExceptionCodeFloatDivideByZero: + type = "Float Divide by Zero"; + break; + case TExceptionCode.EExceptionCodeFloatInexactResult: + type = "Inexact Float Result"; + break; + case TExceptionCode.EExceptionCodeFloatInvalidOperation: + type = "Invalid Float Operation"; + break; + case TExceptionCode.EExceptionCodeFloatOverflow: + type = "Float Overflow"; + break; + case TExceptionCode.EExceptionCodeFloatStackCheck: + type = "Float Stack Check"; + break; + case TExceptionCode.EExceptionCodeFloatUnderflow: + type = "Float Underflow"; + break; + case TExceptionCode.EExceptionAbort: + type = "Abort"; + break; + case TExceptionCode.EExceptionCodeKill: + type = "Kill"; + break; + case TExceptionCode.EExceptionCodeUserInterrupt: + type = "User Interrupt"; + break; + case TExceptionCode.EExceptionCodeDataAbort: + type = "Data Abort"; + break; + case TExceptionCode.EExceptionCodeAbort: + type = "Code Abort"; + break; + case TExceptionCode.EExceptionCodeMaxNumber: + type = "Max Number"; + break; + case TExceptionCode.EExceptionCodeInvalidVector: + type = "Invalid Vector"; + break; + } + // + return type; + } + } + #endregion + + #region Operators + public static implicit operator TExceptionCode( CIRegisterExcCode aReg ) + { + return aReg.ExceptionCode; + } + #endregion + + #region Internal enumerations + private enum TBasicExceptionCode + { + EBasicExceptionPrefechAbort = 0, + EBasicExceptionDataAbort = 1, + EBasicExceptionUndefinedInstruction = 2 + } + #endregion + + #region Internal methods + private CIMessage CreateMessage() + { + CIMessage message = CIMessage.NewMessage( Container ); + // + UpdateMessage( message ); + // + return message; + } + + private void UpdateMessage( CIMessage aMessage ) + { + SymbianUtils.SymDebug.SymDebugger.Assert( aMessage != null ); + // + aMessage.Title = "Exception Code"; + aMessage.SetLineFormatted( "The Exception Code register indicates that the processor encountered an exception of type [{0}].", ExceptionCodeDescription ); + } + #endregion + + #region Data members + private readonly CIMessage iDescription; + private TExceptionCode iExcCode = TExceptionCode.EExceptionCodeUnknown; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Special/CIRegisterFSR.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Special/CIRegisterFSR.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Threads; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashItemLib.Crash.Registers.Special +{ + public class CIRegisterFSR : CIRegister + { + #region Enumerations + public enum TFaultType + { + EFaultTypeUnknown = -1, + EFaultTypeVectorException = 00, + EFaultTypeAlignmentFault = 01, + EFaultTypeTerminalException = 02, + EFaultTypeAlignmentFault2 = 03, + EFaultTypeExternalAbortOnLinefetchForSectionTranslation = 04, + EFaultTypeSectionTranslationFault = 05, + EFaultTypeExternalAbortOnLineFetchForPageTranslation = 06, + EFaultTypePageTranslationFault = 07, + EFaultTypeExternalAbortOnNonLinefetchForSectionTranslation = 08, + EFaultTypeDomainFaultOnSectionTranslation = 09, + EFaultTypeExternalAbortOnNonLinefetchForPageTranslation = 10, + EFaultTypeDomainFaultOnPageTranslation = 11, + EFaultTypeExternalAbortOnFirstLevelTranslation = 12, + EFaultTypePermissionFaultOnSection = 13, + EFaultTypeExternalAbortOnSecondLevelTranslation = 14, + EFaultTypePermissionFaultOnPage = 15 + } + #endregion + + #region Constructors + public CIRegisterFSR( CIRegisterList aCollection, uint aValue ) + : base( aCollection, TArmRegisterType.EArmReg_FSR, aValue ) + { + PrepareMessage(); + } + #endregion + + #region API + #endregion + + #region Properties + public TFaultType FaultType + { + get + { + uint fsr = System.Convert.ToUInt32( base.Value ); + uint fsrMask = 0xF; // Look at first 4 bits + fsr = fsr & fsrMask; + // + TFaultType type = TFaultType.EFaultTypeUnknown; + if ( fsr >= 0 && fsr < (uint) TFaultType.EFaultTypePermissionFaultOnPage ) + { + type = (TFaultType) fsr; + } + // + return type; + } + } + + public string FaultDescription + { + get + { + string ret = "Unknown"; + // + switch ( FaultType ) + { + default: + case TFaultType.EFaultTypeUnknown: + break; + case TFaultType.EFaultTypeVectorException: + ret = "Vector exception"; + break; + case TFaultType.EFaultTypeAlignmentFault: + ret = "Alignment fault"; + break; + case TFaultType.EFaultTypeTerminalException: + ret = "Terminal exception"; + break; + case TFaultType.EFaultTypeAlignmentFault2: + ret = "Alignment fault"; + break; + case TFaultType.EFaultTypeExternalAbortOnLinefetchForSectionTranslation: + ret = "External abort on linefetch for section translation"; + break; + case TFaultType.EFaultTypeSectionTranslationFault: + ret = "Section translation fault (unmapped virtual address)"; + break; + case TFaultType.EFaultTypeExternalAbortOnLineFetchForPageTranslation: + ret = "External abort on linefetch for page translation"; + break; + case TFaultType.EFaultTypePageTranslationFault: + ret = "Page translation fault (unmapped virtual address)"; + break; + case TFaultType.EFaultTypeExternalAbortOnNonLinefetchForSectionTranslation: + ret = "External abort on non-linefetch for section translation"; + break; + case TFaultType.EFaultTypeDomainFaultOnSectionTranslation: + ret = "Domain fault on section translation (access to invalid domain)"; + break; + case TFaultType.EFaultTypeExternalAbortOnNonLinefetchForPageTranslation: + ret = "External abort on non-linefetch for page translation"; + break; + case TFaultType.EFaultTypeDomainFaultOnPageTranslation: + ret = "Domain fault on page translation (access to invalid domain)"; + break; + case TFaultType.EFaultTypeExternalAbortOnFirstLevelTranslation: + ret = "External abort on first level translation"; + break; + case TFaultType.EFaultTypePermissionFaultOnSection: + ret = "Permission fault on section (no permission to access virtual address)"; + break; + case TFaultType.EFaultTypeExternalAbortOnSecondLevelTranslation: + ret = "External abort on second level translation"; + break; + case TFaultType.EFaultTypePermissionFaultOnPage: + ret = "Permission fault on page (no permission to access virtual address)"; + break; + } + // + return ret; + } + } + #endregion + + #region Operators + public static implicit operator TFaultType( CIRegisterFSR aReg ) + { + return aReg.FaultType; + } + #endregion + + #region Internal methods + private void PrepareMessage() + { + CIMessage message = CIMessage.NewMessage( Container ); + // + message.Title = "Fault Status"; + message.AddLineFormatted( "The FSR (Fault Status Register) indicates that the processor encountered an fault of type [{0}].", FaultDescription ); + // + base.AddChild( message ); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/Bits/CIRegisterVisBit.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/Bits/CIRegisterVisBit.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,211 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Registers; + +namespace CrashItemLib.Crash.Registers.Visualization.Bits +{ + public class CIRegisterVisBit : CIElement + { + #region Constructors + public CIRegisterVisBit( CIContainer aContainer ) + : base( aContainer ) + { + } + + public CIRegisterVisBit( CIContainer aContainer, int aIndex, TBit aValue, string aCategory, string aInterpretation ) + : base( aContainer ) + { + Index = aIndex; + Value = aValue; + Category = aCategory; + Interpretation = aInterpretation; + } + #endregion + + #region Constants + public const string KReserved = "Reserved"; + #endregion + + #region API + #endregion + + #region Properties + public override string Name + { + get { return Category; } + set + { + Category = value; + } + } + + public string Category + { + get + { + // Return the "Reserved" category if we are reserved + if ( IsReserved ) + { + return KReserved; + } + + return iCategory; + } + set + { + iCategory = value; + } + } + + public int Index + { + get { return iIndex; } + set { iIndex = value; } + } + + public TBit Value + { + get { return iValue; } + set { iValue = value; } + } + + public string ValueString + { + get + { + switch ( Value ) + { + default: + case TBit.EBitClear: + return KBitClear; + case TBit.EBitSet: + return KBitSet; + } + } + } + + public string Interpretation + { + get + { + // Don't return any interpretation if the bit is reserved + if ( IsReserved ) + { + return string.Empty; + } + + return iInterpretation; + } + set { iInterpretation = value; } + } + + public bool IsReserved + { + get { return iIsReserved; } + set { iIsReserved = value; } + } + + public string ValueCharacter + { + get + { + if ( IsReserved ) + { + return KBitNotApplicable; + } + else + { + switch ( Value ) + { + case TBit.EBitSet: + return iValueCharacters[ 0 ]; + default: + case TBit.EBitClear: + return iValueCharacters[ 1 ]; + } + } + } + } + + public string this[ TBit aBit ] + { + get + { + switch( aBit ) + { + case TBit.EBitSet: + return iValueCharacters[ 0 ]; + default: + case TBit.EBitClear: + return iValueCharacters[ 1 ]; + } + } + set + { + string bitVal = value; + // + if ( bitVal.Length > 1 ) + { + throw new ArgumentException( "Bit value must be a maximum of one character" ); + } + // + switch ( aBit ) + { + case TBit.EBitSet: + iValueCharacters[ 0 ] = bitVal; + break; + default: + case TBit.EBitClear: + iValueCharacters[ 1 ] = bitVal; + break; + } + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + private const string KBitNotApplicable = "-"; + private const string KBitClear = "0"; + private const string KBitSet = "1"; + #endregion + + #region From System.Object + public override string ToString() + { + return ValueString; + } + #endregion + + #region Data members + private string iCategory = string.Empty; + private string iInterpretation = string.Empty; + private int iIndex = 0; + private TBit iValue = TBit.EBitClear; + private bool iIsReserved = false; + private string[] iValueCharacters = new string[] { "1", "" }; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/Bits/CIRegisterVisBitGroup.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/Bits/CIRegisterVisBitGroup.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Registers; +using SymbianUtils.Range; + +namespace CrashItemLib.Crash.Registers.Visualization.Bits +{ + public class CIRegisterVisBitGroup : CIRegisterVisBitList + { + #region Constructors + public CIRegisterVisBitGroup( CIContainer aContainer ) + : base( aContainer ) + { + } + + public CIRegisterVisBitGroup( CIContainer aContainer, string aCategory ) + : base( aContainer ) + { + base.Category = aCategory; + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/Bits/CIRegisterVisBitList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/Bits/CIRegisterVisBitList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,132 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Registers; +using SymbianUtils.Range; + +namespace CrashItemLib.Crash.Registers.Visualization.Bits +{ + public abstract class CIRegisterVisBitList : CIElementList + { + #region Constructors + protected CIRegisterVisBitList( CIContainer aContainer ) + : base( aContainer ) + { + } + #endregion + + #region API + public void AddBit( int aIndex, TBit aValue, string aCategory ) + { + AddBit( aIndex, aValue, aCategory, string.Empty ); + } + + public void AddBit( int aIndex, TBit aValue, string aCategory, string aInterpretation ) + { + CIRegisterVisBit bit = new CIRegisterVisBit( Container ); + bit.Index = aIndex; + bit.Value = aValue; + bit.Category = aCategory; + bit.Interpretation = aInterpretation; + // + Add( bit ); + } + + public new void Add( CIRegisterVisBit aBit ) + { + base.Add( aBit ); + } + #endregion + + #region Properties + public override string Name + { + get { return Category; } + set + { + Category = value; + } + } + + public string Category + { + get { return iCategory; } + set + { + iCategory = value; + } + } + + public AddressRange Range + { + get { return iRange; } + } + + public bool IsReserved + { + get { return iIsReserved; } + set { iIsReserved = value; } + } + + public string Interpretation + { + get + { + if ( IsReserved ) + { + return string.Empty; + } + + return iInterpretation; + } + set { iInterpretation = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + foreach ( CIRegisterVisBit bit in this ) + { + ret.Append( bit.ToString() ); + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private string iCategory = string.Empty; + private string iInterpretation = string.Empty; + private AddressRange iRange = new AddressRange(); + private bool iIsReserved = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/Bits/CIRegisterVisBitRange.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/Bits/CIRegisterVisBitRange.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Registers; +using SymbianUtils.Range; +using CrashItemLib.Crash.Registers.Visualization.Utilities; + +namespace CrashItemLib.Crash.Registers.Visualization.Bits +{ + public class CIRegisterVisBitRange : CIRegisterVisBitList + { + #region Constructors + public CIRegisterVisBitRange( CIContainer aContainer, uint aIndexMin, uint aIndexMax ) + : base( aContainer ) + { + base.Range.Set( aIndexMin, aIndexMax ); + } + + public CIRegisterVisBitRange( CIContainer aContainer, uint aIndexMin, uint aIndexMax, string aCategory ) + : this( aContainer, aIndexMin, aIndexMax ) + { + this.Category = aCategory; + } + + public CIRegisterVisBitRange( CIContainer aContainer, uint aIndexMin, uint aIndexMax, string aCategory, string aValues ) + : this( aContainer, aIndexMin, aIndexMax, aCategory ) + { + if ( aValues.Length != base.Range.Size ) + { + throw new ArgumentException( "Values are outside of range" ); + } + // + int index = (int) aIndexMax; + foreach ( char c in aValues ) + { + TBit value = TBit.EBitClear; + if ( c == VisUtilities.KBitIsSet ) + { + value = TBit.EBitSet; + } + else if ( c == VisUtilities.KBitIsClear ) + { + } + else + { + throw new ArgumentException( "Invalid bit value" ); + } + + base.AddBit( index, value, aCategory ); + --index; + } + } + #endregion + + #region API + public void ExtractBits( uint aExtractFrom, string aMask ) + { + foreach ( CIRegisterVisBit bit in VisUtilities.ExtractBits( Container, aExtractFrom, aMask ) ) + { + this.Add( bit ); + } + } + + public void ExtractBits( uint aExtractFrom, string aByte3Mask, string aByte2Mask, string aByte1Mask, string aByte0Mask ) + { + foreach ( CIRegisterVisBit bit in VisUtilities.ExtractBits( Container, aExtractFrom, aByte3Mask, aByte2Mask, aByte1Mask, aByte0Mask ) ) + { + this.Add( bit ); + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/CIRegisterVisualization.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/CIRegisterVisualization.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Registers.Visualization.Bits; +using CrashItemLib.Crash.Registers.Visualization.Utilities; + +namespace CrashItemLib.Crash.Registers.Visualization +{ + public class CIRegisterVisualization : CIElement + { + #region Constructors + public CIRegisterVisualization( CIRegister aRegister, ICIRegisterVisualizerVisitor aVisitor, string aDescription ) + : base( aRegister.Container, aRegister ) + { + iVisitor = aVisitor; + iRegister = aRegister; + iDescription = aDescription; + } + #endregion + + #region API + public void Refresh() + { + iVisitor.Build( this ); + } + #endregion + + #region Properties + public override string Name + { + get { return Description; } + set { } + } + + public string Description + { + get { return iDescription; } + } + + public string Binary + { + get { return VisUtilities.ToBinary( Value ); } + } + + public CIRegister Register + { + get { return iRegister; } + } + + public int Size + { + get { return KRegisterSizeInBits; } + } + + public uint Value + { + get { return Register.Value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + private const int KRegisterSizeInBits = 32; + #endregion + + #region From System.Object + public override string ToString() + { + return iRegister.ToString(); + } + #endregion + + #region Data members + private readonly CIRegister iRegister; + private readonly ICIRegisterVisualizerVisitor iVisitor; + private readonly string iDescription; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/ICIRegisterVisualizerVisitor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/ICIRegisterVisualizerVisitor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Registers.Visualization.Bits; + +namespace CrashItemLib.Crash.Registers.Visualization +{ + public interface ICIRegisterVisualizerVisitor + { + void Build( CIRegisterVisualization aVisualization ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/TBit.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/TBit.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Registers; + +namespace CrashItemLib.Crash.Registers.Visualization +{ + public enum TBit + { + EBitClear = 0, + EBitSet + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/Utilities/VisUtilities.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Registers/Visualization/Utilities/VisUtilities.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,214 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Registers.Visualization.Bits; + +namespace CrashItemLib.Crash.Registers.Visualization.Utilities +{ + public static class VisUtilities + { + public static IEnumerable ExtractBits( CIContainer aContainer, uint aValue, string aByte3Mask, string aByte2Mask, string aByte1Mask, string aByte0Mask ) + { + return ExtractBits( aContainer, aValue, aByte3Mask + aByte2Mask + aByte1Mask + aByte0Mask ); + } + + public static IEnumerable ExtractBits( CIContainer aContainer, uint aValue, string aMask ) + { + List ret = new List(); + // + int shift = 0; + int sigBitCount = 0; + uint mask = MakeMask( aMask, out shift, out sigBitCount ); + uint maskedValue = ( aValue & mask ) >> shift; + + // Now make bits + for ( int i = sigBitCount-1; i >= 0; i-- ) + { + mask = (uint) ( 1u << i ); + uint value = ( maskedValue & mask ) >> i; + + CIRegisterVisBit bit = new CIRegisterVisBit( aContainer ); + if ( value != 0 ) + { + bit.Value = TBit.EBitSet; + } + ret.Add( bit ); + } + + return ret.ToArray(); + } + + public static TBit ExtractBit( uint aValue, string aByte1Mask, string aByte0Mask ) + { + string b0 = EnsureByteMask( aByte0Mask ); + string b1 = EnsureByteMask( aByte1Mask ); + // + int shift; + uint mask = MakeMask( b1 + b0, out shift ); + // + uint value = aValue & mask; + value >>= shift; + // + if ( value == 1 ) + { + return TBit.EBitSet; + } + + return TBit.EBitClear; + } + + public static TBit ExtractBit( uint aValue, string aByte3Mask, string aByte2Mask, string aByte1Mask, string aByte0Mask ) + { + string b0 = EnsureByteMask( aByte0Mask ); + string b1 = EnsureByteMask( aByte1Mask ); + string b2 = EnsureByteMask( aByte2Mask ); + string b3 = EnsureByteMask( aByte3Mask ); + // + int shift; + uint mask = MakeMask( b3 + b2 + b1 + b0, out shift ); + // + uint value = aValue & mask; + value >>= shift; + // + if ( value == 1 ) + { + return TBit.EBitSet; + } + + return TBit.EBitClear; + } + + // [ aByte0 ] + public static uint MakeMask( string aByte ) + { + return MakeMask( string.Empty, string.Empty, string.Empty, aByte ); + } + + // [ aByte1 ] [ aByte0 ] + public static uint MakeMask( string aByte1, string aByte0 ) + { + return MakeMask( string.Empty, string.Empty, aByte1, aByte0 ); + } + + // [ aByte3 ] [ aByte2 ] [ aByte1 ] [ aByte0 ] + public static uint MakeMask( string aByte3, string aByte2, string aByte1, string aByte0 ) + { + int shift = 0; + return MakeMask( aByte3, aByte2, aByte1, aByte0, out shift ); + } + + public static uint MakeMask( string aByte3, string aByte2, string aByte1, string aByte0, out int aShiftAmount ) + { + string byteString3 = EnsureByteMask( aByte3 ); + string byteString2 = EnsureByteMask( aByte2 ); + string byteString1 = EnsureByteMask( aByte1 ); + string byteString0 = EnsureByteMask( aByte0 ); + string byteString = byteString3 + byteString2 + byteString1 + byteString0; + // + uint mask = MakeMask( byteString, out aShiftAmount ); + // + return mask; + } + + public static uint MakeMask( string aSpec, out int aShiftAmount ) + { + int sigBitCount = 0; + return MakeMask( aSpec, out aShiftAmount, out sigBitCount ); + } + + public static uint MakeMask( string aSpec, out int aShiftAmount, out int aSignificantBitCount ) + { + bool setFirstBitIndex = false; + aShiftAmount = 0; + aSignificantBitCount = 0; + uint mask = 0; + + // Loop through all characters in the mask, starting from the RHS, working + // towards the left hand side. + int count = aSpec.Length; + for ( int bit = 0; bit < count; bit++ ) + { + // Get a character from the string, starting at the RHS + char c = aSpec[ count - bit - 1 ]; + // + if ( c == KBitIsSet ) + { + mask |= (uint) ( 1u << bit ); + if ( !setFirstBitIndex ) + { + aShiftAmount = bit; + setFirstBitIndex = true; + } + ++aSignificantBitCount; + } + else if ( c == KBitIsClear ) + { + if ( !setFirstBitIndex ) + { + aShiftAmount = bit; + setFirstBitIndex = true; + } + ++aSignificantBitCount; + } + else if ( c == KBitIsNotApplicable ) + { + } + } + // + return mask; + } + + public static string EnsureByteMask( string aMask ) + { + string ret = aMask.PadLeft( 8, '0' ); + return ret; + } + + public static string ToBinary( uint aValue ) + { + StringBuilder ret = new StringBuilder(); + // + for ( int i = 31; i >= 0; i-- ) + { + uint mask = (uint) ( 1u << i ); + uint value = ( aValue & mask ) >> i; + if ( value != 0 ) + { + ret.Append( '1' ); + } + else + { + ret.Append( '0' ); + } + } + // + return ret.ToString(); + } + + #region Constants + public const char KBitIsSet = '1'; + public const char KBitIsClear = '0'; + public const char KBitIsNotApplicable = '#'; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Reports/CIReportInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Reports/CIReportInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using SymbianUtils.Range; +using SymbianStructuresLib.Uids; +using SymbianUtils.DataBuffer; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.Reports +{ + [CIDBAttributeColumn( "Name", 0 )] + [CIDBAttributeColumn( "Value", 1, true )] + public class CIReportInfo : CIElement, IEnumerable + { + #region Constructors + public CIReportInfo( CIContainer aContainer ) + : base( aContainer ) + { + } + #endregion + + #region API + public void AddParameter( string aName, uint aValue ) + { + CIReportParameter param = new CIReportParameter( this, aName, aValue ); + iParameters.Add( param ); + } + #endregion + + #region Properties + /// + /// Type of crash report + /// + [CIDBAttributeCell( "Type", 1, "", "" )] + public string Type + { + get { return iType; } + set { iType = value; } + } + + /// + /// Reporter name + /// + [CIDBAttributeCell( "Name", 2, "", "" )] + public override string Name + { + get { return iName; } + set { iName = value; } + } + + [CIDBAttributeCell( "Category", 3, "", "" )] + public string Category + { + get { return iCategory; } + set { iCategory = value; } + } + + [CIDBAttributeCell( "Success Count", 4, "", "" )] + public uint CountSuccess + { + get { return iCountSuccess; } + set { iCountSuccess = value; } + } + + [CIDBAttributeCell( "Fail Count", 5, "", "" )] + public uint CountFail + { + get { return iCountFail; } + set { iCountFail = value; } + } + + /// + /// Misc. reporter comments + /// + [CIDBAttributeCell( "Comments", 6, "", "" )] + public string Comments + { + get { return iComments; } + set { iComments = value; } + } + + public int ParameterCount + { + get { return iParameters.Count; } + } + #endregion + + #region From CIElement + public override void PrepareRows() + { + base.PrepareRows(); + + // Need to add the version information + foreach ( CIReportParameter rp in iParameters ) + { + DataBindingModel.Add( rp ); + } + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( CIReportParameter rp in iParameters ) + { + yield return rp; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIReportParameter rp in iParameters ) + { + yield return rp; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private string iType = string.Empty; + private string iName = string.Empty; + private string iCategory = string.Empty; + private string iComments = string.Empty; + private uint iCountSuccess = 0; + private uint iCountFail = 0; + private List iParameters = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Reports/CIReportParameter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Reports/CIReportParameter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using SymbianUtils.Range; +using SymbianStructuresLib.Uids; +using SymbianUtils.DataBuffer; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.Reports +{ + public class CIReportParameter : CIElement + { + #region Constructors + internal CIReportParameter( CIReportInfo aReport, string aName, uint aValue ) + : base( aReport.Container ) + { + iName = string.IsNullOrEmpty( aName ) ? string.Empty : aName; + iValue = aValue; + } + #endregion + + #region API + #endregion + + #region Properties + public override string Name + { + get { return iName; } + } + + public uint Value + { + get { return iValue; } + } + #endregion + + #region Operators + public static implicit operator CIDBRow( CIReportParameter aObject ) + { + CIDBRow row = new CIDBRow(); + // + row.Add( new CIDBCell( aObject.Name ) ); + row.Add( new CIDBCell( aObject.Value.ToString() ) ); + // + return row; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly string iName; + private readonly uint iValue; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Source/CISource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Source/CISource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; + +namespace CrashItemLib.Crash.Source +{ + /// + /// Base class for all crash sources + /// + public abstract class CISource : IEnumerable + { + #region Constructors + protected CISource( FileInfo aFile ) + { + iFile = aFile; + } + #endregion + + #region Constants + public static readonly string[] KExtensionsTrace = new string[] { ".txt", ".log", ".trace" }; + #endregion + + #region API + public void AddAdditionalFile( FileInfo aFile ) + { + iAdditionalFiles.Add( aFile ); + } + + public static bool SubstringMatch( string aText, string[] aCandidates ) + { + string text = aText.ToUpper(); + foreach ( string candidate in aCandidates ) + { + if ( text.Contains( candidate.ToUpper() ) ) + { + return true; + } + } + + return false; + } + #endregion + + #region Properties + /// + /// The primary file which essentially describes the crash. + /// + public FileInfo MasterFile + { + get { return iFile; } + } + + public string MasterFileName + { + get + { + string ret = string.Empty; + // + if ( MasterFile != null ) + { + ret = MasterFile.FullName; + } + // + return ret; + } + } + + /// + /// Get other files which may be related to the master file. + /// For example, D_EXC stores it stack file separately to + /// the main text file, therefore the STK file would be present + /// only within the 'all files' array. + /// + public FileInfo[] AllFiles + { + get + { + List ret = new List( this.iAdditionalFiles ); + ret.Insert( 0, MasterFile ); + return ret.ToArray(); + } + } + + public string Extension + { + get { return Path.GetExtension( MasterFileName ).ToLower(); } + } + + public int AdditionalFileCount + { + get { return iAdditionalFiles.Count; } + } + + public long LineNumber + { + get { return iLineNumber; } + set { iLineNumber = value; } + } + + public bool Exists + { + get { return File.Exists( MasterFileName ); } + } + + public bool IsTraceExtension + { + get + { + string extn = Extension; + bool ret = SubstringMatch( extn, KExtensionsTrace ); + return ret; + } + } + + public bool IsLineNumberAvailable + { + get { return iLineNumber != KLineNumberNotApplicable; } + } + #endregion + + #region Framework properties + public abstract Version ImplementorVersion + { + get; + } + + public abstract string ImplementorName + { + get; + } + #endregion + + #region Internal constants + private const long KLineNumberNotApplicable = -1; + #endregion + + #region Internal methods + internal void RawDataClear() + { + iRawData.Clear(); + } + + internal byte[] RawData + { + get { return iRawData.ToArray(); } + } + + internal void RawDataAdd( byte[] aRawData ) + { + iRawData.AddRange( aRawData ); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( FileInfo file in iAdditionalFiles ) + { + yield return file; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( FileInfo file in iAdditionalFiles ) + { + yield return file; + } + } + #endregion + + #region Data members + private FileInfo iFile = null; + private List iAdditionalFiles = new List(); + private List iRawData = new List( 1024 ); + private long iLineNumber = KLineNumberNotApplicable; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Source/CISourceElement.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Source/CISourceElement.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.Source +{ + public class CISourceElement : CIElement, IEnumerable + { + #region Constructors + public CISourceElement( CIContainer aContainer, CISource aSource ) + : base( aContainer ) + { + iSource = aSource; + } + #endregion + + #region API + public void InputDataClear() + { + iInputData.Clear(); + } + + public void InputDataAdd( byte[] aRawData ) + { + iInputData.AddRange( aRawData ); + } + #endregion + + #region Properties + public byte[] InputData + { + get { return iInputData.ToArray(); } + } + + public string MasterFileName + { + get { return iSource.MasterFileName; } + } + + public FileInfo[] AllFiles + { + get { return iSource.AllFiles; } + } + + public bool IsLineNumberAvailable + { + get { return iSource.IsLineNumberAvailable; } + } + + public long LineNumber + { + get { return iSource.LineNumber; } + } + #endregion + + #region Operators + public static implicit operator CISource( CISourceElement aSource ) + { + return aSource.iSource; + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + return iSource.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return iSource.GetEnumerator(); + } + #endregion + + #region Data members + private readonly CISource iSource; + private List iInputData = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Stacks/CIStack.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Stacks/CIStack.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,354 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.DataBuffer; +using SymbianUtils.DataBuffer.Entry; +using SymbianUtils.DataBuffer.Primer; +using SymbianStackLib.Engine; +using SymbianStackLib.Data.Source; +using SymbianStackLib.Data.Output; +using SymbianStackLib.Data.Output.Entry; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Arm.Registers; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.CodeSegs; +using CrashItemLib.Crash.Messages; + +namespace CrashItemLib.Crash.Stacks +{ + public class CIStack : CIElement, IEnumerable + { + #region Static constructors + public static CIStack NewStandAlone( CIRegisterList aRegisters, byte[] aData, uint aAddressOfFirstByte, AddressRange aRange ) + { + CIStack ret = new CIStack( aRegisters, aData, aAddressOfFirstByte, aRange ); + return ret; + } + + internal static CIStack NewThreadStack( CIThread aThread, CIRegisterList aRegisters, byte[] aData, uint aAddressOfFirstByte, AddressRange aRange ) + { + CIStack ret = new CIStack( aRegisters, aData, aAddressOfFirstByte, aRange ); + return ret; + } + #endregion + + #region Constructors + private CIStack( CIRegisterList aRegisters, byte[] aData, uint aAddressOfFirstByte, AddressRange aRange ) + : base( aRegisters.Container ) + { + base.AddSupportedChildType( typeof( CIStackEntry ) ); + base.AddSupportedChildType( typeof( CIMessage ) ); + + iRegisters = aRegisters; + iStackAddressRange = aRange; + + // Prepare data + DataBufferPrimer primer = new DataBufferPrimer( iStackData ); + primer.Prime( aData, aAddressOfFirstByte ); + } + #endregion + + #region API + #endregion + + #region Properties + public bool IsStackOutputAvailable + { + get { return iStackOutput != null; } + } + + public bool IsThreadAvailable + { + get { return OwningThread != null; } + } + + public bool IsProcessAvailable + { + get { return OwningProcess != null; } + } + + public bool IsOverflow + { + get + { + bool ret = false; + // + bool pointerAvailable = this.Registers.Contains( TArmRegisterType.EArmReg_SP ); + if ( pointerAvailable ) + { + CIRegister regSP = this.Pointer; + AddressRange stackRange = this.Range; + // + ret = ( regSP <= stackRange.Min ); + } + // + return ret; + } + } + + public TArmRegisterBank Type + { + get { return Registers.Bank; } + } + + public uint Base + { + // NB: CIStack stores addresses differently to the stack + // engine, but these are correct so no need to panic. + get + { + return iStackAddressRange.Min; + } + } + + public uint Limit + { + // NB: CIStack stores addresses differently to the stack + // engine, but these are correct so no need to panic. + get + { + return iStackAddressRange.Max; + } + } + + public uint Size + { + get + { + // The address range contains all-inclusive values. + // + // E.g. a range of 0x00 -> 0x10 would include the values...: + // + // 0x00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 0x10 + // + // ...and therefore AddressRange.Size would return 17. + // + // Symbian OS treats the range as non-inclusive, so the value is one too large. + // Hence we subtract one + uint ret = iStackAddressRange.Size - 1; + return ret; + } + } + + public int EntryCount + { + get { return iStackOutput.Count; } + } + + public string Algorithm + { + get + { + string ret = "Unknown Algorithm"; + if ( iStackOutput != null ) + { + ret = iStackOutput.AlgorithmName; + } + return ret; + } + } + + public byte[] RawStackData + { + get { return iStackData.ToArray(); } + } + + public int RawDataLength + { + get { return iStackData.Count; } + } + + public AddressRange RawDataRange + { + get { return iStackData.Range; } + } + + public CIRegister Pointer + { + get + { + CIRegister ret = Registers[ TArmRegisterType.EArmReg_SP ]; + return ret; + } + } + + public uint PointerValue + { + get + { + uint ret = 0; + + // We do it this way so as to avoid calling operator[] on the + // register list if the register does not exist. The default behaviour + // of the register list class is to create a new register in such a situation + // and we don't really want to do that. + CIRegisterList regs = this.Registers; + if ( regs.Contains( TArmRegisterType.EArmReg_SP ) ) + { + ret = this.Pointer.Value; + } + // + return ret; + } + } + + public AddressRange Range + { + get { return iStackAddressRange; } + set + { + iStackAddressRange = value; + } + } + + public CIThread OwningThread + { + get { return iRegisters.OwningThread; } + } + + public CIProcess OwningProcess + { + get + { + CIProcess ret = null; + // + if ( OwningThread != null ) + { + ret = OwningThread.OwningProcess; + } + // + return ret; + } + } + + public CICodeSegList CodeSegments + { + get + { + CICodeSegList list = null; + CIProcess process = OwningProcess; + if ( process != null ) + { + list = process.CodeSegments; + } + return list; + } + } + + public CIRegisterList Registers + { + get { return iRegisters; } + } + + public StackOutputData RawOutputData + { + get { return iStackOutput; } + } + + internal StackSourceData RawSourceData + { + get { return iStackData; } + } + #endregion + + #region Internal methods + private void CreateEntries() + { + if ( iStackOutput != null ) + { + int count = iStackOutput.Count; + // + for ( int i = 0; i < count; i++ ) + { + StackOutputEntry dataOutputEntry = iStackOutput[ i ]; + // + CIStackEntry entry = new CIStackEntry( this, dataOutputEntry ); + base.AddChild( entry ); + } + } + } + #endregion + + #region From CIElement + internal override void OnFinalize( CIElementFinalizationParameters aParams ) + { + try + { + base.OnFinalize( aParams ); + } + finally + { + CIStackBuilder builder = new CIStackBuilder( this, aParams.DebugEngine ); + builder.Build( TSynchronicity.ESynchronous ); + // + iStackOutput = builder.StackEngine.DataOutput; + // + CreateEntries(); + } + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + CIElementList entries = base.ChildrenByType(); + return entries.GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + CIElementList entries = base.ChildrenByType(); + return entries.GetEnumerator(); + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + if ( OwningThread != null ) + { + ret.Append( "[Stack] " ); + ret.Append( OwningThread.ToString() ); + ret.Append( " " ); + } + else + { + + } + // + ret.Append( Registers.BankName ); + return ret.ToString(); + } + #endregion + + #region Data members + private readonly CIRegisterList iRegisters; + private StackSourceData iStackData = new StackSourceData(); + private AddressRange iStackAddressRange = new AddressRange(); + private StackOutputData iStackOutput = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Stacks/CIStackBuilder.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Stacks/CIStackBuilder.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,211 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianUtils; +using SymbianDebugLib.Engine; +using SymbianStackLib.Engine; +using SymbianStackLib.Exceptions; +using CrashItemLib.Engine.Operations; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.CodeSegs; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Engine; + +namespace CrashItemLib.Crash.Stacks +{ + internal class CIStackBuilder + { + #region Constructors + public CIStackBuilder( CIStack aStack, DbgEngine aDebugEngine ) + { + iStack = aStack; + iStackEngine = new StackEngine( aDebugEngine ); + iStackEngine.AddressInfo.Pointer = aStack.PointerValue; + iStackEngine.AddressInfo.Range = aStack.Range; + iStackEngine.Registers = aStack.Registers; + iStackEngine.DataSource = aStack.RawSourceData; + + // Get the code segments for the process + bool isThreadStack = aStack.IsThreadAvailable; + if ( isThreadStack ) + { + CIProcess process = OwningProcess; + System.Diagnostics.Debug.Assert( process != null ); + + // Seed stack engine with relevant code segments + iStackEngine.CodeSegments = process.CodeSegments; + } + } + #endregion + + #region API + public void Build( TSynchronicity aSynchronicity ) + { + StackEventsSubscribe(); + iStackEngine.Reconstruct( aSynchronicity ); + } + #endregion + + #region Properties + public bool IsReady + { + get { return iIsReady; } + private set + { + lock ( this ) + { + iIsReady = value; + } + } + } + + public CIProcess OwningProcess + { + get + { + CIProcess ret = iStack.OwningProcess; + return ret; + } + } + + public StackEngine StackEngine + { + get { return iStackEngine; } + } + #endregion + + #region Event handlers + private void StackEngine_EventHandler( StackEngine.TEvent aEvent, StackEngine aEngine ) + { + if ( aEvent == StackEngine.TEvent.EStackBuildingComplete ) + { + StackEventsUnsubscribe(); + IsReady = true; + } + } + + private void StackEngine_ExceptionHandler( Exception aException, StackEngine aEngine ) + { + // Operation failed, but we must mark ourselves as ready or else UI clients will block forever... + IsReady = true; + + // We'll deal with the public exceptions ourselves. Any kind of exception we cannot handle + // will just get treated as a generic error. + string msg = string.Empty; + bool recognized = false; + // + if ( aException is StackAddressException ) + { + recognized = true; + StackAddressException exception = (StackAddressException) aException; + switch ( exception.Type ) + { + case StackAddressException.TType.ETypePointerIsNull: + msg = LibResources.CIStackBuilder_AddressInfoException_PointerMissing; + break; + case StackAddressException.TType.ETypePointerOutOfBounds: + msg = LibResources.CIStackBuilder_AddressInfoException_PointerOutOfBounds; + break; + case StackAddressException.TType.ETypeBaseAddressBeforeTopAddress: + msg = LibResources.CIStackBuilder_AddressInfoException_BaseAddressBeforeTopAddress; + break; + case StackAddressException.TType.ETypeTopAddressAfterBaseAddress: + msg = LibResources.CIStackBuilder_AddressInfoException_TopAddressAfterBaseAddress; + break; + default: + recognized = false; + break; + } + } + + // Not recognized? Unfortunately have to leak the original underlying .NET exception details + if ( recognized == false ) + { + msg = aException.Message; + } + + if ( string.IsNullOrEmpty( msg ) == false ) + { + // Treat exceptions as fatal errors + CIMessageError error = new CIMessageError( iStack.Container, LibResources.CIStackBuilder_Error_Title ); + error.AddLine( msg ); + iStack.AddChild( error ); + } + } + + private void StackEngine_MessageHandler( StackEngine.TMessageType aType, string aMessage, StackEngine aEngine ) + { + switch ( aType ) + { + default: + break; + case StackEngine.TMessageType.ETypeError: + { + CIMessageError error = new CIMessageError( iStack.Container, LibResources.CIStackBuilder_Error_Title ); + error.AddLine( aMessage ); + iStack.AddChild( error ); + break; + } + case StackEngine.TMessageType.ETypeWarning: + { + CIMessageWarning warning = new CIMessageWarning( iStack.Container, LibResources.CIStackBuilder_Warning_Title ); + warning.AddLine( aMessage ); + iStack.AddChild( warning ); + break; + } + } + } + #endregion + + #region Internal methods + private void StackEventsSubscribe() + { + StackEngine.MessageHandler += new StackEngine.StackEngineMessageHandler( StackEngine_MessageHandler ); + StackEngine.EventHandler += new StackEngine.StackEngineEventHandler( StackEngine_EventHandler ); + StackEngine.ExceptionHandler += new StackEngine.StackEngineExceptionHandler( StackEngine_ExceptionHandler ); + } + + private void StackEventsUnsubscribe() + { + StackEngine.MessageHandler -= new StackEngine.StackEngineMessageHandler( StackEngine_MessageHandler ); + StackEngine.EventHandler -= new StackEngine.StackEngineEventHandler( StackEngine_EventHandler ); + StackEngine.ExceptionHandler -= new StackEngine.StackEngineExceptionHandler( StackEngine_ExceptionHandler ); + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "CIStackBuilder_{0}_{1}", iStack.Id, iStack.Name ); + return ret.ToString(); + } + #endregion + + #region Data members + private readonly CIStack iStack; + private readonly StackEngine iStackEngine; + private bool iIsReady = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Stacks/CIStackEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Stacks/CIStackEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianUtils.Range; +using SymbianStackLib.Engine; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Arm.Registers; +using SymbianStackLib.Data.Output.Entry; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Registers; + +namespace CrashItemLib.Crash.Stacks +{ + public class CIStackEntry : CIElement + { + #region Constructors + internal CIStackEntry( CIStack aParent, StackOutputEntry aEntry ) + : base( aParent.Container, aParent ) + { + iEntry = aEntry; + + // If the stack entry references a symbol then associate it with + // the parent dictionary immediately. + if ( aEntry.Symbol != null ) + { + ICISymbolManager symbolManager = this.SymbolManager; + CISymbol symbol = symbolManager.SymbolDictionary.Register( aEntry.Symbol ); + this.AddChild( symbol ); + base.Trace( string.Format( "[CIStackEntry] address: 0x{0:x8}, symbol: {1}, symId: {2}", iEntry.Data, symbol.Symbol, symbol.Id ) ); + } + } + #endregion + + #region API + #endregion + + #region Properties + public CIStack Stack + { + get { return (CIStack) base.Parent; } + } + + public CISymbol Symbol + { + get { return base.ChildByType( typeof( CISymbol ) ) as CISymbol; } + } + + public CIRegister Register + { + get + { + CIRegister ret = null; + // + if ( iEntry.IsRegisterBasedEntry ) + { + TArmRegisterType type = iEntry.AssociatedRegister; + CIStack stack = Stack; + CIRegisterList registers = stack.Registers; + if ( registers != null ) + { + ret = registers[ type ]; + } + } + // + return ret; + } + } + + public bool MatchesSymbol + { + get { return Symbol != null; } + } + + public uint Address + { + get { return iEntry.Address; } + } + + public uint FunctionOffset + { + get { return iEntry.FunctionOffset; } + } + + public uint Data + { + get { return iEntry.Data; } + } + + public string DataAsString + { + get { return iEntry.DataAsString; } + } + + public bool IsRegisterBasedEntry + { + get { return iEntry.IsRegisterBasedEntry; } + } + + public bool IsAccurate + { + get { return iEntry.IsAccurate; } + } + + public bool IsCurrentStackPointerEntry + { + get { return iEntry.IsCurrentStackPointerEntry; } + } + + public bool IsGhost + { + get { return iEntry.IsGhost; } + } + + public bool IsOutsideCurrentStackRange + { + get { return iEntry.IsOutsideCurrentStackRange; } + } + + internal ICISymbolManager SymbolManager + { + get + { + ICISymbolManager ret = base.Container; + CIProcess process = Stack.OwningProcess; + if ( process != null ) + { + ret = process; + } + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + return iEntry.ToString(); + } + #endregion + + #region Data members + private readonly StackOutputEntry iEntry; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Summarisable/CISummarisableEntity.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Summarisable/CISummarisableEntity.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,307 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.CodeSegs; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Messages; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashItemLib.Crash.Summarisable +{ + public class CISummarisableEntity : CIElement + { + #region Enumerations + public enum TContext + { + /// + /// A thread-specific entity, the normal case when the crash occurs within a Symbian + /// OS kernel or user side thread context. + /// + EContextTypeThread = 0, + + /// + /// An exception mode entity. For example, an object that represents the associated + /// stack et al for an IRQ handler or FIQ handler crash. + /// + EContextTypeException + } + + public enum TElement + { + EElementThread = 0, + EElementProcess, + EElementCodeSegments, + EElementStack, + EElementRegisters + } + #endregion + + #region Constructors + /// + /// Preferred constructor that is called by CISummarisableEntityList during finalization. + /// This constructor is used to create a summary wrapper for any stack-level objects that + /// were created during container preparation. Those stack objects may be stand-alone exception + /// mode stacks (IRQ, FIQ, ABT, UND et al) or then they may be associated with a specific + /// Symbian OS thread (user or supervisor). + /// + /// + internal CISummarisableEntity( CIStack aStack ) + : base( aStack.Container ) + { + // NB: If the stack has an associated register list, + // and the register list's owner is a thread, then we + // automatically know we're dealing with a thread-based stack. + AddChild( aStack ); + } + + /// + /// Fall back constructor which is called when the thread in question has no associated + /// stack. This means that stack data is unavailable and therefore stack reconstruction is + /// obviously impossible. However, the thread (and by implication the process) may well still + /// contain useful information. + /// + /// + internal CISummarisableEntity( CIThread aThread ) + : base( aThread.Container ) + { + AddChild( aThread ); + } + #endregion + + #region API + public bool IsAvailable( TElement aElement ) + { + bool ret = false; + // + switch ( aElement ) + { + case TElement.EElementThread: + ret = ( Thread != null ); + break; + case TElement.EElementProcess: + ret = ( Process != null ); + break; + case TElement.EElementCodeSegments: + ret = ( CodeSegments != null ); + break; + case TElement.EElementStack: + ret = ( Stack != null ); + break; + case TElement.EElementRegisters: + ret = ( Registers != null ); + break; + } + // + return ret; + } + + public CIMessageDictionary GetMessages() + { + CIElementList list = base.ChildrenByType( TChildSearchType.EEntireHierarchy ); + CIMessageDictionary ret = new CIMessageDictionary( list ); + return ret; + } + #endregion + + #region Properties + public TContext Context + { + get + { + TContext ret = TContext.EContextTypeException; + // + if ( IsAvailable( TElement.EElementThread ) ) + { + ret = TContext.EContextTypeThread; + } + // + return ret; + } + } + + public bool IsAbnormalTermination + { + get + { + // A crash can be an exception stack (i.e. without a thread) + // or then a thread that has panics/crashed in some way. + bool ret = false; + // + if ( IsAvailable( TElement.EElementThread ) ) + { + ret = Thread.IsAbnormalTermination; + } + else if ( IsAvailable( TElement.EElementStack ) ) + { + // All stand-alone stacks are treated as crashes. + ret = true; + } + // + return ret; + } + } + + public CIThread Thread + { + get + { + CIThread ret = null; + + // Use the stack object to find associated thread. + CIStack stack = this.Stack; + if ( stack != null ) + { + ret = stack.OwningThread; + } + + // Did we find a thread? If not, fall back to trying our children. + if ( ret == null ) + { + // Register set unavailable - check child nodes for + // presence of thread object. Implies no stack data for + // this summary wrapper object. + ret = base.ChildByType( typeof( CIThread ) ) as CIThread; + } + // + return ret; + } + } + + public CIProcess Process + { + get + { + CIProcess ret = null; + // + if ( Thread != null ) + { + ret = Thread.OwningProcess; + } + // + return ret; + } + } + + public CICodeSegList CodeSegments + { + get + { + CICodeSegList ret = null; + // + CIProcess process = this.Process; + if ( process != null ) + { + ret = process.CodeSegments; + } + // + return ret; + } + } + + public CIRegisterList Registers + { + get + { + CIRegisterList ret = null; + // + CIStack stack = this.Stack; + if ( stack != null ) + { + // Use registers associated with stack + ret = stack.Registers; + } + else + { + // No stack, if we have a thread then try to + // find the thread register list that is current. + CIThread thread = this.Thread; + if ( thread != null ) + { + ret = thread.CurrentProcessorModeRegisters; + } + } + // + return ret; + } + } + + public CIStack Stack + { + get + { + // Might return null + CIStack ret = base.ChildByType( typeof( CIStack ) ) as CIStack; + return ret; + } + } + + public TArmRegisterBank Bank + { + get + { + TArmRegisterBank ret = TArmRegisterBank.ETypeUnknown; + // + if ( IsAvailable( TElement.EElementStack ) ) + { + ret = Stack.Type; + } + // + return ret; + } + } + + public override string Name + { + get + { + StringBuilder ret = new StringBuilder(); + // + if ( IsAvailable( TElement.EElementThread ) ) + { + // Just use thread name + ret.Append( Thread.FullName ); + } + else if ( IsAvailable( TElement.EElementStack ) ) + { + // Get associated bank type + TArmRegisterBank bank = Stack.Registers.Bank; + string type = ArmRegisterBankUtils.BankAsStringLong( bank ); + ret.AppendFormat( "{0} mode", type ); + } + // + return ret.ToString(); + } + set + { + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Summarisable/CISummarisableEntityList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Summarisable/CISummarisableEntityList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.CodeSegs; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashItemLib.Crash.Summarisable +{ + public class CISummarisableEntityList : CIElement + { + #region Constructors + [CIElementAttributeMandatory()] + public CISummarisableEntityList( CIContainer aContainer ) + : base( aContainer ) + { + // Restrict children to summaries + base.AddSupportedChildType( typeof( CISummarisableEntity ) ); + base.AddSupportedChildType( typeof( CrashItemLib.Crash.Messages.CIMessage ) ); + } + + internal CISummarisableEntityList( CIContainer aContainer, IEnumerable aArray ) + : this( aContainer ) + { + foreach ( CISummarisableEntity entry in aArray ) + { + base.AddChild( entry ); + } + } + #endregion + + #region API + #endregion + + #region Properties + public CISummarisableEntity this[ CIThread aEntry ] + { + get + { + CISummarisableEntity ret = null; + // + foreach ( CISummarisableEntity entry in this ) + { + if ( entry.IsAvailable( CISummarisableEntity.TElement.EElementThread ) ) + { + if ( entry.Thread.Id == aEntry.Id ) + { + ret = entry; + break; + } + } + } + // + return ret; + } + } + + public CISummarisableEntity this[ CIStack aEntry ] + { + get + { + CISummarisableEntity ret = null; + // + foreach ( CISummarisableEntity entry in this ) + { + if ( entry.IsAvailable( CISummarisableEntity.TElement.EElementStack ) ) + { + if ( entry.Stack.Id == aEntry.Id ) + { + ret = entry; + break; + } + } + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region From CIElement + internal override void DoFinalize( CIElementFinalizationParameters aParams, Queue aCallBackLast, bool aForceFinalize ) + { + CIContainer container = base.Container; + + // Find all the stacks and add them as children before we call the base class + // method, since the base class will then take care of finalizing the new dynamically created + // summarisable objects. + CIElementList stacks = container.ChildrenByType( TChildSearchType.EEntireHierarchy ); + if ( stacks != null && stacks.Count > 0 ) + { + foreach( CIStack stack in stacks ) + { + CISummarisableEntity entity = this[ stack ]; + if ( entity == null ) + { + entity = new CISummarisableEntity( stack ); + AddChild( entity ); + } + } + } + + // Now, make sure there are summarisable wrappers created for any threads which do not have associated + // stacks. Call stacks will be unavailable, but there's still plenty of useful information at the thread + // process and register levels. + CIElementList threads = container.ChildrenByType( TChildSearchType.EEntireHierarchy ); + if ( threads != null && threads.Count > 0 ) + { + foreach ( CIThread thread in threads ) + { + CISummarisableEntity entity = this[ thread ]; + if ( entity == null ) + { + entity = new CISummarisableEntity( thread ); + AddChild( entity ); + } + } + } + + // Now run finalizers on children et al. + base.DoFinalize( aParams, aCallBackLast, aForceFinalize ); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Symbols/CISymbol.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Symbols/CISymbol.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,231 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianUtils.Range; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianStructuresLib.Debug.Symbols; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.CodeSegs; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Summarisable; + +namespace CrashItemLib.Crash.Symbols +{ + public class CISymbol : CIElement + { + #region Constructors + internal CISymbol( CIContainer aContainer, uint aAddress ) + : base( aContainer ) + { + iAddress = aAddress; + } + + internal CISymbol( CIContainer aContainer, Symbol aSymbol ) + : this( aContainer, aSymbol.Address ) + { + AssignPermanentSymbol( aSymbol ); + } + #endregion + + #region API + internal CISymbolDictionary Dictionary + { + get + { + CISymbolDictionary ret = base.Container.Symbols; + CIProcess owningProcess = this.OwningProcess; + // + if ( owningProcess != null ) + { + ret = owningProcess.Symbols; + } + // + return ret; + } + } + + internal void AssignPermanentSymbol( Symbol aSymbol ) + { + iSymbol = aSymbol; + iSymbolLocked = true; + } + + internal int ReferenceCountIncrement() + { + return ++iRefCount; + } + + internal int ReferenceCountDecrement() + { + return --iRefCount; + } + #endregion + + #region Properties + public override string Name + { + get + { + string ret = string.Empty; + // + if ( !IsNull ) + { + ret = Symbol.Name; + } + // + return ret; + } + set { } + } + + public uint Address + { + get { return iAddress; } + } + + public bool IsNull + { + get + { + return iSymbol == null; + } + } + + public CICodeSeg CodeSegment + { + get + { + CICodeSeg ret = null; + // + CIProcess process = OwningProcess; + if ( process != null ) + { + ret = process.CodeSegments[ Address ]; + } + // + return ret; + } + } + + public Symbol Symbol + { + get { return iSymbol; } + } + #endregion + + #region Operators + public static implicit operator Symbol( CISymbol aSelf ) + { + return aSelf.Symbol; + } + #endregion + + #region From CIElement + internal override void OnFinalize( CIElementFinalizationParameters aParams ) + { + try + { + base.OnFinalize( aParams ); + } + finally + { + if ( iAddress != 0 ) + { + if ( iSymbolLocked == false ) + { + iSymbol = aParams.DebugEngineView.Symbols[ iAddress ]; + base.Trace( string.Format( "[CISymbol] OnFinalize() - address: 0x{0:x8}, id: {1}, iSymbol: {2}", iAddress, base.Id, iSymbol ) ); + } + } + } + } + #endregion + + #region From System.Object + public override string ToString() + { + if ( iSymbol != null ) + { + return iSymbol.ToString(); + } + // + return "0x" + iAddress.ToString( "x8" ); + } + #endregion + + #region Internal methods + private CIProcess OwningProcess + { + get + { + CIProcess ret = null; + // + CIElement parent = this.Parent; + while ( parent != null ) + { + if ( parent is CIProcess ) + { + ret = (CIProcess) parent; + break; + } + else if ( parent is CIStack ) + { + CIStack entity = (CIStack) parent; + ret = entity.OwningProcess; + break; + } + else if ( parent is CIThread ) + { + CIThread entity = (CIThread) parent; + ret = entity.OwningProcess; + break; + } + else if ( parent is CISummarisableEntity ) + { + CISummarisableEntity entity = (CISummarisableEntity) parent; + ret = entity.Process; + break; + } + else + { + parent = parent.Parent; + } + } + // + return ret; + } + } + #endregion + + #region Data members + private readonly uint iAddress; + private int iRefCount = 0; + private bool iSymbolLocked = false; + private Symbol iSymbol = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Symbols/CISymbolDictionary.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Symbols/CISymbolDictionary.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,222 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Stacks; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbol; + +namespace CrashItemLib.Crash.Symbols +{ + public class CISymbolDictionary : CIElementList + { + #region Constructors + internal CISymbolDictionary( CIContainer aContainer ) + : base( aContainer ) + { + base.IsToBeFinalizedLast = true; + } + #endregion + + #region API + internal CISymbol Register( uint aSymbolAddress ) + { + // First try to find an existing CISymbol that matches the address. + CISymbol symbol = this[ aSymbolAddress ]; + if ( symbol == null ) + { + // No existing entry defined, so create a new symbol which is just based upon + // an address. + symbol = new CISymbol( base.Container, aSymbolAddress ); + DoRegister( symbol ); + } + else + { + // Found an existing symbol object - increment reference count + symbol.ReferenceCountIncrement(); + } + // + return symbol; + } + + internal CISymbol Register( Symbol aSymbol ) + { + // First try to find an existing CISymbol that matches the address. + CISymbol symbol = this[ aSymbol.Address ]; + if ( symbol == null ) + { + // No existing entry defined, so create a new symbol with explicit symbol definition + symbol = new CISymbol( base.Container, aSymbol ); + DoRegister( symbol ); + } + else + { + // Found an existing symbol object - however, does it have an associated + // symbol yet? + symbol.AssignPermanentSymbol( aSymbol ); + + // Also, we must increment the reference count because it's now shared by another client + symbol.ReferenceCountIncrement(); + } + // + return symbol; + } + + internal CISymbol RefreshRegistration( CIElement aElement, uint aSymbolAddress, CISymbol aOldSymbolOrNull ) + { + CISymbol ret = aOldSymbolOrNull; + bool needToRegister = false; + + if ( aOldSymbolOrNull != null ) + { + // We only need to do this if the symbol address changed. + if ( aSymbolAddress != aOldSymbolOrNull.Address ) + { + // We must unregister the symbol from the parent element because potentially we might + // replace the symbol with an entirely new one. + aElement.RemoveChild( aOldSymbolOrNull ); + + // However, we only do this if there are no other client of the same symbol. + int newRefCount = aOldSymbolOrNull.ReferenceCountDecrement(); + if ( newRefCount <= 0 ) + { + // Remove old references to dead symbol + DoDeregister( aOldSymbolOrNull ); + } + + // Since the address of the symbol has changed, we will need to + // re-register a new symbol + needToRegister = true; + } + else + { + // The symbol address hasn't changed + } + } + else if ( aSymbolAddress == 0 && aOldSymbolOrNull == null ) + { + // Err, nothing to do here. + } + else + { + // We weren't supplied with an original symbol object which means we will + // definitely need to register a symbol (if we don't find a pre-existing match). + needToRegister = true; + } + + // Do we need to register a new symbol? + if ( needToRegister ) + { + // Create new entry (or look up existing reference). This will also + // ensure any new symbol is registered with this dictionary. + ret = Register( aSymbolAddress ); + + // Associate with parent element + aElement.AddChild( ret ); + } + + return ret; + } + #endregion + + #region Properties + internal CISymbol this[ uint aAddress ] + { + get + { + CISymbol ret = null; + // + if ( iAddressLUT.ContainsKey( aAddress ) ) + { + ret = iAddressLUT[ aAddress ]; + } + // + return ret; + } + } + #endregion + + #region Internal methods + private void DoRegister( CISymbol aSymbol ) + { + CISymbol check = this[ aSymbol.Address ]; + System.Diagnostics.Debug.Assert( check == null ); + aSymbol.ReferenceCountIncrement(); + Add( aSymbol ); + } + + private void DoDeregister( CISymbol aSymbol ) + { + bool alreadyRegistered = base.Contains( aSymbol ); + if ( alreadyRegistered ) + { + Remove( aSymbol ); + } + } + #endregion + + #region From CIElementDictionary + public override bool Add( CISymbol aEntry ) + { + bool okayToAdd = iAddressLUT.ContainsKey( aEntry.Address ) == false; + if ( okayToAdd ) + { + base.Add( aEntry ); + iAddressLUT.Add( aEntry.Address, aEntry ); + } + + return okayToAdd; + } + + public override void Remove( CISymbol aEntry ) + { + bool alreadyExists = iAddressLUT.ContainsKey( aEntry.Address ); + if ( alreadyExists ) + { + iAddressLUT.Remove( aEntry.Address ); + } + base.Remove( aEntry ); + } + #endregion + + #region From CIElement + internal override void OnFinalize( CIElementFinalizationParameters aParams ) + { + try + { + base.OnFinalize( aParams ); + } + finally + { + } + } + #endregion + + #region Data members + private Dictionary iAddressLUT = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Symbols/ICISymbolManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Symbols/ICISymbolManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianStructuresLib.Debug.Symbols; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Symbols; + +namespace CrashItemLib.Crash.Symbols +{ + internal interface ICISymbolManager + { + CISymbolDictionary SymbolDictionary + { + get; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Telephony/CITelephony.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Telephony/CITelephony.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using SymbianUtils.Range; +using SymbianStructuresLib.Uids; +using SymbianUtils.DataBuffer; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.Telephony +{ + [CIDBAttributeColumn( "Name", 0 )] + [CIDBAttributeColumn( "Value", 1, true )] + public class CITelephony : CIElement + { + #region Constructors + public CITelephony( CIContainer aContainer ) + : base( aContainer ) + { + iNetworkInfo = new CITelephonyNetworkInfo( this ); + } + #endregion + + #region API + #endregion + + #region Properties + [CIDBAttributeCell( "Phone Number", 1, "", "" )] + public string PhoneNumber + { + get { return iPhoneNumber; } + set { iPhoneNumber = value; } + } + + [CIDBAttributeCell( "IMEI", 2, "", "" )] + public string IMEI + { + get { return iIMEI; } + set { iIMEI = value; } + } + + [CIDBAttributeCell( "IMSI", 3, "", "" )] + public string IMSI + { + get { return iIMSI; } + set { iIMSI = value; } + } + + [CIDBAttributeCell( CIDBAttributeCell.TOptions.EAutoExpand )] + public CITelephonyNetworkInfo NetworkInfo + { + get { return iNetworkInfo; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly CITelephonyNetworkInfo iNetworkInfo; + private string iPhoneNumber = string.Empty; + private string iIMEI = string.Empty; + private string iIMSI = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Telephony/CITelephonyNetworkInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Telephony/CITelephonyNetworkInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.ComponentModel; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using SymbianUtils.Range; +using SymbianStructuresLib.Uids; +using SymbianUtils.DataBuffer; + +namespace CrashItemLib.Crash.Telephony +{ + public class CITelephonyNetworkInfo : CIElement + { + #region Enumerations + public enum TRegistrationMode + { + [Description("Unknown")] + ERegModeUnknown = 0, + + [Description( "Offline" )] + ERegModeOffline, + + [Description( "2G" )] + ERegMode2g, + + [Description( "3G" )] + ERegMode3g, + + [Description( "HSDPA" )] + ERegModeHSDPA + } + #endregion + + #region Constructors + internal CITelephonyNetworkInfo( CITelephony aParent ) + : base( aParent.Container ) + { + iParent = aParent; + } + #endregion + + #region API + #endregion + + #region Properties + [CIDBAttributeCell( "Country Code", 100, "", "" )] + public string Country + { + get { return iCountry; } + set { iCountry = value; } + } + + [CIDBAttributeCell( "Identity", 101, "", "" )] + public string Identity + { + get { return iIdentity; } + set { iIdentity = value; } + } + + [CIDBAttributeCell( "Cell ID", 102, "", "" )] + public string CellId + { + get { return iCellId; } + set { iCellId = value; } + } + + [CIDBAttributeCell( "Registration", 103, "", "" )] + public TRegistrationMode RegistrationMode + { + get { return iRegistrationMode; } + set { iRegistrationMode = value; } + } + + [CIDBAttributeCell("CGI", 104, "", "")] + public string CGI + { + get { return iCGI; } + set { iCGI = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly CITelephony iParent; + private string iCountry = string.Empty; + private string iIdentity = string.Empty; + private string iCellId = string.Empty; + private string iCGI = string.Empty; //Cell Global Identity + private TRegistrationMode iRegistrationMode = TRegistrationMode.ERegModeUnknown; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Threads/CIThread.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Threads/CIThread.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,237 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Generic; +using SymbianUtils.Range; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Arm.Registers; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.ExitInfo; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Summarisable; + +namespace CrashItemLib.Crash.Threads +{ + #region Attributes + [CIDBAttributeColumn( "Name", 0 )] + [CIDBAttributeColumn( "Value", 1, true )] + #endregion + public class CIThread : CIElement + { + #region Constructors + public CIThread( CIProcess aProcess ) + : base( aProcess.Container, aProcess ) + { + AddChild( new CIExitInfo( this ) ); + AddChild( new CIThreadRegisterListCollection( this ) ); + } + #endregion + + #region API + public CIStack CreateStack( CIRegisterList aRegisters, byte[] aData, uint aAddressOfFirstByte, AddressRange aRange ) + { + // The registers given must be a child of this thread (in some way) + System.Diagnostics.Debug.Assert( aRegisters.OwningThread == this ); + + // Add it to the overall item too + CIStack stack = CIStack.NewThreadStack( this, aRegisters, aData, aAddressOfFirstByte, aRange ); + AddChild( stack ); + + return stack; + } + + internal bool Contains( CIStack aStack ) + { + return iStacks.ContainsKey( aStack.Type ); + } + #endregion + + #region Properties + [CIDBAttributeCell( "Id", 2 )] + public override CIElementId Id + { + get { return base.Id; } + set { base.Id = value; } + } + + [CIDBAttributeCell( "Priority", 3, 0 )] + public int Priority + { + get { return iPriority; } + set { iPriority = value; } + } + + [CIDBAttributeCell("Full Name", 1 )] + public string FullName + { + get + { + StringBuilder ret = new StringBuilder(); + // + if ( OwningProcess.Name.Length > 0 ) + { + ret.AppendFormat( "{0}[{1:x8}]{2:d4}::{3}", + OwningProcess.Name, + OwningProcess.SID, + OwningProcess.Generation, + Name + ); + } + else + { + ret.Append( Name ); + } + // + return ret.ToString(); + } + } + + public override string Name + { + get + { + return iName; + } + set + { + iName = value; + } + } + + public CIProcess OwningProcess + { + get + { + CIProcess ret = (CIProcess) base.Parent; + return ret; + } + } + + [CIDBAttributeCell( "Exit Info", 4 )] + public CIExitInfo ExitInfo + { + get + { + // We ensure there is only ever one, so this is okay + return (CIExitInfo) base.ChildByType( typeof( CIExitInfo ) ); + } + } + + public CIStack[] Stacks + { + get + { + CIElementList stacks = base.ChildrenByType(); + return stacks.ToArray(); + } + } + + public CISummarisableEntity Summary + { + get + { + CISummarisableEntityList list = Container.Summaries; + CISummarisableEntity ret = list[ this ]; + return ret; + } + } + + public bool IsAbnormalTermination + { + get + { + bool ret = ExitInfo.IsAbnormalTermination; + return ret; + } + } + + public CIRegisterList CurrentProcessorModeRegisters + { + get { return Registers.CurrentProcessorModeRegisters; } + } + + public CIThreadRegisterListCollection Registers + { + get + { + // We ensure there is only ever one, so this is okay + return (CIThreadRegisterListCollection) base.ChildByType( typeof( CIThreadRegisterListCollection ) ); + } + } + #endregion + + #region From CIElement + public override void AddChild( CIElement aChild ) + { + // We support 4 types of children at the moment. + // Registers, stacks and exit info, messages. + if ( aChild.GetType() == typeof( CIExitInfo ) ) + { + if ( base.ChildrenByType().Count != 0 ) + { + throw new ArgumentException( "Exit Info already associated with the thread" ); + } + } + else if ( aChild.GetType() == typeof( CIThreadRegisterListCollection ) ) + { + if ( base.ChildrenByType().Count != 0 ) + { + throw new ArgumentException( "Registers already associated with the thread" ); + } + } + else if ( aChild.GetType() == typeof( CIStack ) ) + { + CIStack stack = (CIStack) aChild; + + // We must ensure we don't already have a stack of the specified mode + // associated with the thread. + bool exists = iStacks.ContainsKey( stack.Type ); + if ( exists ) + { + throw new ArgumentException( ArmRegisterBankUtils.BankAsStringLong( stack.Type ) + " mode stack already registered with thread" ); + } + else + { + iStacks.Add( stack.Type, stack ); + } + } + // + base.AddChild( aChild ); + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + private const string KUnknownThreadName = "UnknownThread"; + #endregion + + #region Data members + private int iPriority = 0; + private string iName = KUnknownThreadName; + private Dictionary iStacks = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Threads/CIThreadRegisterListCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Threads/CIThreadRegisterListCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Registers; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashItemLib.Crash.Threads +{ + public class CIThreadRegisterListCollection : CIRegisterListCollection + { + #region Constructors + public CIThreadRegisterListCollection( CIThread aThread ) + : base( aThread.Container, aThread ) + { + Add( new CIRegisterList( Container, aThread, TArmRegisterBank.ETypeUser ) ); + Add( new CIRegisterList( Container, aThread, TArmRegisterBank.ETypeSupervisor ) ); + Add( new CIRegisterList( Container, aThread, TArmRegisterBank.ETypeException ) ); + Add( new CIRegisterList( Container, aThread, TArmRegisterBank.ETypeCoProcessor ) ); + } + #endregion + + #region API + #endregion + + #region Properties + public CIThread OwningThread + { + get { return (CIThread) base.Parent; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Traces/CITrace.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Traces/CITrace.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianStructuresLib.Debug.Trace; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Utils; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.Traces +{ + public class CITrace : CIElement + { + #region Constructors + public CITrace( CIContainer aContainer, TraceLine aLine ) + : base( aContainer ) + { + iLine = aLine; + } + #endregion + + #region API + #endregion + + #region Properties + public string Payload + { + get { return iLine.Payload; } + } + + public string Prefix + { + get { return iLine.Prefix; } + } + + public string Suffix + { + get { return iLine.Suffix; } + } + + public TraceTimeStamp TimeStamp + { + get { return iLine.TimeStamp; } + } + #endregion + + #region Operators + public static implicit operator CIDBRow( CITrace aTrace ) + { + CIDBRow row = new CIDBRow(); + + // To ensure that the trace and cells are correctly associated + row.Element = aTrace; + row.Add( new CIDBCell( aTrace.Prefix ) ); + row.Add( new CIDBCell( aTrace.Payload ) ); + row.Add( new CIDBCell( aTrace.Suffix ) ); + // + return row; + } + + public static implicit operator TraceLine( CITrace aTrace ) + { + return aTrace.iLine; + } + #endregion + + #region From System.Object + public override string ToString() + { + return iLine.ToString(); + } + #endregion + + #region Data members + private readonly TraceLine iLine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Traces/CITraceData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Traces/CITraceData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,145 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianStructuresLib.Debug.Trace; +using SymbianDebugLib.PluginAPI.Types.Trace; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; +using CrashItemLib.Crash.Utils; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Crash.Traces +{ + [CIDBAttributeColumn( "Prefix", 0 )] + [CIDBAttributeColumn( "Payload", 1, true )] + [CIDBAttributeColumn( "Suffix", 2 )] + public class CITraceData : CIElement, IEnumerable + { + #region Constructors + [CIElementAttributeMandatory()] + public CITraceData( CIContainer aContainer ) + : base( aContainer ) + { + // Restrict children to traces + base.AddSupportedChildType( typeof( CITrace ) ); + + // Must be done at the end because it creates elements + base.IsToBeFinalizedLast = true; + } + #endregion + + #region API + #endregion + + #region Properties + public byte[] RawData + { + get { return iRawData != null ? iRawData : new byte[] { }; } + set + { + iRawData = value; + } + } + + public TraceLine[] Lines + { + get + { + TraceLine[] ret = iLines; + if ( ret == null ) + { + ret = new TraceLine[] { }; + } + return ret; + } + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( CIElement element in base.Children ) + { + if ( element is CITrace ) + { + CITrace reg = (CITrace) element; + yield return reg; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIElement element in base.Children ) + { + if ( element is CITrace ) + { + CITrace reg = (CITrace) element; + yield return reg; + } + } + } + #endregion + + #region From CIElementBase + public override void PrepareRows() + { + DataBindingModel.ClearRows(); + + // Our data binding model is based upon the trace object, rather + // than any key-value-pair properties. + foreach ( CITrace t in this ) + { + DataBindingModel.Add( t ); + } + } + + internal override void OnFinalize( CIElementFinalizationParameters aParams ) + { + base.OnFinalize( aParams ); + // + DecodeTraces( aParams.DebugEngine.TraceDictionaries ); + } + #endregion + + #region Internal methods + private void DecodeTraces( DbgEngineTrace aTraceDecoder ) + { + if ( iRawData != null ) + { + iLines = aTraceDecoder.Decode( iRawData ); + if ( iLines != null && iLines.Length > 0 ) + { + foreach ( TraceLine line in iLines ) + { + CITrace entry = new CITrace( base.Container, line ); + base.AddChild( entry ); + } + } + } + } + #endregion + + #region Data members + private byte[] iRawData = null; + private TraceLine[] iLines = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Utils/CIFullNameUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Utils/CIFullNameUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Threads; +using SymbianStructuresLib.Uids; + +namespace CrashItemLib.Crash.Utils +{ + public sealed class CIFullNameUtils + { + #region Constructors + public CIFullNameUtils( string aFullName ) + { + iMatch = KFullNameRegEx.Match( aFullName ); + } + #endregion + + #region API + public void GetProcessInfo( CIProcess aProcess ) + { + if ( IsValid ) + { + aProcess.Name = Process; + aProcess.Generation = Generation; + aProcess.SID = SID; + } + } + + public void GetThreadInfo( CIThread aThread ) + { + if ( IsValid ) + { + aThread.Name = Thread; + } + } + #endregion + + #region Properties + public bool IsValid + { + get { return iMatch.Success; } + } + + public string Process + { + get + { + string ret = string.Empty; + // + if ( IsValid ) + { + ret = iMatch.Groups[ "ProcessName" ].Value; + } + // + return ret; + } + } + + public string Thread + { + get + { + string ret = string.Empty; + // + if ( IsValid ) + { + ret = iMatch.Groups[ "ThreadName" ].Value; + } + // + return ret; + } + } + + public uint SID + { + get + { + uint ret = 0; + // + if ( IsValid ) + { + ret = uint.Parse( iMatch.Groups[ "SID" ].Value, System.Globalization.NumberStyles.AllowHexSpecifier ); + } + // + return ret; + } + } + + public int Generation + { + get + { + int ret = 0; + // + if ( IsValid ) + { + ret = int.Parse( iMatch.Groups[ "Generation" ].Value ); + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region Internal regular expressions + private static readonly Regex KFullNameRegEx = new Regex( + "(?.+)\\[(?[A-Fa-f0-9]{8})\\](?" + + "\\p{N}{4})\\:\\:(?.+)", + RegexOptions.CultureInvariant + | RegexOptions.Compiled + ); + #endregion + + #region Data members + private readonly Match iMatch; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Utils/CIVersionInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Crash/Utils/CIVersionInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Base.DataBinding; + +namespace CrashItemLib.Crash.Utils +{ + public sealed class CIVersionInfo + { + #region Constructors + internal CIVersionInfo() + : this( string.Empty ) + { + } + + internal CIVersionInfo( string aValue ) + : this( string.Empty, aValue ) + { + } + + internal CIVersionInfo( string aName, string aValue ) + { + Name = aName; + Value = aValue; + } + #endregion + + #region API + #endregion + + #region Properties + public bool IsValid + { + get { return !String.IsNullOrEmpty( Value ); } + } + + public string Value + { + get { return iValue; } + set + { + iValue = value; + if ( value == null ) + { + iValue = string.Empty; + } + } + } + + public string Name + { + get { return iName; } + set + { + iName = value; + if ( value == null ) + { + iName = string.Empty; + } + } + } + #endregion + + #region Operators + public static implicit operator string( CIVersionInfo aVersion ) + { + return aVersion.Value; + } + + public static implicit operator CIVersionInfo( string aText ) + { + return new CIVersionInfo( aText ); + } + + public static implicit operator CIDBRow( CIVersionInfo aVersion ) + { + CIDBRow row = new CIDBRow(); + // + row.Add( new CIDBCell( aVersion.Name ) ); + row.Add( new CIDBCell( aVersion.Value ) ); + // + return row; + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + if ( string.IsNullOrEmpty( iName ) ) + { + ret.Append( iValue ); + } + else + { + ret.AppendFormat( "{0} = {1}", iName, iValue ); + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private string iValue = string.Empty; + private string iName = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/CrashItemLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/CrashItemLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,276 @@ + + + Local + 9.0.30729 + 2.0 + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC} + Debug + AnyCPU + + + + + CrashItemLib + + + JScript + Grid + IE50 + false + Library + CrashItemLib + OnBuildSuccess + + + + + + + 2.0 + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + bin\Debug\ + false + 285212672 + false + + + DEBUG;TRACE + + + true + 4096 + false + + + false + false + false + false + 4 + full + prompt + + + bin\Release\ + false + 285212672 + false + + + TRACE + + + false + 4096 + false + + + true + false + false + false + 4 + none + prompt + + + + System + + + System.Data + + + System.Drawing + + + System.Windows.Forms + + + System.XML + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3} + SymbianStackLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + LibResources.resx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + ResXFileCodeGenerator + LibResources.Designer.cs + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/CrashItemLib.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/CrashItemLib.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,72 @@ + + + 7.10.6030 + Debug + AnyCPU + + + + + + + 0 + ProjectFiles + 0 + + + + + + + + + + + en-US + false + + + + + false + false + false + false + false + + + Project + + + + + + + + + + + false + + + false + false + false + false + false + + + Project + + + + + + + + + + + false + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/CIEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/CIEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,567 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using SymbianDebugLib.Engine; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.Threading; +using SymbianUtils.FileSystem; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.Engine.Interfaces; +using CrashItemLib.Engine.Operations; +using CrashItemLib.Engine.Primer; +using CrashItemLib.Engine.ProblemDetectors; +using CrashItemLib.Engine.Sources; +using CrashItemLib.PluginAPI; +using CrashItemLib.Sink; + +namespace CrashItemLib.Engine +{ + public class CIEngine : DisposableObject, IEnumerable, ITracer + { + #region Enumerations + public enum TState + { + // We've started to process the crash sources + EStateProcessingStarted = 0, + + // Engine is idle & fully ready for display & output + EStateProcessingComplete + } + + public enum TSourceEvent + { + EEventSourceReady = 0, + EEventSourceProgress, + EEventSourceStateChanged + } + + public enum TCrashEvent + { + EEventCrashAdded = 0, + EEventCrashRemoved, + EEventCrashRemovedAll + } + #endregion + + #region Delegates & events + public delegate void CIEngineStateHandler( TState aEvent ); + public event CIEngineStateHandler StateChanged = delegate( TState aState ) { }; + + public delegate void CIEngineSourceObserver( TSourceEvent aEvent, CIEngineSource aSource, object aParameter ); + public event CIEngineSourceObserver SourceObservers = delegate( TSourceEvent aEvent, CIEngineSource aSource, object aParameter ) { }; + + public delegate void CIEngineCrashObserver( TCrashEvent aEvent, CIContainer aContainer ); + public event CIEngineCrashObserver CrashObservers; + + public delegate void CIExceptionHandler( Exception aException ); + public event CIExceptionHandler ExceptionHandlers = delegate( Exception aException ) { }; + #endregion + + #region Constructors + public CIEngine( DbgEngine aDebugEngine, ICIEngineUI aUI ) + { + iUI = aUI; + iDebugEngine = aDebugEngine; + // + iPrimer = new CIEnginePrimer( this ); + iPlugins = new CFFPluginRegistry( this ); + iSinkManager = new CISinkManager( this ); + iSources = new CIEngineSourceCollection( this ); + iContainerIndex = new CIContainerIndex( this ); + iContainerCollection = new CIContainerCollection(); + iOperationManager = new CIEngineOperationManager( this ); + iProblemDetectorManager = new CIProblemDetectorManager( this ); + } + #endregion + + #region API + public void ClearAll() + { + lock ( iSources ) + { + iSources.Clear(); + } + ClearCrashes(); + } + + public void ClearCrashes() + { + bool notify = true; + lock ( iContainerCollection ) + { + notify = iContainerCollection.Count > 0; + iContainerCollection.Clear(); + } + // + if ( notify ) + { + OnContainerRemovedAll(); + } + } + + public bool Prime( FileInfo aFile ) + { + bool success = false; + // + try + { + success = iPrimer.Prime( aFile ); + } + catch ( Exception ) + { + } + // + return success; + } + + public bool Prime( DirectoryInfo aDirectory ) + { + bool success = false; + // + try + { + iPrimer.Prime( aDirectory ); + success = true; + } + catch ( Exception ) + { + } + // + return success; + } + + public bool PrimeRecursive( DirectoryInfo aDirectory ) + { + bool success = false; + // + try + { + iPrimer.PrimeRecursive( aDirectory ); + success = true; + } + catch ( Exception ) + { + } + // + return success; + } + + public void IdentifyCrashes( TSynchronicity aSynchronicity ) + { + // If we must operate in synchronous mode, that is, we must not + // return until the all the crash item containers are prepared, + // then we created a blocking object that will be signalled when + // all the asynchronous operations are complete. + DestroyBlocker(); + if ( aSynchronicity == TSynchronicity.ESynchronous ) + { + iSynchronousBlocker = new ManualResetEvent( false ); + } + + // Next, we start processing the source files in order to create + // crash containers. + DestroySourceProcessor(); + iSourceProcessor = new CIEngineSourceProcessor( iSources ); + iSourceProcessor.EventHandler += new CIEngineSourceProcessor.ProcessorEventHandler( SourceProcessor_EventHandler ); + iSourceProcessor.Start( TSynchronicity.EAsynchronous ); + + // Now we operate asynchronously. When the source processor has read + // all of the CIEngineSource objects, it will trigger and event + // callback (SourceProcessor_EventHandler) which will cause us to start + // the serialized operation manager. + // + // When the serialized operation manager completes, it will again indicate + // this via an event callback at which point we will trigger the manual + // reset event (blocker) and therefore resume this main thread. + if ( aSynchronicity == TSynchronicity.ESynchronous ) + { + // Now wait. + using ( iSynchronousBlocker ) + { + iSynchronousBlocker.WaitOne(); + } + iSynchronousBlocker = null; + } + } + #endregion + + #region Properties + public int Count + { + get + { + lock ( iContainerCollection ) + { + return iContainerCollection.Count; + } + } + } + + public CIContainer this[ int aIndex ] + { + get + { + lock ( iContainerCollection ) + { + return iContainerCollection[ aIndex ]; + } + } + } + + public DbgEngine DebugEngine + { + get { return iDebugEngine; } + } + + public CISinkManager SinkManager + { + get { return iSinkManager; } + } + + public CFFPluginRegistry PluginRegistry + { + get { return iPlugins; } + } + + public CIEngineSourceCollection Sources + { + get { return iSources; } + } + #endregion + + #region Event handlers + private void SourceProcessor_EventHandler( CIEngineSourceProcessor.TEvent aEvent ) + { + this.Trace( "[CIEngine] SourceProcessor_EventHandler() - START - aEvent: {0}", aEvent ); + // + if ( aEvent == CIEngineSourceProcessor.TEvent.EEventStarting ) + { + OnStateChanged( TState.EStateProcessingStarted ); + ClearCrashes(); + } + else if ( aEvent == CIEngineSourceProcessor.TEvent.EEventCompleted ) + { + DestroySourceProcessor(); + // + DestroyIndexProcessor(); + iIndexProcessor = new CIContainerIndexProcessor( iContainerIndex, this ); + iIndexProcessor.EventHandler += new CIContainerIndexProcessor.ProcessorEventHandler( IndexProcessor_EventHandler ); + iIndexProcessor.Start( TSynchronicity.EAsynchronous ); + } + // + this.Trace( "[CIEngine] SourceProcessor_EventHandler() - END - aEvent: {0}", aEvent ); + } + + private void IndexProcessor_EventHandler( CIContainerIndexProcessor.TEvent aEvent ) + { + this.Trace( "[CIEngine] IndexProcessor_EventHandler() - START - aEvent: {0}", aEvent ); + // + if ( aEvent == CIContainerIndexProcessor.TEvent.EEventStarting ) + { + } + else if ( aEvent == CIContainerIndexProcessor.TEvent.EEventCompleted ) + { + DestroyIndexProcessor(); + + // All the sources have been processed. Create any problem detectors. + iProblemDetectorManager.EventHandler += new MultiThreadedProcessor.ProcessorEventHandler( ProblemDetectorManager_EventHandler ); + iProblemDetectorManager.Start( TSynchronicity.EAsynchronous ); + } + // + this.Trace( "[CIEngine] IndexProcessor_EventHandler() - END - aEvent: {0}", aEvent ); + } + + private void ProblemDetectorManager_EventHandler( MultiThreadedProcessor.TEvent aEvent ) + { + this.Trace( "[CIEngine] ProblemDetectorManager_EventHandler() - START - aEvent: {0}", aEvent ); + // + if ( aEvent == MultiThreadedProcessor.TEvent.EEventStarting ) + { + } + else if ( aEvent == MultiThreadedProcessor.TEvent.EEventCompleted ) + { + iProblemDetectorManager.EventHandler -= new MultiThreadedProcessor.ProcessorEventHandler( ProblemDetectorManager_EventHandler ); + + // Run any serialized operations + iOperationManager.StateHandler += new CIEngineOperationManager.QueueStateHandler( OperationManager_StateHandler ); + iOperationManager.Start(); + } + // + this.Trace( "[CIEngine] ProblemDetectorManager_EventHandler() - END - aEvent: {0}", aEvent ); + } + + private void OperationManager_StateHandler( CIEngineOperationManager.TState aState ) + { + this.Trace( "[CIEngine] OperationManager_StateHandler() - START - aState: {0}", aState ); + // + if ( aState == SymbianUtils.SerializedOperations.SerializedOperationManager.TState.EStateOperationsCompleted ) + { + iOperationManager.StateHandler -= new CIEngineOperationManager.QueueStateHandler( OperationManager_StateHandler ); + // + IdentifyCrashesComplete(); + } + // + this.Trace( "[CIEngine] OperationManager_StateHandler() - END - aState: {0}", aState ); + } + #endregion + + #region Internal delegates + private delegate void VoidHandler(); + #endregion + + #region Internal methods + internal void Add( CIContainer aContainer ) + { + string fileName = aContainer.Source.MasterFileName; + if ( string.IsNullOrEmpty( fileName ) ) + { + throw new ArgumentException( "Container source file name cannot be empty" ); + } + // + lock ( iContainerCollection ) + { + iContainerCollection.Add( aContainer ); + } + // + if ( CrashObservers != null ) + { + CrashObservers( TCrashEvent.EEventCrashAdded, aContainer ); + } + } + + internal int GetNextElementId() + { + return iIdProvider.GetNextId(); + } + + internal void QueueOperation( CIEngineOperation aOperation ) + { + this.Trace( "[CIEngine] QueueOperation() - aOperation: {0} ({1})", aOperation, aOperation.GetType() ); + iOperationManager.Queue( aOperation ); + } + + internal void OnSourceStateChanged( CIEngineSource aSource ) + { + this.Trace( "[CIEngine] OnSourceStateChanged() - START - aSource: {0}, aSource.IsReady: {1}, aSource.State: {2}", aSource.FileName, aSource.IsReady, aSource.State ); + + SourceObservers( TSourceEvent.EEventSourceStateChanged, aSource, null ); + if ( aSource.IsReady ) + { + SourceObservers( TSourceEvent.EEventSourceReady, aSource, null ); + } + + this.Trace( "[CIEngine] OnSourceStateChanged() - END - aSource: {0}, aSource.IsReady: {1}, aSource.State: {2}", aSource.FileName, aSource.IsReady, aSource.State ); + } + + internal void OnSourceProgress( CIEngineSource aSource, int aProgress ) + { + this.Trace( "[CIEngine] OnSourceProgress() - START - aSource: {0}, aSource.IsReady: {1}, aProgress: {2}", aSource.FileName, aSource.IsReady, aProgress ); + + SourceObservers( TSourceEvent.EEventSourceProgress, aSource, aProgress ); + + this.Trace( "[CIEngine] OnSourceProgress() - END - aSource: {0}, aSource.IsReady: {1}, aProgress: {2}", aSource.FileName, aSource.IsReady, aProgress ); + } + + internal void OnException( Exception aException ) + { + this.Trace( "[CIEngine] OnException() - {0} / {1}", aException.Message, aException.StackTrace ); + ExceptionHandlers( aException ); + } + + internal void OnContainerRemovedAll() + { + if ( CrashObservers != null ) + { + CrashObservers( TCrashEvent.EEventCrashRemovedAll, null ); + } + } + + private void Remove( CIContainer aContainer ) + { + lock ( iContainerCollection ) + { + if ( iContainerCollection.Contains( aContainer ) ) + { + iContainerCollection.Remove( aContainer ); + if ( CrashObservers != null ) + { + CrashObservers( TCrashEvent.EEventCrashRemoved, aContainer ); + } + } + } + } + + private void OnStateChanged( TState aEvent ) + { + this.Trace( "[CIEngine] OnStateChanged() - START - aEvent: {0}", aEvent ); + if ( StateChanged != null ) + { + StateChanged( aEvent ); + } + this.Trace( "[CIEngine] OnStateChanged() - END - aEvent: {0}", aEvent ); + } + + private void IdentifyCrashesComplete() + { + this.Trace( "[CIEngine] IdentifyCrashesComplete()" ); + OnStateChanged( TState.EStateProcessingComplete ); + // + ReleaseBlocker(); + } + + private void DestroyBlocker() + { + if ( iSynchronousBlocker != null ) + { + iSynchronousBlocker.Close(); + iSynchronousBlocker = null; + } + } + + private void ReleaseBlocker() + { + if ( iSynchronousBlocker != null ) + { + iSynchronousBlocker.Set(); + } + } + + private void DestroySourceProcessor() + { + if ( iSourceProcessor != null ) + { + iSourceProcessor.EventHandler -= new CIEngineSourceProcessor.ProcessorEventHandler( SourceProcessor_EventHandler ); + iSourceProcessor.Dispose(); + iSourceProcessor = null; + } + } + + private void DestroyIndexProcessor() + { + if ( iIndexProcessor != null ) + { + iIndexProcessor.EventHandler -= new CIContainerIndexProcessor.ProcessorEventHandler( IndexProcessor_EventHandler ); + iIndexProcessor = null; + } + } + + private void DestroyProblemDetectorManager() + { + if ( iProblemDetectorManager != null ) + { + iProblemDetectorManager.EventHandler -= new MultiThreadedProcessor.ProcessorEventHandler( ProblemDetectorManager_EventHandler ); + iProblemDetectorManager.Dispose(); + } + } + + private void DestroyOperationManager() + { + if ( iOperationManager != null ) + { + iOperationManager.StateHandler -= new CIEngineOperationManager.QueueStateHandler( OperationManager_StateHandler ); + iOperationManager.Dispose(); + } + } + #endregion + + #region Internal properties + internal ICIEngineUI UI + { + get { return iUI; } + } + #endregion + + #region From System.Object + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + UI.CITrace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + UI.CITrace( aFormat, aParams ); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + lock ( iContainerCollection ) + { + foreach ( CIContainer container in iContainerCollection ) + { + yield return container; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + lock ( iContainerCollection ) + { + foreach ( CIContainer container in iContainerCollection ) + { + yield return container; + } + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + DestroyIndexProcessor(); + DestroySourceProcessor(); + DestroyProblemDetectorManager(); + DestroyOperationManager(); + DestroyBlocker(); + } + } + #endregion + + #region Data members + private readonly DbgEngine iDebugEngine; + private readonly ICIEngineUI iUI; + private readonly CIEnginePrimer iPrimer; + private readonly CISinkManager iSinkManager; + private readonly CFFPluginRegistry iPlugins; + private readonly CIEngineSourceCollection iSources; + private readonly CIContainerCollection iContainerCollection; + private readonly CIEngineOperationManager iOperationManager; + private readonly CIProblemDetectorManager iProblemDetectorManager; + private readonly CIContainerIndex iContainerIndex; + private ManualResetEvent iSynchronousBlocker = null; + private CIEngineSourceProcessor iSourceProcessor = null; + private CIContainerIndexProcessor iIndexProcessor = null; + private CIElementIdProvider iIdProvider = new CIElementIdProvider(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Interfaces/ICIEngineUI.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Interfaces/ICIEngineUI.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Reflection; +using SymbianDebugLib.Engine; +using SymbianUtils; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Container; +using CrashItemLib.PluginAPI; +using CrashItemLib.Engine.Primer; +using CrashItemLib.Engine.Sources; +using CrashItemLib.Engine.Operations; +using CrashItemLib.Engine.ProblemDetectors; +using CrashItemLib.Sink; + +namespace CrashItemLib.Engine.Interfaces +{ + public interface ICIEngineUI + { + void CITrace( string aMessage ); + + void CITrace( string aFormat, params object[] aParameters ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Operations/CIEngineOperation.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Operations/CIEngineOperation.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.ComponentModel; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.PluginAPI; +using CrashItemLib.Engine.Sources; +using SymbianUtils.SerializedOperations; + +namespace CrashItemLib.Engine.Operations +{ + internal abstract class CIEngineOperation : SerializedOperation + { + #region Constructors + protected CIEngineOperation( CIEngine aEngine ) + : this( aEngine, 0 ) + { + } + + protected CIEngineOperation( CIEngine aEngine, long aPriority ) + { + iEngine = aEngine; + iPriority = aPriority; + } + #endregion + + #region Properties + protected CIEngine Engine + { + get { return iEngine; } + } + + public override long Priority + { + get { return iPriority; } + } + #endregion + + #region Internal methods + internal void SetPriority( long aPriority ) + { + iPriority = aPriority; + } + #endregion + + #region Data members + private readonly CIEngine iEngine; + private long iPriority = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Operations/CIEngineOperationManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Operations/CIEngineOperationManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.ComponentModel; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.PluginAPI; +using CrashItemLib.Engine.Sources; +using SymbianUtils.SerializedOperations; +using SymbianUtils.Tracer; + +namespace CrashItemLib.Engine.Operations +{ + /// + /// Serialises asynchronous requests - mainly because the symbol engine doesn't much + /// like having dynamically loaded codesegments unloaded underneath it - i.e. it doesn't + /// work multithreaded! + /// + internal class CIEngineOperationManager : SerializedOperationManager, ITracer + { + #region Constructors + public CIEngineOperationManager( CIEngine aEngine ) + { + iEngine = aEngine; + + // Uncomment this line if you want operation tracing + //base.Tracer = (ITracer) this; + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Event handlers + #endregion + + #region ITracer Members + void ITracer.Trace( string aMessage ) + { + iEngine.Trace( aMessage ); + } + + void ITracer.Trace( string aFormat, params object[] aParams ) + { + iEngine.Trace( aFormat, aParams ); + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly CIEngine iEngine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Primer/CIEnginePrimer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Primer/CIEnginePrimer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,157 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Reflection; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.PluginAPI; +using CrashItemLib.Engine.Sources; + +namespace CrashItemLib.Engine.Primer +{ + public class CIEnginePrimer + { + #region Constructors + internal CIEnginePrimer( CIEngine aEngine ) + { + iEngine = aEngine; + iWorkingSet = new CIPrimerWorkingSet( aEngine ); + } + #endregion + + #region API + public bool Prime( FileInfo aFile ) + { + Clear(); + // + CFFFileList otherFiles = new CFFFileList(); + bool success = PrimeOne( aFile, otherFiles ); + Flush(); + // + return success; + } + + public bool Prime( DirectoryInfo aDirectory ) + { + int successCount = 0; + // + Clear(); + // + CFFFileList otherFiles = new CFFFileList( aDirectory ); + while ( !otherFiles.IsEmpty ) + { + FileInfo file = otherFiles.Dequeue(); + // + try + { + bool success = PrimeOne( file, otherFiles ); + if ( success ) + { + ++successCount; + } + } + catch ( Exception ) + { + } + } + // + Flush(); + // + return ( successCount > 0 ); + } + + public bool PrimeRecursive( DirectoryInfo aDirectory ) + { + int successCount = 0; + // + Clear(); + // + CFFFileList otherFiles = new CFFFileList( aDirectory, SearchOption.AllDirectories ); + while ( !otherFiles.IsEmpty ) + { + FileInfo file = otherFiles.Dequeue(); + // + try + { + bool success = PrimeOne( file, otherFiles ); + if ( success ) + { + ++successCount; + } + } + catch ( Exception ) + { + } + } + // + Flush(); + // + return ( successCount > 0 ); + } + #endregion + + #region Properties + internal CFFPluginRegistry PluginLoader + { + get { return iEngine.PluginRegistry; } + } + + internal CIEngineSourceCollection Sources + { + get { return iEngine.Sources; } + } + #endregion + + #region Internal methods + private void Clear() + { + // Start with a clear list + iWorkingSet.Clear(); + } + + private void Flush() + { + // This populates the engine's source list + iWorkingSet.Rationalise(); + iWorkingSet.Clear(); + } + + private bool PrimeOne( FileInfo aFile, CFFFileList aOtherFiles ) + { + bool success = false; + + // Check with the plugin loader to find all handlers + CFFSourceAndConfidence[] handlers = PluginLoader.GetHandlers( aFile, aOtherFiles ); + if ( handlers.Length > 0 ) + { + iWorkingSet.Add( handlers ); + success = true; + } + // + return success; + } + #endregion + + #region Data members + private readonly CIEngine iEngine; + private readonly CIPrimerWorkingSet iWorkingSet; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Primer/CIEnginePrimerWorkingSet.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Primer/CIEnginePrimerWorkingSet.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using CrashItemLib.PluginAPI; +using CrashItemLib.Crash.Source; +using CrashItemLib.Engine.Sources; + +namespace CrashItemLib.Engine.Primer +{ + internal class CIPrimerWorkingSet + { + #region Constructors + public CIPrimerWorkingSet( CIEngine aEngine ) + { + iEngine = aEngine; + } + #endregion + + #region API + public void Clear() + { + iEntries.Clear(); + } + + public void Add( CFFSourceAndConfidence aEntry ) + { + // For every single source file we might actually have multiple + // plugins that claim they can interpet the contents. + // + // Therefore we maintain a dictionary that is keyed by the file name + // and contains a list of plugin handlers (and their associatied + // confidence level for handling the source file). + List entries = null; + // + FileInfo file = aEntry.MasterFile; + System.Diagnostics.Debug.Assert( file != null ); + // + if ( !iEntries.ContainsKey( file ) ) + { + entries = new List(); + iEntries.Add( file, entries ); + } + else + { + entries = iEntries[ file ]; + } + // + entries.Add( aEntry ); + } + + public void Add( IEnumerable aEntries ) + { + foreach ( CFFSourceAndConfidence level in aEntries ) + { + Add( level ); + } + } + + public void Rationalise() + { + // At this point we're ready to decide how we will process the source + // files. Some may be trace files, in which case we probably need to multiple + // the various plugin handlers (that support trace-based content) so that they + // can each have a stab at handling the trace content. + // + // For native (non-trace) handlers, we only let the handler with the highest + // confidence ultimately read the file. + // + // 1) For any native entries, sort them by priority and discard + // everything but the highest priority entry. + // + // 2) For any trace entries, then we basically don't need to do anything + // because all entries will require processing via a trace reader. + foreach ( KeyValuePair> kvp in iEntries ) + { + // For native entries relating to this file + List listNative = new List(); + + // For trace entries relating to this file + List listTrace = new List(); + + FileInfo file = kvp.Key; + List entries = kvp.Value; + foreach ( CFFSourceAndConfidence conf in entries ) + { + if ( conf.OpType == CFFSource.TReaderOperationType.EReaderOpTypeNative ) + { + listNative.Add( conf ); + } + else if ( conf.OpType == CFFSource.TReaderOperationType.EReaderOpTypeTrace ) + { + listTrace.Add( conf ); + } + else + { + // Not supported + } + } + + // Sort the native list based upon confidence level + Comparison comparer = delegate( CFFSourceAndConfidence aLeft, CFFSourceAndConfidence aRight ) + { + return aLeft.CompareTo( aRight ); + }; + listNative.Sort( comparer ); + + // Save highest priority native entry - only try to treat the source file as a + // trace entry if no native entries claim to be able to read it. + if ( listNative.Count > 0 ) + { + CFFSourceAndConfidence highestConfidence = listNative[ 0 ]; + CIEngineSource sourceNative = CIEngineSource.NewNative( iEngine, highestConfidence ); + iEngine.Sources.Add( sourceNative ); + } + else if ( listTrace.Count > 0 ) + { + // If we found some trace entries, then immediately store the trace source. + // The listTrace array contains all of the plugins that claim to be able to + // read the trace-based source file. + CIEngineSource sourceTrace = CIEngineSource.NewTrace( iEngine, listTrace.ToArray() ); + iEngine.Sources.Add( sourceTrace ); + } + } + } + #endregion + + #region Properties + #endregion + + #region Data members + private readonly CIEngine iEngine; + private Dictionary< FileInfo, List > iEntries = new Dictionary< FileInfo, List >(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Base/CIProblemDetector.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Base/CIProblemDetector.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Summarisable; +using SymbianStructuresLib.Arm.Registers; + +namespace CrashItemLib.Engine.ProblemDetectors +{ + internal abstract class CIProblemDetector + { + #region Constructors + protected CIProblemDetector() + { + } + #endregion + + #region API + public abstract void Check( CIContainer aContainer ); + + public virtual long Priority + { + get { return long.MinValue; } + } + #endregion + + #region Internal methods + protected string CreateIdentifierText( CISummarisableEntity aEntry ) + { + StringBuilder ret = new StringBuilder(); + // + if ( aEntry.IsAvailable( CISummarisableEntity.TElement.EElementThread ) ) + { + ret.AppendFormat( LibResources.CIProblemDetector_Msg_Thread, aEntry.Thread.FullName ); + } + else if ( aEntry.IsAvailable( CISummarisableEntity.TElement.EElementStack ) ) + { + ret.AppendFormat( LibResources.CIProblemDetector_Msg_Stack, ArmRegisterBankUtils.BankAsStringLong( aEntry.Stack.Type ) ); + } + // + return ret.ToString(); + } + + protected void CreateMessage( CIContainer aContainer, CIElement aAssociatedElement, string aTitle ) + { + CreateMessage( aContainer, aAssociatedElement, aTitle, string.Empty ); + } + + protected void CreateMessage( CIContainer aContainer, CIElement aAssociatedElement, string aTitle, string aDescription ) + { + CIMessage message = CIMessage.NewMessage( aContainer ); + message.Title = aTitle; + message.Description = aDescription; + // + aAssociatedElement.AddChild( message ); + } + + protected void CreateWarning( CIContainer aContainer, CIElement aAssociatedElement, string aTitle ) + { + CreateWarning( aContainer, aAssociatedElement, aTitle, string.Empty ); + } + + protected void CreateWarning( CIContainer aContainer, CIElement aAssociatedElement, string aTitle, string aDescription ) + { + CIMessageWarning message = new CIMessageWarning( aContainer, aTitle ); + message.Description = aDescription; + // + aAssociatedElement.AddChild( message ); + } + + protected void CreateError( CIContainer aContainer, CIElement aAssociatedElement, string aTitle ) + { + CreateError( aContainer, aAssociatedElement, aTitle, string.Empty ); + } + + protected void CreateError( CIContainer aContainer, CIElement aAssociatedElement, string aTitle, string aDescription ) + { + CIMessageError message = new CIMessageError( aContainer, aTitle ); + message.Description = aDescription; + // + aAssociatedElement.AddChild( message ); + } + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/CIProblemDetectorManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/CIProblemDetectorManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using SymbianUtils.Threading; +using SymbianUtils; +using SymbianUtils.PluginManager; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Messages; + +namespace CrashItemLib.Engine.ProblemDetectors +{ + internal class CIProblemDetectorManager : MultiThreadedProcessor + { + #region Constructors + public CIProblemDetectorManager( CIEngine aEngine ) + : base( KDetectors ) + { + iEngine = aEngine; + } + + static CIProblemDetectorManager() + { + KDetectors.LoadFromCallingAssembly(); + } + #endregion + + #region API + #endregion + + #region From MultiThreadedProcessor + public override void Start( TSynchronicity aSynchronicity ) + { + // Make sure we always start with a fully populated list of detectors + base.PopulateQueue( KDetectors ); + base.Start( aSynchronicity ); + } + + protected override bool Process( CIProblemDetector aItem ) + { + iEngine.Trace( "[CIProblemDetectorManager] Process() - START - detector: \'{0}\'", aItem.GetType().Name ); + // + foreach ( CIContainer container in iEngine ) + { + aItem.Check( container ); + } + // + iEngine.Trace( "[CIProblemDetectorManager] Process() - END - detector: \'{0}\'", aItem.GetType().Name ); + return true; + } + #endregion + + #region Data members + private readonly CIEngine iEngine; + private static PluginManager KDetectors = new PluginManager(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/CodeSeg/CIPDCodeSegAvailability.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/CodeSeg/CIPDCodeSegAvailability.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.CodeSegs; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Summarisable; +using SymbianStructuresLib.Arm.Registers; +using SymbianUtils.Range; + +namespace CrashItemLib.Engine.ProblemDetectors.CodeSeg +{ + internal class CIPDCodeSegAvailability : CIProblemDetector + { + #region Constructors + public CIPDCodeSegAvailability() + { + } + #endregion + + #region From CIProblemDetector + public override void Check( CIContainer aContainer ) + { + CIElementList allCodeSegs = aContainer.ChildrenByType( CIElement.TChildSearchType.EEntireHierarchy ); + foreach ( CICodeSeg codeSeg in allCodeSegs ) + { + bool isResolved = codeSeg.IsResolved; + if ( !isResolved ) + { + CreateMissingWarning( codeSeg ); + } + if ( codeSeg.IsMismatched ) + { + CreateMismatchWarning( codeSeg ); + } + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void CreateMismatchWarning( CICodeSeg aCodeSeg ) + { + CIMessageWarning warning = new CIMessageWarning( aCodeSeg.Container, LibResources.CIPDCodeSegAvailability_CodeSegMisMatch_Title ); + warning.AddLineFormatted( LibResources.CIPDCodeSegAvailability_CodeSegMisMatch_Description_L1, aCodeSeg, aCodeSeg.OwningProcess.Name ); + warning.AddLineFormatted( LibResources.CIPDCodeSegAvailability_CodeSegMisMatch_Description_L2, aCodeSeg.Base, aCodeSeg.MismatchAddress ); + // + aCodeSeg.AddChild( warning ); + } + + private void CreateMissingWarning( CICodeSeg aCodeSeg ) + { + CIMessageWarning warning = new CIMessageWarning( aCodeSeg.Container, LibResources.CIPDCodeSegAvailability_NoSymbols_Title ); + warning.AddLineFormatted( LibResources.CIPDCodeSegAvailability_NoSymbols_Description, aCodeSeg, aCodeSeg.OwningProcess.Name ); + // + aCodeSeg.AddChild( warning ); + } + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Registers/CIPDRegAvailability.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Registers/CIPDRegAvailability.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Summarisable; +using SymbianStructuresLib.Arm.Registers; +using SymbianUtils.Range; + +namespace CrashItemLib.Engine.ProblemDetectors.Registers +{ + internal class CIPDRegAvailability : CIProblemDetector + { + #region Constructors + public CIPDRegAvailability() + { + } + #endregion + + #region From CIProblemDetector + public override void Check( CIContainer aContainer ) + { + CISummarisableEntityList list = aContainer.Summaries; + foreach ( CISummarisableEntity entry in list ) + { + // Check that each stack contains some registers and at least the SP. + bool stackAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementStack ); + bool regsAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementRegisters ); + // + if ( stackAvailable ) + { + CIStack stack = entry.Stack; + // + if ( regsAvailable ) + { + CIRegisterList regs = stack.Registers; + + // Check that SP, LR and PC are available + bool pointerAvailable = regs.Contains( TArmRegisterType.EArmReg_SP ); + if ( !pointerAvailable ) + { + base.CreateWarning( aContainer, stack, + LibResources.CIPDRegAvailability_MissingSP_Title, + string.Format( LibResources.CIPDRegAvailability_MissingSP_Description, base.CreateIdentifierText( entry ) ) + ); + } + // + bool lrAvailable = regs.Contains( TArmRegisterType.EArmReg_LR ); + if ( !lrAvailable ) + { + base.CreateWarning( aContainer, stack, + LibResources.CIPDRegAvailability_MissingLR_Title, + string.Format( LibResources.CIPDRegAvailability_MissingLR_Description, base.CreateIdentifierText( entry ) ) + ); + } + // + bool pcAvailable = regs.Contains( TArmRegisterType.EArmReg_PC ); + if ( !pcAvailable ) + { + base.CreateWarning( aContainer, stack, + LibResources.CIPDRegAvailability_MissingPC_Title, + string.Format( LibResources.CIPDRegAvailability_MissingPC_Description, base.CreateIdentifierText( entry ) ) + ); + } + + // If R0 is available, check if it is 0 and check whether an exception occurred - if so, it was possibly + // caused by de-referencing a NULL this pointer. + bool threadAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementThread ); + if ( threadAvailable ) + { + if ( regs.Contains( TArmRegisterType.EArmReg_00 ) ) + { + CIRegister r0 = regs[ TArmRegisterType.EArmReg_00 ]; + // + bool r0WasNull = ( r0.Value == 0 ); + bool wasException = entry.IsAbnormalTermination && ( entry.Thread.ExitInfo.Type == CrashItemLib.Crash.ExitInfo.CIExitInfo.TExitType.EExitTypeException ); + bool wasKernExec3 = entry.IsAbnormalTermination && ( entry.Thread.ExitInfo.Type == CrashItemLib.Crash.ExitInfo.CIExitInfo.TExitType.EExitTypePanic && + entry.Thread.ExitInfo.Category.ToUpper() == "KERN-EXEC" && + entry.Thread.ExitInfo.Reason == 3 ); + // + if ( r0WasNull && ( wasException || wasKernExec3 ) ) + { + base.CreateWarning( aContainer, r0, + LibResources.CIPDRegAvailability_NullThisPointer_Title, + string.Format( LibResources.CIPDRegAvailability_NullThisPointer_Description, base.CreateIdentifierText( entry ) ) + ); + } + } + } + } + else + { + base.CreateWarning( aContainer, stack, + LibResources.CIPDRegAvailability_NoRegsForStack_Title, + string.Format( LibResources.CIPDRegAvailability_NoRegsForStack_Description, base.CreateIdentifierText( entry ) ) + ); + } + } + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Stack/CIPDStackBoundaryValidator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Stack/CIPDStackBoundaryValidator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Summarisable; +using SymbianStructuresLib.Arm.Registers; +using SymbianUtils.Range; + +namespace CrashItemLib.Engine.ProblemDetectors.Stack +{ + internal class CIPDStackBoundaryValidator : CIProblemDetector + { + #region Constructors + public CIPDStackBoundaryValidator() + { + } + #endregion + + #region From CIProblemDetector + public override void Check( CIContainer aContainer ) + { + CISummarisableEntityList list = aContainer.Summaries; + foreach ( CISummarisableEntity entry in list ) + { + bool stackAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementStack ); + bool regsAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementRegisters ); + // + if ( stackAvailable && regsAvailable ) + { + CIStack stack = entry.Stack; + bool pointerAvailable = stack.Registers.Contains( TArmRegisterType.EArmReg_SP ); + // + if ( pointerAvailable ) + { + CIRegister regSP = stack.Pointer; + AddressRange stackRange = entry.Stack.Range; + // + if ( stack.IsOverflow ) + { + base.CreateError( aContainer, stack, + LibResources.CIPDStackBoundaryValidator_StackOverflow_Title, + string.Format( LibResources.CIPDStackBoundaryValidator_StackOverflow_Description, base.CreateIdentifierText( entry ) ) + ); + } + else if ( !stackRange.Contains( regSP ) ) + { + base.CreateError( aContainer, stack, + LibResources.CIPDStackBoundaryValidator_StackUnderflow_Title, + string.Format( LibResources.CIPDStackBoundaryValidator_StackUnderflow_Description, base.CreateIdentifierText( entry ) ) + ); + } + } + } + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Stack/CIPDStackDataValidator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Stack/CIPDStackDataValidator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Summarisable; +using SymbianStructuresLib.Arm.Registers; +using SymbianUtils.Range; + +namespace CrashItemLib.Engine.ProblemDetectors.Stack +{ + internal class CIPDStackDataValidator : CIProblemDetector + { + #region Constructors + public CIPDStackDataValidator() + { + } + #endregion + + #region From CIProblemDetector + public override void Check( CIContainer aContainer ) + { + CISummarisableEntityList list = aContainer.Summaries; + foreach ( CISummarisableEntity entry in list ) + { + bool stackAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementStack ); + bool regsAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementRegisters ); + if ( stackAvailable && regsAvailable ) + { + CIStack stack = entry.Stack; + // + bool pointerAvailable = stack.Registers.Contains( TArmRegisterType.EArmReg_SP ); + if ( pointerAvailable ) + { + CIRegister regSP = stack.Pointer; + AddressRange stackDataRange = stack.RawDataRange; + // + if ( !stackDataRange.Contains( regSP ) ) + { + base.CreateWarning( aContainer, stack, + LibResources.CPIDStackDataValidator_Title, + string.Format( LibResources.CPIDStackDataValidator_Description, base.CreateIdentifierText( entry ) ) + ); + } + } + } + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Stack/CIPDStackRegisterAvailability.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Stack/CIPDStackRegisterAvailability.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Summarisable; +using SymbianStructuresLib.Arm.Registers; +using SymbianUtils.Range; + +namespace CrashItemLib.Engine.ProblemDetectors.Stack +{ + internal class CIPDStackRegisterAvailability : CIProblemDetector + { + #region Constructors + public CIPDStackRegisterAvailability() + { + } + #endregion + + #region From CIProblemDetector + public override void Check( CIContainer aContainer ) + { + CISummarisableEntityList list = aContainer.Summaries; + foreach ( CISummarisableEntity entry in list ) + { + bool stackAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementStack ); + if ( stackAvailable ) + { + CIStack stack = entry.Stack; + // + bool regsAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementRegisters ); + if ( regsAvailable ) + { + bool pointerAvailable = stack.Registers.Contains( TArmRegisterType.EArmReg_SP ); + // + if ( pointerAvailable == false && stack.RawDataLength > 0 ) + { + base.CreateWarning( aContainer, stack, + LibResources.CIPDStackRegisterAvailability_MissingSP_Title, + string.Format( LibResources.CIPDStackRegisterAvailability_MissingSP_Description, base.CreateIdentifierText( entry ) ) + ); + } + } + else + { + base.CreateWarning( aContainer, stack, + LibResources.CIPDStackRegisterAvailability_MissingRegisters_Title, + string.Format( LibResources.CIPDStackRegisterAvailability_MissingRegisters_Description, base.CreateIdentifierText( entry ) ) + ); + } + } + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Thread/CIPDThreadValidity.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/ProblemDetectors/Thread/CIPDThreadValidity.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Summarisable; +using SymbianStructuresLib.Arm.Registers; +using SymbianUtils.Range; + +namespace CrashItemLib.Engine.ProblemDetectors.Stack +{ + internal class CIPDThreadValidity : CIProblemDetector + { + #region Constructors + public CIPDThreadValidity() + { + } + #endregion + + #region From CIProblemDetector + public override void Check( CIContainer aContainer ) + { + CISummarisableEntityList list = aContainer.Summaries; + foreach ( CISummarisableEntity entry in list ) + { + bool stackAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementStack ); + bool threadAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementThread ); + // + if ( threadAvailable && !stackAvailable ) + { + base.CreateWarning( aContainer, entry.Thread, + LibResources.CIPDThreadValidity_NoStack_Title, + string.Format( LibResources.CIPDThreadValidity_NoStack_Description, base.CreateIdentifierText( entry ) ) + ); + } + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/CIEngineSource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/CIEngineSource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,238 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using CrashItemLib.PluginAPI; +using CrashItemLib.Crash.Source; +using CrashItemLib.Crash.Container; +using CrashItemLib.Engine.Sources.Types; + +namespace CrashItemLib.Engine.Sources +{ + public class CIEngineSource : IEnumerable + { + #region Enumerations + public enum TState + { + EStateUninitialised = 0, + EStateProcessing, + EStateReady, + EStateReadyNoItems, + EStateReadyCorrupt + } + #endregion + + #region Static constructors + /// + /// Create a source that is linked with a single crash file format plugin + /// + public static CIEngineSource NewNative( CIEngine aEngine, CFFSource aEntry ) + { + CIEngineSource ret = new CIEngineSource( aEngine, aEntry ); + return ret; + } + + /// + /// Create a source that is associated with a trace file and potentially one + /// or more plugins which all think they are capable of interpreting trace-based + /// content. + /// + public static CIEngineSource NewTrace( CIEngine aEngine, CFFSource[] aEntries ) + { + CIEngineSource ret = new CIEngineSource( aEngine, aEntries ); + return ret; + } + #endregion + + #region Constructors + private CIEngineSource( CIEngine aEngine, CFFSource aEntry ) + { + iEngine = aEngine; + iFile = aEntry.MasterFile; + iReader = new CIEngineSourceReaderNative( this, aEntry ); + } + + private CIEngineSource( CIEngine aEngine, CFFSource[] aEntries ) + { + if ( aEntries == null || aEntries.Length == 0 ) + { + throw new ArgumentException( "Cannot create trace-based source without entry list" ); + } + + iEngine = aEngine; + iFile = aEntries[0].MasterFile; + iReader = new CIEngineSourceReaderTrace( this, aEntries ); + } + #endregion + + #region Framework API + #endregion + + #region API + internal void SaveContainer( CIContainer aContainer ) + { + // Update list of created containers + lock ( iCreatedContainers ) + { + iCreatedContainers.Add( aContainer ); + } + + // Notify the engine which will cascade to UI + iEngine.Add( aContainer ); + } + + internal void Read() + { + lock ( iCreatedContainers ) + { + iCreatedContainers.Clear(); + } + State = TState.EStateProcessing; + + // We need this in order to report progress to the engine + System.Diagnostics.Debug.Assert( iCollection != null ); + + // Initiate synchronous read and record any exceptions + TState finalState = iReader.Read(); + this.State = finalState; + } + + internal void OnSourceReadingProgress( int aProgress ) + { + iCollection.OnSourceProgress( this, aProgress ); + } + #endregion + + #region Properties + public TState State + { + get + { + lock ( iSyncRoot ) + { + return iState; + } + } + protected set + { + lock ( iSyncRoot ) + { + iState = value; + } + // + iCollection.OnSourceStateChanged( this ); + } + } + + public bool IsReady + { + get + { + lock ( iSyncRoot ) + { + bool ready = false; + // + switch ( iState ) + { + case TState.EStateReady: + case TState.EStateReadyCorrupt: + case TState.EStateReadyNoItems: + ready = true; + break; + default: + break; + } + // + return ready; + } + } + } + + public FileInfo File + { + get { return iFile; } + } + + public string FileName + { + get { return iFile.FullName; } + } + + public int ContainerCount + { + get + { + lock ( iCreatedContainers ) + { + return iCreatedContainers.Count; + } + } + } + + internal CFFSource.TReaderOperationType OpType + { + get { return iReader.OpType; } + } + + internal CIEngine Engine + { + get { return iEngine; } + } + + internal CIEngineSourceCollection Collection + { + get { return iCollection; } + set { iCollection = value; } + } + #endregion + + #region Internal methods + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( CIContainer container in iCreatedContainers ) + { + yield return container; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( CIContainer container in iCreatedContainers ) + { + yield return container; + } + } + #endregion + + #region Data members + private readonly CIEngine iEngine; + private readonly FileInfo iFile; + private readonly CIEngineSourceReader iReader; + private object iSyncRoot = new object(); + private TState iState = TState.EStateUninitialised; + private CIContainerCollection iCreatedContainers = new CIContainerCollection(); + private CIEngineSourceCollection iCollection = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/CIEngineSourceCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/CIEngineSourceCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace CrashItemLib.Engine.Sources +{ + public class CIEngineSourceCollection : IEnumerable + { + #region Constructors + public CIEngineSourceCollection( CIEngine aEngine ) + { + iEngine = aEngine; + } + #endregion + + #region API + public void Clear() + { + lock ( iSources ) + { + iSources.Clear(); + } + } + + public void Add( CIEngineSource aEntry ) + { + aEntry.Collection = this; + lock ( iSources ) + { + iSources.Add( aEntry ); + } + } + #endregion + + #region Properties + public int Count + { + get + { + lock ( iSources ) + { + return iSources.Count; + } + } + } + + public CIEngineSource this[ int aIndex ] + { + get + { + lock ( iSources ) + { + return iSources[ aIndex ]; + } + } + } + + public CIEngine Engine + { + get { return iEngine; } + } + #endregion + + #region Internal methods + internal void OnSourceProgress( CIEngineSource aSource, int aProgress ) + { + iEngine.OnSourceProgress( aSource, aProgress ); + } + + internal void OnSourceStateChanged( CIEngineSource aSource ) + { + iEngine.OnSourceStateChanged( aSource ); + } + + internal void OnException( Exception aException ) + { + iEngine.Trace( "[CIEngineSourceCollection] OnException() - aException: {0} / {1}", aException.Message, aException.StackTrace ); + iEngine.OnException( aException ); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( CIEngineSource entry in iSources ) + { + yield return entry; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( CIEngineSource entry in iSources ) + { + yield return entry; + } + } + #endregion + + #region Data members + private readonly CIEngine iEngine; + private List iSources = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/CIEngineSourceProcessor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/CIEngineSourceProcessor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Threading; +using System.Reflection; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianUtils; +using SymbianUtils.Threading; +using SymbianUtils.FileSystem; +using SymbianUtils.Tracer; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Container; +using CrashItemLib.PluginAPI; +using CrashItemLib.Engine.Interfaces; +using CrashItemLib.Engine.Sources; + +namespace CrashItemLib.Engine.Sources +{ + internal class CIEngineSourceProcessor : MultiThreadedProcessor + { + #region Constructors + public CIEngineSourceProcessor( CIEngineSourceCollection aCollection ) + : base( aCollection ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + protected override bool Process( CIEngineSource aItem ) + { + aItem.Read(); + return true; + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/Types/CIEngineSourceReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/Types/CIEngineSourceReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianUtils.Tracer; +using CrashItemLib.PluginAPI; +using CrashItemLib.Crash.Source; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Engine.Sources.Types +{ + internal abstract class CIEngineSourceReader : ITracer + { + #region Constructors + protected CIEngineSourceReader( CIEngineSource aSource ) + { + iSource = aSource; + } + #endregion + + #region Abstract API + public abstract CIEngineSource.TState Read(); + + public abstract CFFSource.TReaderOperationType OpType + { + get; + } + #endregion + + #region API + protected void AddException( Exception aException ) + { + iExceptions.Add( aException ); + } + + protected void SaveCrash( CIContainer aCrashContainer ) + { + iSource.SaveContainer( aCrashContainer ); + } + #endregion + + #region Properties + public CIEngineSource Source + { + get { return iSource; } + } + + public int CrashItemCount + { + get { return iSource.ContainerCount; } + } + + public bool HasExceptions + { + get { return iExceptions.Count > 0; } + } + + public Exception[] Exceptions + { + get { return iExceptions.ToArray(); } + } + #endregion + + #region Internal methods + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + iSource.Engine.Trace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iSource.Engine.Trace( aFormat, aParams ); + } + #endregion + + #region Data members + private readonly CIEngineSource iSource; + private List iExceptions = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/Types/CIEngineSourceReaderNative.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/Types/CIEngineSourceReaderNative.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using CrashItemLib.PluginAPI; +using CrashItemLib.Crash.Source; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Engine.Sources.Types +{ + internal sealed class CIEngineSourceReaderNative : CIEngineSourceReader + { + #region Constructors + public CIEngineSourceReaderNative( CIEngineSource aSource, CFFSource aPluginSource ) + : base( aSource ) + { + iPluginSource = aPluginSource; + } + #endregion + + #region From CIEngineSourceReader + public override CIEngineSource.TState Read() + { + CIEngineSource.TState ret = CIEngineSource.TState.EStateReadyCorrupt; + CFFReader reader = iPluginSource.Reader; + // + try + { + reader.Observer += new CFFReader.ReaderObserver( CFFReader_Observer ); + reader.ExceptionHandler += new CFFReader.ReaderExceptionHandler( CFFReader_ExceptionHandler ); + + // Perform synchronous read + reader.OnNativeReadInit(); + + // Decide final state + CFFReader.TState readerState = reader.State; + switch ( readerState ) + { + default: + case CFFReader.TState.EStateProcessing: + case CFFReader.TState.EStateUninitialised: + SymbianUtils.SymDebug.SymDebugger.Assert( false ); + break; + case CFFReader.TState.EStateCorrupt: + ret = CIEngineSource.TState.EStateReadyCorrupt; + break; + case CFFReader.TState.EStateReady: + if ( base.CrashItemCount > 0 ) + { + ret = CIEngineSource.TState.EStateReady; + } + else + { + ret = CIEngineSource.TState.EStateReadyNoItems; + } + break; + } + } + finally + { + reader.Observer -= new CFFReader.ReaderObserver( CFFReader_Observer ); + reader.ExceptionHandler -= new CFFReader.ReaderExceptionHandler( CFFReader_ExceptionHandler ); + } + // + return ret; + } + + public override CFFSource.TReaderOperationType OpType + { + get { return CFFSource.TReaderOperationType.EReaderOpTypeNative; } + } + #endregion + + #region Properties + #endregion + + #region Event Handlers + private void CFFReader_Observer( CFFReader.TEvent aEvent, CFFReader aReader, object aContext ) + { + base.Trace( "[CIEngineSourceNative] CFFReader_Observer() - START - aEvent: " + aEvent + ", file: " + base.Source.FileName ); + + // This method is called for both native and trace based events + if ( aEvent == CFFReader.TEvent.EReadingContainerCreated ) + { + CIContainer container = aContext as CIContainer; + if ( container != null ) + { + base.SaveCrash( container ); + } + } + else if ( aEvent == CFFReader.TEvent.EReadingProgress ) + { + int progress = ( aContext != null && aContext is int ) ? (int) aContext : 0; + base.Source.OnSourceReadingProgress( progress ); + } + + base.Trace( "[CIEngineSourceNative] CFFReader_Observer() - END - aEvent: " + aEvent + ", file: " + base.Source.FileName ); + } + + private void CFFReader_ExceptionHandler( Exception aException, CFFReader aReader ) + { + base.AddException( aException ); + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly CFFSource iPluginSource; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/Types/CIEngineSourceReaderTrace.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Engine/Sources/Types/CIEngineSourceReaderTrace.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,302 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using CrashItemLib.PluginAPI; +using CrashItemLib.Crash.Source; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.Engine.Sources.Types +{ + internal sealed class CIEngineSourceReaderTrace : CIEngineSourceReader + { + #region Constructors + public CIEngineSourceReaderTrace( CIEngineSource aSource, CFFSource[] aPluginSources ) + : base( aSource ) + { + iPluginSources.AddRange( aPluginSources ); + } + #endregion + + #region From CIEngineSourceReader + public override CIEngineSource.TState Read() + { + CIEngineSource.TState ret = CIEngineSource.TState.EStateReadyCorrupt; + + // Listen to container creation events in all plugin reader objects + foreach ( CFFSource source in iPluginSources ) + { + CFFReader reader = source.Reader; + reader.Observer += new CFFReader.ReaderObserver( CFFReader_Observer ); + reader.ExceptionHandler += new CFFReader.ReaderExceptionHandler( CFFReader_ExceptionHandler ); + } + // + try + { + CIEngineTraceReader traceReader = new CIEngineTraceReader( this ); + traceReader.Read( TSynchronicity.ESynchronous ); + } + finally + { + ret = CalculateFinalState(); + + // Stop listening to container creation events in all plugin reader objects + foreach ( CFFSource source in iPluginSources ) + { + CFFReader reader = source.Reader; + reader.Observer -= new CFFReader.ReaderObserver( CFFReader_Observer ); + reader.ExceptionHandler -= new CFFReader.ReaderExceptionHandler( CFFReader_ExceptionHandler ); + } + } + // + return ret; + } + + public override CFFSource.TReaderOperationType OpType + { + get { return CFFSource.TReaderOperationType.EReaderOpTypeTrace; } + } + #endregion + + #region API + #endregion + + #region Event handlers + private void CFFReader_Observer( CFFReader.TEvent aEvent, CFFReader aReader, object aContext ) + { + base.Trace( "[CIEngineSourceReaderTrace] CFFReader_Observer() - START - aEvent: " + aEvent + ", file: " + base.Source.FileName ); + + // This method is called for both native and trace based events + if ( aEvent == CFFReader.TEvent.EReadingContainerCreated ) + { + CIContainer container = aContext as CIContainer; + if ( container != null ) + { + base.SaveCrash( container ); + } + } + else if ( aEvent == CFFReader.TEvent.EReadingProgress ) + { + int progress = ( aContext != null && aContext is int ) ? (int) aContext : 0; + base.Source.OnSourceReadingProgress( progress ); + } + + base.Trace( "[CIEngineSourceReaderTrace] CFFReader_Observer() - END - aEvent: " + aEvent + ", file: " + base.Source.FileName ); + } + + private void CFFReader_ExceptionHandler( Exception aException, CFFReader aReader ) + { + base.AddException( aException ); + } + #endregion + + #region Multiplexing methods + internal void OnTraceReadInit() + { + lock ( iPluginSources ) + { + foreach ( CFFSource entry in iPluginSources ) + { + entry.Reader.OnTraceReadInit(); + } + } + } + + internal void OnTraceReadComplete() + { + lock ( iPluginSources ) + { + foreach ( CFFSource entry in iPluginSources ) + { + entry.Reader.OnTraceReadComplete(); + } + } + } + + internal void OnTraceReadOffer( CFFTraceLine aLine ) + { + lock ( iPluginSources ) + { + foreach ( CFFSource entry in iPluginSources ) + { + CFFTraceLine line = new CFFTraceLine( aLine.Line, aLine.LineNumber, entry ); + entry.Reader.OnTraceReadOffer( line ); + } + } + } + + internal void OnTraceReadException( Exception aException ) + { + base.AddException( aException ); + } + + internal void OnTraceReaderProgress( int aProgress ) + { + base.Source.OnSourceReadingProgress( aProgress ); + } + #endregion + + #region Internal methods + private CIEngineSource.TState CalculateFinalState() + { + CIEngineSource.TState ret = CIEngineSource.TState.EStateReadyCorrupt; + + // For trace-based operations we'll potentially be firing each trace + // line at multiple readers, in which case we only mark the file as + // corrupt if no readers completed successfully. + int countCorrupt = 0; + int countReady = 0; + int countContainers = base.CrashItemCount; + + // Count number of ready vs corrupt readers + foreach ( CFFSource source in iPluginSources ) + { + CFFReader reader = source.Reader; + CFFReader.TState readerState = reader.State; + // + switch ( readerState ) + { + case CFFReader.TState.EStateCorrupt: + ++countCorrupt; + break; + case CFFReader.TState.EStateReady: + ++countReady; + break; + default: + case CFFReader.TState.EStateProcessing: + case CFFReader.TState.EStateUninitialised: + SymbianUtils.SymDebug.SymDebugger.Assert( false ); + break; + } + } + + // If we created at least one container, then we did still manage to create + // some kind of crash output irrespective of how many of the readers indicated + // the source was corrupt. In that case, the underlying source file is treated + // as valid. + base.Trace( "[CIEngineSourceReaderTrace] CalculateFinalState() - total: {0}, ready: {1}, corrupt: {2}", countContainers, countReady, countCorrupt ); + if ( countContainers > 0 ) + { + ret = CIEngineSource.TState.EStateReady; + } + else + { + // We didn't manage to create any crash items at all from this source + // file. + if ( countCorrupt > 0 ) + { + // At least one reader indicated that the source file was corrupt, + // and since no other reader could create any kind of valid output + // we'll treat the source file as entirely corrupt. + ret = CIEngineSource.TState.EStateReadyCorrupt; + } + else + { + // No crash container created, but nobody said the file was corrupt + // either. It's just a "no items" file. + ret = CIEngineSource.TState.EStateReadyNoItems; + } + + } + + base.Trace( "[CIEngineSourceReaderTrace] CalculateFinalState() - END - ret: {0}, file: {1}", ret, base.Source.FileName ); + return ret; + } + #endregion + + #region Internal class - actual trace file reader + internal class CIEngineTraceReader : AsyncTextFileReader + { + #region Constructors + public CIEngineTraceReader( CIEngineSourceReaderTrace aMultiplexer ) + : base( aMultiplexer.Source.FileName ) + { + iMultiplexer = aMultiplexer; + } + #endregion + + #region API + public void Read( TSynchronicity aSynchronicity ) + { + base.StartRead( aSynchronicity ); + } + #endregion + + #region From AsyncTextFileReader + protected override void HandleReadStarted() + { + try + { + base.HandleReadStarted(); + } + finally + { + iMultiplexer.OnTraceReadInit(); + } + } + + protected override void HandleReadCompleted() + { + try + { + base.HandleReadCompleted(); + } + finally + { + iMultiplexer.OnTraceReadComplete(); + } + } + + protected override void HandleFilteredLine( string aLine ) + { + CFFTraceLine line = new CFFTraceLine( aLine, LineNumber, null ); + iMultiplexer.OnTraceReadOffer( line ); + } + + protected override void HandleReadException( Exception aException ) + { + try + { + base.HandleReadException( aException ); + } + finally + { + iMultiplexer.OnTraceReadException( aException ); + } + } + + protected override void OnProgressChanged( int aProgress ) + { + iMultiplexer.OnTraceReaderProgress( aProgress ); + } + #endregion + + #region Data members + private readonly CIEngineSourceReaderTrace iMultiplexer; + #endregion + } + #endregion + + #region Data members + private List iPluginSources = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/LibResources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/LibResources.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,378 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.3603 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CrashItemLib { + using System; + + + // + // A strongly-typed resource class, for looking up localized strings, etc. + // + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class LibResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal LibResources() { + } + + // + // Returns the cached ResourceManager instance used by this class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CrashItemLib.LibResources", typeof(LibResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + // + // Overrides the current thread's CurrentUICulture property for all + // resource lookups using this strongly typed resource class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + // + // Looks up a localized string similar to The code segment: '{0}', for process: '{1}' conflicts with the symbolic information.. + // + internal static string CIPDCodeSegAvailability_CodeSegMisMatch_Description_L1 { + get { + return ResourceManager.GetString("CIPDCodeSegAvailability_CodeSegMisMatch_Description_L1", resourceCulture); + } + } + + // + // Looks up a localized string similar to Crash data indicates that the code segment base address is 0x{0:x8}, however, symbolic information suggests it should be: 0x{1:x8}. + // + internal static string CIPDCodeSegAvailability_CodeSegMisMatch_Description_L2 { + get { + return ResourceManager.GetString("CIPDCodeSegAvailability_CodeSegMisMatch_Description_L2", resourceCulture); + } + } + + // + // Looks up a localized string similar to Code Segment Mismatch. + // + internal static string CIPDCodeSegAvailability_CodeSegMisMatch_Title { + get { + return ResourceManager.GetString("CIPDCodeSegAvailability_CodeSegMisMatch_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to The code segment: '{0}', for process: '{1}' does not have any associated symbols.. + // + internal static string CIPDCodeSegAvailability_NoSymbols_Description { + get { + return ResourceManager.GetString("CIPDCodeSegAvailability_NoSymbols_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Symbols Unavailable. + // + internal static string CIPDCodeSegAvailability_NoSymbols_Title { + get { + return ResourceManager.GetString("CIPDCodeSegAvailability_NoSymbols_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to {0} the registers do not contain a value for the link register (R14).. + // + internal static string CIPDRegAvailability_MissingLR_Description { + get { + return ResourceManager.GetString("CIPDRegAvailability_MissingLR_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Link Register (R14) Not Available. + // + internal static string CIPDRegAvailability_MissingLR_Title { + get { + return ResourceManager.GetString("CIPDRegAvailability_MissingLR_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to {0} the registers do not contain a value for the program counter (R15).. + // + internal static string CIPDRegAvailability_MissingPC_Description { + get { + return ResourceManager.GetString("CIPDRegAvailability_MissingPC_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Program Counter (R15) Not Available. + // + internal static string CIPDRegAvailability_MissingPC_Title { + get { + return ResourceManager.GetString("CIPDRegAvailability_MissingPC_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to {0} the registers do not contain a value for the current stack pointer (R13).. + // + internal static string CIPDRegAvailability_MissingSP_Description { + get { + return ResourceManager.GetString("CIPDRegAvailability_MissingSP_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Stack Pointer (R13) Not Available. + // + internal static string CIPDRegAvailability_MissingSP_Title { + get { + return ResourceManager.GetString("CIPDRegAvailability_MissingSP_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to {0} the stack has no associated registers which reduces the accuracy of stack decoding.. + // + internal static string CIPDRegAvailability_NoRegsForStack_Description { + get { + return ResourceManager.GetString("CIPDRegAvailability_NoRegsForStack_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Registers Missing. + // + internal static string CIPDRegAvailability_NoRegsForStack_Title { + get { + return ResourceManager.GetString("CIPDRegAvailability_NoRegsForStack_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to {0} R00 was null and the thread raised an exception. This suggests a possible de-reference of a NULL 'this' pointer.. + // + internal static string CIPDRegAvailability_NullThisPointer_Description { + get { + return ResourceManager.GetString("CIPDRegAvailability_NullThisPointer_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Possible De-reference of NULL 'this' Pointer?. + // + internal static string CIPDRegAvailability_NullThisPointer_Title { + get { + return ResourceManager.GetString("CIPDRegAvailability_NullThisPointer_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to {0} the stack pointer is beyond the start of the stack range, which will result in an exception.. + // + internal static string CIPDStackBoundaryValidator_StackOverflow_Description { + get { + return ResourceManager.GetString("CIPDStackBoundaryValidator_StackOverflow_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Stack Overflow. + // + internal static string CIPDStackBoundaryValidator_StackOverflow_Title { + get { + return ResourceManager.GetString("CIPDStackBoundaryValidator_StackOverflow_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to {0} the stack pointer is outside of the stack address range.. + // + internal static string CIPDStackBoundaryValidator_StackUnderflow_Description { + get { + return ResourceManager.GetString("CIPDStackBoundaryValidator_StackUnderflow_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Stack Underflow. + // + internal static string CIPDStackBoundaryValidator_StackUnderflow_Title { + get { + return ResourceManager.GetString("CIPDStackBoundaryValidator_StackUnderflow_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to {0} no registers are available, which may result in incomplete analysis.. + // + internal static string CIPDStackRegisterAvailability_MissingRegisters_Description { + get { + return ResourceManager.GetString("CIPDStackRegisterAvailability_MissingRegisters_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Registers Missing. + // + internal static string CIPDStackRegisterAvailability_MissingRegisters_Title { + get { + return ResourceManager.GetString("CIPDStackRegisterAvailability_MissingRegisters_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to {0} stack data has been supplied but the stack pointer value is missing.. + // + internal static string CIPDStackRegisterAvailability_MissingSP_Description { + get { + return ResourceManager.GetString("CIPDStackRegisterAvailability_MissingSP_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Stack Pointer (R13) Not Available. + // + internal static string CIPDStackRegisterAvailability_MissingSP_Title { + get { + return ResourceManager.GetString("CIPDStackRegisterAvailability_MissingSP_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to {0} stack data is not available.. + // + internal static string CIPDThreadValidity_NoStack_Description { + get { + return ResourceManager.GetString("CIPDThreadValidity_NoStack_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Stack Data Unavailable. + // + internal static string CIPDThreadValidity_NoStack_Title { + get { + return ResourceManager.GetString("CIPDThreadValidity_NoStack_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to In relation to the {0} mode stack,. + // + internal static string CIProblemDetector_Msg_Stack { + get { + return ResourceManager.GetString("CIProblemDetector_Msg_Stack", resourceCulture); + } + } + + // + // Looks up a localized string similar to In relation to the thread '{0}',. + // + internal static string CIProblemDetector_Msg_Thread { + get { + return ResourceManager.GetString("CIProblemDetector_Msg_Thread", resourceCulture); + } + } + + // + // Looks up a localized string similar to The stack base address appears to be invalid.. + // + internal static string CIStackBuilder_AddressInfoException_BaseAddressBeforeTopAddress { + get { + return ResourceManager.GetString("CIStackBuilder_AddressInfoException_BaseAddressBeforeTopAddress", resourceCulture); + } + } + + // + // Looks up a localized string similar to Unable to reconstruct call stack as no value was supplied for the current stack pointer (R13).. + // + internal static string CIStackBuilder_AddressInfoException_PointerMissing { + get { + return ResourceManager.GetString("CIStackBuilder_AddressInfoException_PointerMissing", resourceCulture); + } + } + + // + // Looks up a localized string similar to The current stack pointer (R13) is outside of the stack address boundary.. + // + internal static string CIStackBuilder_AddressInfoException_PointerOutOfBounds { + get { + return ResourceManager.GetString("CIStackBuilder_AddressInfoException_PointerOutOfBounds", resourceCulture); + } + } + + // + // Looks up a localized string similar to The stack top/limiting address appears to be invalid.. + // + internal static string CIStackBuilder_AddressInfoException_TopAddressAfterBaseAddress { + get { + return ResourceManager.GetString("CIStackBuilder_AddressInfoException_TopAddressAfterBaseAddress", resourceCulture); + } + } + + // + // Looks up a localized string similar to Stack Reconstruction Error. + // + internal static string CIStackBuilder_Error_Title { + get { + return ResourceManager.GetString("CIStackBuilder_Error_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to Stack Reconstruction Warning. + // + internal static string CIStackBuilder_Warning_Title { + get { + return ResourceManager.GetString("CIStackBuilder_Warning_Title", resourceCulture); + } + } + + // + // Looks up a localized string similar to {0} the stack pointer is outside of the supplied stack data. This may mean that part of the reconstructed call stack is omitted.. + // + internal static string CPIDStackDataValidator_Description { + get { + return ResourceManager.GetString("CPIDStackDataValidator_Description", resourceCulture); + } + } + + // + // Looks up a localized string similar to Stack Data Incomplete. + // + internal static string CPIDStackDataValidator_Title { + get { + return ResourceManager.GetString("CPIDStackDataValidator_Title", resourceCulture); + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/LibResources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/LibResources.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The code segment: '{0}', for process: '{1}' conflicts with the symbolic information. + + + Crash data indicates that the code segment base address is 0x{0:x8}, however, symbolic information suggests it should be: 0x{1:x8} + + + Code Segment Mismatch + + + The code segment: '{0}', for process: '{1}' does not have any associated symbols. + + + Symbols Unavailable + + + {0} the registers do not contain a value for the link register (R14). + + + Link Register (R14) Not Available + + + {0} the registers do not contain a value for the program counter (R15). + + + Program Counter (R15) Not Available + + + {0} the registers do not contain a value for the current stack pointer (R13). + + + Stack Pointer (R13) Not Available + + + {0} the stack has no associated registers which reduces the accuracy of stack decoding. + + + Registers Missing + + + {0} R00 was null and the thread raised an exception. This suggests a possible de-reference of a NULL 'this' pointer. + + + Possible De-reference of NULL 'this' Pointer? + + + {0} the stack pointer is beyond the start of the stack range, which will result in an exception. + + + Stack Overflow + + + {0} the stack pointer is outside of the stack address range. + + + Stack Underflow + + + {0} no registers are available, which may result in incomplete analysis. + + + Registers Missing + + + {0} stack data has been supplied but the stack pointer value is missing. + + + Stack Pointer (R13) Not Available + + + {0} stack data is not available. + + + Stack Data Unavailable + + + In relation to the {0} mode stack, + + + In relation to the thread '{0}', + + + The stack base address appears to be invalid. + + + Unable to reconstruct call stack as no value was supplied for the current stack pointer (R13). + + + The current stack pointer (R13) is outside of the stack address boundary. + + + The stack top/limiting address appears to be invalid. + + + Stack Reconstruction Error + + + Stack Reconstruction Warning + + + {0} the stack pointer is outside of the supplied stack data. This may mean that part of the reconstructed call stack is omitted. + + + Stack Data Incomplete + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFDataProvider.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFDataProvider.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using CrashItemLib.Engine; +using CrashItemLib.Crash; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash.Container; + +namespace CrashItemLib.PluginAPI +{ + public abstract class CFFDataProvider + { + #region Constructors + protected CFFDataProvider() + { + } + #endregion + + #region Framework API + /// + /// Get crash engine handle + /// + public abstract CIEngine Engine + { + get; + } + #endregion + + #region API + public CIContainer CreateContainer( CFFSource aDescriptor ) + { + CIContainer item = CIContainer.New( Engine, aDescriptor ); + return item; + } + + public CIContainer CreateErrorContainer( CFFSource aDescriptor ) + { + CIContainer item = CIContainer.NewErrorContainer( Engine, aDescriptor ); + return item; + } + #endregion + + #region Properties + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFFileList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFFileList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Reflection; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.PluginAPI; +using CrashItemLib.Engine.Sources; + +namespace CrashItemLib.PluginAPI +{ + public class CFFFileList + { + #region Constructors + internal CFFFileList() + { + } + + internal CFFFileList( DirectoryInfo aDir ) + : this( aDir, SearchOption.TopDirectoryOnly ) + { + } + + internal CFFFileList( DirectoryInfo aDir, SearchOption aSearchOption ) + { + BuildLists( aDir, aSearchOption ); + } + #endregion + + #region API + public void Clear() + { + iDictionary.Clear(); + iFiles.Clear(); + } + + public bool Contains( string aFileName ) + { + string key = Key( aFileName ); + return iDictionary.ContainsKey( key ); + } + + public bool Contains( FileInfo aFile ) + { + return Contains( aFile.FullName ); + } + + public void Remove( string aFileName ) + { + string key = Key( aFileName ); + if ( iDictionary.ContainsKey( key ) ) + { + FileInfo file = iDictionary[ key ]; + iFiles.Remove( file ); + iDictionary.Remove( key ); + } + } + + public void Remove( FileInfo aFile ) + { + Remove( aFile.FullName ); + } + + public FileInfo Dequeue() + { + System.Diagnostics.Debug.Assert( Count > 0 ); + FileInfo ret = this[ 0 ]; + // + iFiles.RemoveAt( 0 ); + iDictionary.Remove( Key( ret ) ); + // + return ret; + } + #endregion + + #region Properties + public int Count + { + get + { + System.Diagnostics.Debug.Assert( iFiles.Count == iDictionary.Count ); + return iFiles.Count; + } + } + + public bool IsEmpty + { + get { return Count == 0; } + } + + public FileInfo this[ int aIndex ] + { + get { return iFiles[ aIndex ]; } + } + #endregion + + #region Internal methods + private string Key( FileInfo aFile ) + { + return Key( aFile.FullName ); + } + + private string Key( string aFileName ) + { + return aFileName.ToUpper(); + } + + private void BuildLists( DirectoryInfo aDirectory, SearchOption aSearchOption ) + { + Clear(); + // + FileInfo[] files = aDirectory.GetFiles( "*.*", aSearchOption ); + iFiles.AddRange( files ); + // + iDictionary = new Dictionary(); + foreach ( FileInfo file in files ) + { + string key = file.FullName.ToUpper(); + if ( iDictionary.ContainsKey( key ) ) + { + iDictionary.Add( key, file ); + } + } + } + #endregion + + #region From System.Object + #endregion + + #region Data members + private List iFiles = new List(); + private Dictionary iDictionary = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFFileSpecification.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFFileSpecification.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using CrashItemLib.Crash.Source; + +namespace CrashItemLib.PluginAPI +{ + public class CFFFileSpecification + { + #region Static factory functions + public static CFFFileSpecification Custom( string aDescription, string aExtensions ) + { + return new CFFFileSpecification( aDescription, aExtensions ); + } + + public static CFFFileSpecification AllFiles() + { + return new CFFFileSpecification(); + } + + public static CFFFileSpecification TraceFiles() + { + CFFFileSpecification ret = new CFFFileSpecification(); + ret.Description = "Text files"; + // + StringBuilder extensions = new StringBuilder(); + foreach ( string extn in CISource.KExtensionsTrace ) + { + extensions.Append( "*" + extn + ";" ); + } + + // Remove last trailing semi-colon + extensions.Remove( extensions.Length - 1, 1 ); + ret.Extensions = extensions.ToString(); + return ret; + } + #endregion + + #region Constructors + private CFFFileSpecification() + { + } + + private CFFFileSpecification( string aDescription, string aExtensions ) + { + Description = aDescription; + Extensions = aExtensions; + } + #endregion + + #region API + #endregion + + #region Properties + public string Description + { + get { return iDescription; } + set { iDescription = value; } + } + + public string Extensions + { + get { return iExtensions; } + set { iExtensions = value; } + } + #endregion + + #region Data members + private string iDescription = "All Files"; + private string iExtensions = "*.*"; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFPlugin.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFPlugin.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using CrashItemLib; + +namespace CrashItemLib.PluginAPI +{ + /// + /// Master crash file format (CFF) plugin interface. All crash file formats + /// must implement this base class in order to be invoked by Crash Analyser + /// + public abstract class CFFPlugin + { + #region Constructors + protected CFFPlugin( CFFDataProvider aDataProvider ) + { + iDataProvider = aDataProvider; + } + #endregion + + #region API + public abstract CFFSourceAndConfidence GetConfidence( FileInfo aFile, CFFFileList aOtherFiles ); + + public abstract void GetSupportedFileTypes( List aFileTypes ); + #endregion + + #region Properties + public abstract string Name + { + get; + } + + public CFFDataProvider DataProvider + { + get { return iDataProvider; } + } + #endregion + + #region Data members + private readonly CFFDataProvider iDataProvider; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,311 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.Engine; + +namespace CrashItemLib.PluginAPI +{ + public abstract class CFFReader + { + #region Enumerations + public enum TState + { + EStateUninitialised = 0, + EStateProcessing, + EStateReady, + EStateCorrupt + } + #endregion + + #region Delegates & events + public enum TEvent + { + EReadingStarted = 0, + EReadingProgress, + EReadingContainerCreated, + EReadingComplete, + } + + public delegate void ReaderObserver( TEvent aEvent, CFFReader aReader, object aContext ); + public event ReaderObserver Observer; + + public delegate void ReaderExceptionHandler( Exception aException, CFFReader aReader ); + public event ReaderExceptionHandler ExceptionHandler; + #endregion + + #region Constructors + protected CFFReader( CFFPlugin aEngine, CFFSource aDescriptor ) + { + iPlugin = aEngine; + iDescriptor = aDescriptor; + } + #endregion + + #region API - abstract + /// + /// Called when Crash Analyser wants this plugin to read a + /// native, i.e. format-specific crash file (i.e. not a trace file) + /// synchronously. + /// + public virtual void NativeReadInit() + { + } + + /// + /// Called when Crash Analyser is going to start to send + /// trace lines (that it will read on behalf of the plugin) + /// that should be processed in order to identify embedded + /// traces. + /// + /// This method will only be called if the plugin claims to have + /// some confidence in reading trace data. + /// + public virtual void TraceReadInit() + { + } + + /// + /// Receive an individual trace line and process it if relevant + /// + /// + public virtual bool TraceReadOffer( CFFTraceLine aLine ) + { + // Nothing to do + return false; + } + + /// + /// Called when all trace lines have been delivered + /// + public virtual void TraceReadComplete() + { + } + #endregion + + #region API - framework + protected byte[] RawData + { + get { return Descriptor.RawData; } + } + + protected void RawDataAdd() + { + // Save entire file + RawDataClear(); + RawDataAdd( Descriptor.MasterFile ); + } + + protected void RawDataAdd( FileInfo aFile ) + { + byte[] bytes = File.ReadAllBytes( aFile.FullName ); + RawDataAdd( bytes ); + } + + protected void RawDataClear() + { + Descriptor.RawDataClear(); + } + + protected void RawDataAdd( byte[] aRawData ) + { + Descriptor.RawDataAdd( aRawData ); + } + #endregion + + #region Properties + public TState State + { + get + { + lock ( this ) + { + return iState; + } + } + set + { + lock ( this ) + { + iState = value; + } + } + } + + public CFFPlugin Plugin + { + get { return iPlugin; } + } + + public CFFSource Descriptor + { + get { return iDescriptor; } + } + + public CIEngine CIEngine + { + get { return Plugin.DataProvider.Engine; } + } + #endregion + + #region Internal methods + protected void NotifyEvent( TEvent aEvent ) + { + NotifyEvent( aEvent, null ); + } + + protected void NotifyEvent( TEvent aEvent, object aContext ) + { + // We must notify about "reading started" and "reading complete" only + // once. + // + // When the plugin sends the "reading started" event, we must transition + // to 'EStateProcessing.' + // + // When the plugin sends the "reading complete" event, we must transition + // to 'EStateReady' except if there was an exception during processing, + // in which case we remain as 'EStateCorrupt.' + // + // NB: NotifyException makes the transition to EStateCorrupt. + // + TState oldState = State; + // + bool notify = false; + switch ( aEvent ) + { + case TEvent.EReadingContainerCreated: + notify = true; + break; + case TEvent.EReadingStarted: + State = TState.EStateProcessing; + notify = ( State != oldState ); + break; + case TEvent.EReadingProgress: + notify = true; + break; + case TEvent.EReadingComplete: + if ( State == TState.EStateCorrupt ) + { + // There was an exception during processing. Do not + // change to 'ready' state in this situation. + // + // However, we must still notify about the completion event! + notify = true; + } + else + { + State = TState.EStateReady; + notify = ( State != oldState ); + } + break; + default: + throw new NotSupportedException(); + } + + if ( notify ) + { + if ( Observer != null ) + { + Observer( aEvent, this, aContext ); + } + } + } + + protected void NotifyException( Exception aException ) + { + State = TState.EStateCorrupt; + // + if ( ExceptionHandler != null ) + { + ExceptionHandler( aException, this ); + } + } + #endregion + + #region Internal methods - called by CIEngineSource to carry out operations + internal void OnNativeReadInit() + { + // Indicate reading started + NotifyEvent( TEvent.EReadingStarted ); + try + { + NativeReadInit(); + } + catch ( Exception e ) + { + NotifyException( e ); + NotifyEvent( TEvent.EReadingComplete ); + } + } + + internal void OnTraceReadInit() + { + // Indicate reading started + NotifyEvent( TEvent.EReadingStarted ); + try + { + TraceReadInit(); + } + catch ( Exception e ) + { + NotifyException( e ); + NotifyEvent( TEvent.EReadingComplete ); + } + } + + internal void OnTraceReadOffer( CFFTraceLine aLine ) + { + try + { + bool consumed = TraceReadOffer( aLine ); + if ( consumed ) + { + RawDataAdd( aLine.ToBinary() ); + } + } + catch ( Exception e ) + { + NotifyException( e ); + } + } + + internal void OnTraceReadComplete() + { + try + { + TraceReadComplete(); + } + catch ( Exception e ) + { + NotifyException( e ); + NotifyEvent( TEvent.EReadingComplete ); + } + } + #endregion + + #region Data members + private TState iState = TState.EStateUninitialised; + private readonly CFFPlugin iPlugin; + private readonly CFFSource iDescriptor; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFTraceLine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/FW/CFFTraceLine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using CrashItemLib; + +namespace CrashItemLib.PluginAPI +{ + public class CFFTraceLine + { + #region Constructors + public CFFTraceLine( string aLine, long aLineNumber, CFFSource aSource ) + { + iLine = aLine; + iLineNumber = aLineNumber; + iSource = aSource; + } + #endregion + + #region API + public byte[] ToBinary() + { + List ret = new List(); + + // We just want to map the raw unicode character onto a single byte. + // ASCII range is probably not sufficient (guess?) so this is why we + // do not use System.Text.ASCIIEncoding, but rather roll our own. + string line = iLine + System.Environment.NewLine; + foreach ( char c in line ) + { + byte b = System.Convert.ToByte( c ); + ret.Add( b ); + } + + return ret.ToArray(); + } + #endregion + + #region Properties + public string Line + { + get { return iLine; } + } + + public long LineNumber + { + get { return iLineNumber; } + } + + public CFFSource Descriptor + { + get { return iSource; } + } + #endregion + + #region Operators + public static implicit operator string( CFFTraceLine aLine ) + { + return aLine.Line; + } + #endregion + + #region Data members + private readonly string iLine; + private readonly long iLineNumber; + private readonly CFFSource iSource; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/Internal/CFFPluginRegistry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/Internal/CFFPluginRegistry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Reflection; +using SymbianUtils.PluginManager; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.Engine; + +namespace CrashItemLib.PluginAPI +{ + public class CFFPluginRegistry : CFFDataProvider, IEnumerable + { + #region Constructors + public CFFPluginRegistry( CIEngine aEngine ) + { + iEngine = aEngine; + LoadPlugins(); + } + #endregion + + #region API + public string GetSupportedCrashFileTypes() + { + StringBuilder ret = new StringBuilder(); + + // First get a list of all supported extensions + List initialList = new List(); + foreach ( CFFPlugin plugin in this ) + { + plugin.GetSupportedFileTypes( initialList ); + } + + // Identify duplicate entries and filter them out + Dictionary finalList = new Dictionary(); + foreach ( CFFFileSpecification entry in initialList ) + { + if ( !finalList.ContainsKey( entry.Description ) ) + { + finalList.Add( entry.Description, entry ); + } + } + + // Convert each entry into dialog-like format list specification. + foreach ( KeyValuePair kvp in finalList ) + { + CFFFileSpecification spec = kvp.Value; + // + ret.AppendFormat( "{0} ({1})|{2}", spec.Description, spec.Extensions, spec.Extensions ); + ret.Append( "|" ); + } + + // Remove last trailing pipe + if ( ret.Length > 0 ) + { + ret.Remove( ret.Length - 1, 1 ); + } + + string finalVal = ret.ToString(); + return finalVal; + } + + public CFFSourceAndConfidence[] GetHandlers( FileInfo aFile, CFFFileList aOtherFiles ) + { + List ret = new List(); + // + foreach ( CFFPlugin plugin in iPlugins ) + { + try + { + CFFSourceAndConfidence conf = plugin.GetConfidence( aFile, aOtherFiles ); + // + if ( conf.IsSupported ) + { + ret.Add( conf ); + } + } + catch ( Exception e ) + { + iEngine.Trace( "CFFPrimerRegistry.GetHandlers() - aFile: {0}, message: {1}, stack: {2}", aFile.FullName, e.Message, e.StackTrace ); + } + } + // + return ret.ToArray(); + } + #endregion + + #region Properties + public int Count + { + get { return iPlugins.Count; } + } + + public CFFPlugin this[ int aIndex ] + { + get { return iPlugins[ aIndex ]; } + } + #endregion + + #region Internal methods + private void LoadPlugins() + { + object[] parameters = new object[ 1 ]; + parameters[ 0 ] = this; + // + iPlugins.Load( parameters ); + } + #endregion + + #region From CFFDataProvider + public override CIEngine Engine + { + get { return iEngine; } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return iPlugins.GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return iPlugins.GetEnumerator(); + } + #endregion + + #region Data members + private readonly CIEngine iEngine; + private PluginManager iPlugins = new PluginManager(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/Source/CFFSource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/Source/CFFSource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using CrashItemLib.Crash.Source; + +namespace CrashItemLib.PluginAPI +{ + /// + /// Source with file format-specific extensions + /// + public abstract class CFFSource : CISource + { + #region Enumerations + public enum TReaderOperationType + { + EReaderOpTypeNotSupported = 0, + EReaderOpTypeNative, + EReaderOpTypeTrace + } + #endregion + + #region Constructors + protected CFFSource( FileInfo aFile ) + : base( aFile ) + { + } + #endregion + + #region API + #endregion + + #region Properties + public CFFReader Reader + { + get { return iReader; } + set { iReader = value; } + } + + public TReaderOperationType OpType + { + get { return iOpType; } + set { iOpType = value; } + } + #endregion + + #region Data members + private CFFReader iReader = null; + private TReaderOperationType iOpType = TReaderOperationType.EReaderOpTypeNotSupported; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/Source/CFFSourceAndConfidence.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/PluginAPI/Source/CFFSourceAndConfidence.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Specialized; +using System.Text; +using SymbianUtils; +using CrashItemLib; + +namespace CrashItemLib.PluginAPI +{ + public abstract class CFFSourceAndConfidence : CFFSource, IComparable + { + #region Constructors + protected CFFSourceAndConfidence( FileInfo aFile ) + : base( aFile ) + { + Level = int.MinValue; + } + #endregion + + #region API + public void SetCertain() + { + Level = int.MaxValue; + } + #endregion + + #region Properties + public int Level + { + get { return iLevel; } + set { iLevel = value; } + } + + public bool IsSupported + { + get { return !IsUnsupported && MasterFileName != string.Empty && Reader != null; } + } + + public bool IsCertain + { + get { return Level == int.MaxValue; } + } + + public bool IsUnsupported + { + get + { + bool ret = false; + + // The source cannot be processed if: + // + // a) Type is not supported + // b) The confidence level is "no confidence whatsoever" or + // c) There is no reader + // + if ( Level == int.MinValue ) + { + ret = true; // (b) + } + else if ( Reader == null ) + { + ret = true; // (c) + } + else if ( OpType == TReaderOperationType.EReaderOpTypeNotSupported ) + { + ret = true; // (a) + } + + return ret; + } + } + #endregion + + #region From IComparable + public int CompareTo( CFFSourceAndConfidence aOther ) + { + int ret = 1; + // + if ( aOther != null ) + { + ret = Level.CompareTo( aOther.Level ); + } + // + return ret; + } + #endregion + + #region Data members + private int iLevel = int.MinValue; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Sink/CISink.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Sink/CISink.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Reflection; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Container; +using CrashItemLib.PluginAPI; +using CrashItemLib.Engine; + +namespace CrashItemLib.Sink +{ + public abstract class CISink + { + #region Constructors + protected CISink( string aName, CISinkManager aManager ) + { + iName = aName; + iSinkManager = aManager; + } + #endregion + + #region API + public abstract object Serialize( CISinkSerializationParameters aParams ); + + public virtual object CustomOperation( string aOpName, params object[] aArguments ) + { + throw new NotSupportedException(); + } + #endregion + + #region Properties + public string Name + { + get { return iName; } + } + + public CISinkManager Manager + { + get { return iSinkManager; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region Data members + private readonly string iName; + private readonly CISinkManager iSinkManager; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Sink/CISinkManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Sink/CISinkManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Reflection; +using SymbianUtils.PluginManager; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Container; +using CrashItemLib.Engine; + +namespace CrashItemLib.Sink +{ + public class CISinkManager : IEnumerable + { + #region Constructors + internal CISinkManager( CIEngine aEngine ) + { + iEngine = aEngine; + LoadSinks(); + } + #endregion + + #region API + #endregion + + #region Properties + public int Count + { + get { return iSinks.Count; } + } + + public CISink this[ int aIndex ] + { + get { return iSinks[ aIndex ]; } + } + #endregion + + #region Internal methods + private void LoadSinks() + { + object[] parameters = new object[ 1 ]; + parameters[ 0 ] = this; + // + try + { + iSinks.Load( parameters ); + } + catch ( Exception assemblyLoadException ) + { + iEngine.Trace( "SINK CREATION EXCEPTION: " + assemblyLoadException.Message ); + iEngine.Trace( " " + assemblyLoadException.StackTrace ); + } + } + #endregion + + #region From System.Object + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return iSinks.GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return iSinks.GetEnumerator(); + } + #endregion + + #region Data members + private readonly CIEngine iEngine; + private PluginManager iSinks = new PluginManager(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/Engine/CrashItemLib/Sink/CISinkSerializationParameters.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/Engine/CrashItemLib/Sink/CISinkSerializationParameters.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,363 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Reflection; +using System.ComponentModel; +using SymbianUtils; +using SymbianDebugLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Container; +using CrashItemLib.PluginAPI; +using CrashItemLib.Engine; +using SymbianUtils.FileSystem.Utilities; + +namespace CrashItemLib.Sink +{ + public class CISinkSerializationParameters : DisposableObject + { + #region Enumerations + public enum TDetailLevel + { + [Description("Full")] + EFull = 0, + + [Description( "Summary" )] + ESummary + } + #endregion + + #region Constructors + public CISinkSerializationParameters( Version aUIVersion, string aUICommandLineArguments ) + { + iUIVersion = aUIVersion; + iUICommandLineArguments = aUICommandLineArguments; + // + string tempPath = FSUtilities.MakeTempPath(); + OutputDirectory = new DirectoryInfo( tempPath ); + // + PrepareDefaultExtensions(); + } + + public CISinkSerializationParameters( CIContainer aContainer, Version aUIVersion, string aUICommandLineArguments ) + : this( aUIVersion, aUICommandLineArguments ) + { + iContainer = aContainer; + } + + public CISinkSerializationParameters( CISinkSerializationParameters aCopy ) + : this( aCopy.Container, aCopy.UIVersion, aCopy.UICommandLineArguments ) + { + iDetailLevel = aCopy.DetailLevel; + // + FileExtensionSuccess = aCopy.FileExtensionSuccess; + FileExtensionFailed = aCopy.FileExtensionFailed; + // + if ( aCopy.iOutputMode == TOutputMode.EOutputToFile ) + { + OutputFile = aCopy.OutputFile; + } + else if ( aCopy.iOutputMode == TOutputMode.EOutputToDirectory ) + { + OutputDirectory = aCopy.OutputDirectory; + } + // + iOperationData1 = aCopy.OperationData1; + iOperationData2 = aCopy.OperationData2; + iOperationData3 = aCopy.OperationData3; + } + #endregion + + #region API + public Stream CreateFile( out string aFileName ) + { + return CreateFile( out aFileName, FileMode.Append ); + } + + public Stream CreateFile( out string aFileName, FileMode aMode ) + { + System.Diagnostics.Debug.Assert( iContainer != null ); + + // First, prepare the output directory information that we will write to. + string fileName = Container.Source.MasterFileName; + string sourceFileName = Path.GetFileName( fileName ); + string sourcePath = Path.GetDirectoryName( fileName ); + // + switch ( iOutputMode ) + { + case TOutputMode.EOutputToDirectory: + // Use the OutputDirectory name, but combine with source file name + fileName = Path.Combine( this.OutputDirectory.FullName, sourceFileName ); + fileName = AppendFileExtension( fileName ); + + // Don't overwrite when writing to a specific directory. + aMode = FileMode.CreateNew; + break; + default: + case TOutputMode.EOutputToFile: + // Use the specified OuputFile name. + fileName = this.OutputFile.FullName; + break; + } + + // At this point we now have a fixed output path. + // Ensure that it exists. + DirectoryInfo outputDir = new DirectoryInfo( Path.GetDirectoryName( fileName ) ); + outputDir.Create(); + + // Now try to make a unique file name if we are not appending. + Stream ret = null; + if ( aMode == FileMode.Append ) + { + // Just append to file + ret = TryToCreateStream( fileName, aMode ); + } + else + { + // Update filename to just refer to the name and extension (no path) + fileName = Path.GetFileName( fileName ); + + // Try to create a unique file + for ( int counter = 0; counter < KMaxRetries; counter++ ) + { + // First iteration is a special case were we use input name + // plus our standard extension + string finalFileName = AppendFileExtension( fileName ); + if ( counter > 0 ) + { + // Append a numerical value in order to create unique name + finalFileName = string.Format( "{0} ({1:d3})", + Path.GetFileNameWithoutExtension( fileName ), + counter ); + finalFileName = AppendFileExtension( finalFileName ); + } + + string finalFullName = Path.Combine( outputDir.FullName, finalFileName ); + + // Attempt to create stream + ret = TryToCreateStream( finalFullName, aMode ); + if ( ret != null ) + { + fileName = finalFullName; + break; + } + } + } + + // + if ( ret == null ) + { + throw new IOException( "Unable to create sink file" ); + } + else + { + // Ensure we inform caller of final output file name + aFileName = fileName; + } + // + return ret; + } + #endregion + + #region Framework API + protected virtual void PrepareDefaultExtensions() + { + FileExtensionSuccess = string.Empty; + FileExtensionFailed = string.Empty; + } + #endregion + + #region Properties + public CIEngine Engine + { + get { return Container.Engine; } + } + + public CIContainer Container + { + get { return iContainer; } + set { iContainer = value; } + } + + public TDetailLevel DetailLevel + { + get { return iDetailLevel; } + set { iDetailLevel = value; } + } + + public DirectoryInfo OutputDirectory + { + get + { + if ( iOutputMode != TOutputMode.EOutputToDirectory ) + { + throw new InvalidOperationException( "Output mode is invalid" ); + } + return iOutputDirectory; + } + set + { + iOutputDirectory = value; + iOutputDirectory.Create(); + // + iOutputMode = TOutputMode.EOutputToDirectory; + iOutputFile = null; + } + } + + public FileInfo OutputFile + { + get + { + if ( iOutputMode != TOutputMode.EOutputToFile ) + { + throw new InvalidOperationException( "Output mode is invalid" ); + } + return iOutputFile; + } + set + { + iOutputFile = value; + // + iOutputMode = TOutputMode.EOutputToFile; + iOutputDirectory = null; + } + } + + public Version UIVersion + { + get { return iUIVersion; } + } + + public string FileExtensionSuccess + { + get { return iFileExtensionSuccess; } + set { iFileExtensionSuccess = value; } + } + + public string FileExtensionFailed + { + get { return iFileExtensionFailed; } + set { iFileExtensionFailed = value; } + } + + public string UICommandLineArguments + { + get { return iUICommandLineArguments; } + } + + public object OperationData1 + { + get { return iOperationData1; } + set { iOperationData1 = value; } + } + + public object OperationData2 + { + get { return iOperationData2; } + set { iOperationData2 = value; } + } + + public object OperationData3 + { + get { return iOperationData3; } + set { iOperationData3 = value; } + } + #endregion + + #region Internal methods + private string AppendFileExtension( string aFileName ) + { + System.Diagnostics.Debug.Assert( iContainer != null ); + + // Work out which extension we should be adding to the output + string extensionToAppend = FileExtensionSuccess; + if ( Container.Status == CIContainer.TStatus.EStatusErrorContainer ) + { + extensionToAppend = FileExtensionFailed; + } + + // Then make the name + string ret = aFileName; + string extn = Path.GetExtension( aFileName ); + // + if ( extn.ToUpper() == extensionToAppend.ToUpper() ) + { + // Job done + } + else + { + ret += extensionToAppend; + } + // + return ret; + } + + private Stream TryToCreateStream( string aFileName, FileMode aMode ) + { + Stream ret = null; + // + try + { + // We do this inside a catch block because in multi-threaded situations, there + // could be a race between the entity checking whether a file exists, and another + // thread actually just about to create the file. The File.Exists() check just + // avoids unnecessarily attempting to create the file if we *know* that it already + // exists. The catch copes with the unexpected pre-emption. + if ( !File.Exists( aFileName ) ) + { + ret = new FileStream( aFileName, aMode, FileAccess.Write, FileShare.None, 1024 * 12 ); + } + } + catch ( IOException ) + { + } + // + return ret; + } + #endregion + + #region Internal constants + private const int KMaxRetries = 100; + #endregion + + #region Internal enumerations + private enum TOutputMode + { + EOutputToFile = 0, + EOutputToDirectory + } + #endregion + + #region Data members + private readonly Version iUIVersion; + private readonly string iUICommandLineArguments; + private CIContainer iContainer; + private TDetailLevel iDetailLevel = TDetailLevel.EFull; + private string iFileExtensionSuccess = string.Empty; + private string iFileExtensionFailed = string.Empty; + private FileInfo iOutputFile; + private DirectoryInfo iOutputDirectory; + private TOutputMode iOutputMode = TOutputMode.EOutputToDirectory; + private object iOperationData1 = null; + private object iOperationData2 = null; + private object iOperationData3 = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/CrashInfoFilePlugin.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/CrashInfoFilePlugin.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,91 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {38D6EA43-2CA2-4637-9487-B3D5B5938558} + Library + Properties + CrashInfoFilePlugin + CrashInfoFile.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\Engine\CrashItemLib\bin\Debug\SymbianUtils.dll + + + + + + + + + + + + + + + + True + True + LibResources.resx + + + + + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC} + CrashItemLib + + + + + ResXFileCodeGenerator + LibResources.Designer.cs + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoCallStack.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoCallStack.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,231 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* The class CCrashInfoCallStack is part of CrashAnalyser CrashInfoFile plugin. +* It is a temporary container for thread call stack. +* Call stack is stored in fully decoded form as lines of text +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Symbols; +using CrashInfoFilePlugin.PluginImplementations.FileFormat; + +namespace CrashInfoFilePlugin.FileFormat +{ + class CCrashInfoCallStack + { + + #region Constructors + public CCrashInfoCallStack() + { + + } + #endregion + + + + public void Read(CIStack aStack) + { + foreach (CIStackEntry entry in aStack) + { + CCrashInfoCSItem csItem = new CCrashInfoCSItem(); + if (entry.IsCurrentStackPointerEntry) + { + iStackPointerLocation = iCallStack.Count; + csItem.iIsStackPointer = true; + } + + CIRegister register = entry.Register; + if (register != null) //entry is from registers + { + csItem.iIsRegisterEntry = true; + if (register.Name == "PC") + { + csItem.iRegisterName = "Program counter"; + } + else if (register.Name == "LR") + { + csItem.iRegisterName = "Link register"; + } + else //other register + { + csItem.iRegisterName = register.Name; + } + } + else //entry is from memory (normal case) + { + csItem.iMemoryAddress = entry.Address; + } + + //Add data contained in the memory location + csItem.iItemData = entry.Data; + csItem.iItemDataString = entry.DataAsString; + + if (entry.Symbol != null) //add symbol if possible + { + csItem.iHasSymbol = true; + csItem.iSymbolName = entry.Symbol.Symbol.Name; + csItem.iSymbolOffset = entry.FunctionOffset; + csItem.iSymbolObject = entry.Symbol.Symbol.Object; + + + } + // else symbol is not available + + iCallStack.Add(csItem); + + } + + } + public void CleanStack() + { + //Clean elements far above stack pointer + if (iStackPointerLocation != null) + { + int removeAmount = (int)iStackPointerLocation - CrashInfoConsts.KMaxItemAboveSP; + + if (removeAmount > 0) + { + iCallStack.RemoveRange(0, removeAmount); + } + + //Clean symbolless items far below stack pointer + for (int i = (int)iStackPointerLocation + CrashInfoConsts.KNonSymbolItemsAfterSP; i < iCallStack.Count; ) + { + if (!iCallStack[i].iHasSymbol) + { + iCallStack.RemoveAt(i); + } + else + { + ++i; + } + } + } + } + + + public void WriteToStream(System.IO.StreamWriter aOutput) + { + MakeWritableStack(); + + aOutput.Write(CCrashInfoFileUtilities.BlockStartMarker(CrashInfoConsts.Kcall_stack_text)); + System.Text.StringBuilder output = new System.Text.StringBuilder();; + foreach (string line in iTextContent) + { + if (output.Length + line.Length + CrashInfoConsts.KEOL.Length >= CrashInfoConsts.KMaxStackSize) + { + break; + } + + output.AppendLine(line); + } + + aOutput.Write(output); + + aOutput.Write((CCrashInfoFileUtilities.BlockEndMarker(CrashInfoConsts.Kcall_stack_text))); + + } + + private void MakeWritableStack() + { + + foreach (CCrashInfoCSItem csItem in iCallStack) + { + System.Text.StringBuilder line = new System.Text.StringBuilder(); + if (csItem.iIsStackPointer) + { + line.Append("This is current stack pointer "); + } + + + if (csItem.iIsRegisterEntry) //entry is from registers + { + line.Append(csItem.iRegisterName + " "); + } + else //entry is from memory (normal case) + { + line.Append(csItem.iMemoryAddress.ToString("X").PadLeft(8, '0')); + } + + line.Append(" " + csItem.iItemData.ToString("X").PadLeft(8, '0')); + + + + if (csItem.iHasSymbol) //symbol if available + { + line.Append(" " + csItem.iSymbolName); + + line.Append(" " + csItem.iSymbolOffset.ToString("X").PadLeft(4, '0')); + + line.Append(" " + csItem.iSymbolObject); + } + else //symbol is not available, print content in ascii (may contain some readable text) + { + line.Append(" " + csItem.iItemDataString); + } + iTextContent.Add(line.ToString()); + + } + } + + #region Data Members + + + private List iTextContent = new List(); + + private List iCallStack = new List(); + private int? iStackPointerLocation = null; + #endregion + + #region Nested Classes + private class CCrashInfoCSItem + { + #region Constructors + public CCrashInfoCSItem() + { + + } + #endregion + + #region Data Members + + public uint iMemoryAddress = 0; + public uint iItemData = 0; + public string iItemDataString = string.Empty; + + public bool iIsStackPointer = false; + public bool iIsRegisterEntry = false; + public string iRegisterName = string.Empty; + + public bool iHasSymbol = false; + public string iSymbolName = string.Empty; + public string iSymbolObject = string.Empty; + public uint iSymbolOffset = 0; + + #endregion + } + + #endregion + + } + + + +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoCodeSegData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoCodeSegData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* The class CCrashInfoCodeSegItem is part of CrashAnalyser CrashInfoFile plugin. +* Stores information about one code segment, also known as crash time loaded dll. +* +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace CrashInfoFilePlugin.PluginImplementations.FileFormat +{ + internal class CCrashInfoCodeSegItem + { + #region Constructors + public CCrashInfoCodeSegItem() + { + + } + public CCrashInfoCodeSegItem(uint aStart, uint aEnd, string aName) + { + iStart = aStart; + iEnd = aEnd; + iName = aName; + } + #endregion + + #region Properties + public uint Start + { + get { return iStart; } + set { iStart = value; } + } + + public uint End + { + get { return iEnd; } + set { iEnd = value; } + } + + public string Name + { + get { return iName; } + set { iName = value; } + } + + #endregion + + #region Data Members + + private uint iStart = 0; + private uint iEnd = 0; + private string iName = string.Empty; + + + + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoDataBlock.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoDataBlock.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,878 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* The class CCrashInfoDataBlock is part of CrashAnalyser CrashInfoFile plugin. +* Provides reading methods, container and output methods for all data in a single +* datablock of crashinfo file, corresponding to one crash. Complete crashinfo file +* may contain one or more datablock. +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.InfoSW; +using CrashItemLib.Crash.Utils; +using System.Globalization; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.CodeSegs; +using CrashItemLib.Crash.Memory; +using CrashItemLib.Crash.Summarisable; +using CrashItemLib.Crash.InfoHW; +using CrashItemLib.Crash.Telephony; +using CrashItemLib.Crash.Header; +using CrashItemLib.Crash.Reports; +using CrashItemLib.Crash.Stacks; +using CrashInfoFilePlugin.FileFormat; +using CrashItemLib.Crash.Source; +using CrashItemLib.Crash.Events; +using CrashItemLib.Crash.Messages; +using System.IO; +using CrashItemLib.Crash.Traces; +using SymbianStructuresLib.Debug.Trace; +using CrashItemLib.Crash.InfoEnvironment; + +namespace CrashInfoFilePlugin.PluginImplementations.FileFormat +{ + internal class CCrashInfoDataBlock + { + #region Constructors + public CCrashInfoDataBlock() + + { + } + + #endregion + + #region Adding data content + /** Add timestamp and uptime */ + internal void AddHeader(CIContainer aContainer) + { + CIHeader header = (CIHeader) aContainer.ChildByType( typeof( CIHeader ) ); + if (header != null) + { + //Timestamp + DateTime timeStamp = header.CrashTime; + String date = timeStamp.ToString("yyyyMMdd", DateTimeFormatInfo.InvariantInfo); + int hour = timeStamp.Hour; + int minute = timeStamp.Minute; + int second = timeStamp.Second; + iTimeStampText = date + hour.ToString().PadLeft(2, '0') + minute.ToString().PadLeft(2, '0') + second.ToString().PadLeft(2, '0'); + + //UpTime + iUptime = header.UpTime.TotalSeconds; + } + } + /** Add romid, timestamp, platform, language and sw version */ + internal void AddSWInfos(CIContainer aContainer) + { + CIInfoSW info = (CIInfoSW) aContainer.ChildByType( typeof( CIInfoSW ) ); + if (info != null) + { + //RomID + if (info.ImageCheckSum != 0) + { + iRomId = info.ImageCheckSum; + } + //Platform + iPlatform = info.Platform; + + //Language + iLanguage = info.Language; + + //Version + const string KInfoSW_Version_Runtime = "Runtime Version"; + const string KInfoSW_Version_Variant = "Variant Version"; + const string KInfoSW_Version_S60 = "S60 Version"; + foreach ( CIVersionInfo version in info ) + { + if (version.IsValid && version.Name == KInfoSW_Version_Runtime) + { + iSWVersion = version.Value; + } + if (version.IsValid && version.Name == KInfoSW_Version_Variant) + { + iVariantVersion = version.Value; + } + if (version.IsValid && version.Name == KInfoSW_Version_S60) + { + iS60Version = version.Value; + } + } + + //Timestamp + DateTime timeStamp = info.ImageTimeStamp; + String date = timeStamp.ToString("yyyyMMdd", DateTimeFormatInfo.InvariantInfo); + int hour = timeStamp.Hour; + int minute = timeStamp.Minute; + int second = timeStamp.Second; + iTimeStampText = date + hour.ToString().PadLeft(2, '0') + minute.ToString().PadLeft(2, '0') + second.ToString().PadLeft(2, '0'); + + } + } + + + + internal void AddThreadAndExitInfo(CIContainer aContainer) + { + + CIElementList threads = aContainer.ChildrenByType( CIElement.TChildSearchType.EEntireHierarchy ); + if (threads.Count > 1) + { + System.Console.WriteLine("Warning: CrashInfoFilePlugin found multiple threads. CI file output can handle only one thread!"); + } + foreach (CIThread thread in threads) + { + iPanicCategory = thread.ExitInfo.Category; + iPanicID = thread.ExitInfo.Reason; + + iCrashedModuleName = thread.FullName; + } + + } + + internal void AddPanicedProcess(CIContainer aContainer) + { + CIElementList processes = aContainer.ChildrenByType(CIElement.TChildSearchType.EEntireHierarchy); + if (processes.Count > 1) + { + System.Console.WriteLine("Warning: CrashInfoFilePlugin found multiple processes. CI file output can handle only one process!"); + } + foreach (CIProcess process in processes) + { + iProcess = process.Name; + iUID = process.Uids.MostSignificant; + } + + } + + internal void AddRegisterLists(CIContainer aContainer) + { + CIElementList regListCols = aContainer.ChildrenByType(CIElement.TChildSearchType.EEntireHierarchy); + foreach (CIRegisterListCollection regListCol in regListCols) + { + foreach (CIRegisterList regList in regListCol) + { + iRegStorage.ReadRegisterData(regList); + } + } + + } + + internal void AddStacks(CIContainer aContainer) + { + CIElementList stacks = aContainer.ChildrenByType(CIElement.TChildSearchType.EEntireHierarchy); + foreach (CIStack stack in stacks) + { + CCrashInfoCallStack callStack = new CCrashInfoCallStack(); + callStack.Read(stack); + callStack.CleanStack(); + iCallStacks.Add(callStack); + + } + } + + internal void AddCodeSegments(CIContainer aContainer) + { + // Get the code segments + CIElementList codeSegs = aContainer.ChildrenByType(CIElement.TChildSearchType.EEntireHierarchy); + + // Sort them + Comparison comparer = delegate(CICodeSeg aLeft, CICodeSeg aRight) + { + return string.Compare(aLeft.Name, aRight.Name, true); + }; + codeSegs.Sort(comparer); + + // List them + foreach (CICodeSeg codeSeg in codeSegs) + { + uint start = codeSeg.Range.Min; + uint end = codeSeg.Range.Max; + string name = codeSeg.Name; + + CCrashInfoCodeSegItem ciCodeSeg = new CCrashInfoCodeSegItem(start, end, name); + iCodeSegs.Add(ciCodeSeg); + } + } + + internal void AddMemoryInfo(CIContainer aContainer) + { + CIElementList list = aContainer.ChildrenByType(CIElement.TChildSearchType.EEntireHierarchy); + foreach ( CIMemoryInfo info in list ) + { + if ( info.Type == CIMemoryInfo.TType.ETypeRAM ) + { + iFreeMomery = info.Free; + } + if (info.Type == CIMemoryInfo.TType.ETypeDrive) + { + iDiskInfo = info.Free; + } + } + } + + internal void AddHWInfo(CIContainer aContainer) + { + CIInfoHW info = (CIInfoHW)aContainer.ChildByType(typeof(CIInfoHW)); + if (info != null) + { + iProductType = info.ProductType; + iProductCode = info.ProductCode.Trim(); + iSerialNumber = info.SerialNumber.Trim(); + } + } + + internal void AddTelephony(CIContainer aContainer) + { + CITelephony info = (CITelephony)aContainer.ChildByType(typeof(CITelephony)); + if (info != null) + { + iPhoneNumber = info.PhoneNumber; + iImei = info.IMEI; + iImsi = info.IMSI; + + CITelephonyNetworkInfo networkInfo = info.NetworkInfo; + + iNetworkCountry = networkInfo.Country; + iNetworkIdentity = networkInfo.Identity; + iNetworkCell = networkInfo.CellId; + iLocInfo = networkInfo.CGI; + + } + + } + + internal void AddEnvInfo(CIContainer aContainer) + { + CIInfoEnvironment info = (CIInfoEnvironment)aContainer.ChildByType(typeof(CIInfoEnvironment)); + if (info != null) + { + iTestSet = info.TestSet; + } + + } + + internal void AddReportParameters(CIContainer aContainer) + { + CIReportInfo report = (CIReportInfo)aContainer.ChildByType(typeof(CIReportInfo)); + if (report != null) + { + iReportType = report.Type; + if (iReportType != string.Empty) + { + iFileType = CrashInfoConsts.MobileCrashFileType.ETypeCrashAPIReport; + } + + + iReportCategory = report.Category; + iReportOK = report.CountSuccess; + iReportFail = report.CountFail; + IEnumerator parameters = report.GetEnumerator(); + if (parameters.MoveNext()) //has first parameter + { + iReportParamName1 = parameters.Current.Name; + iReportParamValue1 = parameters.Current.Value; + + if (parameters.MoveNext()) //has second parameter + { + iReportParamName2 = parameters.Current.Name; + iReportParamValue2 = parameters.Current.Value; + if (parameters.MoveNext()) + { + iReportParamName3 = parameters.Current.Name; + iReportParamValue3 = parameters.Current.Value; + } + } + } + + iReportComments = report.Comments; + + } + + } + + internal void AddMessages(CIContainer container) + { + foreach (CIMessage message in container.Messages) + { + if (message.Title == "Miscellaneous Information") + { + + if (message.Description.Trim() == CrashInfoConsts.KRegistrationMiscInfo) + { + iFileType = CrashInfoConsts.MobileCrashFileType.ETypeRegistrationMessage; + } + if (message.Description.Trim() == CrashInfoConsts.KAliveTimeMiscInfo) + { + iFileType = CrashInfoConsts.MobileCrashFileType.ETypeAliveMessage; + } + } + } + } + + internal void AddCrashHash(CIContainer aContainer) + { + //hash is only calculated for normal crashes - registrations and reports are omitted + if (iFileType == CrashInfoConsts.MobileCrashFileType.ETypeBasicCrash) + { + CISummarisableEntity primarySummary = aContainer.PrimarySummary; + if (primarySummary != null) + { + CCrashInfoHashBuilder.TConfiguration config = CCrashInfoHashBuilder.TConfiguration.EDefault; + try //CCrashInfoHashBuilder.New throws an exception if there's not enough data for hash creation + { + CCrashInfoHashBuilder builder = CCrashInfoHashBuilder.New(config, primarySummary); + iHash = builder.GetHash(); + } + catch (Exception e) + { + //Not enough data -> no hash and no grouping + } + } + } + } + + internal void AddFileNames(CIContainer aContainer, string aArchivedFileName) + + { + iBinFilename = aArchivedFileName; + + CISource source = aContainer.Source; + string binFileOriginalName = source.MasterFileName; + + foreach (string filename in aContainer.FileNames) + { + if (filename != binFileOriginalName) //Since bin file name is stored separately, remove it from this list + { + iSymbolFiles.Add(filename); + } + } + + } + internal void AddEventlog(CIContainer aContainer) + { + CIEventList events = aContainer.Events; + foreach (CIEvent ev in events) + { + + iEventlog.Add(ev.Value.ToString()); + } + } + + + internal void AddOstTraces(CIContainer aContainer) + { + CITraceData traceData = aContainer.Traces; + // + if (traceData != null && traceData.Lines.Length > 0) + { + foreach (CITrace ciTrace in traceData) + { + System.Text.StringBuilder line = new System.Text.StringBuilder(); + + TraceLine trace = ciTrace; + + // Type + string type = string.Empty; + switch (trace.Type) + { + case TraceLine.TType.ETypeBinary: + type = "Bin"; + break; + case TraceLine.TType.ETypeRaw: + type = "Raw"; + break; + case TraceLine.TType.ETypeText: + type = "Text"; + break; + default: + type = "Unknown"; + break; + } + if (string.IsNullOrEmpty(type) == false) + { + line.Append(type); + } + + // Context id + if (trace.ContextId != 0) + { + line.Append(" " + "0x" + trace.ContextId.ToString("x8")); + } + + // Time stamp + line.Append(" " + trace.TimeStamp.ToString()); + + // Prefix + string prefix = trace.Prefix; + if (string.IsNullOrEmpty(prefix) == false) + { + line.Append(" " + prefix); + } + + // Suffix + string suffix = trace.Suffix; + if (string.IsNullOrEmpty(suffix) == false) + { + line.Append(" " + suffix); + } + + if (trace.HasIdentifier) + { + // Component/group/id triplet + TraceIdentifier identifier = trace.Identifier; + line.Append(" C:" + "0x" + identifier.Component.ToString("x8")); + line.Append(" G:" + identifier.Group.ToString()); + line.Append(" I:" + identifier.Id.ToString()); + // File & line + TraceLocation location = identifier.Location; + // + string file = location.File; + string lineNumber = location.Line.ToString(); + // + if (string.IsNullOrEmpty(file) == false && string.IsNullOrEmpty(lineNumber) == false) + { + line.Append(" " +file); + line.Append(":" + lineNumber); + } + } + + // Payload + string payload = trace.Payload; + line.Append(" " + payload); + iOstTraces.Add(line.ToString()); + } + } + } + + #endregion + + #region Data writers + + internal void WriteTimeStamp(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iTimeStampText, CrashInfoConsts.Ktimestamp, aOutput); + } + + internal void WriteRomID(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iRomId, CrashInfoConsts.Kromid, aOutput); + } + + internal void WriteSWVersion(System.IO.StreamWriter aOutput) + { + string version = iPlatform + CrashInfoConsts.KSeparator + iSWVersion; + CCrashInfoFileUtilities.WriteOutputTags(version, CrashInfoConsts.Ksw_version, aOutput); + } + + internal void WriteVariantID(System.IO.StreamWriter aOutput) + { + //variant id is not really used - dummy value needs to be written for dbmover + CCrashInfoFileUtilities.WriteOutputTags("12345678", CrashInfoConsts.Kvariant_id, aOutput); + } + + internal void WriteHWVersion(System.IO.StreamWriter aOutput) + { + //HW version is not really used - dummy value needs to be written for dbmover + CCrashInfoFileUtilities.WriteOutputTags("NotFound", CrashInfoConsts.Khw_version, aOutput); + } + + internal void WritePanicID(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iPanicID, CrashInfoConsts.Kpanic_id, aOutput); + } + + internal void WritePanicCategory(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iPanicCategory, CrashInfoConsts.Kpanic_category, aOutput); + } + + internal void WriteLanguage(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iLanguage, CrashInfoConsts.Klanguage, aOutput); + } + + internal void WritePanicedProcess(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iProcess, CrashInfoConsts.Kpanicked_process, aOutput); + } + + internal void WriteProgramCounter(System.IO.StreamWriter aOutput) + { + iRegStorage.WriteProgramCounter(aOutput); + } + + internal void WriteRegisterList(System.IO.StreamWriter aOutput) + { + iRegStorage.WriteBasicRegisters(aOutput); + } + + internal void WriteModuleName(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iCrashedModuleName, CrashInfoConsts.Kcrashed_module_name, aOutput); + } + + internal void WriteLoadedDLLs(System.IO.StreamWriter aOutput) + { + aOutput.Write(CCrashInfoFileUtilities.BlockStartMarker(CrashInfoConsts.Kcrashtime_loaded_dlls)); + bool first = true; + foreach(CCrashInfoCodeSegItem codeseg in iCodeSegs) + { + if (first) //all but first item start with separator - special handling needed + { + first = false; + } + else + { + aOutput.Write(CrashInfoConsts.KSeparator); + } + aOutput.Write(codeseg.Start); + aOutput.Write(CrashInfoConsts.KSeparator); + aOutput.Write(codeseg.End); + aOutput.Write(CrashInfoConsts.KSeparator); + aOutput.Write(codeseg.Name); + } + aOutput.Write(CCrashInfoFileUtilities.BlockEndMarker(CrashInfoConsts.Kcrashtime_loaded_dlls)); + } + + internal void WriteAvailableMemory(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iFreeMomery, CrashInfoConsts.Kavailable_memory, aOutput); + } + + internal void WriteUserComment(System.IO.StreamWriter aOutput) + { + //Dummy value needs to be written for dbmover + CCrashInfoFileUtilities.WriteOutputTags("NotFound", CrashInfoConsts.Kuser_comment, aOutput); + } + + internal void WriteMemoryInfo(System.IO.StreamWriter aOutput) + { + //Dummy value needs to be written for dbmover - for memory info just the tags + aOutput.Write(CCrashInfoFileUtilities.BlockStartMarker(CrashInfoConsts.Kmemory_info)); + aOutput.Write(CCrashInfoFileUtilities.BlockEndMarker(CrashInfoConsts.Kmemory_info)); + } + + internal void WriteMiscInfo(System.IO.StreamWriter aOutput) + { + //Dummy value needs to be written for dbmover + string mInfo = "NotFound"; + if (iFileType == CrashInfoConsts.MobileCrashFileType.ETypeRegistrationMessage) + { + mInfo = CrashInfoConsts.KRegistrationMiscInfo; + } + if (iFileType == CrashInfoConsts.MobileCrashFileType.ETypeAliveMessage) + { + mInfo = CrashInfoConsts.KAliveTimeMiscInfo; + } + + CCrashInfoFileUtilities.WriteOutputTags(mInfo, CrashInfoConsts.Kmisc_info, aOutput); + } + + //This is the phone number + internal void WriteReporter(System.IO.StreamWriter aOutput) + { + //Dummy value needs to be written for first part + aOutput.Write(CCrashInfoFileUtilities.BlockStartMarker(CrashInfoConsts.Kreporter)); + aOutput.Write("NotFound"); + aOutput.Write(CrashInfoConsts.KSeparator); + aOutput.Write(iPhoneNumber); + aOutput.Write(CCrashInfoFileUtilities.BlockEndMarker(CrashInfoConsts.Kreporter)); + } + + internal void WriteArchive(System.IO.StreamWriter aOutput) + { + //Dummy value needs to be written for dbmover + CCrashInfoFileUtilities.WriteOutputTags("0", CrashInfoConsts.Karchive, aOutput); + } + + internal void WriteProductType(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iProductType, CrashInfoConsts.Kproduct_type, aOutput); + } + internal void WriteImei(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iImei, CrashInfoConsts.Kimei, aOutput); + } + + internal void WriteResetreason(System.IO.StreamWriter aOutput) + { + //Dummy value needs to be written for dbmover + CCrashInfoFileUtilities.WriteOutputTags("", CrashInfoConsts.Kresetreason, aOutput); + } + + internal void WriteUptime(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iUptime.ToString(), CrashInfoConsts.Kuptime, aOutput); + } + + internal void WriteIMSI(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iImsi, CrashInfoConsts.Ksiminfo, aOutput); + } + + internal void WriteNetworkCountry(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iNetworkCountry, CrashInfoConsts.Knetwork_country_code, aOutput); + } + + internal void WriteNetworkIdentity(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iNetworkIdentity, CrashInfoConsts.Knetwork_identity, aOutput); + } + + internal void WriteLocInfo(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iLocInfo, CrashInfoConsts.Klocinfo, aOutput); + } + + internal void WriteNetworkCell(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iNetworkCell, CrashInfoConsts.Kcellid, aOutput); + } + + internal void WriteTestset(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iTestSet, CrashInfoConsts.Ktestset, aOutput); + } + + //Serial number known also as PSN + internal void WriteSerialNumber(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iSerialNumber, CrashInfoConsts.Kpsninfo, aOutput); + } + + internal void WriteS60Version(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iS60Version, CrashInfoConsts.Ks60version, aOutput); + } + + internal void WriteProductCode(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iProductCode, CrashInfoConsts.Kproduct_code, aOutput); + } + + internal void WriteVariantVersion(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iVariantVersion, CrashInfoConsts.Kvariant_version, aOutput); + } + internal void WriteCrashHash(System.IO.StreamWriter aOutput) + { + if ( string.IsNullOrEmpty( iHash ) == false ) + { + aOutput.Write( CCrashInfoFileUtilities.MakeOutputTags( iHash, CrashInfoConsts.Kcrash_hash ) ); + } + } + internal void WriteMMCInfo(System.IO.StreamWriter aOutput) + { + //Dummy value needs to be written for dbmover + CCrashInfoFileUtilities.WriteOutputTags("", CrashInfoConsts.Kmmcinfo, aOutput); + } + internal void WriteUID(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iUID, CrashInfoConsts.Kuid, aOutput); + } + + internal void WriteDiskInfo(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iDiskInfo.ToString(), CrashInfoConsts.Kdiskinfo, aOutput); + } + + internal void WriteFileType(System.IO.StreamWriter aOutput) + { + int type = 0; //default type 0 + if (iReportType != string.Empty) + { + type = 1; //for reports, type 1 + } + CCrashInfoFileUtilities.WriteOutputTags(type, CrashInfoConsts.Kfile_type, aOutput); + } + + internal void WriteReportType(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iReportType, CrashInfoConsts.Kreport_type, aOutput); + } + + internal void WriteReportCategory(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iReportCategory, CrashInfoConsts.Kreport_category, aOutput); + } + + internal void WriteReportOK(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iReportOK, CrashInfoConsts.Kreport_ok, aOutput); + } + + internal void WriteReportFail(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iReportFail, CrashInfoConsts.Kreport_fail, aOutput); + } + + internal void WriteReportParam1(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iReportParamName1, CrashInfoConsts.Kreport_param_name1, aOutput); + CCrashInfoFileUtilities.WriteOutputTags(iReportParamValue1, CrashInfoConsts.Kreport_param_value1, aOutput); + + } + + internal void WriteReportParam2(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iReportParamName2, CrashInfoConsts.Kreport_param_name2, aOutput); + CCrashInfoFileUtilities.WriteOutputTags(iReportParamValue2, CrashInfoConsts.Kreport_param_value2, aOutput); + } + + internal void WriteReportParam3(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iReportParamName3, CrashInfoConsts.Kreport_param_name3, aOutput); + CCrashInfoFileUtilities.WriteOutputTags(iReportParamValue3, CrashInfoConsts.Kreport_param_value3, aOutput); + } + + internal void WriteReportComments(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iReportComments, CrashInfoConsts.Kreport_comments, aOutput); + } + + internal void WriteRegisterExtraList(System.IO.StreamWriter aOutput) + { + iRegStorage.WriteOtherRegisters(aOutput); + } + + internal void WriteCallstacks(System.IO.StreamWriter aOutput) + { + foreach (CCrashInfoCallStack stack in iCallStacks) + { + stack.WriteToStream(aOutput); + } + } + + internal void WriteBinFileName(System.IO.StreamWriter aOutput) + { + CCrashInfoFileUtilities.WriteOutputTags(iBinFilename, CrashInfoConsts.Kbinfile_name, aOutput); + } + internal void WriteSymbolFileNames(System.IO.StreamWriter aOutput) + { + string symbolfilenames = string.Empty; + foreach (string fileName in iSymbolFiles) + { + if (symbolfilenames != string.Empty) + { + symbolfilenames = symbolfilenames + ", "; + } + symbolfilenames = symbolfilenames + Path.GetFileName(fileName); + } + CCrashInfoFileUtilities.WriteOutputTags(symbolfilenames, CrashInfoConsts.Ksymbolfile_names, aOutput); + } + + internal void WriteEventlog(System.IO.StreamWriter aOutput) + { + if (iEventlog.Count > 0) + { + aOutput.Write(CCrashInfoFileUtilities.BlockStartMarker(CrashInfoConsts.Keventlog)); + foreach (string line in iEventlog) + { + aOutput.Write(line + CrashInfoConsts.KEOL); + } + aOutput.Write(CCrashInfoFileUtilities.BlockEndMarker(CrashInfoConsts.Keventlog)); + } + } + + + internal void WriteOstTraces(System.IO.StreamWriter aOutput) + { + if (iOstTraces.Count > 0) + { + aOutput.Write(CCrashInfoFileUtilities.BlockStartMarker(CrashInfoConsts.Ktrace_data)); + foreach (string line in iOstTraces) + { + aOutput.Write(line + CrashInfoConsts.KEOL); + } + aOutput.Write(CCrashInfoFileUtilities.BlockEndMarker(CrashInfoConsts.Ktrace_data)); + } + } + + #endregion + + + + #region Data members + private CrashInfoConsts.MobileCrashFileType iFileType = CrashInfoConsts.MobileCrashFileType.ETypeBasicCrash; + + private string iTimeStampText = string.Empty; //YearMonthDayHourMinSec + private uint? iRomId = null; //aka rom's checksum word + private string iPlatform = string.Empty; //usually SOS + private string iSWVersion = string.Empty; //The "main" version number + private string iS60Version = string.Empty; + private string iVariantVersion = string.Empty; + + private int? iPanicID = null; + private string iPanicCategory = string.Empty; + + private string iLanguage = string.Empty; //english, finnish etc + + private string iProcess = string.Empty; + + private CCrashInfoRegisterStorage iRegStorage = new CCrashInfoRegisterStorage(); //registers + + private string iCrashedModuleName = string.Empty; //thread name + + private List iCodeSegs = new List(); //crash time loaded dlls + + private ulong? iFreeMomery = null; //free ram + + private string iProductType = string.Empty; //aka RM-code + private string iProductCode = string.Empty; //7-digit HW variant code + private string iSerialNumber = string.Empty; //aka PSN + + private string iPhoneNumber = "NotFound"; + private string iImei = string.Empty; + private string iImsi = string.Empty; + private string iNetworkCountry = string.Empty; + private string iNetworkIdentity = string.Empty; + private string iNetworkCell = string.Empty; + private string iLocInfo = string.Empty; + private string iTestSet = string.Empty; + private double? iUptime = null; + private uint? iUID = null; + private ulong? iDiskInfo = null; + private string iReportType = string.Empty; + private string iReportCategory = string.Empty; + private uint? iReportOK = null; + private uint? iReportFail = null; + private string iReportParamName1 = string.Empty; + private uint? iReportParamValue1 = null; + private string iReportParamName2 = string.Empty; + private uint? iReportParamValue2 = null; + private string iReportParamName3 = string.Empty; + private uint? iReportParamValue3 = null; + private string iReportComments = string.Empty; + private string iHash = string.Empty; + + private List iCallStacks = new List(); //Call stacks + + private string iBinFilename = string.Empty; + List iSymbolFiles = new List(); + List iEventlog = new List(); + List iOstTraces = new List(); + + #endregion + + + + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoFileDocument.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoFileDocument.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,159 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* The class CCrashInfoFileDocument is part of CrashAnalyser CrashInfoFile plugin. +* Container and output implementation for data in Crash Info File format. +* CI format is an intermediate file used in the MobileCrash server +* CCrashInfoFileSink creates an instance of this class and uses it to output +* crash data to file in CI format. +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Container; +using System.IO; +using CrashItemLib.Sink; + +namespace CrashInfoFilePlugin.PluginImplementations.FileFormat +{ + internal class CCrashInfoFileDocument + { + #region Constructors + public CCrashInfoFileDocument() + + { + } + + #endregion + + /** Creates a new datablock and inputs data from container to the datablock */ + public void ReadDataFromContainer(CISinkSerializationParameters aParams) + { + CIContainer container = aParams.Container; + + //Create a datablock for this container's contents + CCrashInfoDataBlock datablock = new CCrashInfoDataBlock(); + + //Read all interesting data from container to the datablock + datablock.AddHeader(container); + datablock.AddSWInfos(container); + datablock.AddThreadAndExitInfo(container); + datablock.AddPanicedProcess(container); + datablock.AddRegisterLists(container); + datablock.AddStacks(container); + datablock.AddCodeSegments(container); + datablock.AddMemoryInfo(container); + datablock.AddHWInfo(container); + datablock.AddTelephony(container); + datablock.AddEnvInfo(container); + datablock.AddReportParameters(container); + datablock.AddMessages(container); + datablock.AddCrashHash(container); + + string archivedFileName = (String)aParams.OperationData1; + datablock.AddFileNames(container, archivedFileName); + datablock.AddEventlog(container); + + datablock.AddOstTraces(container); + + //If all went well, we will add datablock to stored datablocks + iDatablocks.Add(datablock); + } + + /** Writes datablock contents to stream in CrashInfoFile format. Makes a complete .ci file */ + public void WriteToStream(StreamWriter aOutput) + { + aOutput.Write(CCrashInfoFileUtilities.BlockStartMarker(CrashInfoConsts.Kversion)); + aOutput.Write(CrashInfoConsts.KVersionNumber.ToString().PadLeft(8, '0')); + aOutput.Write(CCrashInfoFileUtilities.BlockEndMarker(CrashInfoConsts.Kversion)); + + aOutput.Write(CCrashInfoFileUtilities.BlockStartMarker(CrashInfoConsts.Knum_datablocks)); + aOutput.Write(iDatablocks.Count.ToString().PadLeft(8, '0')); + aOutput.Write(CCrashInfoFileUtilities.BlockEndMarker(CrashInfoConsts.Knum_datablocks)); + + foreach (CCrashInfoDataBlock datablock in iDatablocks) + { + datablock.WriteTimeStamp(aOutput); + datablock.WriteRomID(aOutput); + datablock.WriteSWVersion(aOutput); + datablock.WriteVariantID(aOutput); + datablock.WriteHWVersion(aOutput); + datablock.WritePanicID(aOutput); + datablock.WritePanicCategory(aOutput); + datablock.WriteLanguage(aOutput); + datablock.WritePanicedProcess(aOutput); + datablock.WriteProgramCounter(aOutput); + datablock.WriteModuleName(aOutput); + datablock.WriteRegisterList(aOutput); + datablock.WriteLoadedDLLs(aOutput); + datablock.WriteAvailableMemory(aOutput); + datablock.WriteUserComment(aOutput); + datablock.WriteMemoryInfo(aOutput); + datablock.WriteMiscInfo(aOutput); + datablock.WriteReporter(aOutput); + datablock.WriteArchive(aOutput); + datablock.WriteProductType(aOutput); + datablock.WriteImei(aOutput); + datablock.WriteResetreason(aOutput); + datablock.WriteUptime(aOutput); + datablock.WriteTestset(aOutput); + datablock.WriteIMSI(aOutput); + datablock.WriteNetworkCountry(aOutput); + datablock.WriteNetworkIdentity(aOutput); + datablock.WriteLocInfo(aOutput); + datablock.WriteNetworkCell(aOutput); + datablock.WriteSerialNumber(aOutput); + datablock.WriteS60Version(aOutput); + datablock.WriteProductCode(aOutput); + datablock.WriteVariantVersion(aOutput); + datablock.WriteMMCInfo(aOutput); + datablock.WriteUID(aOutput); + datablock.WriteDiskInfo(aOutput); + datablock.WriteFileType(aOutput); + + datablock.WriteReportType(aOutput); + datablock.WriteReportCategory(aOutput); + datablock.WriteReportOK(aOutput); + datablock.WriteReportFail(aOutput); + datablock.WriteReportParam1(aOutput); + datablock.WriteReportParam2(aOutput); + datablock.WriteReportParam3(aOutput); + datablock.WriteReportComments(aOutput); + + datablock.WriteRegisterExtraList(aOutput); + + datablock.WriteCrashHash(aOutput); + + datablock.WriteBinFileName(aOutput); + datablock.WriteSymbolFileNames(aOutput); + + datablock.WriteCallstacks(aOutput); + datablock.WriteEventlog(aOutput); + + datablock.WriteOstTraces(aOutput); + + + } + } + + #region Data members + private List iDatablocks = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoFileUtilities.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoFileUtilities.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using CrashItemLib.Crash.Symbols; +using SymbianStructuresLib.Debug.Symbols; + +namespace CrashInfoFilePlugin.PluginImplementations.FileFormat +{ + static class CCrashInfoFileUtilities + { + public static bool IsSymbolSerializable(CISymbol aSymbol) + { + bool ret = true; + // + if (aSymbol.IsNull) + { + ret = false; + } + else + { + TSymbolType type = aSymbol.Symbol.Type; + ret = ( type != TSymbolType.EUnknown ); + } + return ret; + } + + /** Write given value, if it exists, in tags to stream */ + public static void WriteOutputTags(uint? aContent, string aTagText, System.IO.StreamWriter aOutput) + { + if (aContent.HasValue) + { + aOutput.Write(MakeOutputTags(aContent.Value.ToString(), aTagText)); + } + } + + /** Write given value, if it exists, in tags to stream */ + public static void WriteOutputTags(int? aContent, string aTagText, System.IO.StreamWriter aOutput) + { + if (aContent.HasValue) + { + aOutput.Write(MakeOutputTags(aContent.Value.ToString(), aTagText)); + } + } + + /** Write given value, if it exists, in tags to stream */ + public static void WriteOutputTags(ulong? aContent, string aTagText, System.IO.StreamWriter aOutput) + { + if (aContent.HasValue) + { + aOutput.Write(MakeOutputTags(aContent.Value.ToString(), aTagText)); + } + } + + + /** Write given string, if not empty, in tags to stream */ + public static void WriteOutputTags(string aContent, string aTagText, System.IO.StreamWriter aOutput) + { + if (aContent != string.Empty) + { + aOutput.Write(MakeOutputTags(aContent, aTagText)); + } + } + /** Return the parameter string enclosed in crashinfofile identifier tags */ + public static string MakeOutputTags(string aContent, string aTagText) + { + string output = CCrashInfoFileUtilities.BlockStartMarker(aTagText); + output += aContent; + output += CCrashInfoFileUtilities.BlockEndMarker(aTagText); + return output; + } + + /** Return the parameter integer enclosed in crashinfofile identifier tags */ + public static string MakeOutputTags(uint aContent, string aTagText) + { + return MakeOutputTags(aContent.ToString(), aTagText); + } + + public static string BlockEndMarker(string aId) + { + return CrashInfoConsts.KCloseIdStart + aId + CrashInfoConsts.KCloseIdEnd + CrashInfoConsts.KEOL; + } + + public static string BlockStartMarker(string aId) + { + return CrashInfoConsts.KNewIdStart + aId + CrashInfoConsts.KNewIdEnd; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoHashBuilder.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoHashBuilder.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,399 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Security.Cryptography; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Registers.Special; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Summarisable; +using SymbianStructuresLib.Arm.Registers; + + +namespace CrashInfoFilePlugin.PluginImplementations.FileFormat +{ + public class CCrashInfoHashBuilder + { + #region Enumerations + [Flags] + public enum TConfiguration + { + // + // Include stack data in hash + // + EIncludeStack = 1, + + // + // Force inclusion of stack data in hash, even if hash builder + // believes that it's inclusion is not needed in order to uniquely + // pin-point the crash. + // + EIncludeStackForced = 2, + + // + // By default, offset is only included in program counter symbol. + // This will force it to be incldued for all symbols (i.e. even + // those within stack trace). + // + EIncludeOffsetsForAllSymbols = 4, + + // + // Include the processor mode at the time of the crash within the hash. + // + EIncludeProcessorMode = 8, + + // + // By default we output an MD5 hash, but you can enable plain text + // output by using this option. + // + EOutputAsText = 16, + + // + // A general purpose default configuration + // + EDefault = EIncludeStack | EIncludeStackForced | EIncludeProcessorMode + } + #endregion + + #region Factory + public static CCrashInfoHashBuilder New( TConfiguration aConfig, CISummarisableEntity aEntity ) + { + CCrashInfoHashBuilder ret = CCrashInfoHashBuilder.New( aConfig, aEntity, KDefaultNumberOfStackEntriesToCheckForSymbols ); + return ret; + } + + public static CCrashInfoHashBuilder New( TConfiguration aConfig, CISummarisableEntity aEntity, int aNumberOfStackEntriesToCheck ) + { + // By default we'll return an empty string for the hash if mandatory input + // elements are not available + CCrashInfoHashBuilder ret = null; + // + CIStack stack = aEntity.Stack; + CIThread thread = aEntity.Thread; + CIProcess process = aEntity.Process; + CIRegisterList regs = aEntity.Registers; + // + if ( stack != null && regs != null ) + { + if ( process == null || thread == null ) + { + ret = new CCrashInfoHashBuilder( aConfig, regs, stack, aNumberOfStackEntriesToCheck ); + } + else + { + ret = new CCrashInfoHashBuilder( aConfig, regs, stack, thread, process, aNumberOfStackEntriesToCheck ); + } + } + else + { + throw new ArgumentException( LibResources.KRes_CCrashInfoHashBuilder_BadSummarisable ); + } + // + return ret; + } + #endregion + + #region Constructors + private CCrashInfoHashBuilder( TConfiguration aConfig, CIRegisterList aRegisters, CIStack aStack, int aNumberOfStackEntriesToCheck ) + : this( aConfig, aRegisters, aStack, null, null, aNumberOfStackEntriesToCheck ) + { + } + + private CCrashInfoHashBuilder( TConfiguration aConfig, CIRegisterList aRegisters, CIStack aStack, CIThread aThread, CIProcess aProcess, int aNumberOfStackEntriesToCheck ) + { + iConfig = aConfig; + iRegisters = aRegisters; + iStack = aStack; + iProcess = aProcess; + iThread = aThread; + iNumberOfStackEntriesToCheck = aNumberOfStackEntriesToCheck; + } + #endregion + + #region API + public string GetHash() + { + StringBuilder hash = new StringBuilder(); + // + if ( ( iConfig & TConfiguration.EIncludeProcessorMode ) != 0 ) + { + string processorMode = GetProcessorMode(); + hash.AppendFormat( "MODE: [{0}] ", processorMode ); + } + // + string moduleName = GetAppropriateBinaryModuleName(); + hash.AppendFormat( "MODN: [{0}] ", moduleName ); + // + string programCounter = GetProgramCounter(); + hash.AppendFormat( "PC: [{0}] ", programCounter ); + // + if ( ( iConfig & TConfiguration.EIncludeStack ) != 0 || ( iConfig & TConfiguration.EIncludeStackForced ) != 0 ) + { + string stackSymbols = GetStackSymbols(); + hash.AppendFormat( "STK: [{0}] ", stackSymbols ); + } + + // Final stage is to MD5 hash the text, unless the caller requested + // plain text output. + string ret = hash.ToString(); + if ( ( iConfig & TConfiguration.EOutputAsText ) == 0 ) + { + ret = GetMD5( ret ); + } + // + return ret; + } + #endregion + + #region Internal constants + private const int KDefaultNumberOfStackEntriesToCheckForSymbols = 4; + #endregion + + #region Internal methods + private string GetProcessorMode() + { + string ret = LibResources.KRes_CCrashInfoHashBuilder_NoCPUMode; + // + if ( iRegisters.IsCurrentProcessorMode ) + { + CIRegisterCPSR cpsr = iRegisters[ TArmRegisterType.EArmReg_CPSR ] as CIRegisterCPSR; + if ( cpsr != null ) + { + ret = ArmRegisterBankUtils.BankAsString( cpsr.ProcessorMode ); + } + } + // + return ret; + } + + private string GetAppropriateBinaryModuleName() + { + // We'll use the name of the binary associated with the program + // counter symbol (if present) or then if not, we'll fall back + // to using the process name. + string ret = string.Empty; + // + bool fallBack = false; + if ( iRegisters.Contains( TArmRegisterType.EArmReg_PC ) ) + { + CIRegister pc = iRegisters[ TArmRegisterType.EArmReg_PC ]; + if ( pc.Symbol.IsNull == false ) + { + // Symbol available - use the associated binary name + string binName = pc.Symbol.Symbol.Collection.FileName.EitherFullNameButDevicePreferred; + ret = Path.GetFileName( binName ); + } + else + { + fallBack = true; + } + } + else + { + fallBack = true; + } + + // Do we need to fallback because symbol et al was unavailable? + if ( fallBack ) + { + // No Symbol, then in this case we'll try to fall back + // to the process name. + if ( iProcess != null ) + { + ret = iProcess.Name; + } + else + { + // Must be e.g. IRQ, FIQ, ABT, etc + ret = LibResources.KRes_CCrashInfoHashBuilder_AbortModeStack; + } + } + // + return ret; + } + + private string GetProgramCounter() + { + string ret = string.Empty; + // + if ( iRegisters.Contains( TArmRegisterType.EArmReg_PC ) ) + { + CIRegister pc = iRegisters[ TArmRegisterType.EArmReg_PC ]; + ret = CleanSymbol( pc.Value, pc.Symbol, true ); + } + // + return ret; + } + + private string GetStackSymbols() + { + StringBuilder ret = new StringBuilder(); + // + if ( iStack.IsStackOutputAvailable ) + { + bool isOverflow = iStack.IsOverflow; + bool isForced = ( iConfig & TConfiguration.EIncludeStackForced ) != 0; + bool isNullDereference = ( iStack.Registers.Contains( TArmRegisterType.EArmReg_00 ) && iStack.Registers[ TArmRegisterType.EArmReg_00 ].Value == 0 ); + + // If dealing with a stack overflow, then we don't, by default, include any + // symbols from the stack, as they are likely to be entirely dirty or "ghosts" for + // the most part. + // + // Furthermore, if the 'crash' was caused by dereferencing a NULL this pointer + // (which is somewhat of a guess on our part, but we ascertain this by inspecting + // the value of R0) then we don't include stack either. + // + // However, the above behaviour can be overriden by forcing stack processing. + bool processEntries = ( ( isOverflow == false && isNullDereference == false ) || isForced ); + if ( processEntries ) + { + // Get the entries and work out the number of items we should check for + // associated symbols. + CIElementList stackEntries = iStack.ChildrenByType(); + + // Discard all the entries that are outside of the stack pointer range. + // Once we see a register-based entry (for accurate decoding) or the current + // stack pointer entry, we've reached the start of the interesting stack data. + // + // However, if there has been a stack overflow then don't discard anything + // or else we'll end up with nothing left! + if ( iStack.IsOverflow == false && stackEntries.Count > 0 ) + { + int i = 0; + while ( stackEntries.Count > 0 ) + { + // If we see a register based entry then the stack reconstruction almost certainly + // used the accurate algorithm. + // + // Since we have already included the program counter in the hash text, it doesn't + // make sense to include it twice, so skip that. + // However, link register might be useful. + bool remove = true; + CIStackEntry entry = stackEntries[ i ]; + + if ( entry.IsCurrentStackPointerEntry ) + { + break; + } + else if ( entry.IsRegisterBasedEntry ) + { + // Preserve LR, skip PC + if ( entry.Register.Type == TArmRegisterType.EArmReg_LR ) + { + ++i; + remove = false; + } + } + + if ( remove ) + { + stackEntries.RemoveAt( 0 ); + } + } + } + + // Did the caller also want offsets within the output? By default only the program + // counter receives this treatment, but it can be overridden. + bool includeOffset = ( iConfig & TConfiguration.EIncludeOffsetsForAllSymbols ) != 0; + + // We should now have the stack entries directly relating to the crash call stack. + // Process them in turn, but only look at entries which happen to have associated + // symbols. + + int SymbolsNeeded = iNumberOfStackEntriesToCheck; + foreach (CIStackEntry entry in stackEntries) + { + if ( entry.Symbol != null && entry.Symbol.IsNull == false ) + { + string txt = CleanSymbol( entry.Data, entry.Symbol, includeOffset ); + ret.AppendFormat( "{0}, ", txt ); + SymbolsNeeded--; + } + if (SymbolsNeeded == 0) + { + break; + } + } + + // Remove trailing comma + string t = ret.ToString(); + if ( t.EndsWith( ", " ) ) + { + ret = ret.Remove( ret.Length - 2, 2 ); + } + } + } + // + string final = ret.ToString().TrimEnd(); + return final; + } + + private string GetMD5( string aMakeHash ) + { + MD5 md5 = MD5.Create(); + byte[] inputBytes = Encoding.ASCII.GetBytes( aMakeHash ); + byte[] hash = md5.ComputeHash( inputBytes ); + // + StringBuilder sb = new StringBuilder(); + // + for ( int i = 0; i < hash.Length; i++ ) + { + sb.Append( hash[ i ].ToString( "x2" ) ); + } + // + return sb.ToString(); + } + + private static string CleanSymbol( uint aAddress, CISymbol aSymbol, bool aAddOffset ) + { + string ret = string.Empty; + // + if ( aSymbol.IsNull == false ) + { + if ( aAddOffset ) + { + // Only include the name and offset, not the address + uint offset = aSymbol.Symbol.Offset( aAddress ); + ret = string.Format( "|0x{0:x4}| {1}", offset, aSymbol.Symbol.Name ); + } + else + { + ret = aSymbol.Symbol.Name; + } + } + // + return ret; + } + #endregion + + #region Data members + private readonly TConfiguration iConfig; + private readonly CIRegisterList iRegisters; + private readonly CIStack iStack; + private readonly CIThread iThread; + private readonly CIProcess iProcess; + private readonly int iNumberOfStackEntriesToCheck; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoRegisterStorage.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CCrashInfoRegisterStorage.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,322 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* The class CCrashInfoRegisterStorage is part of CrashAnalyser CrashInfoFile plugin. +* Temporary container for arm register list information conversion from +* CrashAnalyser data to CrashInfoFile document. +* Reads register info from CIRegisterList structures and outputs formatted +* CrashInfo file rows. +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using CrashItemLib.Crash.Registers; + +namespace CrashInfoFilePlugin.PluginImplementations.FileFormat +{ + internal class CCrashInfoRegisterStorage + { + #region Constructors + public CCrashInfoRegisterStorage() + { + + } + #endregion + + public void ReadRegisterData(CIRegisterList aRegList) + { + //If long enough reglist starts with R0, it is assumed to be the "basic" register list (R0-R15) + if (aRegList.Count > 15 && aRegList[0].Type == SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_00) + { + iBasicRegs.Name = aRegList.Name; + foreach (CIRegister register in aRegList) + { + string regName = GetRegisterName(register); + + CCrasInfoRegisterItem regItem = new CCrasInfoRegisterItem(regName, register.Value); + + if (register.Symbol != null && CCrashInfoFileUtilities.IsSymbolSerializable(register.Symbol)) + { + regItem.Symbol = register.Symbol.Name; + } + + iBasicRegs.Registers.Add(regItem); + + //Check if this is PC and save it separately + if (register.Type == SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_PC) + { + iProgramCounter.Value = register.Value; + iProgramCounter.Symbol = register.Symbol.Name; + } + } + } + else //all other registers as their own list + { + CCrashInfoRegisterList regs = new CCrashInfoRegisterList(); + regs.Name = aRegList.Name; + bool hasRealData = false; + foreach (CIRegister register in aRegList) + { + string regName = GetRegisterName(register); + CCrasInfoRegisterItem regItem = new CCrasInfoRegisterItem(regName, register.Value); + if (register.Symbol != null && CCrashInfoFileUtilities.IsSymbolSerializable(register.Symbol)) + { + regItem.Symbol = register.Symbol.Name; + } + + regs.Registers.Add(regItem); + + if (register.Value != 0) + { + hasRealData = true; + } + } + + if (hasRealData) + { + iOtherRegLists.Add(regs); + } + } + } + + public void WriteBasicRegisters(System.IO.StreamWriter aOutput) + { + aOutput.Write(CCrashInfoFileUtilities.BlockStartMarker(CrashInfoConsts.Kregister)); + if (iBasicRegs.Registers.Count == 0) + { + aOutput.Write("NotFound|"); + + } + else + { + aOutput.Write(iBasicRegs.Name); + foreach (CCrasInfoRegisterItem reg in iBasicRegs.Registers) + { + aOutput.Write(CrashInfoConsts.KSeparator); + aOutput.Write(reg.Name); + aOutput.Write(CrashInfoConsts.KSeparator); + aOutput.Write(reg.Value); + if (reg.Symbol != string.Empty) + { + aOutput.Write(":" +reg.Symbol); + } + } + } + aOutput.Write(CCrashInfoFileUtilities.BlockEndMarker(CrashInfoConsts.Kregister)); + } + + internal void WriteOtherRegisters(System.IO.StreamWriter aOutput) + { + if (iOtherRegLists.Count > 0) + { + aOutput.Write(CCrashInfoFileUtilities.BlockStartMarker(CrashInfoConsts.Kregister_extra)); + foreach (CCrashInfoRegisterList regList in iOtherRegLists) + { + + aOutput.Write(regList.Name); + foreach (CCrasInfoRegisterItem reg in regList.Registers) + { + aOutput.Write(CrashInfoConsts.KSeparator); + aOutput.Write(reg.Name); + aOutput.Write(CrashInfoConsts.KSeparator); + aOutput.Write(reg.Value); + if (reg.Symbol != string.Empty) + { + aOutput.Write(":" + reg.Symbol); + } + } + aOutput.Write(CrashInfoConsts.KEOL); + + } + aOutput.Write(CCrashInfoFileUtilities.BlockEndMarker(CrashInfoConsts.Kregister_extra)); + + } + } + + internal void WriteProgramCounter(System.IO.StreamWriter aOutput) + { + aOutput.Write(CCrashInfoFileUtilities.BlockStartMarker(CrashInfoConsts.Kprogram_counter)); + aOutput.Write(iProgramCounter.Value); + aOutput.Write(CrashInfoConsts.KSeparator); + if (iProgramCounter.Symbol != string.Empty) + { + aOutput.Write(iProgramCounter.Symbol); + } + else + { + aOutput.Write("-"); //missing pc symbol is marked with - in ci file. + } + + + aOutput.Write(CCrashInfoFileUtilities.BlockEndMarker(CrashInfoConsts.Kprogram_counter)); + } + + /** Return CrashInfo compatible register name - R0-R15 in short numeric form, other as they are */ + public static string GetRegisterName(CIRegister aRegister) + { + string ret = aRegister.Name; + // + switch (aRegister.Type) + { + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_00: + ret = "R0"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_01: + ret = "R1"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_02: + ret = "R2"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_03: + ret = "R3"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_04: + ret = "R4"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_05: + ret = "R5"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_06: + ret = "R6"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_07: + ret = "R7"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_08: + ret = "R8"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_09: + ret = "R9"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_10: + ret = "R10"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_11: + ret = "R11"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_12: + ret = "R12"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_SP: + ret = "R13"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_LR: + ret = "R14"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_PC: + ret = "R15"; + break; + default: + break; + } + // + return ret; + } + + #region Data Members + private CCrashInfoRegisterList iBasicRegs = new CCrashInfoRegisterList(); //R0-R15 + private List iOtherRegLists = new List(); //Other registers + private CCrasInfoRegisterItem iProgramCounter = new CCrasInfoRegisterItem("PC"); + + #endregion + + #region Nested Classes + private class CCrashInfoRegisterList + { + #region Constructors + public CCrashInfoRegisterList() + { + + } + #endregion + + #region Properties + public List Registers + { + get { return iRegisters; } + set { iRegisters = value; } + } + public string Name + { + get { return iName; } + set { iName = value; } + } + + #endregion + + private List iRegisters = new List(); + private string iName; + + + } + + private class CCrasInfoRegisterItem + { + #region Constructors + public CCrasInfoRegisterItem(string aName) + { + iName = aName; + } + + public CCrasInfoRegisterItem(string aName, uint aValue) + { + iName = aName; + iValue = aValue; + } + + #endregion + + #region Properties + public string Name + { + get { return iName; } + set { iName = value; } + } + + public uint Value + { + get { return iValue; } + set { iValue = value; } + } + + public string Symbol + { + get { return iSymbol; } + set { iSymbol = value; } + } + + #endregion + + + #region Data Members + + private uint iValue = 0; + private string iName = string.Empty; + private string iSymbol = string.Empty; + + #endregion + } + + #endregion + + + + + + } + + +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CrashInfoConsts.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/FileFormat/CrashInfoConsts.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* The class CrashInfoConsts is part of CrashAnalyser CrashInfoFile plugin. +* Defines constant strings used in the crash info file format. +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace CrashInfoFilePlugin.PluginImplementations.FileFormat +{ + internal class CrashInfoConsts + { + //General constants + public const int KVersionNumber = 10; + public const string KNewIdStart = "["; + public const string KNewIdEnd = "]"; + public const string KCloseIdStart = "[/"; + public const string KCloseIdEnd = "]"; + public const string KSeparator = "|"; + public const string KEOL = "\r\n"; + public const string KRegistrationMiscInfo = "MOBILECRASH_REGISTRATION"; + public const string KAliveTimeMiscInfo = "MOBILECRASH_ALIVETIME"; + + //Data item identifiers + public const string Kversion = "VERSION"; + public const string Ktimestamp = "TIMESTAMP"; + public const string Kromid = "ROMID"; + public const string Ksw_version = "SW_VERSION"; + public const string Kvariant_id = "VARIANT_ID"; + public const string Khw_version = "HW_VERSION"; + public const string Kpanic_id = "PANIC_ID"; + public const string Kpanic_category = "PANIC_CATEGORY"; + public const string Klanguage = "LANGUAGE"; + public const string Kpanicked_process = "PANICKED_PROCESS"; + public const string Kprogram_counter = "PROGRAM_COUNTER"; + public const string Kcrashed_module_name = "CRASHED_MODULE_NAME"; + public const string Kregister = "REGISTER"; + public const string Kcrashtime_loaded_dlls = "CRASHTIME_LOADED_DLLS"; + public const string Kavailable_memory = "AVAILABLE_MEMORY"; + public const string Kuser_comment = "USER_COMMENT"; + public const string Kmemory_info = "MEMORY_INFO"; + public const string Kmisc_info = "MISC_INFO"; + public const string Kreporter = "REPORTER"; + public const string Karchive = "ARCHIVE"; + public const string Kproduct_type = "PRODUCT_TYPE"; + public const string Kimei = "IMEI"; + public const string Knetwork_country_code = "NETWORK_COUNTRY_CODE"; + public const string Knetwork_identity = "NETWORK_IDENTITY"; + public const string Kresetreason = "RESETREASON"; + public const string Kuptime = "UPTIME"; + public const string Ktestset = "TESTSET"; + public const string Ksymbols = "SYMBOLS"; + public const string Kcall_stack = "CALL_STACK"; + public const string Kexcinfo = "EXCINFO"; + public const string Ksiminfo = "SIMINFO"; + public const string Klocinfo = "LOCINFO"; + public const string Kcellid = "CELLID"; + public const string Kpsninfo = "PSNINFO"; + public const string Ks60version = "S60VERSION"; + public const string Kdiskinfo = "DISKINFO"; + public const string Kmmcinfo = "MMCINFO"; + public const string Kuid = "UID"; + public const string Keventlog = "EVENTLOG"; + public const string Kproduct_code = "PRODUCT_CODE"; + public const string Kvariant_version = "VARIANT_VERSION"; + public const string Kfile_type = "FILE_TYPE"; + public const string Kreport_type = "REPORT_TYPE"; + public const string Kreport_category = "REPORT_CATEGORY"; + public const string Kreport_ok = "REPORT_OK"; + public const string Kreport_fail = "REPORT_FAIL"; + public const string Kreport_param_name1 = "REPORT_PARAM_NAME1"; + public const string Kreport_param_value1 = "REPORT_PARAM_VALUE1"; + public const string Kreport_param_name2 = "REPORT_PARAM_NAME2"; + public const string Kreport_param_value2 = "REPORT_PARAM_VALUE2"; + public const string Kreport_param_name3 = "REPORT_PARAM_NAME3"; + public const string Kreport_param_value3 = "REPORT_PARAM_VALUE3"; + public const string Kreport_comments = "REPORT_COMMENTS"; + public const string Ktrace_data = "TRACE_DATA"; + public const string Knum_datablocks = "NUM_DATABLOCKS"; + + //CrashAnalyser implementation's own types (not used in selge output) + + public const string Kregister_extra = "REGISTER_EXTRA"; + public const string Kcall_stack_text = "CALL_STACK_TEXT"; + public const string Kcrash_hash = "DEFECT_HASH"; // New crash hash that DbMover used to create itself. + public const string Kbinfile_name = "BIN_FILE_NAME"; + public const string Ksymbolfile_names = "SYMBOL_FILE_NAME"; + + public const int KMaxStackSize = 65000; //max length of call stack output in bytes + public const int KMaxItemAboveSP = 7; //How many items are taken above stack pointer, should never be less than 2 to keep PC and LR + public const int KNonSymbolItemsAfterSP = 20; //How many items are always taken below stack pointer (rest items are taken if they have symbols) + + + //Internally used constants + + public enum MobileCrashFileType + { + ETypeBasicCrash = 0, + ETypeCrashAPIReport, + ETypeRegistrationMessage, + ETypeAliveMessage + } + + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/LibResources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/LibResources.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,90 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CrashInfoFilePlugin { + using System; + + + // + // A strongly-typed resource class, for looking up localized strings, etc. + // + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class LibResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal LibResources() { + } + + // + // Returns the cached ResourceManager instance used by this class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CrashInfoFilePlugin.LibResources", typeof(LibResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + // + // Overrides the current thread's CurrentUICulture property for all + // resource lookups using this strongly typed resource class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + // + // Looks up a localized string similar to Abort Mode Stack. + // + internal static string KRes_CCrashInfoHashBuilder_AbortModeStack { + get { + return ResourceManager.GetString("KRes_CCrashInfoHashBuilder_AbortModeStack", resourceCulture); + } + } + + // + // Looks up a localized string similar to The specified sumarisable entity cannot be hashed because it is complete. + // + internal static string KRes_CCrashInfoHashBuilder_BadSummarisable { + get { + return ResourceManager.GetString("KRes_CCrashInfoHashBuilder_BadSummarisable", resourceCulture); + } + } + + // + // Looks up a localized string similar to CPU Mode N/A. + // + internal static string KRes_CCrashInfoHashBuilder_NoCPUMode { + get { + return ResourceManager.GetString("KRes_CCrashInfoHashBuilder_NoCPUMode", resourceCulture); + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/LibResources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/LibResources.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Abort Mode Stack + + + The specified sumarisable entity cannot be hashed because it is complete + + + CPU Mode N/A + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/PluginImplementations/Sink/CCrashInfoFileSink.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/PluginImplementations/Sink/CCrashInfoFileSink.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* The class CCrashInfoFileSink is part of CrashAnalyser CrashInfoFile plugin. +* Sink output plugin for Crash Info File format. +* Implements CISink which is automatically discovered by CISinkManager. +* Serialize function produces a Crash Info file formatted text output +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +using CrashItemLib.Sink; + +//using CrashItemLib.Crash.Symbols; +//using CrashItemLib.Crash.CodeSegs; +//using CrashItemLib.Crash.Registers; +//using CrashItemLib.Crash.Threads; + + +using CrashInfoFilePlugin.PluginImplementations.FileFormat; +using System.IO; + +namespace CrashInfoFilePlugin.PluginImplementations.Sink +{ + public class CCrashInfoFileSink : CISink + { + #region Constants + public const string KCrashInfoSinkName = "Crash Info File"; + #endregion + + #region Constructors + public CCrashInfoFileSink(CISinkManager aManager) + : base(KCrashInfoSinkName, aManager) + { + } + #endregion + + #region From CISink + public override object Serialize(CISinkSerializationParameters aParams) + { + CCrashInfoFileDocument document = new CCrashInfoFileDocument(); + + //Read information relevant to crash info file from container to internal variables + document.ReadDataFromContainer(aParams); + + //Override default file extension + aParams.FileExtensionFailed = ".corrupt_ci"; + aParams.FileExtensionSuccess = ".ci"; + + //Write document's internal data to file + string newFileName = string.Empty; + using ( Stream output = aParams.CreateFile( out newFileName ) ) + { + using ( StreamWriter sw = new StreamWriter( output, Encoding.ASCII ) ) + { + document.WriteToStream( sw ); + } + } + return newFileName; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashInfoFilePlugin/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CrashInfoFilePlugin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Nokia")] +[assembly: AssemblyProduct("CrashInfoFilePlugin")] +[assembly: AssemblyCopyright("Copyright © Nokia 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b8dc3315-750d-4c7d-893e-393f50796847")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/CrashXmlPlugin.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/CrashXmlPlugin.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,123 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D} + Library + Properties + CrashXmlPlugin + CrashXml.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8} + SymbianTree + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC} + CrashItemLib + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/CrashAnalyser/CXmlNodeCrashAnalyser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/CrashAnalyser/CXmlNodeCrashAnalyser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Xml; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.CrashAnalyser +{ + internal class CXmlNodeCrashAnalyser : CXmlNode + { + #region Constructors + public CXmlNodeCrashAnalyser() + : base( Constants.CrashAnalyser ) + { + base.Add( new CXmlNodeCrashAnalyserFileFormat() ); + base.Add( new CXmlNodeCrashAnalyserRuntime() ); + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/CrashAnalyser/CXmlNodeCrashAnalyserFileFormat.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/CrashAnalyser/CXmlNodeCrashAnalyserFileFormat.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Xml; +using CrashXmlPlugin.FileFormat.Node; +using CrashXmlPlugin.FileFormat.Versions; + +namespace CrashXmlPlugin.FileFormat.CrashAnalyser +{ + internal class CXmlNodeCrashAnalyserFileFormat : CXmlNode + { + #region Constructors + public CXmlNodeCrashAnalyserFileFormat() + : base( Constants.CrashAnalyser_FileFormat ) + { + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlVersionExtended version = new CXmlVersionExtended( Constants.MasterFileFormatVersionMajor, + Constants.MasterFileFormatVersionMinor ); + version.XmlSerialize( aParameters ); + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/CrashAnalyser/CXmlNodeCrashAnalyserRuntime.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/CrashAnalyser/CXmlNodeCrashAnalyserRuntime.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Xml; +using System.Collections.Generic; +using CrashItemLib.Sink; +using CrashXmlPlugin.FileFormat.Node; +using CrashXmlPlugin.FileFormat.Versions; +using SymbianUtils.Enum; + +namespace CrashXmlPlugin.FileFormat.CrashAnalyser +{ + internal class CXmlNodeCrashAnalyserRuntime : CXmlNode + { + #region Constructors + public CXmlNodeCrashAnalyserRuntime() + : base( Constants.CrashAnalyser_Runtime ) + { + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + // UI Version + CXmlVersionExtended version = new CXmlVersionExtended( aParameters.UIVersion ); + version.XmlSerialize( aParameters ); + + // Analysis type + string analysisType = EnumUtils.ToString( aParameters.DetailLevel ); + aParameters.Writer.WriteElementString( Constants.CrashAnalyser_Runtime_AnalysisType, analysisType ); + + // Command line + string commandLine = aParameters.UICommandLineArguments; + aParameters.Writer.WriteElementString( Constants.CrashAnalyser_Runtime_CommandLine, commandLine ); + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + aParameters.Writer.WriteStartElement( Constants.CrashAnalyser_Runtime_InputFiles ); + + // Get the file names & sort them + List files = new List(); + files.AddRange( aParameters.Container.FileNames ); + files.Sort(); + + // Output them + foreach ( string file in files ) + { + aParameters.Writer.WriteElementString( Constants.CrashAnalyser_Runtime_InputFiles_File, file ); + } + // + aParameters.Writer.WriteEndElement(); + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Document/CXmlDocumentRoot.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Document/CXmlDocumentRoot.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Xml; +using CrashXmlPlugin.FileFormat.CrashAnalyser; +using CrashXmlPlugin.FileFormat.SourceInfo; +using CrashXmlPlugin.FileFormat.Segment; +using CrashXmlPlugin.FileFormat.Node; +using SymbianTree; + +namespace CrashXmlPlugin.FileFormat.Document +{ + internal class CXmlDocumentRoot : SymDocument + { + #region Constructors + public CXmlDocumentRoot() + { + base.Add( new CXmlNodeCrashAnalyser() ); + base.Add( new CXmlNodeSourceInfo() ); + + // Segment table must be serialized first - it writes its data to a memory buffer + base.Add( new CXmlNodeSegmentTable() ); + + // ... and then the dictionary writes its data to the underlying file, after which + // it appends the serialized segment table memory-buffer + base.Add( new CXmlNodeSegmentDictionary() ); + } + #endregion + + #region API + public void XmlSerialize( CXmlDocumentSerializationParameters aParameters ) + { + string nodeName = XmlNodeName; + // + aParameters.Writer.WriteStartElement( null, nodeName, null ); + XmlSerializeChildren( aParameters ); + aParameters.Writer.WriteEndElement(); + } + #endregion + + #region Properties + public CXmlNodeCrashAnalyser CrashAnalyser + { + get { return (CXmlNodeCrashAnalyser) base.ChildByType( typeof( CXmlNodeCrashAnalyser ) ); } + } + + public CXmlNodeSourceInfo SourceInfo + { + get { return (CXmlNodeSourceInfo) base.ChildByType( typeof( CXmlNodeSourceInfo ) ); } + } + + public CXmlNodeSegmentDictionary SegmentDictionary + { + get { return (CXmlNodeSegmentDictionary) base.ChildByType( typeof( CXmlNodeSegmentDictionary ) ); } + } + + public CXmlNodeSegmentTable SegmentTable + { + get { return (CXmlNodeSegmentTable) base.ChildByType( typeof( CXmlNodeSegmentTable ) ); } + } + #endregion + + #region Internal methods + private void XmlSerializeChildren( CXmlDocumentSerializationParameters aParameters ) + { + foreach ( SymNode node in this ) + { + if ( node is CXmlNode ) + { + CXmlNode xmlNode = (CXmlNode) node; + xmlNode.XmlSerialize( aParameters ); + } + } + } + #endregion + + #region From SymNode + protected override string XmlNodeName + { + get + { + return Constants.RootNode; + } + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Document/CXmlDocumentSerializationParameters.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Document/CXmlDocumentSerializationParameters.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; +using System.IO; +using CrashItemLib.Sink; +using SymbianUtils; + +namespace CrashXmlPlugin.FileFormat.Document +{ + internal class CXmlDocumentSerializationParameters : CISinkSerializationParameters + { + #region Constructors + public CXmlDocumentSerializationParameters( CISinkSerializationParameters aCopy, CXmlDocumentRoot aDocument ) + : base( aCopy ) + { + PrepareDefaultExtensions(); + iDocument = aDocument; + // + Stream stream = base.CreateFile( out iFileName ); + // + XmlWriterSettings settings = CreateWriterSettings(); + settings.CloseOutput = true; + // + iWriter = XmlWriter.Create( stream, settings ); + } + + public CXmlDocumentSerializationParameters( CISinkSerializationParameters aCopy, CXmlDocumentRoot aDocument, StringBuilder aBuilder ) + : base( aCopy ) + { + PrepareDefaultExtensions(); + iDocument = aDocument; + // + XmlWriterSettings settings = CreateWriterSettings(); + settings.ConformanceLevel = ConformanceLevel.Fragment; + settings.OmitXmlDeclaration = true; + // + iWriter = XmlWriter.Create( aBuilder, settings ); + iFileName = string.Empty; + } + #endregion + + #region From + protected override void PrepareDefaultExtensions() + { + if ( string.IsNullOrEmpty( base.FileExtensionFailed ) ) + { + base.FileExtensionFailed = KXmlDefaultExtensionFailure; + } + if ( string.IsNullOrEmpty( base.FileExtensionSuccess ) ) + { + base.FileExtensionSuccess = KXmlDefaultExtensionSuccess; + } + } + #endregion + + #region Properties + public CXmlDocumentRoot Document + { + get { return iDocument; } + } + + public XmlWriter Writer + { + get { return iWriter; } + } + + public string FileName + { + get { return iFileName; } + } + #endregion + + #region Internal constants + private const string KXmlDefaultExtensionSuccess = ".xml"; + private const string KXmlDefaultExtensionFailure = ".failedxml"; + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iWriter.Flush(); + iWriter.Close(); + } + } + #endregion + + #region Internal methods + private static XmlWriterSettings CreateWriterSettings() + { + XmlWriterSettings settings = new XmlWriterSettings(); + settings.Indent = true; + settings.IndentChars = " "; + settings.NewLineHandling = NewLineHandling.None; + settings.Encoding = Encoding.UTF8; + // + return settings; + } + #endregion + + #region Data members + private readonly string iFileName; + private readonly XmlWriter iWriter; + private readonly CXmlDocumentRoot iDocument; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Node/CXmlNode.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Node/CXmlNode.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Xml; +using CrashItemLib.Crash.Base; +using SymbianTree; +using CrashXmlPlugin.FileFormat.Document; +using CrashXmlPlugin.FileFormat.Segment.Entries; + +namespace CrashXmlPlugin.FileFormat.Node +{ + internal class CXmlNode : SymNodeAddAsChild + { + #region Constructors + protected CXmlNode( string aName ) + { + iName = aName; + } + #endregion + + #region API - Framework + public virtual void XmlSerialize( CXmlDocumentSerializationParameters aParameters ) + { + string nodeName = XmlNodeName; + // + aParameters.Writer.WriteStartElement( null, nodeName, null ); + XmlSerializeContent( aParameters ); + XmlSerializeChildren( aParameters ); + aParameters.Writer.WriteEndElement(); + } + + /// + /// Override this virtual function if you have dynamic content to serialize at the + /// level of this node. + /// + /// + protected virtual void XmlSerializeContent( CXmlDocumentSerializationParameters aParameters ) + { + } + + /// + /// By default, this method invokes the XmlSerialize() method on all children. Override this + /// method if you have dynamic children to serialize that are not directly added as child nodes. + /// + /// + protected virtual void XmlSerializeChildren( CXmlDocumentSerializationParameters aParameters ) + { + SymNodeEnumeratorChildren iterator = new SymNodeEnumeratorChildren( this ); + foreach ( SymNode node in iterator ) + { + try + { + ( (CXmlNode) node ).XmlSerialize( aParameters ); + } + catch ( Exception e ) + { +#if DEBUG + System.Diagnostics.Debug.WriteLine( "CXmlNode Exception: " + this.GetType().Name ); + System.Diagnostics.Debug.WriteLine( " Message: " + e.Message ); + System.Diagnostics.Debug.WriteLine( " Stack: " + e.StackTrace ); +#endif + } + } + } + #endregion + + #region Writer Helpers + public static void WriteId( CIElement aElement, XmlWriter aWriter ) + { + aWriter.WriteStartElement( SegConstants.CmnId ); + if ( aElement.IsIdExplicit ) + { + aWriter.WriteAttributeString( SegConstants.CmnType, SegConstants.CmnId_Explicit ); + } + aWriter.WriteValue( aElement.Id.ToString() ); + aWriter.WriteEndElement(); + } + + public static void WriteLink( CIElementId aLinkTo, string aSegment, XmlWriter aWriter ) + { + aWriter.WriteStartElement( Constants.CmnLink ); + aWriter.WriteAttributeString( Constants.CmnLink_Seg, aSegment ); + aWriter.WriteValue( aLinkTo.ToString() ); + aWriter.WriteEndElement(); + } + + public static void WriteLinkListStart( XmlWriter aWriter, string aSegment ) + { + aWriter.WriteStartElement( Constants.CmnLinkList ); + aWriter.WriteAttributeString( Constants.CmnLink_Seg, aSegment ); + } + + public static void WriteLinkListEnd( XmlWriter aWriter ) + { + aWriter.WriteEndElement(); + } + + public static void WriteStringIfNotEmpty( XmlWriter aWriter, string aName, string aValue ) + { + if ( !string.IsNullOrEmpty( aValue ) ) + { + aWriter.WriteElementString( aName, aValue ); + } + } + + public static void WriteDate( XmlWriter aWriter, DateTime aDate, string aName ) + { + string date = string.Format( "{0:d4}{1:d2}{2:d2}", aDate.Year, aDate.Month, aDate.Day ); + aWriter.WriteElementString( aName, date ); + } + + public static void WriteTime( XmlWriter aWriter, DateTime aTime, string aName ) + { + string time = string.Format( "{0:d2}{1:d2}{2:d2}", aTime.Hour, aTime.Minute, aTime.Second ); + aWriter.WriteElementString( aName, time ); + } + #endregion + + #region Properties + public string Name + { + get { return iName; } + protected set { iName = value; } + } + #endregion + + #region From SymNode + protected override string XmlNodeName + { + get + { + return iName; + } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + return iName; + } + #endregion + + #region Data members + private string iName = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/CXmlNodeSegmentDictionary.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/CXmlNodeSegmentDictionary.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Engine; +using CrashXmlPlugin.FileFormat.Node; +using CrashXmlPlugin.FileFormat.Document; +using CrashXmlPlugin.FileFormat.Segment.Entries; + +namespace CrashXmlPlugin.FileFormat.Segment +{ + internal class CXmlNodeSegmentDictionary : CXmlNode + { + #region Constructors + public CXmlNodeSegmentDictionary() + : base( Constants.SegmentDictionary ) + { + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CXmlDocumentSerializationParameters aParameters ) + { + base.XmlSerialize( aParameters ); + + // Now write segment table in-memory buffer + string segTable = aParameters.Document.SegmentTable.SerializedData; + if ( segTable.Length > 0 ) + { + aParameters.Writer.WriteRaw( segTable ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlDocumentRoot docRoot = ( base.Parent as CXmlDocumentRoot ); + if ( docRoot != null ) + { + CXmlNodeSegmentTable table = docRoot.SegmentTable; + if ( table != null ) + { + foreach ( CXmlSegBase seg in table ) + { + bool wasSerialized = seg.WasSerialized; + if ( wasSerialized ) + { + aParameters.Writer.WriteStartElement( Constants.SegmentDictionary_Segment ); + // + seg.Version.XmlSerialize( aParameters ); + aParameters.Writer.WriteElementString( SegConstants.CmnName, seg.Name ); + // + aParameters.Writer.WriteEndElement(); + } + } + } + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/CXmlNodeSegmentTable.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/CXmlNodeSegmentTable.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.IO; +using CrashItemLib.Engine; +using CrashXmlPlugin.FileFormat.Node; +using CrashXmlPlugin.FileFormat.Document; +using CrashXmlPlugin.FileFormat.Segment.Entries; +using SymbianUtils.PluginManager; + +namespace CrashXmlPlugin.FileFormat.Segment +{ + internal class CXmlNodeSegmentTable : CXmlNode, IEnumerable + { + #region Constructors + public CXmlNodeSegmentTable() + : base( Constants.SegmentTable ) + { + AddChildren(); + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CXmlDocumentSerializationParameters aParameters ) + { + try + { + // Serialize data to string + using ( CXmlDocumentSerializationParameters newParams = new CXmlDocumentSerializationParameters( aParameters, aParameters.Document, iSerializedData ) ) + { + base.XmlSerialize( newParams ); + + // The serialized XML data which is stored to this class' data member will + // be written later on by the segment dictionary. + newParams.Writer.Flush(); + + // Tidy up head and tail so that it matches the rest of the document. + string indent = aParameters.Writer.Settings.IndentChars; + string text = iSerializedData.ToString(); + using ( StringReader reader = new StringReader( text ) ) + { + iSerializedData.Length = 0; + string line = reader.ReadLine(); + while ( line != null ) + { + iSerializedData.AppendLine( indent + line ); + line = reader.ReadLine(); + } + } + iSerializedData.Insert( 0, System.Environment.NewLine ); + } + } + catch ( Exception ) + { + } + } + #endregion + + #region Properties + internal string SerializedData + { + get { return iSerializedData.ToString(); } + } + #endregion + + #region Internal methods + private void AddChildren() + { + PluginManager plugins = new PluginManager( 1 ); + plugins.LoadFromCallingAssembly(); + + // Sort them by priority + SortedList list = new SortedList(); + foreach( CXmlSegBase seg in plugins ) + { + list.Add( seg.SegmentPriority, seg ); + } + + // Now they are sorted, add them as children + foreach ( KeyValuePair kvp in list ) + { + base.Add( kvp.Value ); + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( SymbianTree.SymNode node in base.Children ) + { + if ( node is CXmlSegBase ) + { + CXmlSegBase ret = (CXmlSegBase) node; + yield return ret; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( SymbianTree.SymNode node in base.Children ) + { + if ( node is CXmlSegBase ) + { + CXmlSegBase ret = (CXmlSegBase) node; + yield return ret; + } + } + } + #endregion + + #region Data members + private StringBuilder iSerializedData = new StringBuilder(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Base/CXmlSegBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Base/CXmlSegBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashXmlPlugin.FileFormat.Segment; +using CrashXmlPlugin.FileFormat.Versions; +using CrashXmlPlugin.FileFormat.Node; +using CrashXmlPlugin.FileFormat.Document; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries +{ + internal abstract class CXmlSegBase : CXmlNode + { + #region Constructors + protected CXmlSegBase( string aName ) + : base( aName ) + { + } + #endregion + + #region Framework API + public abstract int SegmentPriority + { + get; + } + #endregion + + #region API + public static void XmlSerializeMessages( CXmlDocumentSerializationParameters aParameters, CIElement aElement ) + { + CIElementList messages = aElement.ChildrenByType(); + foreach ( CIMessage msg in messages ) + { + CXmlNode.WriteLink( msg.Id, SegConstants.Messages, aParameters.Writer ); + } + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CXmlDocumentSerializationParameters aParameters ) + { + iWasSerialized = true; + base.XmlSerialize( aParameters ); + } + #endregion + + #region Properties + public CXmlVersionExtended Version + { + get { return iVersion; } + } + + public bool WasSerialized + { + get { return iWasSerialized; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private CXmlVersionExtended iVersion = new CXmlVersionExtended(); + private bool iWasSerialized = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/BinaryData/CXmlBlob.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/BinaryData/CXmlBlob.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Xml; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.BinaryData; +using CrashXmlPlugin.FileFormat.Node; +using SymbianUtils.DataBuffer; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.BinaryData +{ + internal class CXmlBlob : CXmlNode + { + #region Constructors + public CXmlBlob( CIBinaryData aBinaryData ) + : base( SegConstants.BinaryData_Blob ) + { + iBinaryData = aBinaryData; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlNode.WriteId( iBinaryData, aParameters.Writer ); + aParameters.Writer.WriteElementString( SegConstants.CmnName, iBinaryData.Name ); + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + aParameters.Writer.WriteStartElement( SegConstants.BinaryData_Blob_Payload ); + + // Convert blob to bytequeue. + DataBuffer buffer = iBinaryData.DataBuffer; + + string[] lines = Utilities.ConvertBinaryDataToText( buffer, Constants.KBinaryDataMaxLineLength ); + foreach( string line in lines ) + { + WriteLineOfData( aParameters.Writer, line ); + } + + aParameters.Writer.WriteEndElement(); + } + #endregion + + #region Internal constants + #endregion + + #region Properties + private void WriteLineOfData( XmlWriter aWriter, string aLine ) + { + if ( !string.IsNullOrEmpty( aLine ) ) + { + aWriter.WriteElementString( SegConstants.BinaryData_Blob_Payload_Data, aLine ); + } + } + #endregion + + #region Data members + private readonly CIBinaryData iBinaryData; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/BinaryData/CXmlSegBinaryData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/BinaryData/CXmlSegBinaryData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.BinaryData; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.BinaryData +{ + internal class CXmlSegBinaryData : CXmlSegBase + { + #region Constructors + public CXmlSegBinaryData() + : base( SegConstants.BinaryData ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 120; } + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + iList = aParameters.Container.ChildrenByType( CIElement.TChildSearchType.EEntireHierarchy ); + // + if ( iList != null && iList.Count > 0 ) + { + base.XmlSerialize( aParameters ); + } + // + iList = null; + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + System.Diagnostics.Debug.Assert( iList != null ); + // + foreach ( CIBinaryData blob in iList ) + { + CXmlBlob xmlBlob = new CXmlBlob( blob ); + xmlBlob.XmlSerialize( aParameters ); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + private CIElementList iList = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/CodeSegs/CXmlCodeSeg.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/CodeSegs/CXmlCodeSeg.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.CodeSegs; +using SymbianStructuresLib.CodeSegments; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.CodeSegs +{ + internal class CXmlCodeSeg : CXmlNode + { + #region Constructors + public CXmlCodeSeg( CICodeSeg aCodeSeg ) + : base( SegConstants.CodeSegs_CodeSeg ) + { + iCodeSeg = aCodeSeg; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlNode.WriteId( iCodeSeg, aParameters.Writer ); + aParameters.Writer.WriteElementString( SegConstants.CmnName, iCodeSeg.Name ); + aParameters.Writer.WriteElementString( SegConstants.CmnBase, iCodeSeg.Base.ToString( "x8" ) ); + aParameters.Writer.WriteElementString( SegConstants.CmnSize, iCodeSeg.Size.ToString( "x8" ) ); + aParameters.Writer.WriteElementString( SegConstants.CmnRange, iCodeSeg.Range.ToString() ); + + if ( iCodeSeg.Checksum != 0 ) + { + aParameters.Writer.WriteElementString( SegConstants.CmnChecksum, iCodeSeg.Checksum.ToString( "x8" ) ); + } + + // Write any messages + CXmlSegBase.XmlSerializeMessages( aParameters, iCodeSeg ); + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + aParameters.Writer.WriteStartElement( SegConstants.CmnAttributes ); + // + CodeSegDefinition codeSegDef = (CodeSegDefinition) iCodeSeg; + if ( ( codeSegDef.Attributes & CodeSegDefinition.TAttributes.EAttributeXIP ) == CodeSegDefinition.TAttributes.EAttributeXIP ) + { + aParameters.Writer.WriteElementString( SegConstants.CmnXIP, string.Empty ); + } + else if ( ( codeSegDef.Attributes & CodeSegDefinition.TAttributes.EAttributeRAM ) == CodeSegDefinition.TAttributes.EAttributeRAM ) + { + aParameters.Writer.WriteElementString( SegConstants.CmnRAM, string.Empty ); + } + if ( !iCodeSeg.IsResolved ) + { + aParameters.Writer.WriteElementString( SegConstants.CodeSegs_CodeSeg_Attributes_NoSymbols, string.Empty ); + } + if ( iCodeSeg.IsSpeculative ) + { + aParameters.Writer.WriteElementString( SegConstants.CodeSegs_CodeSeg_Attributes_Speculative, string.Empty ); + } + if ( iCodeSeg.IsMismatched ) + { + aParameters.Writer.WriteElementString( SegConstants.CodeSegs_CodeSeg_Attributes_Mismatch, string.Empty ); + } + // + aParameters.Writer.WriteEndElement(); + } + #endregion + + #region Properties + #endregion + + #region Data members + private readonly CICodeSeg iCodeSeg; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/CodeSegs/CXmlSegCodeSegs.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/CodeSegs/CXmlSegCodeSegs.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.CodeSegs; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.CodeSegs +{ + internal class CXmlSegCodeSegs : CXmlSegBase + { + #region Constructors + public CXmlSegCodeSegs() + : base( SegConstants.CodeSegs ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 30; } + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + // Get the code segments + CIElementList codeSegs = aParameters.Container.ChildrenByType( CIElement.TChildSearchType.EEntireHierarchy ); + + // Sort them + Comparison comparer = delegate( CICodeSeg aLeft, CICodeSeg aRight ) + { + return string.Compare( aLeft.Name, aRight.Name, true ); + }; + codeSegs.Sort( comparer ); + + // List them + foreach ( CICodeSeg codeSeg in codeSegs ) + { + CXmlCodeSeg xmlCodeSeg = new CXmlCodeSeg( codeSeg ); + xmlCodeSeg.XmlSerialize( aParameters ); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Events/CXmlEvent.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Events/CXmlEvent.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Events; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Events +{ + internal class CXmlEvent : CXmlNode + { + #region Constructors + public CXmlEvent( CIEvent aEvent ) + : base( SegConstants.EventLog_Event ) + { + iEvent = aEvent; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + aParameters.Writer.WriteAttributeString( SegConstants.CmnType, iEvent.TypeName ); + aParameters.Writer.WriteString( iEvent.Value.ToString() ); + } + #endregion + + #region Properties + #endregion + + #region Data members + private readonly CIEvent iEvent; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Events/CXmlSegEventLog.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Events/CXmlSegEventLog.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Events; +using CrashItemLib.Crash.Utils; +using CrashXmlPlugin.FileFormat.Versions; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Events +{ + internal class CXmlSegEventLog : CXmlSegBase + { + #region Constructors + public CXmlSegEventLog() + : base( SegConstants.EventLog ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 90; } + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIEventList events = aParameters.Container.Events; + if ( events.Count > 0 ) + { + base.XmlSerialize( aParameters ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIEventList events = aParameters.Container.Events; + foreach( CIEvent e in events ) + { + CXmlEvent xmlEvent = new CXmlEvent( e ); + xmlEvent.XmlSerialize( aParameters ); + } + } + #endregion + + #region Properties + #endregion + + #region From SegBase + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Header/CXmlSegHeader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Header/CXmlSegHeader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Header; +using CrashXmlPlugin.FileFormat.Versions; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Header +{ + internal class CXmlSegHeader : CXmlSegBase + { + #region Constructors + public CXmlSegHeader() + : base( SegConstants.Header ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 0; } + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + if ( aParameters.Container.Status != CrashItemLib.Crash.Container.CIContainer.TStatus.EStatusErrorContainer ) + { + CIHeader header = aParameters.Container.Header; + DateTime crashTime = header.CrashTime; + + // Date and time + CXmlNode.WriteDate( aParameters.Writer, crashTime, SegConstants.CmnDate ); + CXmlNode.WriteTime( aParameters.Writer, crashTime, SegConstants.CmnTime ); + + // Uptime + double uptime = header.UpTime.TotalSeconds; + if ( uptime > 0 ) + { + aParameters.Writer.WriteElementString( SegConstants.Header_Uptime, uptime.ToString() ); + } + + // Underlying version information from crash file (if available) + if ( header.FileFormatVersion.IsValid ) + { + CXmlVersionText version = new CXmlVersionText( header.FileFormatVersion ); + version.XmlSerialize( aParameters ); + } + } + } + #endregion + + #region Properties + #endregion + + #region From SegBase + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/InfoHW/CXmlSegInfoHW.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/InfoHW/CXmlSegInfoHW.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.InfoHW; +using CrashItemLib.Crash.Utils; +using CrashXmlPlugin.FileFormat.Versions; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.InfoHW +{ + internal class CXmlSegInfoHW : CXmlSegBase + { + #region Constructors + public CXmlSegInfoHW() + : base( SegConstants.HWInfo ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 70; } + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIInfoHW info = (CIInfoHW) aParameters.Container.ChildByType( typeof( CIInfoHW ) ); + if ( info != null ) + { + base.XmlSerialize( aParameters ); + } + } + + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIInfoHW info = (CIInfoHW) aParameters.Container.ChildByType( typeof( CIInfoHW ) ); + if ( info != null ) + { + // Product type + string productType = info.ProductType; + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.HWInfo_ProductType, productType ); + + // Product code + string productCode = info.ProductCode; + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.HWInfo_ProductCode, productCode ); + + // Serial number + string serialNumber = info.SerialNumber; + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.HWInfo_SerialNumber, serialNumber ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIInfoHW info = (CIInfoHW) aParameters.Container.ChildByType( typeof( CIInfoHW ) ); + if ( info != null ) + { + int count = info.VersionCount; + if ( count > 0 ) + { + CXmlVersionText.WriteVersionTextListStart( aParameters.Writer ); + foreach ( CIVersionInfo version in info ) + { + if ( version.IsValid ) + { + CXmlVersionText xmlVersion = new CXmlVersionText( version.Value ); + xmlVersion.XmlSerialize( aParameters ); + } + } + CXmlVersionText.WriteVersionTextListEnd( aParameters.Writer ); + } + } + } + #endregion + + #region Properties + #endregion + + #region From SegBase + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/InfoSW/CXmlSegInfoSW.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/InfoSW/CXmlSegInfoSW.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.InfoSW; +using CrashItemLib.Crash.Utils; +using CrashXmlPlugin.FileFormat.Versions; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.InfoSW +{ + internal class CXmlSegInfoSW : CXmlSegBase + { + #region Constructors + public CXmlSegInfoSW() + : base( SegConstants.SWInfo ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 80; } + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIInfoSW info = (CIInfoSW) aParameters.Container.ChildByType( typeof( CIInfoSW ) ); + if ( info != null ) + { + base.XmlSerialize( aParameters ); + } + } + + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIInfoSW info = (CIInfoSW) aParameters.Container.ChildByType( typeof( CIInfoSW ) ); + if ( info != null ) + { + // Checksum + if ( info.ImageCheckSum != 0 ) + { + aParameters.Writer.WriteElementString( SegConstants.CmnChecksum, info.ImageCheckSum.ToString( "x8" ) ); + } + + // Date and time + CXmlNode.WriteDate( aParameters.Writer, info.ImageTimeStamp, SegConstants.CmnDate ); + CXmlNode.WriteTime( aParameters.Writer, info.ImageTimeStamp, SegConstants.CmnTime ); + + // Platform + string platform = info.Platform; + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.SWInfo_Platform, platform ); + + // Language + string language = info.Language; + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.SWInfo_Language, language ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIInfoSW info = (CIInfoSW) aParameters.Container.ChildByType( typeof( CIInfoSW ) ); + if ( info != null ) + { + int count = info.VersionCount; + if ( count > 0 ) + { + CXmlVersionText.WriteVersionTextListStart( aParameters.Writer ); + foreach ( CIVersionInfo version in info ) + { + if ( version.IsValid ) + { + CXmlVersionText xmlVersion = new CXmlVersionText( version.Value ); + xmlVersion.XmlSerialize( aParameters ); + } + } + CXmlVersionText.WriteVersionTextListEnd( aParameters.Writer ); + } + } + } + #endregion + + #region Properties + #endregion + + #region From SegBase + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Memory/CXmlMemoryInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Memory/CXmlMemoryInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Xml; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Memory; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Memory +{ + internal class CXmlMemoryInfo : CXmlNode + { + #region Constructors + public CXmlMemoryInfo( CIMemoryInfo aInfo, string aName ) + : base( aName ) + { + iInfo = aInfo; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlNode.WriteId( iInfo, aParameters.Writer ); + WriteIfNotZero( aParameters.Writer, SegConstants.CmnName, iInfo.Free ); + WriteIfNotZero( aParameters.Writer, SegConstants.MemoryInfo_Capacity, iInfo.Capacity ); + + if ( iInfo.Type == CIMemoryInfo.TType.ETypeDrive ) + { + WriteDrivePath( aParameters.Writer, iInfo.DriveNumber ); + WriteIfNotZero( aParameters.Writer, SegConstants.MemoryInfo_UID, iInfo.UID ); + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.MemoryInfo_Drive_Vendor, iInfo.Vendor ); + } + else if ( iInfo.Type == CIMemoryInfo.TType.ETypeRAM ) + { + } + + // Reuse "name" tag for volume name + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.CmnName, iInfo.VolumeName ); + } + #endregion + + #region Internal methods + private void WriteIfNotZero( XmlWriter aWriter, string aName, ulong aValue ) + { + if ( aValue != 0 ) + { + aWriter.WriteElementString( aName, aValue.ToString() ); + } + } + + private static void WriteDrivePath( XmlWriter aWriter, int aDriveNumber ) + { + char driveLetter = ( (char) ( (int) 'A' + aDriveNumber ) ); + string path = driveLetter + ":"; + // + aWriter.WriteElementString( SegConstants.MemoryInfo_Drive_Path, path ); + } + #endregion + + #region Data members + private readonly CIMemoryInfo iInfo; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Memory/CXmlSegMemoryInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Memory/CXmlSegMemoryInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Memory; +using CrashItemLib.Crash.Utils; +using CrashXmlPlugin.FileFormat.Versions; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Memory +{ + internal class CXmlSegMemoryInfo : CXmlSegBase + { + #region Constructors + public CXmlSegMemoryInfo() + : base( SegConstants.MemoryInfo ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 110; } + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + iList = aParameters.Container.ChildrenByType( CIElement.TChildSearchType.EEntireHierarchy ); + // + if ( iList != null && iList.Count > 0 ) + { + base.XmlSerialize( aParameters ); + } + // + iList = null; + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + System.Diagnostics.Debug.Assert( iList != null ); + foreach ( CIMemoryInfo info in iList ) + { + string name = SegConstants.MemoryInfo_Drive; + if ( info.Type == CIMemoryInfo.TType.ETypeRAM ) + { + name = SegConstants.MemoryInfo_RAM; + } + // + CXmlMemoryInfo xmlInfo = new CXmlMemoryInfo( info, name ); + xmlInfo.XmlSerialize( aParameters ); + } + } + #endregion + + #region Properties + #endregion + + #region From SegBase + #endregion + + #region Data members + private CIElementList iList = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Messages/CXmlMessage.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Messages/CXmlMessage.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Messages +{ + internal class CXmlMessage : CXmlNode + { + #region Constructors + public CXmlMessage( CIMessage aMessage ) + : base( SegConstants.Messages_Message ) + { + iMessage = aMessage; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlNode.WriteId( iMessage, aParameters.Writer ); + aParameters.Writer.WriteElementString( SegConstants.CmnType, iMessage.TypeName ); + aParameters.Writer.WriteElementString( SegConstants.Messages_Message_Title, iMessage.Title ); + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + foreach ( string line in iMessage ) + { + aParameters.Writer.WriteElementString( SegConstants.Messages_Message_Line, line ); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + private readonly CIMessage iMessage; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Messages/CXmlSegMessages.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Messages/CXmlSegMessages.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Messages; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Messages +{ + internal class CXmlSegMessages : CXmlSegBase + { + #region Constructors + public CXmlSegMessages() + : base( SegConstants.Messages ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 140; } + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + iMessages = aParameters.Container.ChildrenByType( CIElement.TChildSearchType.EEntireHierarchy ); + if ( iMessages.Count > 0 ) + { + base.XmlSerialize( aParameters ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + foreach ( CIMessage message in iMessages ) + { + CXmlMessage xmlMessage = new CXmlMessage( message ); + xmlMessage.XmlSerialize( aParameters ); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + private CIElementList iMessages = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Processes/CXmlProcess.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Processes/CXmlProcess.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.CodeSegs; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Threads; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Processes +{ + internal class CXmlProcess : CXmlNode + { + #region Constructors + public CXmlProcess( CIProcess aProcess ) + : base( SegConstants.Processes_Process ) + { + iProcess = aProcess; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlNode.WriteId( iProcess, aParameters.Writer ); + aParameters.Writer.WriteElementString( SegConstants.CmnName, iProcess.Name ); + + // UIDs + if ( iProcess.Uids[ 0 ] != 0 ) + { + aParameters.Writer.WriteElementString( SegConstants.Processes_Process_UID1, iProcess.Uids[ 0 ].ToString( "x8" ) ); + } + if ( iProcess.Uids[ 1 ] != 0 ) + { + aParameters.Writer.WriteElementString( SegConstants.Processes_Process_UID2, iProcess.Uids[ 1 ].ToString( "x8" ) ); + } + if ( iProcess.Uids[ 2 ] != 0 ) + { + aParameters.Writer.WriteElementString( SegConstants.Processes_Process_UID3, iProcess.Uids[ 2 ].ToString( "x8" ) ); + } + + // SID + if ( iProcess.SID != 0 ) + { + aParameters.Writer.WriteElementString( SegConstants.Processes_Process_SID, iProcess.SID.ToString( "x8" ) ); + } + + // Generation + aParameters.Writer.WriteElementString( SegConstants.Processes_Process_Generation, iProcess.Generation.ToString() ); + + // Priority + if ( iProcess.Priority != 0 ) + { + aParameters.Writer.WriteElementString( SegConstants.CmnPriority, iProcess.Priority.ToString() ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + // Stacks + CXmlNode.WriteLinkListStart( aParameters.Writer, SegConstants.Threads ); + foreach ( CIThread thread in iProcess.Threads ) + { + CXmlNode.WriteLink( thread.Id, SegConstants.Threads, aParameters.Writer ); + } + CXmlNode.WriteLinkListEnd( aParameters.Writer ); + + // Code segments + CXmlNode.WriteLinkListStart( aParameters.Writer, SegConstants.CodeSegs ); + foreach ( CICodeSeg codeSeg in iProcess.CodeSegments ) + { + CXmlNode.WriteLink( codeSeg.Id, SegConstants.CodeSegs, aParameters.Writer ); + } + CXmlNode.WriteLinkListEnd( aParameters.Writer ); + } + #endregion + + #region Properties + #endregion + + #region Data members + private readonly CIProcess iProcess; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Processes/CXmlSegProcesses.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Processes/CXmlSegProcesses.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.CodeSegs; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Processes; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Processes +{ + internal class CXmlSegProcesses : CXmlSegBase + { + #region Constructors + public CXmlSegProcesses() + : base( SegConstants.Processes ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 60; } + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIElementList processes = aParameters.Container.ChildrenByType( CIElement.TChildSearchType.EEntireHierarchy ); + foreach ( CIProcess process in processes ) + { + CXmlProcess xmlProcess = new CXmlProcess( process ); + xmlProcess.XmlSerialize( aParameters ); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Registers/CXmlRegister.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Registers/CXmlRegister.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Registers.Special; +using CrashItemLib.Crash.Registers.Visualization; +using CrashItemLib.Crash.Registers.Visualization.Bits; +using CrashItemLib.Crash.Symbols; +using CrashXmlPlugin.FileFormat.Node; +using CrashXmlPlugin.FileFormat.Segment.Entries.Symbols; +using SymbianUtils.Enum; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Registers +{ + internal class CXmlRegister : CXmlNode + { + #region Constructors + public CXmlRegister( CIRegister aRegister ) + : base( SegConstants.Registers_RegisterSet_Register ) + { + iRegister = aRegister; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlNode.WriteId( iRegister, aParameters.Writer ); + + // Map the ArmRegister name onto the register names we expose via XML. In reality, the only register names + // that need remapping are R13, R14 and R15. + string regName = RemapRegisterName(); + aParameters.Writer.WriteElementString( SegConstants.CmnName, regName ); + aParameters.Writer.WriteElementString( SegConstants.CmnValue, iRegister.Value.ToString("x8") ); + + if ( iRegister.Symbol != null && CXmlSymbol.IsSerializable( iRegister.Symbol ) ) + { + CXmlNode.WriteLink( iRegister.Symbol.Id, SegConstants.Symbols, aParameters.Writer ); + } + + // Write any messages + CXmlSegBase.XmlSerializeMessages( aParameters, iRegister ); + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIElementList visList = iRegister.ChildrenByType(); + foreach ( CIRegisterVisualization vis in visList ) + { + CXmlNode.WriteLink( vis.Id, SegConstants.ValueInterpretation, aParameters.Writer ); + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private string RemapRegisterName() + { + string ret = iRegister.Name; + // + switch ( iRegister.Type ) + { + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_SP: + ret = "R13"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_LR: + ret = "R14"; + break; + case SymbianStructuresLib.Arm.Registers.TArmRegisterType.EArmReg_PC: + ret = "R15"; + break; + default: + break; + } + // + return ret; + } + #endregion + + #region Data members + private readonly CIRegister iRegister; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Registers/CXmlRegisterSet.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Registers/CXmlRegisterSet.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianStructuresLib.Arm.Registers; +using CrashItemLib.Crash.Registers; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Registers +{ + internal class CXmlRegisterSet : CXmlNode + { + #region Constructors + public CXmlRegisterSet( CIRegisterList aList ) + : base( SegConstants.Registers_RegisterSet ) + { + iList = aList; + } + #endregion + + #region API + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlNode.WriteId( iList, aParameters.Writer ); + + // Abbreviated type + string typeAbbreviated = ArmRegisterBankUtils.BankAsString( iList.Bank ); + aParameters.Writer.WriteElementString( SegConstants.CmnType, typeAbbreviated ); + + // Long type + string typeLong = ArmRegisterBankUtils.BankAsStringLong( iList.Bank ); + aParameters.Writer.WriteElementString( SegConstants.CmnName, typeLong ); + + // Link to thread + if ( iList.OwningThread != null ) + { + CXmlNode.WriteLink( iList.OwningThread.Id, SegConstants.Threads, aParameters.Writer ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + if ( iList.IsCurrentProcessorMode ) + { + aParameters.Writer.WriteStartElement( SegConstants.CmnAttributes ); + aParameters.Writer.WriteElementString( SegConstants.Registers_RegisterSet_CurrentBank, string.Empty ); + aParameters.Writer.WriteEndElement(); + } + + foreach ( CIRegister register in iList ) + { + CXmlRegister xmlRegister = new CXmlRegister( register ); + xmlRegister.XmlSerialize( aParameters ); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + private readonly CIRegisterList iList; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Registers/CXmlSegRegisters.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Registers/CXmlSegRegisters.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Registers +{ + internal class CXmlSegRegisters : CXmlSegBase + { + #region Constructors + public CXmlSegRegisters() + : base( SegConstants.Registers ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 40; } + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIElementList regListCols = aParameters.Container.ChildrenByType( CIElement.TChildSearchType.EEntireHierarchy ); + foreach ( CIRegisterListCollection regListCol in regListCols ) + { + foreach ( CIRegisterList regList in regListCol ) + { + if ( regList.Count > 0 ) + { + CXmlRegisterSet xmlRegList = new CXmlRegisterSet( regList ); + xmlRegList.XmlSerialize( aParameters ); + } + } + } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Stacks/CXmlSegStacks.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Stacks/CXmlSegStacks.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Stacks +{ + internal class CXmlSegStacks : CXmlSegBase + { + #region Constructors + public CXmlSegStacks() + : base( SegConstants.Stacks ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 20; } + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIElementList stacks = aParameters.Container.ChildrenByType( CIElement.TChildSearchType.EEntireHierarchy ); + foreach ( CIStack stack in stacks ) + { + CXmlStack xmlStack = new CXmlStack( stack ); + xmlStack.XmlSerialize( aParameters ); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Stacks/CXmlStack.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Stacks/CXmlStack.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Stacks +{ + internal class CXmlStack : CXmlNode + { + #region Constructors + public CXmlStack( CIStack aStack ) + : base( SegConstants.Stacks_Stack ) + { + iStack = aStack; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlNode.WriteId( iStack, aParameters.Writer ); + + if ( iStack.Registers != null ) + { + CXmlNode.WriteLink( iStack.Registers.Id, SegConstants.Registers, aParameters.Writer ); + } + if ( iStack.OwningThread != null ) + { + CXmlNode.WriteLink( iStack.OwningThread.Id, SegConstants.Threads, aParameters.Writer ); + } + + aParameters.Writer.WriteElementString( SegConstants.CmnBase, iStack.Base.ToString("x8") ); + aParameters.Writer.WriteElementString( SegConstants.CmnSize, iStack.Size.ToString( "x" ) ); + aParameters.Writer.WriteElementString( SegConstants.CmnRange, iStack.Range.ToString() ); + + // Write any messages + CXmlSegBase.XmlSerializeMessages( aParameters, iStack ); + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + // Algorithm name directly maps onto an attribute + string attributeAlgorithm = string.Empty; + if ( iStack.Algorithm.ToUpper().Contains( "ACCURATE" ) ) + { + attributeAlgorithm = SegConstants.Stacks_Stack_Attributes_Accurate; + } + else if ( iStack.Algorithm.ToUpper().Contains( "HEURISTIC" ) ) + { + attributeAlgorithm = SegConstants.Stacks_Stack_Attributes_Heuristic; + } + + // Attributes + if ( attributeAlgorithm != string.Empty ) + { + aParameters.Writer.WriteStartElement( SegConstants.CmnAttributes ); + aParameters.Writer.WriteElementString( attributeAlgorithm, string.Empty ); + aParameters.Writer.WriteEndElement(); + } + + // Entries + if ( aParameters.DetailLevel != CrashItemLib.Sink.CISinkSerializationParameters.TDetailLevel.ESummary ) + { + System.Diagnostics.Debug.Assert( iStack.IsStackOutputAvailable ); + // + aParameters.Writer.WriteStartElement( SegConstants.Stacks_Stack_Data ); + // + foreach ( CIStackEntry entry in iStack ) + { + CXmlStackEntry xmlEntry = new CXmlStackEntry( entry ); + xmlEntry.XmlSerialize( aParameters ); + } + // + aParameters.Writer.WriteEndElement(); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + private readonly CIStack iStack; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Stacks/CXmlStackEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Stacks/CXmlStackEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Stacks +{ + internal class CXmlStackEntry : CXmlNode + { + #region Constructors + public CXmlStackEntry( CIStackEntry aEntry ) + : base( SegConstants.Stacks_Stack_Data_Entry ) + { + iEntry = aEntry; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + if ( !iEntry.IsRegisterBasedEntry ) + { + aParameters.Writer.WriteElementString( SegConstants.CmnAddress, iEntry.Address.ToString( "x8" ) ); + } + // + aParameters.Writer.WriteElementString( SegConstants.CmnValue, iEntry.Data.ToString( "x8" ) ); + aParameters.Writer.WriteElementString( SegConstants.CmnText, iEntry.DataAsString ); + if ( iEntry.FunctionOffset != 0 ) + { + aParameters.Writer.WriteElementString( SegConstants.Stacks_Stack_Data_Offset, iEntry.FunctionOffset.ToString( "x4" ) ); + } + // + if ( iEntry.IsRegisterBasedEntry ) + { + // Get the corresponding register from the stack + CIStack stack = iEntry.Stack; + CIRegister register = iEntry.Register; + if ( register != null ) + { + CXmlNode.WriteLink( register.Id, SegConstants.Registers, aParameters.Writer ); + } + } + + if ( iEntry.Symbol != null ) + { + CXmlNode.WriteLink( iEntry.Symbol.Id, SegConstants.Symbols, aParameters.Writer ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + aParameters.Writer.WriteStartElement( SegConstants.CmnAttributes ); + // + if ( iEntry.IsCurrentStackPointerEntry ) + { + aParameters.Writer.WriteElementString( SegConstants.Stacks_Stack_Data_Entry_Attributes_CurrentStackPointer, string.Empty ); + } + if ( iEntry.IsAccurate ) + { + aParameters.Writer.WriteElementString( SegConstants.Stacks_Stack_Data_Entry_Attributes_Accurate, string.Empty ); + } + if ( iEntry.IsRegisterBasedEntry ) + { + aParameters.Writer.WriteElementString( SegConstants.Stacks_Stack_Data_Entry_Attributes_FromRegister, string.Empty ); + } + else if ( iEntry.IsOutsideCurrentStackRange ) + { + aParameters.Writer.WriteElementString( SegConstants.Stacks_Stack_Data_Entry_Attributes_OutsideBounds, string.Empty ); + } + // + aParameters.Writer.WriteEndElement(); + } + #endregion + + #region Properties + #endregion + + #region Data members + private readonly CIStackEntry iEntry; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Symbols/CXmlSegSymbols.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Symbols/CXmlSegSymbols.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Processes; +using SymbianStructuresLib.Debug.Symbols; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Symbols +{ + internal class CXmlSegSymbols : CXmlSegBase + { + #region Constructors + public CXmlSegSymbols() + : base( SegConstants.Symbols ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 10; } + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + // Don't write symbols or stack if we were asked to create the summary file. + if ( aParameters.DetailLevel == CrashItemLib.Sink.CISinkSerializationParameters.TDetailLevel.EFull ) + { + base.XmlSerialize( aParameters ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + // First partition the symbols into sets + CISymbolDictionary globalSymbols = aParameters.Container.Symbols; + Partition( globalSymbols ); + + // Also get the dictionaries from the individual processes + CIElementList processes = aParameters.Container.ChildrenByType(); + foreach ( CIProcess process in processes ) + { + CISymbolDictionary processSymbols = process.Symbols; + Partition( processSymbols ); + } + + // Then serialize the sets + foreach ( KeyValuePair kvp in iSets ) + { + CXmlSymbolSet set = kvp.Value; + set.XmlSerialize( aParameters ); + } + } + #endregion + + #region Internal methods + private void Partition( CISymbolDictionary aDictionary ) + { + foreach ( CISymbol crashItemSymbol in aDictionary ) + { + bool serializable = CXmlSymbol.IsSerializable( crashItemSymbol ); + if ( serializable ) + { + Symbol symbol = crashItemSymbol.Symbol; + SymbolCollection symbolCollection = symbol.Collection; + // + string collectionName = symbolCollection.FileName.FileNameInHost.ToUpper(); + CXmlSymbolSet set = null; + // + if ( !iSets.ContainsKey( collectionName ) ) + { + set = new CXmlSymbolSet( symbolCollection ); + iSets.Add( collectionName, set ); + } + else + { + set = iSets[ collectionName ]; + } + // + set.Add( crashItemSymbol ); + } + } + } + #endregion + + #region Data members + private SortedDictionary iSets = new SortedDictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Symbols/CXmlSymbol.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Symbols/CXmlSymbol.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.CodeSegs; +using SymbianStructuresLib.Debug.Symbols; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Symbols +{ + internal class CXmlSymbol : CXmlNode + { + #region Constructors + public CXmlSymbol( CISymbol aSymbol ) + : base( SegConstants.Symbols_SymbolSet_Symbol ) + { + iSymbol = aSymbol; + } + #endregion + + #region API + public static bool IsSerializable( CISymbol aSymbol ) + { + bool ret = true; + // + if ( aSymbol.IsNull ) + { + ret = false; + } + else + { + Symbol symbol = aSymbol.Symbol; + TSymbolType type = symbol.Type; + // + ret = ( type != TSymbolType.EUnknown ); + } + // + return ret; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlNode.WriteId( iSymbol, aParameters.Writer ); + + aParameters.Writer.WriteElementString( SegConstants.CmnAddress, iSymbol.Symbol.Address.ToString("x8") ); + aParameters.Writer.WriteElementString( SegConstants.CmnSize, iSymbol.Symbol.Size.ToString( "x8" ) ); + aParameters.Writer.WriteElementString( SegConstants.CmnName, iSymbol.Symbol.Name ); + aParameters.Writer.WriteElementString( SegConstants.Symbols_SymbolSet_Symbol_Object, iSymbol.Symbol.Object ); + + // If there is a link to a code code segment, then write that too. + CICodeSeg correspondingCodeSeg = iSymbol.CodeSegment; + if ( correspondingCodeSeg != null ) + { + CXmlNode.WriteLink( correspondingCodeSeg.Id, SegConstants.CodeSegs, aParameters.Writer ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + aParameters.Writer.WriteStartElement( SegConstants.CmnAttributes ); + + // XIP vs RAM + bool isLoadedFromRAM = this.IsFromRAMLoadedCode; + if ( isLoadedFromRAM ) + { + aParameters.Writer.WriteElementString( SegConstants.CmnRAM, string.Empty ); + } + else + { + aParameters.Writer.WriteElementString( SegConstants.CmnXIP, string.Empty ); + } + + // MAP vs SYMBOL + TSymbolSource source = this.SymbolSource; + switch( source ) + { + case TSymbolSource.ESourceWasMapFile: + aParameters.Writer.WriteElementString( SegConstants.Symbols_SymbolSet_Symbol_Attribute_Map, string.Empty ); + break; + case TSymbolSource.ESourceWasSymbolFile: + aParameters.Writer.WriteElementString( SegConstants.Symbols_SymbolSet_Symbol_Attribute_Symbol, string.Empty ); + break; + default: + case TSymbolSource.ESourceWasUnknown: + break; + } + + aParameters.Writer.WriteEndElement(); + } + #endregion + + #region Properties + public bool IsFromRAMLoadedCode + { + get + { + bool ret = false; + // + if ( iSymbol.Symbol != null ) + { + ret = iSymbol.Symbol.IsFromRAMLoadedCode; + } + // + return ret; + } + } + + public TSymbolSource SymbolSource + { + get + { + TSymbolSource ret = TSymbolSource.ESourceWasUnknown; + // + if ( iSymbol.Symbol != null ) + { + ret = iSymbol.Symbol.Source; + } + // + return ret; + } + } + #endregion + + #region Data members + private readonly CISymbol iSymbol; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Symbols/CXmlSymbolSet.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Symbols/CXmlSymbolSet.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using SymbianStructuresLib.Debug.Symbols; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Symbols +{ + internal class CXmlSymbolSet : CXmlNode + { + #region Constructors + public CXmlSymbolSet( SymbolCollection aCollection ) + : base( SegConstants.Symbols_SymbolSet ) + { + iCollection = aCollection; + } + #endregion + + #region API + public void Add( CISymbol aSymbol ) + { + if ( !iSymbols.ContainsKey( aSymbol.Id ) ) + { + iSymbols.Add( aSymbol.Id, aSymbol ); + } + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + aParameters.Writer.WriteElementString( SegConstants.Symbols_SymbolSet_Source, iCollection.FileName.FileNameInHost ); + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + foreach ( KeyValuePair kvp in iSymbols ) + { + CXmlSymbol xmlSymbol = new CXmlSymbol( kvp.Value ); + xmlSymbol.XmlSerialize( aParameters ); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + private readonly SymbolCollection iCollection; + private Dictionary iSymbols = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Telephony/CXmlSegTelephony.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Telephony/CXmlSegTelephony.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Telephony; +using CrashItemLib.Crash.Utils; +using CrashXmlPlugin.FileFormat.Versions; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Telephony +{ + internal class CXmlSegTelephony : CXmlSegBase + { + #region Constructors + public CXmlSegTelephony() + : base( SegConstants.Telephony ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 100; } + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CITelephony info = (CITelephony) aParameters.Container.ChildByType( typeof( CITelephony ) ); + if ( info != null ) + { + base.XmlSerialize( aParameters ); + } + } + + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CITelephony info = (CITelephony) aParameters.Container.ChildByType( typeof( CITelephony ) ); + if ( info != null ) + { + string phoneNumber = info.PhoneNumber; + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_PhoneNumber, phoneNumber ); + + string imei = info.IMEI; + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Imei, imei ); + + string imsi = info.IMSI; + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Imsi, imsi ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CITelephony info = (CITelephony) aParameters.Container.ChildByType( typeof( CITelephony ) ); + if ( info != null ) + { + CITelephonyNetworkInfo networkInfo = info.NetworkInfo; + // + aParameters.Writer.WriteStartElement( SegConstants.Telephony_Network ); + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Network_Country, networkInfo.Country ); + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Network_Identity, networkInfo.Identity ); + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Network_Cell, networkInfo.CellId ); + // + string regMode = SymbianUtils.Enum.EnumUtils.ToString( networkInfo.RegistrationMode ); + WriteStringIfNotEmpty( aParameters.Writer, SegConstants.Telephony_Network_Registration, regMode ); + // + aParameters.Writer.WriteEndElement(); + } + } + #endregion + + #region Properties + #endregion + + #region From SegBase + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Threads/CXmlSegThreads.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Threads/CXmlSegThreads.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Symbols; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Threads; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Threads +{ + internal class CXmlSegThreads : CXmlSegBase + { + #region Constructors + public CXmlSegThreads() + : base( SegConstants.Threads ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 50; } + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIElementList threads = aParameters.Container.ChildrenByType( CIElement.TChildSearchType.EEntireHierarchy ); + foreach ( CIThread thread in threads ) + { + CXmlThread xmlThread = new CXmlThread( thread ); + xmlThread.XmlSerialize( aParameters ); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Threads/CXmlThread.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Threads/CXmlThread.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.Stacks; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Threads +{ + internal class CXmlThread : CXmlNode + { + #region Constructors + public CXmlThread( CIThread aThread ) + : base( SegConstants.Threads_Thread ) + { + iThread = aThread; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlNode.WriteId( iThread, aParameters.Writer ); + + aParameters.Writer.WriteElementString( SegConstants.CmnName, iThread.Name ); + aParameters.Writer.WriteElementString( SegConstants.Threads_Thread_FullName, iThread.FullName ); + + // Parent process + if ( iThread.OwningProcess != null ) + { + CXmlNode.WriteLink( iThread.OwningProcess.Id, SegConstants.Processes, aParameters.Writer ); + } + + // Thread priority + if ( iThread.Priority != 0 ) + { + aParameters.Writer.WriteElementString( SegConstants.CmnPriority, iThread.Priority.ToString() ); + } + + // Write any messages + CXmlSegBase.XmlSerializeMessages( aParameters, iThread ); + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + // Exit info + CXmlExitInfo xmlExitInfo = new CXmlExitInfo( iThread.ExitInfo ); + xmlExitInfo.XmlSerialize( aParameters ); + + // Stacks + XmlSerializeStacks( aParameters ); + + // Registers + XmlSerializeRegisters( aParameters ); + } + #endregion + + #region Internal methods + private void XmlSerializeRegisters( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + // Must obtain the registers in advance to avoid creating an empty list. + List regs = new List(); + + // Find register lists + CIElementList allRegs = iThread.ChildrenByType(); + foreach ( CIRegisterListCollection registerListCol in allRegs ) + { + foreach ( CIRegisterList registerList in registerListCol ) + { + if ( registerList.Count > 0 ) + { + regs.Add( registerList ); + } + } + } + + // Only write something if we have some entries + if ( regs.Count > 0 ) + { + CXmlNode.WriteLinkListStart( aParameters.Writer, SegConstants.Registers ); + foreach ( CIRegisterList registerList in regs ) + { + CXmlNode.WriteLink( registerList.Id, SegConstants.Registers, aParameters.Writer ); + } + CXmlNode.WriteLinkListEnd( aParameters.Writer ); + } + } + + private void XmlSerializeStacks( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + // Find stacks + CIElementList stacks = iThread.ChildrenByType(); + + // Only write something if we have some entries + if ( stacks.Count > 0 ) + { + CXmlNode.WriteLinkListStart( aParameters.Writer, SegConstants.Stacks ); + foreach ( CIStack item in stacks ) + { + CXmlNode.WriteLink( item.Id, SegConstants.Stacks, aParameters.Writer ); + } + CXmlNode.WriteLinkListEnd( aParameters.Writer ); + } + } + #endregion + + #region Data members + private readonly CIThread iThread; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Traces/CXmlSegTraces.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/Traces/CXmlSegTraces.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Traces; +using CrashItemLib.Crash.Utils; +using CrashXmlPlugin.FileFormat.Versions; +using SymbianStructuresLib.Debug.Trace; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.Traces +{ + internal class CXmlSegTraces : CXmlSegBase + { + #region Constructors + public CXmlSegTraces() + : base( SegConstants.Traces ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 150; } + } + #endregion + + #region From CXmlNode + public override void XmlSerialize( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + iTraceData = aParameters.Container.Traces; + // + if ( iTraceData != null && iTraceData.Lines.Length > 0 ) + { + base.XmlSerialize( aParameters ); + } + // + iTraceData = null; + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + System.Diagnostics.Debug.Assert( iTraceData != null ); + foreach ( CITrace ciTrace in iTraceData ) + { + aParameters.Writer.WriteStartElement( SegConstants.Traces_Line ); + // + TraceLine trace = ciTrace; + + // Type + string type = string.Empty; + switch ( trace.Type ) + { + case TraceLine.TType.ETypeBinary: + type = SegConstants.Traces_Type_Binary; + break; + case TraceLine.TType.ETypeRaw: + type = SegConstants.Traces_Type_Raw; + break; + case TraceLine.TType.ETypeText: + type = SegConstants.Traces_Type_Text; + break; + default: + type = SegConstants.Traces_Type_Unknown; + break; + } + if ( string.IsNullOrEmpty( type ) == false ) + { + aParameters.Writer.WriteAttributeString( SegConstants.CmnType, type ); + } + + // Context id + if ( trace.ContextId != 0 ) + { + aParameters.Writer.WriteAttributeString( SegConstants.Traces_ContextId, "0x" + trace.ContextId.ToString( "x8" ) ); + } + + // Time stamp + aParameters.Writer.WriteAttributeString( SegConstants.Traces_TimeStamp, trace.TimeStamp.ToString() ); + + // Prefix + string prefix = trace.Prefix; + if ( string.IsNullOrEmpty( prefix ) == false ) + { + aParameters.Writer.WriteAttributeString( SegConstants.Traces_Prefix, prefix ); + } + + // Suffix + string suffix = trace.Suffix; + if ( string.IsNullOrEmpty( suffix ) == false ) + { + aParameters.Writer.WriteAttributeString( SegConstants.Traces_Suffix, suffix ); + } + + if ( trace.HasIdentifier ) + { + // Component/group/id triplet + TraceIdentifier identifier = trace.Identifier; + aParameters.Writer.WriteAttributeString( SegConstants.Traces_ComponentId, "0x" + identifier.Component.ToString( "x8" ) ); + aParameters.Writer.WriteAttributeString( SegConstants.Traces_GroupId, identifier.Group.ToString() ); + aParameters.Writer.WriteAttributeString( SegConstants.Traces_InstanceId, identifier.Id.ToString() ); + + // File & line + TraceLocation location = identifier.Location; + // + string file = location.File; + string lineNumber = location.Line.ToString(); + // + if ( string.IsNullOrEmpty( file ) == false && string.IsNullOrEmpty( lineNumber ) == false ) + { + aParameters.Writer.WriteAttributeString( SegConstants.Traces_File, file ); + aParameters.Writer.WriteAttributeString( SegConstants.Traces_LineNumber, lineNumber ); + } + } + + // Payload + string payload = trace.Payload; + aParameters.Writer.WriteValue( payload ); + + aParameters.Writer.WriteEndElement(); + } + } + #endregion + + #region Properties + #endregion + + #region From SegBase + #endregion + + #region Data members + private CITraceData iTraceData = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/ValueInterpretations/CXmlSegValueInterpretations.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/ValueInterpretations/CXmlSegValueInterpretations.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Registers.Visualization; +using CrashItemLib.Crash.Registers.Visualization.Bits; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.ValueInterpretations +{ + internal class CXmlSegValueInterpretations : CXmlSegBase + { + #region Constructors + public CXmlSegValueInterpretations() + : base( SegConstants.ValueInterpretation ) + { + } + #endregion + + #region From CXmlSegBase + public override int SegmentPriority + { + get { return 130; } + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CIElementList visList = aParameters.Container.ChildrenByType( CIElement.TChildSearchType.EEntireHierarchy ); + foreach ( CIRegisterVisualization visualisation in visList ) + { + CXmlValueInterpretation xmlVis = new CXmlValueInterpretation( visualisation ); + xmlVis.XmlSerialize( aParameters ); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/ValueInterpretations/CXmlValueInterpretation.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/ValueInterpretations/CXmlValueInterpretation.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Xml; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Registers.Visualization; +using CrashItemLib.Crash.Registers.Visualization.Bits; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries.ValueInterpretations +{ + internal class CXmlValueInterpretation : CXmlNode + { + #region Constructors + public CXmlValueInterpretation( CIRegisterVisualization aValue ) + : base( SegConstants.ValueInterpretation_Entry ) + { + iValue = aValue; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CXmlNode.WriteId( iValue, aParameters.Writer ); + + aParameters.Writer.WriteElementString( SegConstants.ValueInterpretation_Entry_Hex, iValue.Value.ToString("x8") ); + aParameters.Writer.WriteElementString( SegConstants.ValueInterpretation_Entry_Binary, iValue.Binary ); + aParameters.Writer.WriteElementString( SegConstants.CmnSize, iValue.Size.ToString() ); + + // Endianness + aParameters.Writer.WriteStartElement( SegConstants.ValueInterpretation_Entry_Endianness ); + aParameters.Writer.WriteAttributeString( SegConstants.CmnType, SegConstants.ValueInterpretation_Entry_Endianness_Little ); + aParameters.Writer.WriteAttributeString( SegConstants.ValueInterpretation_Entry_Endianness_Bit0, SegConstants.ValueInterpretation_Entry_Endianness_Bit0_Right ); + aParameters.Writer.WriteEndElement(); + + // Associated register + CXmlNode.WriteLink( iValue.Register.Id, SegConstants.Registers, aParameters.Writer ); + + // Description + aParameters.Writer.WriteElementString( SegConstants.ValueInterpretation_Entry_Description, iValue.Description ); + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + aParameters.Writer.WriteStartElement( SegConstants.ValueInterpretation_Entry_Interpretation ); + + foreach ( CIElement child in iValue ) + { + if ( child is CIRegisterVisBit ) + { + WriteBit( aParameters.Writer, child as CIRegisterVisBit ); + } + else if ( child is CIRegisterVisBitGroup ) + { + WriteBitGroup( aParameters.Writer, child as CIRegisterVisBitGroup ); + } + else if ( child is CIRegisterVisBitRange ) + { + WriteBitRange( aParameters.Writer, child as CIRegisterVisBitRange ); + } + } + + aParameters.Writer.WriteEndElement(); + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void WriteBit( XmlWriter aWriter, CIRegisterVisBit aItem ) + { + aWriter.WriteStartElement( SegConstants.ValueInterpretation_Entry_Interpretation_Bit ); + + // Index + aWriter.WriteAttributeString( SegConstants.CmnIndex, aItem.Index.ToString() ); + + // Value + aWriter.WriteAttributeString( SegConstants.CmnValue, aItem.ToString() ); + + // Category + aWriter.WriteAttributeString( SegConstants.ValueInterpretation_Entry_Category, aItem.Category ); + + // Reserved + if ( aItem.IsReserved ) + { + aWriter.WriteAttributeString( SegConstants.CmnType, SegConstants.ValueInterpretation_Entry_Reserved ); + } + + // Single character interpretation + aWriter.WriteAttributeString( SegConstants.ValueInterpretation_Entry_Interpretation_Bit_Char, aItem.ValueCharacter ); + + // Interpretation + if ( !string.IsNullOrEmpty( aItem.Interpretation ) ) + { + aWriter.WriteAttributeString( SegConstants.ValueInterpretation_Entry_Interpretation, aItem.Interpretation ); + } + + aWriter.WriteEndElement(); + } + + private void WriteBitGroup( XmlWriter aWriter, CIRegisterVisBitGroup aItem ) + { + aWriter.WriteStartElement( SegConstants.ValueInterpretation_Entry_Interpretation_BitGroup ); + + foreach ( CIRegisterVisBit bit in aItem ) + { + WriteBit( aWriter, bit ); + } + + aWriter.WriteEndElement(); + } + + private void WriteBitRange( XmlWriter aWriter, CIRegisterVisBitRange aItem ) + { + aWriter.WriteStartElement( SegConstants.ValueInterpretation_Entry_Interpretation_BitRange ); + + // Start & end + aWriter.WriteAttributeString( SegConstants.CmnStart, aItem.Range.Min.ToString() ); + aWriter.WriteAttributeString( SegConstants.CmnEnd, aItem.Range.Max.ToString() ); + + // Value + aWriter.WriteAttributeString( SegConstants.CmnValue, aItem.ToString() ); + + // Category + aWriter.WriteAttributeString( SegConstants.ValueInterpretation_Entry_Category, aItem.Category ); + + // Reserved + if ( aItem.IsReserved ) + { + aWriter.WriteAttributeString( SegConstants.CmnType, SegConstants.ValueInterpretation_Entry_Reserved ); + } + + // Interpretation + string interpretation = aItem.Interpretation; + if ( !string.IsNullOrEmpty( interpretation ) ) + { + aWriter.WriteAttributeString( SegConstants.ValueInterpretation_Entry_Interpretation, interpretation ); + } + + aWriter.WriteEndElement(); + } + #endregion + + #region Data members + private readonly CIRegisterVisualization iValue; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Utilities/CXmlExitInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Utilities/CXmlExitInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashItemLib.Crash.Base; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.ExitInfo; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries +{ + internal class CXmlExitInfo : CXmlNode + { + #region Constructors + public CXmlExitInfo( CIExitInfo aExitInfo ) + : base( SegConstants.ExitInfo ) + { + iExitInfo = aExitInfo; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + // Type + aParameters.Writer.WriteStartElement( SegConstants.ExitInfo_Type ); + switch ( iExitInfo.Type ) + { + case CIExitInfo.TExitType.EExitTypeException: + aParameters.Writer.WriteString( SegConstants.ExitInfo_Type_Exception ); + break; + case CIExitInfo.TExitType.EExitTypeKill: + aParameters.Writer.WriteString( SegConstants.ExitInfo_Type_Kill ); + break; + case CIExitInfo.TExitType.EExitTypePanic: + aParameters.Writer.WriteString( SegConstants.ExitInfo_Type_Panic ); + break; + case CIExitInfo.TExitType.EExitTypePending: + aParameters.Writer.WriteString( SegConstants.ExitInfo_Type_Pending ); + break; + case CIExitInfo.TExitType.EExitTypeTerminate: + aParameters.Writer.WriteString( SegConstants.ExitInfo_Type_Terminate ); + break; + } + aParameters.Writer.WriteEndElement(); + + // For panics or terminates, reason & category + switch ( iExitInfo.Type ) + { + case CIExitInfo.TExitType.EExitTypeException: + case CIExitInfo.TExitType.EExitTypeTerminate: + case CIExitInfo.TExitType.EExitTypePanic: + aParameters.Writer.WriteElementString( SegConstants.ExitInfo_Category, iExitInfo.Category ); + aParameters.Writer.WriteElementString( SegConstants.ExitInfo_Reason, iExitInfo.Reason.ToString() ); + break; + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + } + #endregion + + #region Properties + #endregion + + #region Data members + private readonly CIExitInfo iExitInfo; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Utilities/SegConstants.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Utilities/SegConstants.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,199 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; + +namespace CrashXmlPlugin.FileFormat.Segment.Entries +{ + internal static class SegConstants + { + // Common + public const string CmnAddress = "address"; + public const string CmnSize = "size"; + public const string CmnName = "name"; + public const string CmnAttributes = "attributes"; + public const string CmnXIP = "xip"; + public const string CmnRAM = "ram"; + public const string CmnRange = "range"; + public const string CmnValue = "value"; + public const string CmnText = "text"; + public const string CmnBase = "base"; + public const string CmnType = "type"; + public const string CmnPriority = "priority"; + public const string CmnChecksum = "checksum"; + public const string CmnDate = "date"; + public const string CmnTime = "time"; + public const string CmnIndex = "index"; + public const string CmnStart = "start"; + public const string CmnEnd = "end"; + + // Id related + public const string CmnId = "id"; + public const string CmnId_Explicit = "explicit"; + + // Header + public const string Header = "seg_header"; + public const string Header_Uptime = "uptime"; + + // Symbols + public const string Symbols = "seg_symbols"; + public const string Symbols_SymbolSet = "symbol_set"; + public const string Symbols_SymbolSet_Source = "source"; + public const string Symbols_SymbolSet_Symbol = "symbol"; + public const string Symbols_SymbolSet_Symbol_Object = "object"; + public const string Symbols_SymbolSet_Symbol_Attribute_Map = "map"; + public const string Symbols_SymbolSet_Symbol_Attribute_Symbol = "symbol"; + + // Stacks + public const string Stacks = "seg_stacks"; + public const string Stacks_Stack = "stack"; + public const string Stacks_Stack_Data = "stack_data"; + public const string Stacks_Stack_Attributes_Accurate = "accurate"; + public const string Stacks_Stack_Attributes_Heuristic = "heuristic"; + public const string Stacks_Stack_Data_Entry = "stack_entry"; + public const string Stacks_Stack_Data_Offset = "offset"; + public const string Stacks_Stack_Data_Entry_Attributes_FromRegister = "from_register"; + public const string Stacks_Stack_Data_Entry_Attributes_CurrentStackPointer = "current_stack_pointer"; + public const string Stacks_Stack_Data_Entry_Attributes_Accurate = "accurate"; + public const string Stacks_Stack_Data_Entry_Attributes_OutsideBounds = "outside_current_stack_pointer_range"; + + // Registers + public const string Registers = "seg_registers"; + public const string Registers_RegisterSet = "register_set"; + public const string Registers_RegisterSet_CurrentBank = "current_bank"; + public const string Registers_RegisterSet_Register = "register"; + public const string Registers_RegisterSet_Register_Extra = "extra"; + + // Threads + public const string Threads = "seg_threads"; + public const string Threads_Thread = "thread"; + public const string Threads_Thread_FullName = "fullname"; + + // Processes + public const string Processes = "seg_processes"; + public const string Processes_Process = "process"; + public const string Processes_Process_UID1 = "uid1"; + public const string Processes_Process_UID2 = "uid2"; + public const string Processes_Process_UID3 = "uid3"; + public const string Processes_Process_SID = "sid"; + public const string Processes_Process_Generation = "generation"; + + // Messages + public const string Messages = "seg_messages"; + public const string Messages_Message = "message"; + public const string Messages_Message_Title = "title"; + public const string Messages_Message_Line = "line"; + + // Exit info + public const string ExitInfo = "exit_info"; + public const string ExitInfo_Type = "exit_type"; + public const string ExitInfo_Type_Kill = "Kill"; + public const string ExitInfo_Type_Exception = "Exception"; + public const string ExitInfo_Type_Terminate = "Terminate"; + public const string ExitInfo_Type_Panic = "Panic"; + public const string ExitInfo_Type_Pending = "Pending"; + public const string ExitInfo_Reason = "exit_reason"; + public const string ExitInfo_Category = "exit_category"; + + // Code Segs + public const string CodeSegs = "seg_codesegs"; + public const string CodeSegs_CodeSeg = "codeseg"; + public const string CodeSegs_CodeSeg_Attributes_NoSymbols = "nosymbols"; + public const string CodeSegs_CodeSeg_Attributes_Speculative = "speculative"; + public const string CodeSegs_CodeSeg_Attributes_Mismatch = "mismatch"; + + // HW Info + public const string HWInfo = "seg_hw_info"; + public const string HWInfo_ProductType = "product_type"; + public const string HWInfo_ProductCode = "product_code"; + public const string HWInfo_SerialNumber = "serial_number"; + + // SW Info + public const string SWInfo = "seg_sw_info"; + public const string SWInfo_Platform = "platform"; + public const string SWInfo_Language = "language"; + + // Event log + public const string EventLog = "seg_event_log"; + public const string EventLog_Event = "event"; + + // Telephony + public const string Telephony = "seg_telephony"; + public const string Telephony_PhoneNumber = "phone_number"; + public const string Telephony_Imsi = "imsi"; + public const string Telephony_Imei = "imei"; + public const string Telephony_Network = "network"; + public const string Telephony_Network_Country = "country"; + public const string Telephony_Network_Identity = "identity"; + public const string Telephony_Network_Cell = "cell"; + public const string Telephony_Network_Registration = "registration"; + + // Memory Info + public const string MemoryInfo = "seg_memory_info"; + public const string MemoryInfo_Free = "free"; + public const string MemoryInfo_Capacity = "capacity"; + public const string MemoryInfo_UID = "uid"; + public const string MemoryInfo_Drive = "drive"; + public const string MemoryInfo_Drive_Path = "path"; + public const string MemoryInfo_Drive_Vendor = "vendor"; + public const string MemoryInfo_RAM = "ram"; + + // Binary data + public const string BinaryData = "seg_binary_data"; + public const string BinaryData_Blob = "blob"; + public const string BinaryData_Blob_Payload = "payload"; + public const string BinaryData_Blob_Payload_Data = "data"; + + // (Register) Value Interpretations + public const string ValueInterpretation = "seg_value_interpretations"; + public const string ValueInterpretation_Entry = "vi_entry"; + public const string ValueInterpretation_Entry_Hex = "hex"; + public const string ValueInterpretation_Entry_Binary = "binary"; + public const string ValueInterpretation_Entry_Endianness = "endian"; + public const string ValueInterpretation_Entry_Endianness_Bit0 = "bit0"; + public const string ValueInterpretation_Entry_Endianness_Bit0_Right = "right"; + public const string ValueInterpretation_Entry_Endianness_Bit0_Left = "left"; + public const string ValueInterpretation_Entry_Endianness_Big = "big"; + public const string ValueInterpretation_Entry_Endianness_Little = "little"; + public const string ValueInterpretation_Entry_Description = "description"; + public const string ValueInterpretation_Entry_Category = "category"; + public const string ValueInterpretation_Entry_Interpretation = "interpretation"; + public const string ValueInterpretation_Entry_Reserved = "reserved"; + public const string ValueInterpretation_Entry_Interpretation_BitRange = "bit_range"; + public const string ValueInterpretation_Entry_Interpretation_BitGroup = "bit_group"; + public const string ValueInterpretation_Entry_Interpretation_Bit = "bit"; + public const string ValueInterpretation_Entry_Interpretation_Bit_Char = "char"; + + // Trace + public const string Traces = "seg_traces"; + public const string Traces_Line = "line"; + public const string Traces_Type_Binary = "bin"; + public const string Traces_Type_Raw = "raw"; + public const string Traces_Type_Unknown = "unknown"; + public const string Traces_Type_Text = ""; + public const string Traces_ContextId = "context_id"; + public const string Traces_TimeStamp = "timestamp"; + public const string Traces_Prefix = "prefix"; + public const string Traces_Suffix = "suffix"; + public const string Traces_File = "file"; + public const string Traces_LineNumber = "line_number"; + public const string Traces_ComponentId = "component"; + public const string Traces_GroupId = "group"; + public const string Traces_InstanceId = "id"; + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/SourceInfo/CXmlNodeSourceInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/SourceInfo/CXmlNodeSourceInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Xml; +using CrashItemLib.Crash.Source; +using CrashXmlPlugin.FileFormat.Node; +using CrashXmlPlugin.FileFormat.Versions; + +namespace CrashXmlPlugin.FileFormat.SourceInfo +{ + internal class CXmlNodeSourceInfo : CXmlNode + { + #region Constructors + public CXmlNodeSourceInfo() + : base( Constants.SourceInfo ) + { + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + CISource source = aParameters.Container.Source; + + // File type + string fileType = source.ImplementorName; + aParameters.Writer.WriteElementString( Constants.SourceInfo_FileType, fileType ); + + // Version + CXmlVersionExtended version = new CXmlVersionExtended( source.ImplementorVersion ); + version.XmlSerialize( aParameters ); + + // Source file (master file) + string masterFileName = source.MasterFileName; + aParameters.Writer.WriteElementString( Constants.SourceInfo_MasterFile, masterFileName ); + + // Line number (if relevant) + if ( source.IsLineNumberAvailable ) + { + aParameters.Writer.WriteElementString( Constants.SourceInfo_LineNumber, source.LineNumber.ToString() ); + } + } + + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + base.XmlSerializeChildren( aParameters ); + + CISourceElement source = aParameters.Container.Source; + + // Write any raw data + byte[] rawData = source.InputData; + if ( rawData != null && rawData.Length > 0 ) + { + aParameters.Writer.WriteStartElement( Constants.SourceInfo_RawData ); + + string[] lines = Utilities.ConvertBinaryDataToText( rawData, Constants.KBinaryDataMaxLineLength ); + foreach ( string line in lines ) + { + if ( !string.IsNullOrEmpty( line ) ) + { + aParameters.Writer.WriteElementString( Constants.SourceInfo_RawData_Item, line ); + } + } + + aParameters.Writer.WriteEndElement(); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Utiltities/Constants.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Utiltities/Constants.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Xml; + +namespace CrashXmlPlugin.FileFormat +{ + internal static class Constants + { + #region Node names + + // Root node name + public const string RootNode = "crash_root"; + + // For + public const string CrashAnalyser = "crash_analyser"; + public const string CrashAnalyser_FileFormat = "file_format"; + public const string CrashAnalyser_Runtime = "runtime"; + public const string CrashAnalyser_Runtime_AnalysisType = "analysis_type"; + public const string CrashAnalyser_Runtime_CommandLine = "command_line"; + public const string CrashAnalyser_Runtime_InputFiles = "sources"; + public const string CrashAnalyser_Runtime_InputFiles_File = "file"; + + // For + public const string SourceInfo = "source_info"; + public const string SourceInfo_FileType = "type"; + public const string SourceInfo_MasterFile = "source"; + public const string SourceInfo_LineNumber = "line"; + public const string SourceInfo_RawData = "raw_data"; + public const string SourceInfo_RawData_Item = "data"; + + // For + public const string SegmentDictionary = "segment_dictionary"; + public const string SegmentDictionary_Segment = "segment"; + + // For + public const string SegmentTable = "segment_table"; + + // For versions + public const string Version = "version"; + public const string Version_Extended = "version_extended"; + public const string Version_Extended_Major = "major"; + public const string Version_Extended_Minor = "minor"; + public const string Version_Text = "version_text"; + public const string Version_Text_List = "version_text_list"; + + // Common + public const string CmnLink = "link"; + public const string CmnLink_Seg = "seg"; + public const string CmnLinkList = "linklist"; + #endregion + + #region Versions + public const int MasterFileFormatVersionMajor = 1; + public const int MasterFileFormatVersionMinor = 0; + #endregion + + #region Misc + public const int KBinaryDataMaxLineLength = 60; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Utiltities/Utilities.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Utiltities/Utilities.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Xml; + +namespace CrashXmlPlugin.FileFormat +{ + internal static class Utilities + { + public static string[] ConvertBinaryDataToText( IEnumerable aData, int aLineLength ) + { + List lines = new List(); + + StringBuilder line = new StringBuilder(); + foreach ( byte b in aData ) + { + line.AppendFormat( "{0:x2}", b ); + + if ( line.Length >= aLineLength ) + { + lines.Add( line.ToString() ); + line.Length = 0; + } + } + + // Flush leftovers + if ( line.Length > 0 ) + { + lines.Add( line.ToString() ); + } + + return lines.ToArray(); + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Versions/CXmlVersion.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Versions/CXmlVersion.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Versions +{ + internal class CXmlVersion : CXmlNode + { + #region Constructors + public CXmlVersion() + : this( 1 ) + { + } + + public CXmlVersion( int aNumber ) + : base( Constants.Version ) + { + iNumber = aNumber; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + aParameters.Writer.WriteString( this.ToString() ); + } + #endregion + + #region Properties + public int Number + { + get { return iNumber; } + set { iNumber = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + return Number.ToString(); + } + #endregion + + #region Data members + private int iNumber = 1; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Versions/CXmlVersionExtended.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Versions/CXmlVersionExtended.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Versions +{ + internal class CXmlVersionExtended : CXmlNode + { + #region Constructors + public CXmlVersionExtended() + : base( Constants.Version_Extended ) + { + } + + public CXmlVersionExtended( Version aVersion ) + : this( aVersion.Major, aVersion.Minor ) + { + // Version supports 4 levels of versining information: + // + // major.minor.build.revision + // + // This object only supports two: + // + // major.minor + // + // However, "this.minor" can encapsulate both Version.minor and Version.build. + // + iMinor = ( aVersion.Minor * 10 ) + aVersion.Build; + } + + public CXmlVersionExtended( int aMajor ) + : this( aMajor, 0 ) + { + } + + public CXmlVersionExtended( int aMajor, int aMinor ) + : this() + { + iMajor = aMajor; + iMinor = aMinor; + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + aParameters.Writer.WriteElementString( Constants.Version_Extended_Major, Major.ToString() ); + aParameters.Writer.WriteElementString( Constants.Version_Extended_Minor, Minor.ToString( "d2" ) ); + } + #endregion + + #region Properties + public int Major + { + get { return iMajor; } + set { iMajor = value; } + } + + public int Minor + { + get { return iMinor; } + set { iMinor = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "{0}.{1:d2}", Major, Minor ); + return ret.ToString(); + } + #endregion + + #region Data members + private int iMajor = 1; + private int iMinor = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Versions/CXmlVersionText.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Versions/CXmlVersionText.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Xml; +using System.Collections.Generic; +using CrashXmlPlugin.FileFormat.Node; + +namespace CrashXmlPlugin.FileFormat.Versions +{ + internal class CXmlVersionText : CXmlNode + { + #region Constructors + public CXmlVersionText() + : this( string.Empty ) + { + } + + public CXmlVersionText( string aText ) + : base( Constants.Version_Text ) + { + iText = aText; + } + #endregion + + #region API + public static void WriteVersionTextListStart( XmlWriter aWriter ) + { + aWriter.WriteStartElement( Constants.CmnLinkList ); + } + + public static void WriteVersionTextListEnd( XmlWriter aWriter ) + { + aWriter.WriteEndElement(); + } + #endregion + + #region From CXmlNode + protected override void XmlSerializeContent( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters ) + { + aParameters.Writer.WriteString( this.ToString() ); + } + #endregion + + #region Properties + public string Text + { + get { return iText; } + set { iText = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + return iText; + } + #endregion + + #region Data members + private string iText = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/PluginImplementations/Sink/CIXmlSink.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/PluginImplementations/Sink/CIXmlSink.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using CrashItemLib.Sink; +using CrashXmlPlugin.FileFormat.Document; + +namespace CrashXmlPlugin.PluginImplementations.Sink +{ + public class CrashXmlSink : CISink + { + #region Constants + public const string KXmlSinkName = "Crash XML"; + #endregion + + #region Constructors + public CrashXmlSink( CISinkManager aManager ) + : base( KXmlSinkName, aManager ) + { + } + #endregion + + #region From CISink + public override object Serialize( CISinkSerializationParameters aParams ) + { + CXmlDocumentRoot document = new CXmlDocumentRoot(); + // + string fileName = string.Empty; + using ( CXmlDocumentSerializationParameters parameters = new CXmlDocumentSerializationParameters( aParams, document ) ) + { + fileName = parameters.FileName; + document.XmlSerialize( parameters ); + } + // + return fileName; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "efae6aad-c56f-48ae-be8b-22f1b0203425" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/DExcPlugin.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/DExcPlugin.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {B75A7857-BA19-4A73-AACD-9F4D60C048F7} + Library + Properties + DExcPlugin + DExc.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC} + CrashItemLib + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Descriptor/DExcDescriptor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Descriptor/DExcDescriptor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Reflection; +using System.Collections.Generic; +using CrashItemLib.PluginAPI; + +namespace DExcPlugin.Descriptor +{ + internal class DExcDescriptor : CFFSourceAndConfidence + { + #region Constructors + public DExcDescriptor( FileInfo aFile ) + : base( aFile ) + { + if ( StackFileExists ) + { + string stackFile = StackFileName; + base.AddAdditionalFile( new FileInfo( stackFile ) ); + } + } + #endregion + + #region From CISource + public override Version ImplementorVersion + { + get + { + Assembly assembly = Assembly.GetExecutingAssembly(); + Version version = assembly.GetName().Version; + return version; + } + } + + public override string ImplementorName + { + get { return "D_EXC"; } + } + #endregion + + #region Constants + public const string KFileExtensionStack = ".stk"; + #endregion + + #region Properties + public string StackFileName + { + get + { + string path = Path.GetDirectoryName( base.MasterFileName ); + string fileName = Path.GetFileNameWithoutExtension( base.MasterFileName ); + // + string ret = Path.Combine( path, fileName + KFileExtensionStack ); + return ret; + } + } + + public bool StackFileExists + { + get + { + string file = StackFileName; + return ( File.Exists( file ) ); + } + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/ExpressionManager/DExcExpressionManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/ExpressionManager/DExcExpressionManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Generic; + +namespace DExcPlugin.ExpressionManager +{ + internal static class DExcExpressionManager + { + // For start of log + public static readonly Regex LogStart = new Regex( "(?:.*)EKA2 USER CRASH LOG(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + + // For thread + public static readonly Regex ThreadName = new Regex( "(?:.*)Thread Name: (.+)(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + public static readonly Regex ThreadId = new Regex( "(?:.*)Thread ID: ([0-9]{1,5})(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + public static readonly Regex ThreadStackRange = new Regex( "(?:.*)User Stack(?:\\:|) ([a-fA-F0-9]{8})\\-([a-fA-F0-9]{8})(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + public static readonly Regex ThreadPanicDetails = new Regex( "(?:.*)Panic: (.*)-(\\d+)(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + + // For stack + public static readonly Regex StackDataEntry = new Regex( "(?:.*)\r\n([a-fA-F0-9]{8})\r\n\r\n\\:\\s{1}\r\n\r\n((?:[a-fA-F0-9]{2})\\s{1}){1,16}\r\n(?:.*)", RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled ); + + // For registers (exception) + public static readonly Regex RegistersExceptionStart = new Regex( "(?:.*)UNHANDLED EXCEPTION(?:\\:|)(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + public static readonly Regex RegistersExceptionSet1 = new Regex( "(?:.*)code=(\\d*) PC=([a-fA-F0-9]{8}) FAR=([a-fA-F0-9]{8}) FSR=([a-fA-F0-9]{8})(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + public static readonly Regex RegistersExceptionSet2 = new Regex( "(?:.*)R13svc=([a-fA-F0-9]{8}) R14svc=([a-fA-F0-9]{8}) SPSRsvc=([a-fA-F0-9]{8})(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + + // For registers (user) + public static readonly Regex RegistersUserStart = new Regex( "(?:.*)USER REGISTERS(?:\\:|)(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + public static readonly Regex RegistersUserCPSR = new Regex( "(?:.*)CPSR=([a-fA-F0-9]{8})(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + public static readonly Regex RegistersUserSet = new Regex( "(?:.*)r(\\d{2})=([a-fA-F0-9]{8}) ([a-fA-F0-9]{8}) ([a-fA-F0-9]{8}) ([a-fA-F0-9]{8})(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + + // For code segments + public static readonly Regex CodeSegmentsStart = new Regex( "(?:.*)CODE SEGMENTS(?:\\:|)(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + public static readonly Regex CodeSegmentsEntry = new Regex( "(?:.*)([a-fA-F0-9]{8})\\-([a-fA-F0-9]{8}) (.+)(?:.*)", RegexOptions.CultureInvariant | RegexOptions.Compiled ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractedData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractedData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Generic; +using EM=DExcPlugin.ExpressionManager.DExcExpressionManager; + +namespace DExcPlugin.Extractor +{ + internal class DExcExtractedData + { + #region Constructors + public DExcExtractedData() + { + } + #endregion + + #region API + public void Add( DExcExtractorList aList ) + { + iLists.Add( aList.Type, aList ); + } + #endregion + + #region Properties + public long LineNumber + { + get { return iLineNumber; } + set { iLineNumber = value; } + } + + public DExcExtractorList this[ DExcExtractorListType aType ] + { + get + { + DExcExtractorList ret = null; + // + if ( iLists.ContainsKey( aType ) ) + { + ret = iLists[ aType ]; + } + // + return ret; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + foreach ( KeyValuePair kvp in iLists ) + { + DExcExtractorList list = kvp.Value; + string lines = list.ToString(); + if ( lines.Length > 0 ) + { + ret.AppendLine( lines ); + } + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private long iLineNumber = 0; + private Dictionary iLists = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,286 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Generic; +using SymbianUtils.Range; +using EM=DExcPlugin.ExpressionManager.DExcExpressionManager; + +namespace DExcPlugin.Extractor +{ + internal class DExcExtractor + { + #region Events + public enum TEvent + { + EEventExtractedAllData + } + + public delegate void EventHandler( TEvent aEvent, DExcExtractor aExtractor ); + public event EventHandler StateChanged; + #endregion + + #region Constructors + public DExcExtractor() + { + Init(); + } + #endregion + + #region API + public void Init() + { + iState = TState.EStateIdle; + iData = new DExcExtractedData(); + iLists = new Dictionary(); + iCurrentLineNumber = 0; + + // Null (really just exists to catch a state transition) + // ======================================================= + CreateList( TState.EStateIdle, DExcExtractorListType.EListNull ).AddExpression( DExcExtractorEntry.NewMatchSaveAndTransition( EM.LogStart, TState.EStateHeader ) ); + + // Header + // ======================================================= + CreateList( TState.EStateHeader, DExcExtractorListType.EListHeader ).AddExpression( DExcExtractorEntry.NewMatchSaveAndTransition( EM.ThreadName, TState.EStateThreadInfo ) ); + + // Thread info + // =========== + DExcExtractorListThreadInfo listThreadInfo = new DExcExtractorListThreadInfo( TState.EStateThreadInfo, DExcExtractorListType.EListThread ); + PrepareList( listThreadInfo, EM.ThreadName, EM.ThreadId, EM.ThreadStackRange, EM.ThreadPanicDetails ); + listThreadInfo.AddExpression( DExcExtractorEntry.NewMatchSaveAndTransition( EM.RegistersExceptionStart, TState.EStateRegisterInfoException ) ); + listThreadInfo.AddExpression( DExcExtractorEntry.NewMatchSaveAndTransition( EM.RegistersUserStart, TState.EStateRegisterInfoUser ) ); + + // Registers (exception) + // ===================== + DExcExtractorList listRegisterInfoException = CreateList( TState.EStateRegisterInfoException, DExcExtractorListType.EListRegistersException, + EM.RegistersExceptionSet1, + EM.RegistersExceptionSet2 ); + listRegisterInfoException.AddExpression( DExcExtractorEntry.NewMatchSaveAndTransition( EM.RegistersUserStart, TState.EStateRegisterInfoUser ) ); + + // Registers (user) + // ================ + DExcExtractorList listRegisterInfoUser = CreateList( TState.EStateRegisterInfoUser, DExcExtractorListType.EListRegistersUser, + EM.RegistersUserCPSR, + EM.RegistersUserSet ); + + // Since code segs are optional, we want to record that we at least saw the header text (which is mandatory). This + // tracking allows us to validate that we have received/observed data for all states. + listRegisterInfoUser.AddExpression( DExcExtractorEntry.NewMatchSaveAndTransition( EM.CodeSegmentsStart, TState.EStateCodeSegments ) ); + + // Code segments + // ============= + DExcExtractorList listCodeSegments = CreateList( TState.EStateCodeSegments, DExcExtractorListType.EListCodeSegments, EM.CodeSegmentsEntry ); + + // We need to transition state to "stack data", but we must be sure not to throw away the state line we just encountered. + listCodeSegments.AddExpression( DExcExtractorEntry.NewMatchSaveAndTransition( EM.StackDataEntry, TState.EStateStackData ) ); + + // Stack data + // ========== + DExcExtractorListStackData listStackData = new DExcExtractorListStackData( TState.EStateStackData, DExcExtractorListType.EListStackData ); + PrepareList( listStackData, EM.StackDataEntry ); + listStackData.AddExpression( DExcExtractorEntry.NewMatchSaveAndTransition( EM.LogStart, TState.EStateHeader ) ); + + // We want to observe the stack data as it arrives so that we can identify when all stack data has been supplied. + listStackData.StackChanged += new DExcExtractorListStackData.StackDataChangeHandler( StackDataChanged ); + } + + public void Init( string aStackFileName ) + { + Init(); + // + DExcExtractorListStackData stackData = (DExcExtractorListStackData) iLists[ TState.EStateStackData ]; + stackData.Prime( aStackFileName ); + } + + public bool Offer( string aLine, long aLineNumber ) + { + bool consumed = false; + + // Cache line number - we use this to update the data starting position + // when the state is changed. + iCurrentLineNumber = aLineNumber; + + // Get list for current state + DExcExtractorList list = CurrentList; + if ( list != null ) + { + consumed = list.Offer( aLine, aLineNumber, this ); + } + + return consumed; + } + + public void Finialize() + { + // If we were parsing code segs but we didn't get any stack + // data then we must ensure we still notify when we've reached + // the end of the code seg data (or else no crash item will be + // created). + switch ( State ) + { + case TState.EStateIdle: + // Already finished or not started + return; + default: + break; + } + + // Did we create entries in all non-idle lists? + bool haveEntriesForAllLists = ListsAreValid; + if ( haveEntriesForAllLists ) + { + NotifyEvent( TEvent.EEventExtractedAllData ); + State = TState.EStateIdle; + } + } + #endregion + + #region Properties + public TState State + { + get { return iState; } + set + { + if ( value != iState ) + { + TState oldState = value; + iState = value; + // + if ( oldState == TState.EStateIdle ) + { + // Was idle, now not - set starting line number + iData.LineNumber = iCurrentLineNumber; + } + else if ( iState == TState.EStateIdle ) + { + Init(); + } + } + } + } + + public DExcExtractedData CurrentData + { + get { return iData; } + } + + public DExcExtractorList CurrentList + { + get + { + DExcExtractorList ret = null; + // + if ( iLists.ContainsKey( State ) ) + { + ret = iLists[ State ]; + } + // + return ret; + } + } + #endregion + + #region Event handlers + private void StackDataChanged( DExcExtractorListStackData aSelf ) + { + DExcExtractorListThreadInfo threadInfo = (DExcExtractorListThreadInfo) iLists[ TState.EStateThreadInfo ]; + AddressRange range = threadInfo.StackRange; + if ( range.IsValid ) + { + uint lastAddress = aSelf.StackData.Last.Address; + if ( lastAddress == range.Max - 1 ) + { + NotifyEvent( TEvent.EEventExtractedAllData ); + State = TState.EStateIdle; + } + } + } + #endregion + + #region Internal enumerations + internal enum TState + { + EStateIdle = 0, + EStateHeader, + EStateThreadInfo, + EStateRegisterInfoException, + EStateRegisterInfoUser, + EStateCodeSegments, + EStateStackData, + } + #endregion + + #region Internal methods + private void NotifyEvent( TEvent aEvent ) + { + if ( StateChanged != null ) + { + StateChanged( aEvent, this ); + } + } + + private void PrepareList( DExcExtractorList aList, params Regex[] aExpressions ) + { + foreach ( Regex exp in aExpressions ) + { + DExcExtractorEntry entry = DExcExtractorEntry.NewMatchAndSave( exp ); + aList.AddExpression( entry ); + } + // + iLists.Add( aList.State, aList ); + iData.Add( aList ); + } + + private DExcExtractorList CreateList( TState aAssociatedState, DExcExtractorListType aType, params Regex[] aExpressions ) + { + DExcExtractorList ret = new DExcExtractorList( aAssociatedState, aType ); + PrepareList( ret, aExpressions ); + return ret; + } + + private bool ListsAreValid + { + get + { + int countThreadInfo = iLists[ TState.EStateThreadInfo ].Count; + int countRegUser = iLists[ TState.EStateRegisterInfoUser ].Count; + int countCodeSegs = iLists[ TState.EStateCodeSegments ].Count; + int countStackData = ((DExcExtractorListStackData) iLists[ TState.EStateStackData ]).StackData.Count; + // + bool valid = ( countThreadInfo >= 3 ) && ( countRegUser > 0 ) && ( countCodeSegs > 0 ) && ( countStackData > 0 ); + return valid; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + string ret = iData.ToString(); + return ret; + } + #endregion + + #region Data members + private TState iState; + private long iCurrentLineNumber = 0; + private DExcExtractedData iData = new DExcExtractedData(); + private Dictionary iLists = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractorEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractorEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Generic; + +namespace DExcPlugin.Extractor +{ + internal class DExcExtractorEntry + { + #region Constructors + public static DExcExtractorEntry NewMatchAndSave( Regex aExpression ) + { + DExcExtractorEntry ret = new DExcExtractorEntry( aExpression ); + return ret; + } + + public static DExcExtractorEntry NewMatchAndTransition( Regex aExpression, DExcExtractor.TState aNewState ) + { + DExcExtractorEntry ret = new DExcExtractorEntry( aExpression, TType.ETypeMatchAndTransition, aNewState ); + return ret; + } + + public static DExcExtractorEntry NewMatchSaveAndTransition( Regex aExpression, DExcExtractor.TState aNewState ) + { + DExcExtractorEntry ret = new DExcExtractorEntry( aExpression, TType.ETypeMatchSaveAndTransition, aNewState ); + return ret; + } + #endregion + + #region Internal constructors + private DExcExtractorEntry( Regex aExpression ) + : this( aExpression, TType.ETypeMatchAndSave, DExcExtractor.TState.EStateIdle ) + { + } + + private DExcExtractorEntry( Regex aExpression, TType aType, DExcExtractor.TState aNewState ) + { + iType = aType; + iNewState = aNewState; + iExpression = aExpression; + } + #endregion + + #region API + public bool Offer( string aLine, long aLineNumber, DExcExtractorList aList, DExcExtractor aInterpreter ) + { + Match m = iExpression.Match( aLine ); + // + if ( m.Success ) + { + if ( Type == TType.ETypeMatchAndTransition || Type == TType.ETypeMatchSaveAndTransition ) + { + aInterpreter.State = iNewState; + } + if ( Type == TType.ETypeMatchAndSave ) + { + aList.Add( m.Value ); + } + else if ( Type == TType.ETypeMatchSaveAndTransition ) + { + // We have just transitioned state and we must add the line + // to the new state's list + if ( aInterpreter.CurrentList != null ) + { + aInterpreter.CurrentList.Add( m.Value ); + } + } + } + // + return m.Success; + } + #endregion + + #region Properties + private TType Type + { + get { return iType; } + } + #endregion + + #region Internal enumerations + private enum TType + { + ETypeMatchAndSave, + ETypeMatchAndTransition, + ETypeMatchSaveAndTransition + } + #endregion + + #region From System.Object + public override string ToString() + { + return iExpression.ToString(); + } + #endregion + + #region Data members + private readonly TType iType; + private readonly Regex iExpression; + private readonly DExcExtractor.TState iNewState; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractorList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractorList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Generic; + +namespace DExcPlugin.Extractor +{ + internal class DExcExtractorList : IEnumerable + { + #region Constructors + public DExcExtractorList( DExcExtractor.TState aState, DExcExtractorListType aType ) + { + iType = aType; + iState = aState; + } + #endregion + + #region API + public void AddExpression( DExcExtractorEntry aExpression ) + { + iEntries.Add( aExpression ); + } + + public void AddExpressions( params DExcExtractorEntry[] aExpressions ) + { + foreach ( DExcExtractorEntry exp in aExpressions ) + { + AddExpression( exp ); + } + } + + public virtual void Add( string aLine ) + { + iLines.Add( aLine ); + } + + public virtual bool Offer( string aLine, long aLineNumber, DExcExtractor aInterpreter ) + { + bool handled = false; + // + foreach ( DExcExtractorEntry interpreter in iEntries ) + { + handled = interpreter.Offer( aLine, aLineNumber, this, aInterpreter ); + if ( handled ) + { + break; + } + } + // + return handled; + } + #endregion + + #region Properties + public int Count + { + get { return iLines.Count; } + } + + public string[] Lines + { + get { return iLines.ToArray(); } + } + + public DExcExtractorListType Type + { + get { return iType; } + } + + public DExcExtractor.TState State + { + get { return iState; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + foreach ( string line in iLines ) + { + ret.AppendLine( line ); + } + // + return ret.ToString(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( string line in iLines ) + { + yield return line; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( string line in iLines ) + { + yield return line; + } + } + #endregion + + #region Data members + private readonly DExcExtractorListType iType; + private readonly DExcExtractor.TState iState; + private List iLines = new List(); + private List iEntries = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractorListStackData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractorListStackData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Text.RegularExpressions; +using System.Collections.Generic; +using SymbianUtils.DataBuffer; +using SymbianUtils.DataBuffer.Primer; + +namespace DExcPlugin.Extractor +{ + internal class DExcExtractorListStackData : DExcExtractorList + { + #region Delegates & events + public delegate void StackDataChangeHandler( DExcExtractorListStackData aSelf ); + public event StackDataChangeHandler StackChanged; + #endregion + + #region Constructors + public DExcExtractorListStackData( DExcExtractor.TState aState, DExcExtractorListType aType ) + : base( aState, aType ) + { + iPrimer = new DataBufferPrimer( iBuffer ); + } + #endregion + + #region API + public override void Add( string aLine ) + { + base.Add( aLine ); + // + iPrimer.PrimeLine( aLine ); + if ( StackChanged != null ) + { + StackChanged( this ); + } + } + + public void Prime( string aFileName ) + { + using ( FileStream stream = new FileStream( aFileName, FileMode.Open ) ) + { + long len = stream.Length; + byte[] bytes = new byte[ len ]; + stream.Read( bytes, 0, (int) len ); + iPrimer.Prime( bytes, 0 ); + } + } + #endregion + + #region Properties + public DataBuffer StackData + { + get { return iBuffer; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + #endregion + + #region Data members + private readonly DataBufferPrimer iPrimer; + private DataBuffer iBuffer = new DataBuffer(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractorListThreadInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractorListThreadInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Text.RegularExpressions; +using System.Collections.Generic; +using SymbianUtils.Range; +using EM = DExcPlugin.ExpressionManager.DExcExpressionManager; + +namespace DExcPlugin.Extractor +{ + internal class DExcExtractorListThreadInfo : DExcExtractorList + { + #region Constructors + public DExcExtractorListThreadInfo( DExcExtractor.TState aState, DExcExtractorListType aType ) + : base( aState, aType ) + { + } + #endregion + + #region API + public override void Add( string aLine ) + { + base.Add( aLine ); + // + Match m = EM.ThreadStackRange.Match( aLine ); + if ( m.Success ) + { + iStackRange.Min = uint.Parse( m.Groups[ 1 ].Value, System.Globalization.NumberStyles.HexNumber ); + iStackRange.Max = uint.Parse( m.Groups[ 2 ].Value, System.Globalization.NumberStyles.HexNumber ); + } + } + #endregion + + #region Properties + public AddressRange StackRange + { + get { return iStackRange; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + #endregion + + #region Data members + private AddressRange iStackRange = new AddressRange(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractorListType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Extractor/DExcExtractorListType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; + +namespace DExcPlugin.Extractor +{ + public enum DExcExtractorListType + { + EListNull = 0, + EListHeader, + EListThread, + EListStack, + EListRegistersException, + EListRegistersUser, + EListCodeSegments, + EListStackData + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Plugin/DExcPluginImp.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Plugin/DExcPluginImp.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.PluginAPI; +using DExcPlugin.Descriptor; +using DExcPlugin.Reader; + +namespace DExcPlugin.Plugin +{ + public class DExcPluginImp : CFFPlugin + { + #region Constructors + public DExcPluginImp( CFFDataProvider aDataProvider ) + : base( aDataProvider ) + { + } + #endregion + + #region From CFFEngine + public override CFFSourceAndConfidence GetConfidence( FileInfo aFile, CFFFileList aOtherFiles ) + { + DExcDescriptor ret = new DExcDescriptor( aFile ); + // + if ( ret.Exists ) + { + string extension = ret.Extension.ToLower(); + // + if ( ret.IsTraceExtension ) + { + ret.Level = int.MaxValue / 2; + ret.OpType = CFFSource.TReaderOperationType.EReaderOpTypeTrace; + } + + // If confidence indicates we can handle the file, then make a reader + if ( ret.OpType != CFFSource.TReaderOperationType.EReaderOpTypeNotSupported ) + { + ret.Reader = new DExcReader( this, ret ); + + // Remove any stack file if present + string stackFile = ret.StackFileName; + if ( ret.StackFileExists ) + { + aOtherFiles.Remove( stackFile ); + } + } + } + // + return ret; + } + + public override void GetSupportedFileTypes( List aFileTypes ) + { + aFileTypes.Add( CFFFileSpecification.TraceFiles() ); + aFileTypes.Add( CFFFileSpecification.AllFiles() ); + } + + public override string Name + { + get + { + return "D_EXC Plugin"; + } + } + #endregion + + #region Internal constants + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "019d73e6-31f6-4f6d-8053-cadb7cfda68e" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Reader/DExcReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Reader/DExcReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.Crash.Container; +using CrashItemLib.PluginAPI; +using SymbianUtils.DataBuffer; +using SymbianUtils.DataBuffer.Primer; +using SymbianUtils; +using DExcPlugin.Extractor; +using DExcPlugin.Descriptor; +using DExcPlugin.Plugin; +using DExcPlugin.Transformer; + +namespace DExcPlugin.Reader +{ + internal class DExcReader : CFFReader + { + #region Constructors + public DExcReader( DExcPluginImp aEngine, DExcDescriptor aDescriptor ) + : base( aEngine, aDescriptor ) + { + iTraceExtractor.StateChanged += new DExcExtractor.EventHandler( TraceExtractor_StateChanged ); + } + #endregion + + #region From CFFReader + public override void NativeReadInit() + { + throw new NotSupportedException(); + } + + public override void TraceReadInit() + { + // Check if there is an stk file with the same name + string stackFile = DExcDescriptor.StackFileName; + if ( File.Exists( stackFile ) ) + { + iTraceExtractor.Init( stackFile ); + } + else + { + iTraceExtractor.Init(); + } + } + + public override bool TraceReadOffer( CFFTraceLine aLine ) + { + bool consumed = iTraceExtractor.Offer( aLine, aLine.LineNumber ); + return consumed; + } + + public override void TraceReadComplete() + { + // This flushes any pending raw data items in the interpreter. + iTraceExtractor.Finialize(); + + base.NotifyEvent( TEvent.EReadingComplete ); + } + #endregion + + #region Properties + public DExcPluginImp DExcEngine + { + get { return base.Plugin as DExcPluginImp; } + } + + public DExcDescriptor DExcDescriptor + { + get { return base.Descriptor as DExcDescriptor; } + } + #endregion + + #region Observer - Trace interpreter + private void TraceExtractor_StateChanged( DExcExtractor.TEvent aEvent, DExcExtractor aExtractor ) + { + // This event is notified when the extractor has obtained one entire D_EXC crash + if ( aEvent == DExcExtractor.TEvent.EEventExtractedAllData ) + { + DExcExtractedData data = aExtractor.CurrentData; + DExcTransformer transformer = new DExcTransformer( DExcDescriptor, base.Plugin.DataProvider, data ); + + // Transform into crash container + CIContainer container = transformer.Transform(); + if ( container != null ) + { + base.NotifyEvent( TEvent.EReadingContainerCreated, container ); + } + + // Get extractor ready for next file + iTraceExtractor.Init(); + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private DExcExtractor iTraceExtractor = new DExcExtractor(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Transformer/DExcTransformer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/Libraries/File Formats/Plugins/DExcPlugin/Transformer/DExcTransformer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,361 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.PluginAPI; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Source; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Registers; +using CrashItemLib.Crash.Registers.Special; +using CrashItemLib.Crash.Utils; +using CrashItemLib.Crash.Threads; +using CrashItemLib.Crash.CodeSegs; +using CrashItemLib.Crash.Stacks; +using CrashItemLib.Crash.Summarisable; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Telephony; +using CrashItemLib.Crash.Memory; +using CrashItemLib.Crash.InfoHW; +using CrashItemLib.Crash.InfoSW; +using CrashItemLib.Crash.Events; +using CrashItemLib.Crash.Header; +using CrashItemLib.Crash.Container; +using SymbianStructuresLib.Arm.Registers; +using SymbianUtils.DataBuffer; +using SymbianUtils.DataBuffer.Primer; +using SymbianUtils.Range; +using DExcPlugin.Extractor; +using EM=DExcPlugin.ExpressionManager.DExcExpressionManager; + +namespace DExcPlugin.Transformer +{ + internal class DExcTransformer + { + #region Constructors + public DExcTransformer( CFFSource aDescriptor, CFFDataProvider aDataProvider, DExcExtractedData aData ) + { + iData = aData; + iDescriptor = aDescriptor; + iDataProvider = aDataProvider; + } + #endregion + + #region API + public CIContainer Transform() + { + try + { + iContainer = iDataProvider.CreateContainer( iDescriptor ); + + SaveInputData(); + + CreateHeader(); + CIProcess process = CreateProcess(); + CreateThread( process ); + } + catch ( Exception e ) + { +#if DEBUG + System.Diagnostics.Debug.WriteLine( "DEXC READER QUEUE EXCEPTION: " + e.Message ); + System.Diagnostics.Debug.WriteLine( "DEXC READER QUEUE STACK: " + e.StackTrace ); +#endif + // + iContainer = iDataProvider.CreateErrorContainer( iDescriptor ); + CIMessageError error = new CIMessageError( iContainer, "Error" ); + error.AddLine( e.Message ); + iContainer.Messages.Add( error ); + } + // + return iContainer; + } + #endregion + + #region Internal methods + private void SaveInputData() + { + string inputData = iData.ToString(); + + // Convert the entire text data into binary + List inputDataAsBytes = new List(); + + // We just want to map the raw unicode character onto a single byte. + // ASCII range is probably not sufficient (guess?) so this is why we + // do not use System.Text.ASCIIEncoding, but rather roll our own. + foreach ( char c in inputData ) + { + byte b = System.Convert.ToByte( c ); + inputDataAsBytes.Add( b ); + } + + CISourceElement source = iContainer.Source; + source.InputDataClear(); + source.InputDataAdd( inputDataAsBytes.ToArray() ); + } + + private void CreateHeader() + { + CIHeader header = iContainer.Header; + header.CrashTime = iDescriptor.MasterFile.LastWriteTime; + header.FileFormatVersion = "D_EXC for Symbian OS EKA2"; + } + + private CIProcess CreateProcess() + { + CIProcess process = new CIProcess( iContainer ); + + ExtractProcess( process ); + ExtractProcessCodeSegs( process ); + + iContainer.AddChild( process ); + return process; + } + + private CIThread CreateThread( CIProcess aProcess ) + { + // Make a new thread + CIThread thread = aProcess.CreateThread(); + + // Extract items + ExtractThread( thread ); + ExtractThreadExitReason( thread ); + ExtractThreadRegisters( thread ); + ExtractThreadStack( thread ); + + iContainer.AddChild( thread ); + return thread; + } + #endregion + + #region Internal constants + #endregion + + #region Helpers - process + private void ExtractProcess( CIProcess aProcess ) + { + // Extract process info from thread full name. + DExcExtractorList threadInfo = iData[ DExcExtractorListType.EListThread ]; + foreach ( string line in threadInfo ) + { + Match m = EM.ThreadName.Match( line ); + if ( m.Success ) + { + CIFullNameUtils parser = new CIFullNameUtils( m.Groups[ 1].Value ); + parser.GetProcessInfo( aProcess ); + + return; + } + } + } + + private void ExtractProcessCodeSegs( CIProcess aProcess ) + { + DExcExtractorList codeSegInfo = iData[ DExcExtractorListType.EListCodeSegments ]; + foreach ( string line in codeSegInfo ) + { + Match m = EM.CodeSegmentsEntry.Match( line ); + if ( m.Success ) + { + GroupCollection groups = m.Groups; + // + uint codeSegBase = uint.Parse( groups[ 1 ].Value, System.Globalization.NumberStyles.HexNumber ); + uint codeSegLimit = uint.Parse( groups[ 2 ].Value, System.Globalization.NumberStyles.HexNumber ); + string codeSegName = groups[ 3 ].Value; + // + aProcess.CreateCodeSeg( codeSegName, codeSegBase, codeSegLimit ); + } + } + } + #endregion + + #region Helpers - thread + private void ExtractThread( CIThread aThread ) + { + // Extract process info from thread full name. + DExcExtractorList threadInfo = iData[ DExcExtractorListType.EListThread ]; + foreach ( string line in threadInfo ) + { + Match m = EM.ThreadName.Match( line ); + if ( m.Success ) + { + CIFullNameUtils parser = new CIFullNameUtils( m.Groups[ 1 ].Value ); + parser.GetThreadInfo( aThread ); + } + else + { + m = EM.ThreadId.Match( line ); + if ( m.Success ) + { + aThread.Id = int.Parse( m.Groups[ 1 ].Value ); + } + } + } + } + + private void ExtractThreadExitReason( CIThread aThread ) + { + aThread.ExitInfo.Type = CrashItemLib.Crash.ExitInfo.CIExitInfo.TExitType.EExitTypeException; + + // Extract process info from thread full name. + DExcExtractorList threadInfo = iData[ DExcExtractorListType.EListThread ]; + foreach ( string line in threadInfo ) + { + Match m = EM.ThreadPanicDetails.Match( line ); + if ( m.Success ) + { + aThread.ExitInfo.Type = CrashItemLib.Crash.ExitInfo.CIExitInfo.TExitType.EExitTypePanic; + aThread.ExitInfo.Category = m.Groups[ 1 ].Value; + aThread.ExitInfo.Reason = int.Parse( m.Groups[ 2 ].Value ); + } + } + } + + private void ExtractThreadRegisters( CIThread aThread ) + { + CIThreadRegisterListCollection threadRegs = aThread.Registers; + CIRegisterList regListUser = threadRegs[ TArmRegisterBank.ETypeUser ]; + CIRegisterList regListEXC = threadRegs[ TArmRegisterBank.ETypeException ]; + CIRegisterList regListCOP = threadRegs[ TArmRegisterBank.ETypeCoProcessor ]; + CIRegisterList regListSVC = threadRegs[ TArmRegisterBank.ETypeSupervisor ]; + + #region User registers + foreach ( string line in iData[ DExcExtractorListType.EListRegistersUser ] ) + { + Match m = EM.RegistersUserSet.Match( line ); + if ( m.Success ) + { + GroupCollection groups = m.Groups; + int firstReg = int.Parse( groups[ 1 ].Value ); + for ( int i = firstReg; i < firstReg + 4; i++ ) + { + Group gp = groups[ 2 + ( i - firstReg ) ]; + uint value = uint.Parse( gp.Value, System.Globalization.NumberStyles.HexNumber ); + TArmRegisterType regType = (TArmRegisterType) i; + regListUser[ regType ].Value = value; + } + } + else + { + m = EM.RegistersUserCPSR.Match( line ); + if ( m.Success ) + { + // Get CPSR value and set it + uint cpsrValue = uint.Parse( m.Groups[ 1 ].Value, System.Globalization.NumberStyles.HexNumber ); + threadRegs.CPSR = cpsrValue; + } + } + } + #endregion + + #region Exception registers + foreach ( string line in iData[ DExcExtractorListType.EListRegistersException ] ) + { + Match m = EM.RegistersExceptionSet1.Match( line ); + if ( m.Success ) + { + GroupCollection groups = m.Groups; + // + regListEXC[ TArmRegisterType.EArmReg_EXCCODE ].Value = uint.Parse( m.Groups[ 1 ].Value, System.Globalization.NumberStyles.HexNumber ); + regListEXC[ TArmRegisterType.EArmReg_EXCPC ].Value = uint.Parse( m.Groups[ 2 ].Value, System.Globalization.NumberStyles.HexNumber ); + // + regListCOP[ TArmRegisterType.EArmReg_FAR ].Value = uint.Parse( m.Groups[ 3 ].Value, System.Globalization.NumberStyles.HexNumber ); + regListCOP[ TArmRegisterType.EArmReg_FSR ].Value = uint.Parse( m.Groups[ 4 ].Value, System.Globalization.NumberStyles.HexNumber ); + + if ( regListEXC.Contains( TArmRegisterType.EArmReg_EXCCODE ) ) + { + CIRegister reg = regListEXC[ TArmRegisterType.EArmReg_EXCCODE ]; + System.Diagnostics.Debug.Assert( reg is CIRegisterExcCode ); + CIRegisterExcCode excReg = (CIRegisterExcCode) reg; + // + excReg.ExpandToFullExceptionRange(); + } + + // It also means it was an exception + aThread.ExitInfo.Type = CrashItemLib.Crash.ExitInfo.CIExitInfo.TExitType.EExitTypeException; + } + else + { + m = EM.RegistersExceptionSet2.Match( line ); + if ( m.Success ) + { + GroupCollection groups = m.Groups; + // + regListSVC[ TArmRegisterType.EArmReg_SP ].Value = uint.Parse( m.Groups[ 1 ].Value, System.Globalization.NumberStyles.HexNumber ); + regListSVC[ TArmRegisterType.EArmReg_LR ].Value = uint.Parse( m.Groups[ 2 ].Value, System.Globalization.NumberStyles.HexNumber ); + regListSVC[ TArmRegisterType.EArmReg_SPSR ].Value = uint.Parse( m.Groups[ 3 ].Value, System.Globalization.NumberStyles.HexNumber ); + } + } + } + #endregion + } + + private void ExtractThreadStack( CIThread aThread ) + { + DExcExtractorListStackData stackDataList = (DExcExtractorListStackData) iData[ DExcExtractorListType.EListStackData ]; + DataBuffer stackData = stackDataList.StackData; + + // Get stack range details + DExcExtractorListThreadInfo threadInfo = (DExcExtractorListThreadInfo) iData[ DExcExtractorListType.EListThread ]; + AddressRange stackRange = threadInfo.StackRange; + + // If we didn't get the stack range, we cannot create a stack entry + if ( !stackRange.IsValid || stackRange.Max == 0 || stackRange.Min == 0 ) + { + CIMessageWarning warning = new CIMessageWarning( aThread.Container, "Stack Address Range Unavailable" ); + warning.AddLine( "The stack address range details are invalid." ); + aThread.AddChild( warning ); + } + else if ( stackData.Count == 0 ) + { + // No stack data + CIMessageWarning warning = new CIMessageWarning( aThread.Container, "Stack Data Unavailable" ); + warning.AddLine( "The crash details contain no stack data." ); + aThread.AddChild( warning ); + } + else + { + // Set base address of data buffer if not already set + if ( stackData.AddressOffset == 0 ) + { + stackData.AddressOffset = stackRange.Min; + } + + // In theory, D_EXC only ever captures user-side crashes (panics/exceptions) therefore + // we should always be able to assume that the stack data goes with a user-side thread. + CIRegisterList userRegs = aThread.Registers[ TArmRegisterBank.ETypeUser ]; + if ( userRegs != null ) + { + CIStack stack = aThread.CreateStack( userRegs, stackData, stackData.AddressOffset, stackRange ); + + // Register it as a specific crash instance + iContainer.AddChild( stack ); + } + } + } + #endregion + + #region Data members + private readonly CFFDataProvider iDataProvider; + private readonly CFFSource iDescriptor; + private readonly DExcExtractedData iData = null; + private CIContainer iContainer = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Common/Objects/SymArgument.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Common/Objects/SymArgument.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; +using SymBuildParsingLib.Tree; +using SymbianTree; + +namespace SymBuildParsingLib.Common.Objects +{ + public class SymArgumentSubLevel : SymNodeAddAsChild + { + #region Constructors & destructor + public SymArgumentSubLevel( SymNode aCopyFrom ) + { + AppendChildrenFrom( aCopyFrom ); + } + #endregion + } + + public class SymArgument : SymDocument + { + #region Constructors & destructor + public SymArgument() + { + } + #endregion + + #region API + #endregion + + #region Properties + public string CoalescedTokenValue + { + get + { + StringBuilder ret = new StringBuilder(); + // + BuildRecursiveTokenValueString( this, ref ret ); + // + return ret.ToString(); + } + } + #endregion + + #region Internal methods + private void BuildRecursiveTokenValueString( SymNode aNode, ref StringBuilder aString ) + { + if ( aNode is SymNodeToken ) + { + SymNodeToken tokenNode = (SymNodeToken) aNode; + aString.Append( tokenNode.Token ); + } + // + foreach( SymNode child in aNode ) + { + BuildRecursiveTokenValueString( child, ref aString ); + } + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Common/Objects/SymDefineDefinition.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Common/Objects/SymDefineDefinition.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; +using SymBuildParsingLib.Token; +using SymbianTree; + +namespace SymBuildParsingLib.Common.Objects +{ + public class SymDefineArgument : SymArgument + { + #region Constructors & destructor + public SymDefineArgument( SymArgument aArgumentToCopyFrom ) + { + AppendChildrenFrom( aArgumentToCopyFrom ); + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } + + public class SymDefineDefinition + { + #region Enumerations + #endregion + + #region Constructors & destructor + public SymDefineDefinition() + { + } + + public SymDefineDefinition( string aName ) + { + iName = aName; + } + #endregion + + #region API + public void AddArgument( SymDefineArgument aArgument ) + { + iArguments.Add( aArgument ); + } + #endregion + + #region Properties + public bool IsValid + { + get + { + bool valid = ( Name.Length > 0 ); + return valid; + } + } + + public string Name + { + get { return iName; } + set { iName = value; } + } + + public string CoalescedTokenValue + { + get + { + StringBuilder args = new StringBuilder(); + // + int count = iArguments.Count; + for( int i=0; i 0 ) + { + args.Insert( 0, "(" ); + args.Append( ")" ); + } + return Name + args.ToString(); + } + } + public SymTokenContainer Value + { + get { return iValue; } + set { iValue = value; } + } + #endregion + + #region Properties - argument related + public bool HasArguments + { + get { return ArgumentCount > 0; } + } + + public int ArgumentCount + { + get { return iArguments.Count; } + } + + public SymDefineArgument this[ int aIndex ] + { + get + { + SymDefineArgument arg = (SymDefineArgument) iArguments[ aIndex ]; + return arg; + } + } + #endregion + + #region From System.Object + public override int GetHashCode() + { + int ret = iName.GetHashCode(); + return ret; + } + #endregion + + #region Data members + private string iName = string.Empty; + private ArrayList iArguments = new ArrayList(); + private SymTokenContainer iValue = new SymTokenContainer(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Common/Objects/SymDefineDirectory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Common/Objects/SymDefineDirectory.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections; +using SymBuildParsingLib.Utils; + +namespace SymBuildParsingLib.Common.Objects +{ + public class SymDefineDirectory + { + #region Constructors & destructor + public SymDefineDirectory() + { + } + + public SymDefineDirectory( SymDefineDirectory aCopy ) + { + } + #endregion + + #region API + public void Add( SymDefineDefinition aDefinition ) + { + object key = aDefinition.GetHashCode(); + iDefines.Add( key, aDefinition ); + } + + public bool IsDefined( string aName ) + { + SymDefineDefinition ret = DefineDefinition( aName ); + return ( ret != null ); + } + + public SymDefineDefinition DefineDefinition( string aName ) + { + SymDefineDefinition ret = null; + // + object key = new SymDefineDefinition( aName ).GetHashCode(); + object item = iDefines[ key ]; + if ( item != null ) + { + ret = (SymDefineDefinition) item; + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + private Hashtable iDefines = new Hashtable( 10 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Common/Objects/SymIncludeDefinition.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Common/Objects/SymIncludeDefinition.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; + +namespace SymBuildParsingLib.Common.Objects +{ + public class SymIncludeDefinition + { + #region Enumerations + public enum TType + { + ETypeUndefined = 0, + ETypeUser, + ETypeSystem + }; + #endregion + + #region Constructors & destructor + public SymIncludeDefinition() + { + } + + public SymIncludeDefinition( string aLocation ) + { + iLocation = aLocation; + } + + public SymIncludeDefinition( TType aType ) + { + iType = aType; + } + + public SymIncludeDefinition( TType aType, string aLocation ) + { + iType = aType; + iLocation = aLocation; + } + #endregion + + #region API + public void AdjustRelativeInclude( string aBasePath ) + { + bool isRooted = Path.IsPathRooted( Location ); + // + if ( isRooted == false ) + { + Location = Utils.SymFileSystemUtils.MergePaths( aBasePath, Location ); + } + } + #endregion + + #region Properties + public TType Type + { + get { return iType; } + set { iType = value; } + } + + public string Location + { + get { return iLocation; } + set { iLocation = value; } + } + #endregion + + #region Data members + private TType iType = TType.ETypeUndefined; + private string iLocation = String.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Common/Objects/SymIncludeDirectory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Common/Objects/SymIncludeDirectory.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections; +using SymBuildParsingLib.Utils; + +namespace SymBuildParsingLib.Common.Objects +{ + public class SymIncludeDirectory + { + #region Constructors & destructor + public SymIncludeDirectory() + { + } + + public SymIncludeDirectory( SymIncludeDirectory aCopy ) + { + } + #endregion + + #region API + public void Add( SymIncludeDefinition aDefinition ) + { + string location = aDefinition.Location; + if ( location == String.Empty ) + { + throw new ArgumentException( "Include location cannot be null when adding to include directory", aDefinition.ToString() ); + } + + if ( iIncludes[ location ] == null ) + { + iIncludes.Add( location, aDefinition ); + } + } + + public string ResolveFileName( SymIncludeDefinition aDefinition ) + { + // First check against the specified type for an exact match... + string location = aDefinition.Location; + string ret = FindInSpecifiedIncludeEntries( location, aDefinition.Type ); + + if ( ret == string.Empty ) + { + // Try the other remaining type + SymIncludeDefinition.TType type = SymIncludeDefinition.TType.ETypeUser; + + if ( aDefinition.Type == SymIncludeDefinition.TType.ETypeUser ) + { + type = SymIncludeDefinition.TType.ETypeSystem; + } + else + { + type = SymIncludeDefinition.TType.ETypeUser; + } + + ret = FindInSpecifiedIncludeEntries( location, type ); + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private string FindInSpecifiedIncludeEntries( string aFileName, SymIncludeDefinition.TType aType ) + { + string ret = string.Empty; + // + IDictionaryEnumerator enumerator = iIncludes.GetEnumerator(); + while ( enumerator.MoveNext() ) + { + SymIncludeDefinition include = (SymIncludeDefinition) enumerator.Value; + // + if ( include.Type == aType ) + { + string includePath = include.Location; + string resolvedFileName = SymFileSystemUtils.MergePaths( includePath, aFileName ); + // + if ( SymFileSystemUtils.FileExists( resolvedFileName ) ) + { + ret = resolvedFileName; + break; + } + } + } + // + return ret; + } + #endregion + + #region Data members + private Hashtable iIncludes = new Hashtable( 10 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Grouper/SymGrouper.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Grouper/SymGrouper.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Threading; +using System.Collections; +using SymBuildParsingLib.Utils; +using SymBuildParsingLib.Lexer; +using SymBuildParsingLib.Token; + +namespace SymBuildParsingLib.Grouper +{ + public class SymGrouper + { + #region Enumerations + public enum TEvent + { + EEventGroupingStarted = 0, + EEventGroupingPaused, + EEventGroupingTokenReady, + EEventGroupingComplete + }; + #endregion + + #region Observer interface + public delegate void GrouperObserver( SymGrouper aGrouper, TEvent aEvent, SymToken aToken ); + #endregion + + #region Events + public event GrouperObserver GrouperObservers; + #endregion + + #region Constructors & destructor + public SymGrouper( SymLexer aLexer ) + { + // The mastermind implements all the logic for grouping token runs into + // more sophisticated/logical token groupings. + iMastermind.MastermindObservers += new SymGrouperMastermind.MastermindObserver( MastermindObserver ); + + // Observe the lexer for tokens + aLexer.LexerObservers += new SymLexer.LexerObserver( LexerTokenHandler ); + + // Prepare worker thread + ThreadStart threadStart = new ThreadStart( DoGrouping ); + iWorkerThread = new Thread( threadStart ); + iWorkerThread.Name = "SymGrouperWorkerThread"; + iWorkerThread.IsBackground = true; + iWorkerThread.Start(); + } + #endregion + + #region Internal methods + private void ReportEvent( TEvent aEvent, SymToken aToken ) + { + if ( GrouperObservers != null ) + { + GrouperObservers( this, aEvent, aToken ); + } + } + #endregion + + #region Internal threading related + private void DoGrouping() + { + ReportEvent( TEvent.EEventGroupingStarted, SymToken.NullToken() ); + + bool lexerFinished = false; + do + { + // Count how many tokens we have... + lock( this ) + { + iMastermind.PerformGrouping(); + lexerFinished = iLexerFinished; + } + + // Wait until there are more items to process + if ( lexerFinished == false ) + { + ReportEvent( TEvent.EEventGroupingPaused, SymToken.NullToken() ); + iSemaphore.Wait(); + ReportEvent( TEvent.EEventGroupingStarted, SymToken.NullToken() ); + } + } + while ( lexerFinished == false ); + + ReportEvent( TEvent.EEventGroupingComplete, SymToken.NullToken() ); + } + #endregion + + #region Event handlers + private void LexerTokenHandler( SymLexer aLexer, SymLexer.TEvent aEvent, SymToken aToken ) + { + if ( aEvent == SymLexer.TEvent.EEventLexingToken ) + { + // Store the token + lock( this ) + { + iMastermind.EnqueueLexedToken( aToken ); + } + + // and signal the worker thread if it is waiting... + if ( iSemaphore.Count == 0 ) + { + iSemaphore.Signal(); + } + } + else if ( aEvent == SymLexer.TEvent.EEventLexingComplete ) + { + lock( this ) + { + iLexerFinished = true; + } + + // and signal the worker thread if it is waiting... + if ( iSemaphore.Count == 0 ) + { + iSemaphore.Signal(); + } + } + } + + private void MastermindObserver( SymGrouperMastermind.TEvent aEvent, SymToken aGroupedToken ) + { + // We've received a token from the grouper. Pass it on to our observer to handle. + if ( aEvent == SymGrouperMastermind.TEvent.EEventGroupTokenReady ) + { + ReportEvent( TEvent.EEventGroupingTokenReady, aGroupedToken ); + } + } + #endregion + + #region Data members + private Thread iWorkerThread; + private SymGrouperMastermind iMastermind = new SymGrouperMastermind(); + private SymSemaphore iSemaphore = new SymSemaphore( 0, 1 ); + private bool iLexerFinished = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Grouper/SymGrouperMastermind.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Grouper/SymGrouperMastermind.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,973 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Threading; +using System.Collections; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Lexer; + +namespace SymBuildParsingLib.Grouper +{ + public class SymGrouperMastermind + { + #region Enumerations + public enum TEvent + { + EEventGroupTokenReady = 0 + }; + #endregion + + #region Observer interface + public delegate void MastermindObserver( TEvent aEvent, SymToken aGroupedToken ); + #endregion + + #region Events + public event MastermindObserver MastermindObservers; + #endregion + + #region Constructors & destructor + public SymGrouperMastermind() + { + } + #endregion + + #region Internal enumerations + private enum TGroupingAction + { + ETokenIgnore = -1, + ETokenMerge = 0, + ETokenEnqueue, + ETokenFlushQueue + }; + + [Flags] + private enum TStateFlag + { + EStateFlagUnspecified = 0, + EStateFlagInQuotation = 1, + EStateFlagInComment = 2, + EStateFlagInPreProcessorDirective = 4 + }; + #endregion + + #region API + public void PerformGrouping() + { + SymToken token = NextInputToken(); + // + while( token != null ) + { + ProcessToken( token ); + token = NextInputToken(); + } + } + + public void EnqueueLexedToken( SymToken aToken ) + { + lock( iLexedTokens ) + { + iLexedTokens.Enqueue( aToken ); + } + } + #endregion + + #region Internal token processors + private void ProcessToken( SymToken aToken ) + { + aToken.RefineTokenClass(); + aToken.RefineTokenType(); + + if ( InQuotation ) + { + ProcessTokenDuringQuotation( aToken ); + } + else if ( InComment ) + { + ProcessTokenDuringComment( aToken ); + } + else if ( InPreProcessorDirective ) + { + ProcessTokenDuringPreProcessorDirective( aToken ); + } + else + { + ProcessTokenDuringNormalOperations( aToken ); + } + } + + private void ProcessTokenDuringNormalOperations( SymToken aToken ) + { + // By default we will just add the input token to the + // pending queue (i.e. no combining/grouping) + TGroupingAction action = TGroupingAction.ETokenEnqueue; + // + if ( iCache.Count == 0 ) + { + #region The cache is empty - enqueue the token. + // Starting a new token batch, so just push the token. If + // its a quotation, then it will be handled during + // the enqueuing. Pragma symbols must appear as the first + // item on a line, and will be picked up similarly to quotes. + if ( aToken.Class == SymToken.TClass.EClassNewLine ) + { + // If we're adding a new blank line as the first + // token, we just want to flush it out immediately. + EnqueueNewOutputToken( aToken ); + action = TGroupingAction.ETokenFlushQueue; + } + else + { + action = TGroupingAction.ETokenEnqueue; + } + #endregion + } + else + { + #region The cache already has some tokens... + SymToken previousToken = PreviousOutputToken; + SymToken.TClass previousTokenClass = previousToken.Class; + // + if ( aToken.Class == SymToken.TClass.EClassNewLine ) + { + #region New line detected... + + // Checking for continuations... + if ( previousToken.Class == SymToken.TClass.EClassSymbol && previousToken.Value == @"\" ) + { + // Because of the continuation character, we don't + // flush the cache. + + // Discard new line + previousToken.Class = SymToken.TClass.EClassContinuation; + action = TGroupingAction.ETokenIgnore; + } + else + { + // We never allow new lines to be combined. In fact, + // they are the signal that we should flush whatever we have + // cached so far. We must add the new line token + // first though. + EnqueueNewOutputToken( aToken ); + action = TGroupingAction.ETokenFlushQueue; + } + #endregion + } + else if ( previousTokenClass == aToken.Class ) + { + #region Tokens are the same class - check for combining + // We group almost all tokens, but some are not permitted + // to be combined, for example, brackets. + bool combiningAllowed = previousToken.CombiningAllowed; + if ( combiningAllowed && aToken.CombiningAllowed ) + { + // Merge the two tokens + action = TGroupingAction.ETokenMerge; + } + else + { + // Treat it as a separate token. + action = TGroupingAction.ETokenEnqueue; + } + #endregion + } + else + { + #region Handling some other type of token... + if ( previousTokenClass == SymToken.TClass.EClassSymbol && previousToken.Value == @"\" ) + { + // If the last token was a single escaped character, and this next + // character is not an asterisk or another back slash, then + // we can try to combine the two. + if ( !(aToken.Value == "*" || aToken.Value == @"\" ) ) + { + action = TGroupingAction.ETokenMerge; + } + else + { + System.Diagnostics.Debug.Assert( false ); + } + } + else + { + action = TGroupingAction.ETokenEnqueue; + } + #endregion + } + #endregion + } + + #region Now perform the action + switch( action ) + { + case TGroupingAction.ETokenEnqueue: + EnqueueNewOutputToken( aToken ); + break; + case TGroupingAction.ETokenMerge: + MergeWithPreviousToken( aToken ); + break; + case TGroupingAction.ETokenFlushQueue: + FlushCache(); + break; + default: + case TGroupingAction.ETokenIgnore: + break; + } + #endregion + } + + private void ProcessTokenDuringQuotation( SymToken aToken ) + { +// System.Diagnostics.Debug.Write( "[" + aToken.Value + "] " ); + System.Diagnostics.Debug.Assert( iCache.Count > 0 ); + + #region Quotation examples + // 1) "" + // 2) "\"" + // 3) "\"\"" + // 4) '' + // 5) '\'' + // 6) '\'\'' + // 7) "\'\'\'\"\"" + // 8) "abc def ghi" + // + // 9) #define WIBBLE " this is a test string \ + // This too" " - and this!" + // + // 10) #define WIBBLE2 " this is a test string \\ abc \ + // This too" " - and this!" + // + // 11) #pragma message("Quotation with brackets (;') and other \'nasty\' things! inside it__\\"); + // + #endregion + + if ( aToken.Class == SymToken.TClass.EClassQuotation ) + { + #region Token is a quotation ... + // Quotation symbol whilst already in a quotation. + // We should check whether we have reached + // the closing quotation symbol, or then whether + // this is possibly just an escaped character? + // + // See examples 2,3,5,6,7,10,11 + + SymToken previousToken = PreviousOutputToken; + if ( previousToken.Class == SymToken.TClass.EClassSymbol && previousToken.Value == @"\" ) + { + // Combine the \' or \" with any previous token + previousToken.ForceCombine( aToken ); + System.Diagnostics.Debug.Assert( iCache.Count > 0 ); + } + else + { + // The last token was not an escape marker, so this + // is a quotation character all on its own. Since + // we always start a new cache run when we first see + // a quotation (during "normal" state), then the + // first token in the cache forms the basis for the + // search character. + // + // If the number of tokens in the cache with the same + // type (as the first token) is even, then we have + // reached the end of a quotation. If its odd, then + // we're still inside one. + + SymToken initialQuotationToken = iCache.PeekHead; + System.Diagnostics.Debug.Assert( initialQuotationToken.Value.Length == 1 ); + System.Diagnostics.Debug.Assert( initialQuotationToken.Class == SymToken.TClass.EClassQuotation ); + System.Diagnostics.Debug.Assert( initialQuotationToken.Type == SymToken.TType.ETypeQuotationDouble || initialQuotationToken.Type == SymToken.TType.ETypeQuotationSingle ); + + if ( initialQuotationToken.Value == aToken.Value ) + { + // Need to check for a closing quotation. The count in the cache + // should be odd (so that adding aToken makes a balanced set of + // quotation characters). + int count = iCache.CountByType( initialQuotationToken ); + int remainder = count % 2; + if ( remainder == 1 ) + { + // Odd number which means that the quotation is treated as complete + System.Diagnostics.Debug.Assert( aToken.Value == initialQuotationToken.Value ); + EnqueueNewOutputToken( aToken ); + + #region Try to group all of the text into a logical string + + // No sense in doing this unless we have more than 3 tokens + count = iCache.Count; + if ( count > 3 ) + { + // Assume we have the following string: + // "marker.h" + // + // This is actually represented as 5 tokens:- + // + // 0 ["] => EClassQuotation + // 1 [marker] => EClassQuotation + // 2 [.] => EClassQuotation + // 3 [h] => EClassQuotation + // 4 ["] => EClassQuotation + // + // We need to merge tokens at indicies 1, 2 and 3 into a + // single token. + + iCache.MergeAllTokensWithinRange( 1, count - 1, false, true ); + } + #endregion + + FlushCache(); + } + else + { + EnqueueNewOutputToken( aToken ); + } + } + else + { + // It wasn't the closing quotation, so just queue it up + EnqueueNewOutputToken( aToken ); + } + } + #endregion + } + else + { + #region Token is not a quotation... + // We'll try to combine the tokens as much as is possible. + if ( aToken.Class == SymToken.TClass.EClassNewLine ) + { + #region Handle new line during quotation... + // Checking for continuations... + // + // If the last token was not a backshash marker, then + // we should flush the cache (reset state). + SymToken previousToken = PreviousOutputToken; + if ( previousToken.Class == SymToken.TClass.EClassSymbol && previousToken.Value == @"\" ) + { + // The last token was an backslash. This means we + // are dealing with a similar case to examples 9 & 10. + + // Discard new line + previousToken.Class = SymToken.TClass.EClassContinuation; + } + else + { + // The last token wasn't a continuation character + // which means this is a "normal" EOL scenario. + // Just add the token and flush the cache. Mind you, this actually + // means the content is invalid. + EnqueueNewOutputToken( aToken ); + FlushCache(); + } + #endregion + } + else if ( aToken.Class == SymToken.TClass.EClassSymbol && aToken.Value == @"\" ) + { + SymToken previousToken = PreviousOutputToken; + if ( previousToken.Class == SymToken.TClass.EClassSymbol && previousToken.Value == @"\" ) + { + // Example 10 - an escaped backslash. Combine the + // previous token (a backslash) with the new token + // then join this new combined token with the previous. + // Phew. + MergeWithPreviousToken( aToken ); + PreviousOutputToken.Class = SymToken.TClass.EClassQuotation; + } + else + { + // This should not be combined until we know + // what the next character is. + EnqueueNewOutputToken( aToken ); + } + } + else + { + // Irrespective of what class the token is + // currently, we treat it as part of a quotation. + aToken.Class = SymToken.TClass.EClassQuotation; + + // If the previous character wasn't a quotation, + EnqueueNewOutputToken( aToken ); + } + #endregion + } + } + + private void ProcessTokenDuringComment( SymToken aToken ) + { + #region Comment examples + // // this is a comment + // /* this is also a comment */ + // // "This is another comment" + // // This is a comment with a continuation \ + // and here's the rest. + #endregion + + System.Diagnostics.Debug.Assert( iCache.Count > 0 ); + + if ( aToken.Class == SymToken.TClass.EClassSymbol && aToken.Value == "*" ) + { + #region Ensure asterisk is not merged with other comments + // The asterisk character is separated from + // the rest of the comment in order that we can + // ascertain when the end of a block comment has + // been reached. + EnqueueNewOutputToken( aToken ); + #endregion + } + else if ( aToken.Class == SymToken.TClass.EClassNewLine ) + { + #region New line during comment... + + // Checking for continuations... + SymToken previousToken = PreviousOutputToken; + if ( previousToken.Value == @"\" ) + { + // Discard new line + previousToken.Class = SymToken.TClass.EClassContinuation; + } + else + { + // If we're in a block comment, then we don't flush when we + // see a new line token. + SymToken firstToken = iCache.PeekHead; + EnqueueNewOutputToken( aToken ); + // + if ( firstToken.Type == SymToken.TType.ETypeCommentFullLine ) + { + // Flushing the cache resets the flags... + FlushCache(); + } + else if ( firstToken.Type == SymToken.TType.ETypeCommentBlock ) + { + // Don't end the comment until we see the closing block token. + } + } + #endregion + } + else if ( aToken.Class == SymToken.TClass.EClassSymbol && aToken.Value == "/" ) + { + #region Handle Closing Comment Block [ */ ] + // For ending a comment region, we must have at least one token + // already in the cache. + SymToken previousToken = PreviousOutputToken; + + // Check whether previous token was a "*" - we might be closing a block comment + if ( previousToken.Class == SymToken.TClass.EClassSymbol && previousToken.Value == "*" ) + { + // Check whether first token was an opening block + SymToken firstToken = iCache.PeekHead; + if ( firstToken.Type == SymToken.TType.ETypeCommentBlock && firstToken.Value == "/*" ) + { + // End of a block reached. Combine the closing "/" with the asterisk we already + // have in order to form a closing "*/" block token. + previousToken.Combine( aToken ); + previousToken.Class = SymToken.TClass.EClassComment; + previousToken.Type = SymToken.TType.ETypeCommentBlock; + + // No longer in a comment + InComment = false; + } + } + #endregion + } + else if ( aToken.Class == SymToken.TClass.EClassSymbol && aToken.Value == @"\" ) + { + #region Handle possible continuation during comment + // We treat the possible continuation character as a comment. + // If the next character that arrives is really a new line, then we change + // the class to continuation and handle the situation accordingly... + aToken.Class = SymToken.TClass.EClassComment; + EnqueueNewOutputToken( aToken ); + #endregion + } + else + { + aToken.Class = SymToken.TClass.EClassComment; + + if ( PreviousOutputToken.Class == SymToken.TClass.EClassContinuation ) + { + // In this scenario, we don't want to try to merge the specified token with the previous + // new line character, since new lines must be left intact. Just enque it, ensuring + // that the token class is suitably updated. + EnqueueNewOutputToken( aToken ); + } + else if ( iCache.Count == 1 ) + { + // We don't want to merge this token with the first token in the + // cache, or else we won't be able to successfully identify closing + // block comments + EnqueueNewOutputToken( aToken ); + } + else + { + System.Diagnostics.Debug.Assert( PreviousOutputToken.CombiningAllowed ); + ForceMergeWithPreviousToken( aToken ); + } + } + } + + private void ProcessTokenDuringPreProcessorDirective( SymToken aToken ) + { + #region PreProcessor examples + // 1) #_ pragma "This is invalid" + // + // 2) #\ + // pragma message("hello") + // + // 3) #\ + // define TEST + // + // 4) # \ + // define TEST + // + // 5) # \\ + // define INVALID_DEFINE + // + // 6) # pragma "This is a valid \ + // pragma which contains a quotation" + // + // 7) #define LOG_FUNC XLeaveDetector __instrument; \ + // TCleanupItem __cleanupItem(XLeaveDetector::LeaveOccurred, &__instrument); \ + // CleanupStack::PushL(__cleanupItem); + #endregion + + // NB. We only stay in "preprocessor mode" until we've identified + // the preprocessor type,i.e. the first non-whitespace word that + // appears after the initial hash sign. + bool validPreProcessorDirective = true; + int cacheCount = iCache.Count; + System.Diagnostics.Debug.Assert( cacheCount > 0 ); + System.Diagnostics.Debug.Assert( iCache.PeekHead.Class == SymToken.TClass.EClassPreProcessor && iCache.PeekHead.Value == "#" ); + + // Handle case 5 first of all. If the previous token was a possible + // continuation, then this next token must be a new line. If its not, + // then the PP statement is invalid. + SymToken previousToken = PreviousOutputToken; + if ( previousToken.Class == SymToken.TClass.EClassSymbol && previousToken.Value == @"\" ) + { + #region Handle new line character - checking for continuations + if ( aToken.Class == SymToken.TClass.EClassNewLine ) + { + previousToken.Class = SymToken.TClass.EClassContinuation; + } + else + { + // Borked. + validPreProcessorDirective = false; + } + #endregion + } + else + { + // The next token HAS to be an alphanumeric or then a whitespace. + // If its not, we're borked. + if ( aToken.Class == SymToken.TClass.EClassAlphaNumeric && aToken.Type == SymToken.TType.ETypeAlphaNumericNormal ) + { + #region Handle identified preprocessor command + // Token was okay - and we can switch back to normal mode + // now as we've grabbed our preprocessor command. + aToken.Class = SymToken.TClass.EClassPreProcessor; + EnqueueNewOutputToken( aToken ); + InPreProcessorDirective = false; + #endregion + } + else if ( aToken.Class == SymToken.TClass.EClassWhiteSpace ) + { + // Token is okay, but don't change mode yet. We still need an alphanumeric word. + } + else if ( aToken.Class == SymToken.TClass.EClassSymbol && aToken.Value == @"\" ) + { + #region Handle possible continuation + // Possibly a valid continuation character prior to seeing the first + // preprocessor command. For this to be really valid, we must only + // have seen whitespace between the first token and now. + bool everythingExceptFirstTokenIsWhiteSpace = iCache.CheckTokensAreOfClass( SymToken.TClass.EClassWhiteSpace, 1 ); + if ( everythingExceptFirstTokenIsWhiteSpace ) + { + // Could be a continuation character, but only if the next char is a new line + EnqueueNewOutputToken( aToken ); + } + else + { + // Borked - we've seen non-whitespace. Actually I don't think we can + // ever come here anyway + System.Diagnostics.Debug.Assert( false ); + validPreProcessorDirective = false; + } + #endregion + } + else + { + // Something else -> borked. + validPreProcessorDirective = false; + } + } + + #region Handle detection of invalid preprocessor line + if ( validPreProcessorDirective == false ) + { + // Token is not valid - this isn't a valid preprocessor directive. + // Reset state, update previous character so that its marked as a symbol + // and bail out. + InPreProcessorDirective = false; + iCache.PeekHead.Class = SymToken.TClass.EClassSymbol; + EnqueueNewOutputToken( aToken ); + } + #endregion + } + #endregion + + #region Internal cache manipulation methods + private void FlushCache() + { +#if SHOW_FLUSHED_TOKENS + StringBuilder debugListing = new StringBuilder(); + foreach( SymToken token in iCache ) + { + if ( token.Class == SymToken.TClass.EClassNewLine ) + { + debugListing.Append( "[NL] " ); + } + else + { + debugListing.Append( "[" + token.Value + "] "); + } + } + if ( debugListing.Length > 0 ) + { + System.Diagnostics.Debug.WriteLine( debugListing.ToString() ); + } +#endif + + foreach( SymToken token in iCache ) + { + if ( MastermindObservers != null ) + { + MastermindObservers( TEvent.EEventGroupTokenReady, token ); + } + } + + iCache.Reset(); + ResetState(); + } + + private SymToken NextInputToken() + { + SymToken ret = null; + // + lock( iLexedTokens ) + { + if ( iLexedTokens.Count > 0 ) + { + ret = iLexedTokens.Dequeue(); + } + } + // + return ret; + } + + private SymToken PreviousOutputToken + { + get + { + SymToken ret = SymToken.NullToken(); + if ( iCache.Count > 0 ) + { + SymToken previousToken = (SymToken) iCache.PeekTail; + ret = previousToken; + } + return ret; + } + } + + private void EnqueueNewOutputToken( SymToken aToken ) + { + if ( CheckIfStateChangeRequiredForEnqueuedToken( aToken ) == false ) + { + //System.Console.WriteLine( "Enqueue [" + aToken.Value + "]" ); + iCache.Append( aToken ); + } + } + + private void MergeWithPreviousTwoTokens( SymToken aNewToken, SymToken.TClass aNewClassType ) + { + System.Diagnostics.Debug.Assert( iCache.Count > 0 ); + + SymToken previousToken = iCache.PopTail(); + + // Combine it with the new token... + previousToken.Combine( aNewToken ); + previousToken.Class = aNewClassType; + + // And combine any previous previous token + MergeWithPreviousToken( previousToken ); + } + + private void MergeWithPreviousToken( SymToken aNewToken ) + { + if ( iCache.Count > 0 ) + { + if ( CheckIfStateChangeRequiredForEnqueuedToken( aNewToken ) == false ) + { + SymToken previousOutputToken = PreviousOutputToken; + previousOutputToken.Combine( aNewToken ); + } + } + else + { + EnqueueNewOutputToken( aNewToken ); + } + } + + private void ForceMergeWithPreviousToken( SymToken aNewToken ) + { + if ( iCache.Count > 0 ) + { + if ( CheckIfStateChangeRequiredForEnqueuedToken( aNewToken ) == false ) + { + SymToken previousOutputToken = PreviousOutputToken; + previousOutputToken.ForceCombine( aNewToken ); + } + } + else + { + EnqueueNewOutputToken( aNewToken ); + } + } + #endregion + + #region Internal state related methods + private void ResetState() + { + iFlags = TStateFlag.EStateFlagUnspecified; + } + + private bool CheckIfStateChangeRequiredForEnqueuedToken( SymToken aToken ) + { + // NB. This method is called before aToken has been enqueued + // or in the case of combining, before the token has been combined + // with any prior token. + bool tokenProcessed = false; + + if ( InQuotation ) + { + } + else if ( InComment ) + { + } + else if ( InPreProcessorDirective ) + { + } + else + { + if ( aToken.Class == SymToken.TClass.EClassQuotation ) + { + #region Handle start of quotation + if ( iCache.Count > 0 ) + { + // Check whether the previous symbol was a backslash. If it was + // then this must be an escaped " or ' character, in which case + // we don't change state. + SymToken previousToken = PreviousOutputToken; + + if ( previousToken.Class == SymToken.TClass.EClassSymbol && previousToken.Value == @"\" ) + { + // Last character was an escape marker. Combine it + // with the quotation + previousToken.Combine( aToken ); + + // Already handled the token + tokenProcessed = true; + } + else + { + // Really are starting a quotation. + FlushCache(); + InQuotation = true; + } + } + #endregion + } + else if ( aToken.Class == SymToken.TClass.EClassSymbol ) + { + if ( aToken.Value == "*" ) + { + #region Handle Opening comment block [ /* ] + if ( iCache.Count > 0 ) + { + SymToken previousToken = PreviousOutputToken; + // + if ( previousToken.Class == SymToken.TClass.EClassSymbol && previousToken.Value == "/" ) + { + // "/*" case + // + // In this scenario, in order to ensure that we do not + // flush the first character of our comment marker, we must + // dequeue the tail item, then flush, then enqueue. + SymToken tailToken = iCache.PopTail(); // -> this is the initial "/" that we pop... + FlushCache(); + + // Forward slash and asterisk are combined + tailToken.Combine( aToken ); + + // Mark the token as a full line comment + tailToken.Class = SymToken.TClass.EClassComment; + tailToken.Type = SymToken.TType.ETypeCommentBlock; + + // ...and re-added to the cache + iCache.Append( tailToken ); + + // aToken was already combined so we don't want the caller + // to add it twice. + tokenProcessed = true; + + // We're now in a full line comment. + InComment = true; + } + } + #endregion + } + else if ( aToken.Value == "/" ) + { + #region Handle Full-Line comment [ // ] + if ( iCache.Count > 0 ) + { + SymToken previousToken = PreviousOutputToken; + // + if ( previousToken.Value == aToken.Value ) + { + // "//" case + // + // In this scenario, in order to ensure that we do not + // flush the first character of our comment marker, we must + // dequeue the tail item, then flush, then enqueue. + SymToken tailToken = iCache.PopTail(); // -> this is the initial "/" that we pop... + FlushCache(); + + // Two forward slashes are combined into one. + tailToken.Combine( aToken ); + + // Mark the token as a full line comment + tailToken.Class = SymToken.TClass.EClassComment; + tailToken.Type = SymToken.TType.ETypeCommentFullLine; + + // ...and re-added to the cache + iCache.Append( tailToken ); + + // aToken was already combined so we don't want the caller + // to add it twice. + tokenProcessed = true; + + // We're now in a full line comment. + InComment = true; + } + } + #endregion + } + } + else if ( aToken.Class == SymToken.TClass.EClassPreProcessor ) + { + #region Handle start of preprocessor directive + // Preprocessor directives must only appear on a line + // after whitespace. If there was any non-whitespace + // characters before the preprocessor directive, then its illegal. + bool tokensAreAllWhiteSpace = iCache.CheckTokensAreOfEitherClass( SymToken.TClass.EClassWhiteSpace, SymToken.TClass.EClassNewLine ); + if ( aToken.Value == "#" && tokensAreAllWhiteSpace ) + { + // Starting a preprocess directive + FlushCache(); + InPreProcessorDirective = true; + } + #endregion + } + } + + return tokenProcessed; + } + + #endregion + + #region Internal state properties + private bool InQuotation + { + get + { + bool ret = ( ( iFlags & TStateFlag.EStateFlagInQuotation ) == TStateFlag.EStateFlagInQuotation ); + return ret; + } + set + { + if ( value ) + { + iFlags |= TStateFlag.EStateFlagInQuotation; + } + else + { + iFlags &= ~TStateFlag.EStateFlagInQuotation; + } + } + } + + private bool InComment + { + get + { + bool ret = ( ( iFlags & TStateFlag.EStateFlagInComment ) == TStateFlag.EStateFlagInComment ); + return ret; + } + set + { + if ( value ) + { + iFlags |= TStateFlag.EStateFlagInComment; + } + else + { + iFlags &= ~TStateFlag.EStateFlagInComment; + } + } + } + + private bool InPreProcessorDirective + { + get + { + bool ret = ( ( iFlags & TStateFlag.EStateFlagInPreProcessorDirective ) == TStateFlag.EStateFlagInPreProcessorDirective ); + return ret; + } + set + { + if ( value ) + { + iFlags |= TStateFlag.EStateFlagInPreProcessorDirective; + } + else + { + iFlags &= ~TStateFlag.EStateFlagInPreProcessorDirective; + } + } + } + #endregion + + #region Data members + private SymLexedTokens iLexedTokens = new SymLexedTokens(); + private SymGrouperMastermindCache iCache = new SymGrouperMastermindCache(); + private TStateFlag iFlags = TStateFlag.EStateFlagUnspecified; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Grouper/SymGrouperMastermindCache.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Grouper/SymGrouperMastermindCache.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Threading; +using System.Collections; +using SymBuildParsingLib.Token; + +namespace SymBuildParsingLib.Grouper +{ + public class SymGrouperMastermindCache : SymTokenContainer + { + #region Constructors & destructor + public SymGrouperMastermindCache() + { + } + #endregion + + #region API + public int CountByType( SymToken aToken ) + { + int count = 0; + // + foreach( SymToken token in this ) + { + if ( aToken.Class == token.Class && + aToken.Type == token.Type && + aToken.Value == token.Value ) + { + ++count; + } + } + // + return count; + } + + public bool CheckTokensAreOfClass( SymToken.TClass aClass ) + { + bool tokensAreAllTheSameClass = CheckTokensAreOfClass( aClass, 0 ); + return tokensAreAllTheSameClass; + } + + public bool CheckTokensAreOfClass( SymToken.TClass aClass, int aStartIndex ) + { + bool tokensAreAllTheSameClass = true; + // + int count = Count; + for( int i=aStartIndex; i aStartIndex ); + System.Diagnostics.Debug.Assert( aEndIndex < count ); + + // Have to do this in two passes to ensure token + // text remains from left to right. + SymToken startingToken = this[ aStartIndex++ ]; + if ( aForceMerge == false ) + { + // Not force-merging, so need to find a valid combinable starting element + while( startingToken.CombiningAllowed == false && aStartIndex < aEndIndex ) + { + startingToken = this[ ++aStartIndex ]; + } + } + + // First pass - join tokens + for( int i=aStartIndex; i<=aEndIndex; i++ ) + { + SymToken thisToken = this[ i ]; + + // Ignore continuations during merging + if ( thisToken.Class != SymToken.TClass.EClassContinuation || aMergeInContinuations ) + { + if ( aForceMerge == false ) + { + startingToken.Combine( thisToken ); + } + else + { + startingToken.ForceCombine( thisToken ); + } + } + } + + // Second pass - discard merged tokens. + for( int i=aEndIndex-1; i>=aStartIndex; i-- ) + { + Remove( i ); + } + + //System.Diagnostics.Debug.WriteLine( "Merged: " + startingToken.Value ); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Lexer/ISymLexerPositionProvider.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Lexer/ISymLexerPositionProvider.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; +using SymBuildParsingLib.Utils; + +namespace SymBuildParsingLib.Lexer +{ + public interface ISymLexerPositionObserver + { + #region ISymLexerPositionProvider definition + void HandleEndOfLineDetected( SymTextPosition aEOLPosition ); + #endregion + } + + public interface ISymLexerPositionProvider + { + #region ISymLexerPositionProvider definition + void SetObserver( ISymLexerPositionObserver aObserver ); + SymTextPosition CurrentPosition { get; } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Lexer/SymLexedTokens.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Lexer/SymLexedTokens.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; +using SymBuildParsingLib.Token; + +namespace SymBuildParsingLib.Lexer +{ + public class SymLexedTokens + { + #region Observer interface + public delegate void TokenHandler( SymToken aNewToken ); + #endregion + + #region Events + public event TokenHandler iTokenHandlers; + #endregion + + #region Constructors & destructor + public SymLexedTokens() + { + } + #endregion + + #region API + public void Enqueue( SymToken aToken ) + { + iTokens.Enqueue( aToken ); + NotifyNewToken( aToken ); + } + + public SymToken Dequeue() + { + SymToken ret = (SymToken) iTokens.Dequeue(); + return ret; + } + #endregion + + #region Properties + public int Count + { + get { return iTokens.Count; } + } + #endregion + + #region Internal methods + private void NotifyNewToken( SymToken aToken ) + { + if ( iTokenHandlers != null ) + { + iTokenHandlers( aToken ); + } + } + #endregion + + #region Data members + private Queue iTokens = new Queue( 250 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Lexer/SymLexer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Lexer/SymLexer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Threading; +using System.Collections; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Lexer; +using SymBuildParsingLib.Utils; + +namespace SymBuildParsingLib.Lexer +{ + public class SymLexer : ISymLexerPositionObserver + { + #region Enumerations + public enum TEvent + { + EEventLexingStarted = 0, + EEventLexingNewLine, + EEventLexingToken, + EEventLexingComplete + }; + #endregion + + #region Observer interface + public delegate void LexerObserver( SymLexer aLexer, TEvent aEvent, SymToken aToken ); + #endregion + + #region Events + public event LexerObserver LexerObservers; + #endregion + + #region Constructors & destructor + public SymLexer( string aFileName ) + { + iStream = new SymStream( aFileName ); + // + PrepareDefaultWorkers(); + } + #endregion + + #region API + public void Lex() + { + StartWorkerThread(); + } + + internal void RegisterWorker( SymLexerWorker aWorker ) + { + iWorkers.Add( aWorker ); + } + + internal void FlushToken( SymToken aToken ) + { + ReportEvent( TEvent.EEventLexingToken, aToken ); + } + #endregion + + #region Properties + public string FileName + { + get { return iStream.FileName; } + } + + internal SymStream Stream + { + get { return iStream; } + } + + internal SymTextPosition CurrentPosition + { + get { return iPositionProvider.CurrentPosition; } + } + #endregion + + #region Internal threading related + private void DoLexing() + { + ReportEvent( TEvent.EEventLexingStarted, SymToken.NullToken() ); + + while( !Stream.EOF ) + { + char character = Stream.ReadChar(); + ProcessCharacter( character ); + } + + ReportEvent( TEvent.EEventLexingComplete, SymToken.NullToken() ); + } + + private void StartWorkerThread() + { + lock( this ) + { + if ( iWorkerThread == null ) + { + ThreadStart threadStart = new ThreadStart( DoLexing ); + iWorkerThread = new Thread( threadStart ); + iWorkerThread.Name = "SymLexerWorkerThread"; + iWorkerThread.IsBackground = true; + iWorkerThread.Priority = ThreadPriority.BelowNormal; + iWorkerThread.Start(); + } + } + } + #endregion + + #region Internal methods + private void PrepareDefaultWorkers() + { + SymLexerWorkerLine workerLine = new SymLexerWorkerLine( this ); + RegisterWorker( workerLine); + iPositionProvider = workerLine; + // + SymLexerWorkerWord workerWord = new SymLexerWorkerWord( this ); + RegisterWorker( workerWord ); + } + + private void ProcessCharacter( char aCharacter ) + { + int count = iWorkers.Count; + // + for( int i=0; i implicitly, the last + // character was an end of line. + AddNewEndOfLinePosition(); + } + else + { + iCurrentPosition.Inc(); + LastCharacter = aCharacter; + } + + return consumed; + } + + public override void StartedNewLine( SymTextPosition aEOLPosition ) + { + } + #endregion + + #region ISymLexerPositionProvider Members + public SymTextPosition CurrentPosition + { + get + { + return new SymTextPosition( iCurrentPosition ); + } + } + + public void SetObserver( ISymLexerPositionObserver aObserver ) + { + } + #endregion + + #region Internal methods + private void AddNewEndOfLinePosition() + { + iLineEndingPositions.Add( iCurrentPosition ); + Lexer.HandleEndOfLineDetected( iCurrentPosition ); + + iCurrentPosition.NewLine(); + iLastCharacter = '\0'; + } + #endregion + + #region Internal constants + const int KSymLineFeed = 0xA; + const int KSymCarriageReturn = 0xD; + #endregion + + #region Data members + private char iLastCharacter = '\0'; + private ArrayList iLineEndingPositions = new ArrayList( 1024 ); + private SymTextPosition iCurrentPosition = new SymTextPosition(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Lexer/SymLexerWorkerWord.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Lexer/SymLexerWorkerWord.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,174 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Utils; + +namespace SymBuildParsingLib.Lexer +{ + public class SymLexerWorkerWord : SymLexerWorker + { + #region Constructors & destructor + public SymLexerWorkerWord( SymLexer aLexer ) + : base( aLexer ) + { + } + #endregion + + #region API + #endregion + + #region SymLexerWorker Members + public override bool ProcessCharacter( char aCharacter ) + { + bool consumed = true; + // + if ( iCurrentWord.Length == 0 ) + { + // First letter of new word. Just take the character + AddToWord( aCharacter, CharacterClassType( aCharacter ) ); + } + else if ( char.IsWhiteSpace( aCharacter ) ) + { + // Was the last character also white space? + bool lastCharWasWhiteSpace = char.IsWhiteSpace( LastCharacter ); + if ( lastCharWasWhiteSpace ) + { + // We don't want to make a new word for each white space + // character, so begin to group them here. + } + else + { + // Last character wasn't whitespace, so we must have ended + // a word + MakeWord(); + } + + AddToWord( aCharacter, SymToken.TClass.EClassWhiteSpace ); + } + else if ( iCurrentWord.Length > 0 ) + { + // We're already processing a word. + bool thisCharIsLetterOrDigit = char.IsLetterOrDigit( aCharacter ); + bool lastCharWasLetterOrDigit = char.IsLetterOrDigit( LastCharacter ); + // + if ( thisCharIsLetterOrDigit && lastCharWasLetterOrDigit ) + { + // In the middle of an ascii word, keep going... + AddToWord( aCharacter, SymToken.TClass.EClassAlphaNumeric ); + } + else + { + // This char is text, but the last wasn't - make a new word + // from what we have and use this character as the basis + // for the next word. + MakeWord(); + AddToWord( aCharacter, CharacterClassType( aCharacter ) ); + } + } + // + return consumed; + } + + public override void StartedNewLine( SymTextPosition aEOLPosition ) + { + MakeWord(); + } + #endregion + + #region Internal methods + private static SymToken.TClass CharacterClassType( char aCharacter ) + { + SymToken.TClass ret = SymToken.TClass.EClassSymbol; + // + if ( char.IsWhiteSpace( aCharacter ) ) + { + ret = SymToken.TClass.EClassWhiteSpace; + } + else if ( char.IsLetterOrDigit( aCharacter ) ) + { + ret = SymToken.TClass.EClassAlphaNumeric; + } + // + return ret; + } + + private void AddToWord( char aCharacter, SymToken.TClass aClassType ) + { + iCurrentClass = aClassType; + iCurrentWord.Append( aCharacter ); + } + + private void MakeWord() + { + if ( iCurrentWord.Length > 0 ) + { + // Finished a word + SymToken token = new SymToken( iCurrentWord.ToString(), iCurrentClass, Lexer.CurrentPosition ); + Lexer.FlushToken( token ); + + // Reset + iCurrentWord.Remove( 0, iCurrentWord.Length ); + iCurrentClass = SymToken.TClass.EClassWhiteSpace; + } + } + #endregion + + #region Internal properties + private char LastCharacter + { + get + { + char ret = '\0'; + int length = iCurrentWord.Length; + // + if ( length > 0 ) + { + ret = iCurrentWord[ length - 1 ]; + } + // + return ret; + } + } + #endregion + + #region Internal enumerations + private enum TCharClass + { + ECharClassWhiteSpace = 0, + ECharClassText, + ECharClassDigit, + ECharClassComma, + ECharClassPeriod, + ECharClassHash, + ECharClassSlash, + ECharClassColon, + ECharClassSemiColon, + ECharClassTilde, + ECharClassMathematic + }; + #endregion + + #region Data members + private StringBuilder iCurrentWord = new StringBuilder( 200 ); + private SymToken.TClass iCurrentClass = SymToken.TClass.EClassWhiteSpace; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Document/SymBuildFileDocument.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Document/SymBuildFileDocument.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymbianTree; +using SymBuildParsingLib.Common.Objects; +using SymBuildParsingLib.Utils; +using SymBuildParsingLib.Parser.Framework.Document; +using SymBuildParsingLib.Parser.PreProcessor.Document; + + +namespace SymBuildParsingLib.Parser.BuildFile.Document +{ + public sealed class SymBuildFileDocument : SymPreProcessorDocument + { + #region Constructors and destructor + public SymBuildFileDocument( SymParserDocumentContext aContext ) + : base( aContext ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Nodes/SymNodeBuildFileEntities.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Nodes/SymNodeBuildFileEntities.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymBuildParsingLib.Tree; +using SymbianTree; + +namespace SymBuildParsingLib.Parser.BuildFile.Nodes +{ + public abstract class SymNodeBuildFileEntity : SymNodeAddAsChild + { + #region Constructors & destructor + public SymNodeBuildFileEntity() + { + } + #endregion + + #region API + #endregion + } + + public sealed class SymNodeBuildFileEntityTest : SymNodeBuildFileEntity + { + #region Constructors & destructor + public SymNodeBuildFileEntityTest() + { + } + #endregion + + #region API + #endregion + } + + public sealed class SymNodeBuildFileEntityRelease : SymNodeBuildFileEntity + { + #region Constructors & destructor + public SymNodeBuildFileEntityRelease() + { + } + #endregion + + #region API + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Nodes/SymNodeBuildFileExport.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Nodes/SymNodeBuildFileExport.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using SymbianTree; +using SymBuildParsingLib.Utils; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Parser.BuildFile.Document; + +namespace SymBuildParsingLib.Parser.BuildFile.Nodes +{ + public sealed class SymNodeBuildFileExport : SymNodeAddAsChild + { + #region Enumerations + public enum TType + { + ETypeFile = 0, + ETypeZipFile + } + #endregion + + #region Constructors & destructor + public SymNodeBuildFileExport() + { + } + + public SymNodeBuildFileExport( TType aType ) + { + iType = aType; + } + #endregion + + #region API + public TType Type + { + get { return iType; } + set { iType = value; } + } + + public string FileName + { + get { return iFileName; } + set + { + if ( !( Root is SymBuildFileDocument ) ) + { + throw new ArgumentException( "Node must be added to tree before using this API" ); + } + + // Get bld.inf file name + SymBuildFileDocument doc = (SymBuildFileDocument) Root; + string bldInfPath = Path.GetFullPath( doc.Context.FileName ); + + // Try to intepret MMP file name + bool valid = false; + string rootPath = Path.GetPathRoot( value ); + bool isRooted = Path.IsPathRooted( value ); + // + if ( isRooted == false || rootPath == string.Empty || rootPath == @"\" ) + { + // If a source file is listed with a relative path, the path will be considered relative to the directory containing the bld.inf file. + + iFileName = SymFileSystemUtils.MergePaths( bldInfPath, value ); + valid = true; + } + else if ( isRooted ) + { + iFileName = SymFileSystemUtils.MergePaths( SymEnvironment.RootPath, value ); + valid = true; + } + + // Throw errors if we didn't find a valid match + if ( valid == false ) + { + throw new ArgumentException( "Invalid file name: " + value ); + } + } + } + + public string DestinationPath + { + get { return iDestinationPath; } + set + { + // If a destination file is not specified, the source file will be copied to epoc32\include\. + bool valid = false; + string rootPath = Path.GetPathRoot( value ); + // + if ( Path.IsPathRooted( value ) == false || rootPath == string.Empty || rootPath == @"\" ) + { + // If a destination file is specified with the relative path, the path will be considered relative to directory epoc32\include\. + iDestinationPath = SymFileSystemUtils.MergePaths( SymEnvironment.Epoc32IncludePath, value ); + valid = true; + } + else if ( rootPath.Length == 2 || rootPath.Length == 3 && rootPath[1] == ':' ) + { + // If a destination begins with a drive letter, then the file is copied to epoc32\data\\. For example, + // + // mydata.dat e:\appdata\mydata.dat + // copies mydata.dat to epoc32\data\e\appdata\mydata.dat. + // + // You can use any driveletter between A and Z. + + string drive = rootPath[ 0 ].ToString().ToLower(); + string pathWithoutDrive = SymFileSystemUtils.DirectoryFromPath( rootPath ); + + // Check drive letter is valid + bool driveIsValid = SymFileSystemUtils.IsDriveValid( drive ); + if ( driveIsValid ) + { + iDestinationPath = SymEnvironment.Epoc32DataPath + drive + pathWithoutDrive; + valid = true; + } + } + + // Throw errors if we didn't find a valid match + if ( valid == false ) + { + throw new ArgumentException( "Invalid destination path: " + value ); + } + } + } + #endregion + + #region Data members + private TType iType = TType.ETypeFile; + private string iFileName = string.Empty; + private string iDestinationPath = SymEnvironment.Epoc32IncludePath; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Nodes/SymNodeBuildFileMMP.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Nodes/SymNodeBuildFileMMP.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using SymbianTree; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Utils; +using SymBuildParsingLib.Parser.BuildFile.Document; + +namespace SymBuildParsingLib.Parser.BuildFile.Nodes +{ + public abstract class SymNodeBuildFileMMPEntity : SymNodeAddAsChild + { + #region Constructors & destructor + public SymNodeBuildFileMMPEntity() + { + } + #endregion + + #region Internal enumerations + [Flags] + private enum TAttributes + { + EAttributeNone = 0, + EAttributeTidy = 1, + EAttributeBuildAsARM = 2 + } + #endregion + + #region Properties + public bool AttribsBuildAsARM + { + get + { + bool ret = ( iAttributes & TAttributes.EAttributeBuildAsARM ) == TAttributes.EAttributeBuildAsARM; + return ret; + } + set + { + iAttributes &= ~TAttributes.EAttributeBuildAsARM; + } + } + + public bool AttribsTidy + { + get + { + bool ret = ( iAttributes & TAttributes.EAttributeTidy ) == TAttributes.EAttributeTidy; + return ret; + } + set + { + iAttributes &= ~TAttributes.EAttributeTidy; + } + } + + public string FileName + { + get { return iFileName; } + set + { + if ( !( Root is SymBuildFileDocument ) ) + { + throw new ArgumentException( "Node must be added to tree before using this API" ); + } + + // Get bld.inf file name + SymBuildFileDocument doc = (SymBuildFileDocument) Root; + string bldInfPath = Path.GetFullPath( doc.Context.FileName ); + + // Try to intepret MMP file name + bool valid = false; + string rootPath = Path.GetPathRoot( value ); + bool isRooted = Path.IsPathRooted( value ); + // + if ( isRooted == false || rootPath == string.Empty || rootPath == @"\" ) + { + // If a relative path is specified with an .mmp file, the path will be considered relative to the directory containing the bld.inf file. + // For example, if in the prj_mmpfiles section, a certain Hello.mmp file is specified as a relative path: + // + // PRJ_MMPFILES + // ProjSpec\Hello.mmp + // and if the bld.inf file is in \MyComp\, then the full path for the location of Hello.mmp will be \MyComp\ProjSpec\Hello.mmp. + + iFileName = SymFileSystemUtils.MergePaths( bldInfPath, value ); + valid = true; + } + else if ( isRooted ) + { + iFileName = SymFileSystemUtils.MergePaths( SymEnvironment.RootPath, value ); + valid = true; + } + + // Throw errors if we didn't find a valid match + if ( valid == false ) + { + throw new ArgumentException( "Invalid file name: " + value ); + } + } + } + #endregion + + #region Data members + private TAttributes iAttributes = TAttributes.EAttributeNone; + private string iFileName = string.Empty; + #endregion + } + + public sealed class SymNodeBuildFileMMP : SymNodeBuildFileMMPEntity + { + #region Constructors & destructor + public SymNodeBuildFileMMP() + { + } + #endregion + } + + public sealed class SymNodeBuildFileMakefile : SymNodeBuildFileMMPEntity + { + #region Constructors & destructor + public SymNodeBuildFileMakefile() + { + } + #endregion + } + + public sealed class SymNodeBuildFileNMakefile : SymNodeBuildFileMMPEntity + { + #region Constructors & destructor + public SymNodeBuildFileNMakefile() + { + } + #endregion + } + + public sealed class SymNodeBuildFileGNUMakefile : SymNodeBuildFileMMPEntity + { + #region Constructors & destructor + public SymNodeBuildFileGNUMakefile() + { + } + #endregion + } + +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Nodes/SymNodeBuildFilePlatformList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Nodes/SymNodeBuildFilePlatformList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Specialized; +using SymBuildParsingLib.Tree; +using SymbianTree; + +namespace SymBuildParsingLib.Parser.BuildFile.Nodes +{ + public sealed class SymNodeBuildFilePlatformList : SymNodeAddAsChild + { + #region Constructors & destructor + public SymNodeBuildFilePlatformList() + { + } + #endregion + + #region API + public void Add( string aPlatform ) + { + if ( iPlatforms.IndexOf( aPlatform ) < 0 ) + { + iPlatforms.Add( aPlatform ); + } + } + + public void Remove( string aPlatform ) + { + if ( iPlatforms.IndexOf( aPlatform ) >= 0 ) + { + iPlatforms.Remove( aPlatform ); + } + } + + public bool IsPresent( string aPlatform ) + { + return ( iPlatforms.IndexOf( aPlatform ) >= 0 ); + } + + public string At( int aIndex ) + { + // NB. Cannot use indexer because it would hide SymNode::this[ int ] + return iPlatforms[ aIndex ]; + } + #endregion + + #region Properties + public int Count + { + get { return iPlatforms.Count; } + } + #endregion + + #region Data members + private StringCollection iPlatforms = new StringCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Parser/SymBuildFileParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Parser/SymBuildFileParser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymbianTree; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Parser.Framework.Workers; +using SymBuildParsingLib.Parser.Framework.Document; +using SymBuildParsingLib.Parser.PreProcessor.Parser; +using SymBuildParsingLib.Parser.PreProcessor.Workers; +using SymBuildParsingLib.Parser.BuildFile.Workers; +using SymBuildParsingLib.Common.Objects; + + +namespace SymBuildParsingLib.Parser.BuildFile.Parser +{ + public class SymBuildFileParser : SymPreProcessorParser + { + public SymBuildFileParser( SymParserDocument aDocument ) + : base( aDocument ) + { + } + + #region From SymParserBase + protected override string ParserName + { + get { return this.ToString(); } + } + + protected override void PrepareInitialWorkers() + { + SymParserWorkerContext context = new SymParserWorkerContext( Document.Context ); + SymWorkerBuildFileMain mainWorker = new SymWorkerBuildFileMain( context ); + // + QueueWorker( mainWorker ); + + // Make a base call + base.PrepareInitialWorkers(); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Workers/SymWorkerBuildFileMain.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Workers/SymWorkerBuildFileMain.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Parser.Framework; +using SymBuildParsingLib.Parser.Framework.Workers; + +namespace SymBuildParsingLib.Parser.BuildFile.Workers +{ + public class SymWorkerBuildFileMain : SymParserWorker + { + #region Constructors & destructor + public SymWorkerBuildFileMain( SymParserWorkerContext aContext ) + : base( aContext ) + { + } + #endregion + + #region From SymParserWorker + public override SymParserWorker.TTokenConsumptionType OfferToken( SymToken aToken ) + { + // Offer the token to the base class first. If it doesn't want it, we'll + // check it. + TTokenConsumptionType ret = base.OfferToken( aToken ); + if ( ret == TTokenConsumptionType.ETokenNotConsumed ) + { + if ( aToken.Class != SymToken.TClass.EClassComment ) + { + // Try to find a new child worker to handle this kind + // of data. + SymParserWorker worker = CreateWorkerByTokenType( aToken ); + if ( worker != null ) + { + System.Diagnostics.Debug.WriteLine( "SymWorkerBuildFileMain.OfferToken() - FOUND HANDLER FOR: " + aToken.Value ); + + AddChild( worker ); + ret = TTokenConsumptionType.ETokenConsumed; + } + } + } + // + return ret; + } + #endregion + + #region Internal methods + private SymParserWorker CreateWorkerByTokenType( SymToken aToken ) + { + // Find a worker to handle the token type + SymParserWorkerContext context = new SymParserWorkerContext( WorkerContext.Document.Context, this, aToken ); + // + SymParserWorker worker = null; + switch( aToken.Value.ToLower() ) + { + // Simple preprocessor operations + case "prj_platforms": + break; + case "prj_exports": + break; + case "prj_testexports": + break; + case "prj_mmpfiles": + break; + case "prj_testmmpfiles": + break; + + // Skip unhandled preprocessor directives + default: + break; + } + // + return worker; + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Workers/SymWorkerBuildFilePlatforms.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/BuildFile/Workers/SymWorkerBuildFilePlatforms.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Parser.Framework; +using SymBuildParsingLib.Parser.Framework.Workers; + +namespace SymBuildParsingLib.Parser.BuildFile.Workers +{ + public class SymWorkerBuildFilePlatforms : SymParserWorkerConsumer + { + #region Constructors & destructor + public SymWorkerBuildFilePlatforms( SymParserWorkerContext aContext ) + : base( aContext, SymToken.TClass.EClassNewLine ) + { + } + #endregion + + #region From SymParserWorker + public override SymParserWorker.TTokenConsumptionType OfferToken( SymToken aToken ) + { + return TTokenConsumptionType.ETokenConsumed; + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Document/SymParserDocument.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Document/SymParserDocument.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections; +using SymbianTree; + +namespace SymBuildParsingLib.Parser.Framework.Document +{ + public abstract class SymParserDocument : SymDocument + { + #region Constructors & destructor + public SymParserDocument( SymParserDocumentContext aContext ) + { + aContext.Document = this; + iContextStack.Push( aContext ); + } + #endregion + + #region API + public void PushContext( SymParserDocumentContext aContext ) + { + iContextStack.Push( aContext ); + } + + public SymParserDocumentContext PopContext() + { + SymParserDocumentContext top = (SymParserDocumentContext) iContextStack.Peek(); + return PopContext( top ); + } + + public SymParserDocumentContext PopContext( SymParserDocumentContext aExpected ) + { + // Can't pop off the last context + System.Diagnostics.Debug.Assert( iContextStack.Count > 1 ); + SymParserDocumentContext top = (SymParserDocumentContext) iContextStack.Peek(); + // + if ( aExpected.Equals( aExpected ) == false ) + { + throw new ArgumentException( "Cannot pop context - expectations not met during pop operation" ); + } + // + iContextStack.Pop(); + return top; + } + #endregion + + #region Properties + public SymParserDocumentContext Context + { + get + { + System.Diagnostics.Debug.Assert( iContextStack.Count > 0 ); + SymParserDocumentContext ret = (SymParserDocumentContext) iContextStack.Peek(); + return ret; + } + } + #endregion + + #region Data members + private Stack iContextStack = new Stack(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Document/SymParserDocumentContext.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Document/SymParserDocumentContext.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymbianTree; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Common.Objects; +using SymBuildParsingLib.Parser.Framework.Parser; + +namespace SymBuildParsingLib.Parser.Framework.Document +{ + public class SymParserDocumentContext + { + #region Constructors & destructor + public SymParserDocumentContext( string aFileName ) + { + iFileName = aFileName; + + // Construct empty directories + iDefineDirectory = new SymDefineDirectory(); + iIncludeDirectory = new SymIncludeDirectory(); + } + + public SymParserDocumentContext( string aFileName, SymDefineDirectory aDefineDirectory, SymIncludeDirectory aIncludeDirectory ) + { + iFileName = aFileName; + // + iDefineDirectory = aDefineDirectory; + iIncludeDirectory = aIncludeDirectory; + } + + public SymParserDocumentContext( SymParserDocumentContext aContext ) + { + iFileName = aContext.FileName; + // + iDefineDirectory = aContext.DefineDirectory; + iIncludeDirectory = aContext.IncludeDirectory; + // + iDocument = aContext.Document; + iParser = aContext.Parser; + } + + public SymParserDocumentContext( string aFileName, SymParserDocumentContext aContext ) + { + iFileName = aFileName; + // + iDefineDirectory = aContext.DefineDirectory; + iIncludeDirectory = aContext.IncludeDirectory; + // + iDocument = aContext.Document; + iParser = aContext.Parser; + } + #endregion + + #region Properties + public SymNode CurrentNode + { + get { return iDocument.CurrentNode; } + set { iDocument.CurrentNode = value; } + } + + public SymDefineDirectory DefineDirectory + { + get { return iDefineDirectory; } + } + + public SymIncludeDirectory IncludeDirectory + { + get { return iIncludeDirectory; } + } + + public string FileName + { + get { return iFileName; } + } + + public SymParserDocument Document + { + get { return iDocument; } + set { iDocument = value; } + } + + public SymParserBase Parser + { + get { return iParser; } + set { iParser = value; } + } + #endregion + + #region Data members + private readonly string iFileName; + private SymParserDocument iDocument; + private readonly SymDefineDirectory iDefineDirectory; + private readonly SymIncludeDirectory iIncludeDirectory; + private SymParserBase iParser; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Nodes/SymNodeCondition.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Nodes/SymNodeCondition.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Utils; +using SymBuildParsingLib.Parser.Framework.Document; +using SymBuildParsingLib.Parser.Framework.Workers; +using SymbianTree; + +namespace SymBuildParsingLib.Parser.Framework.Nodes +{ + public class SymNodeCondition : SymNodeAddAsChild + { + #region Enumerations + public enum TType + { + ETypeUnknown = -1, + ETypeIf = 0, + ETypeIfdef, + ETypeIfndef, + ETypeElseIf, + ETypeElse + } + #endregion + + #region Constructors & destructor + public SymNodeCondition( TType aType ) + { + iType = aType; + } + + public SymNodeCondition( string aName ) + : this( SymNodeCondition.TypeByName( aName ) ) + { + if ( Type == TType.ETypeUnknown ) + { + throw new ArgumentException( "Invalid condition name: " + aName ); + } + } + #endregion + + #region API + public void MakeConditionalArgumentCurrent( SymParserDocument aDocument ) + { + SymNodeConditionalExpression condExpNode = SymParserWorkerConditionalExpression.FindMostRecentConditionalExpression( this ); + if ( condExpNode == null ) + { + throw new Exception( "Unable to locate conditional expression. Document is corrupt" ); + } + + aDocument.CurrentNode = condExpNode; + } + + static public TType TypeByName( string aName ) + { + TType ret = TType.ETypeUnknown; + // + switch( aName ) + { + case "if": + ret = TType.ETypeIf; + break; + case "ifdef": + ret = TType.ETypeIfdef; + break; + case "ifndef": + ret = TType.ETypeIfndef; + break; + case "elif": + case "else if": + ret = TType.ETypeElseIf; + break; + case "else": + ret = TType.ETypeElse; + break; + default: + break; + } + // + return ret; + } + + public void AssignArgumentTokens( SymTokenBalancerDocument aDocument ) + { + Data = aDocument; + } + + public virtual void Evaluate( SymParserDocumentContext aContext ) + { + IsEvaluated = false; + + // Evaluate the expression, taking into account the current #define'd + // values. Prepares a new document with these expressions evaluated. + SymTokenDocument evalDoc = BalancedArguments.ExtractTokensAsDocument( false, true ); + string expression = evalDoc.ChildrenAsString( false, true ); + + // Get evaluated result from evaluator + iEvaluationResult = SymExpressionEvaluator.EvaluateAsBoolean( expression ); + + IsEvaluated = true; + } + #endregion + + #region Properties + public TType Type + { + get { return iType; } + } + + public bool EvaluationResult + { + get { return iEvaluationResult; } + set { iEvaluationResult = value; } + } + + public bool IsEvaluated + { + get { return iIsEvaluated; } + set { iIsEvaluated = value; } + } + + public SymTokenBalancerDocument BalancedArguments + { + get { return (SymTokenBalancerDocument) Data; } + } + #endregion + + #region Data members + private bool iIsEvaluated = false; + private bool iEvaluationResult = true; + private readonly TType iType; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Nodes/SymNodeConditionalExpression.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Nodes/SymNodeConditionalExpression.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Token; +using SymbianTree; + +#region Example layout +// +// SymNodeConditionalExpression +// | +// +----- [if] SymNodeCondition [neg] +// +---------- { +// +---------- do something +// +---------- [if] SymNodeCondition [pos, but inherits neg] +// +--------------- { +// +--------------- do something else +// +--------------- } +// +---------- } +// | +// +----- [else if] SymNodeCondition [neg] +// +---------- { +// +---------- do something else +// +---------- } +// | +// +----- [else if] SymNodeCondition [pos] +// +---------- { +// +---------- do something else +// +---------- } +// | +// +----- [else] SymNodeCondition [neg] +// +---------- { +// +---------- do something else +// +---------- } +// +#endregion + +namespace SymBuildParsingLib.Parser.Framework.Nodes +{ + public class SymNodeConditionalExpression : SymNodeToken + { + #region Constructors & destructor + public SymNodeConditionalExpression( SymToken aType ) + : base( aType ) + { + } + #endregion + + #region Properties + public bool InheritedValue + { + get { return iInheritedValue; } + set { iInheritedValue = value; } + } + + public bool HasPositiveBranch + { + get + { + bool found = ( PositiveBranch != null ); + return found; + } + } + + public SymNodeCondition PositiveBranch + { + get + { + SymNodeCondition found = null; + // + foreach( SymNode c in this ) + { + if ( c is SymNodeCondition ) + { + SymNodeCondition cond = (SymNodeCondition) c; + if ( cond.IsEvaluated && cond.EvaluationResult == true ) + { + found = cond; + break; + } + } + } + // + return found; + } + } + + public bool HasCondition + { + get + { + int count = ChildCountByType( typeof(SymNodeCondition) ); + return count > 0; + } + } + + public SymNodeCondition CurrentCondition + { + get + { + SymNodeCondition ret = (SymNodeCondition) LastChild; + return ret; + } + } + #endregion + + #region Data members + private bool iInheritedValue; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Parser/SymParserBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Parser/SymParserBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,309 @@ +#define SHOW_TOKENS/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections; +using System.Threading; +using System.Reflection; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Utils; +using SymBuildParsingLib.Grouper; +using SymBuildParsingLib.Lexer; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Parser.Framework.Workers; +using SymBuildParsingLib.Parser.Framework.Document; +using SymbianTree; + +namespace SymBuildParsingLib.Parser.Framework.Parser +{ + public abstract class SymParserBase + { + #region Event enumerations + public enum TEvent + { + EEventStaringLexing = 0, + EEventStaringGrouping, + EEventParsingComplete + }; + #endregion + + #region Observer interface + public delegate void ParserObserver( SymParserBase aParser, TEvent aEvent ); + #endregion + + #region Events + public event ParserObserver ParserObservers; + #endregion + + #region Constructors and destructor + public SymParserBase( SymParserDocument aDocument ) + { + // Store the document and initialise the document's + // parser reference + iDocument = aDocument; + iDocument.Context.Parser = this; + + // The lexer reads the tokens from the stream and performs minimal + // (very basic) grouping. + iLexer = new SymLexer( iDocument.Context.FileName ); + + // We observe the lexer in order to know when all the input data + // has been consumed from the source file. + iLexer.LexerObservers += new SymLexer.LexerObserver( HandleLexerEvent ); + + // The grouper performs more sophisticated grouping based upon + // simple C++/C rules. It observes the lexer for tokens. + iGrouper = new SymGrouper( iLexer ); + + // We observe the grouper in order to obtain the grouped tokens + // which we will parse to form the tree. + iGrouper.GrouperObservers += new SymGrouper.GrouperObserver( HandleGrouperEvent ); + + // Create the thread for the parser + iWorkerThread = new Thread( new System.Threading.ThreadStart( BuildParserTree ) ); + PrepareWorkerThread(); + + // Create any initial required workers + PrepareInitialWorkers(); + } + #endregion + + #region API + public void Parse() + { + // Starting the lexer will implicitly start the grouper + // as the grouper is already awaiting the lexer's output + // tokens. Tokens will arrive into the iGroupedTokens data + // member. This call is asynchronous. + iLexer.Lex(); + } + #endregion + + #region Clone API + public SymParserBase CarbonCopy( object[] aArguments ) + { + // NB. Should use object.Clone with custom IClonable charactersitics? + System.Type type = this.GetType(); + object objectInstance = Activator.CreateInstance( type, aArguments ); + // + if ( !(objectInstance is SymParserBase) ) + { + throw new Exception( "Unexpected object type during Carbon Copy operation" ); + } + // + SymParserBase parser = (SymParserBase) objectInstance; + return parser; + } + #endregion + + #region Abstract API + protected virtual void PrepareInitialWorkers() + { + } + + protected virtual void HandleParserToken( SymToken aToken ) + { + // Try to dish the token out to the workers. Give + // the token to the highest priority worker initially. + // Keep trying to offer it until one of the workers + // consumes it. + int count = iWorkers.Count; + for( int i=0; i= existingPriority ) + { + iWorkers.Insert( i, aWorker ); + return; + } + } + + // First entry - just append it... + iWorkers.Add( aWorker ); + } + #endregion + + #region Internal Properties + protected SymTokenContainer GroupedTokens + { + get { return iGroupedTokens; } + } + #endregion + + #region Internal methods + private void BuildParserTree() + { + // Pull a token from the source buffer + do + { + int tokenCount = 0; + // + do + { + SymToken token = null; + + // Try to get the head token (if there is one) + lock( iGroupedTokens ) + { + tokenCount = iGroupedTokens.Count; + if ( tokenCount > 0 ) + { + token = iGroupedTokens.PopHead(); + } + } + + // Then process it + if ( token != null ) + { +#if SHOW_TOKENS + System.Diagnostics.Debug.WriteLine( "BuildParserTree() - next token is: [" + token.Value + "]"); +#endif + HandleParserToken( token ); + } + } + while ( tokenCount > 0 ); + + // We've processed all the tokens we had so far... put us to sleep + //System.Diagnostics.Debug.WriteLine( "Parser.BuildParserTree() - no more tokens - waiting on semaphore..." ); + iSemaphore.Wait(); + //System.Diagnostics.Debug.WriteLine( "Parser.BuildParserTree() - AWAKE!" ); + } + while( true ); + + } + + private void PrepareWorkerThread() + { + System.Random randomNumberGen = new Random( System.Environment.TickCount ); + int uniquePostfix = randomNumberGen.Next(); + // + string workerThreadName = ParserName + uniquePostfix.ToString("d8"); + iWorkerThread.Name = workerThreadName; + iWorkerThread.IsBackground = true; + iWorkerThread.Start(); + } + private void ReportEvent( TEvent aEvent ) + { + if ( ParserObservers != null ) + { + ParserObservers( this, aEvent ); + } + } + private void NewGroupedTokenArrived( SymToken aToken ) + { + lock( this ) + { + iGroupedTokens.Append( aToken ); + // + if ( iSemaphore.Count == 0 ) + { + iSemaphore.Signal(); + } + } + } + #endregion + + #region Event handlers + private void HandleLexerEvent( SymLexer aLexer, SymLexer.TEvent aEvent, SymToken aToken ) + { + switch( aEvent ) + { + case SymLexer.TEvent.EEventLexingStarted: + ReportEvent( TEvent.EEventStaringLexing ); + break; + case SymLexer.TEvent.EEventLexingNewLine: + break; + case SymLexer.TEvent.EEventLexingComplete: + break; + default: + break; + } + } + + private void HandleGrouperEvent( SymGrouper aGrouper, SymGrouper.TEvent aEvent, SymToken aGroupedToken ) + { + switch( aEvent ) + { + case SymGrouper.TEvent.EEventGroupingStarted: + ReportEvent( TEvent.EEventStaringGrouping ); + break; + case SymGrouper.TEvent.EEventGroupingPaused: + break; + case SymGrouper.TEvent.EEventGroupingComplete: + ReportEvent( TEvent.EEventParsingComplete ); + break; + case SymGrouper.TEvent.EEventGroupingTokenReady: + NewGroupedTokenArrived( aGroupedToken ); + break; + default: + break; + } + } + #endregion + + #region Data members + private readonly Thread iWorkerThread; + private readonly SymGrouper iGrouper; + private readonly SymLexer iLexer; + private readonly SymParserDocument iDocument; + private SymTokenContainer iGroupedTokens = new SymTokenContainer(); + private ArrayList iWorkers = new ArrayList( 4 ); + private SymSemaphore iSemaphore = new SymSemaphore( 0, 1 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Parser/SymParserWaiter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Parser/SymParserWaiter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymbianTree; +using SymBuildParsingLib.Utils; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Common.Objects; +using SymBuildParsingLib.Parser.Framework.Parser; + +namespace SymBuildParsingLib.Parser.Framework.Parser +{ + public class SymParserWaiter + { + #region Constructors & destructor + public SymParserWaiter( SymParserBase aParser ) + { + iParser = aParser; + // + iParser.ParserObservers += new SymBuildParsingLib.Parser.Framework.Parser.SymParserBase.ParserObserver( HandleParserEvent ); + } + #endregion + + #region API + public void Wait() + { + iSemaphore.Wait(); + } + #endregion + + #region Parser event handler + private void HandleParserEvent(SymParserBase aParser, SymBuildParsingLib.Parser.Framework.Parser.SymParserBase.TEvent aEvent) + { + if ( aEvent == SymParserBase.TEvent.EEventParsingComplete ) + { + iSemaphore.Signal(); + } + } + #endregion + + #region Data members + private readonly SymParserBase iParser; + private SymSemaphore iSemaphore = new SymSemaphore( 0, 1 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Utils/SymFunctionParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Utils/SymFunctionParser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,290 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Common.Objects; +using SymbianTree; + +namespace SymBuildParsingLib.Parser.Framework.Utils +{ + public class SymFunctionParser : SymTokenBalancer + { + #region Observer interface + public delegate void ArgumentAvailable( SymArgument aArgument, SymToken aDelimitingToken ); + #endregion + + #region Events + public event ArgumentAvailable EventArgumentAvailableHandler; + #endregion + + #region Constructors & destructor + public SymFunctionParser() + { + } + #endregion + + #region API + public virtual void RegisterFunctionParserTokens() + { + // Base class registration + RegisterBalancerTokens(); + + // These are the important tokens relating to function arguments + SymToken bracketTokenOpening = new SymToken( "(", SymToken.TClass.EClassSymbol, SymToken.TType.ETypeUnidentified ); + SymToken bracketTokenClosing = new SymToken( ")", SymToken.TClass.EClassSymbol, SymToken.TType.ETypeUnidentified ); + SymToken squareBracketTokenOpening = new SymToken( "[", SymToken.TClass.EClassSymbol, SymToken.TType.ETypeUnidentified ); + SymToken squareBracketTokenClosing = new SymToken( "]", SymToken.TClass.EClassSymbol, SymToken.TType.ETypeUnidentified ); + SymToken templateBracketTokenOpening = new SymToken( "<", SymToken.TClass.EClassSymbol, SymToken.TType.ETypeUnidentified ); + SymToken templateBracketTokenClosing = new SymToken( ">", SymToken.TClass.EClassSymbol, SymToken.TType.ETypeUnidentified ); + + // We want to track levels for square brackets and template arguments in order to ensure we balance correctly. + // We don't want to remove any redundancy here as these may have special meaning. + RegisterOpeningToken( squareBracketTokenOpening, squareBracketTokenClosing, true, true, TLevelExpectations.ELevelExpectationsAboveLevelNumber, 0, TAssociatedBehaviour.EBehaviourNone ); + RegisterClosingToken( squareBracketTokenClosing, squareBracketTokenOpening, true, true, TLevelExpectations.ELevelExpectationsAboveLevelNumber, 0, TAssociatedBehaviour.EBehaviourNone ); + RegisterOpeningToken( templateBracketTokenOpening, templateBracketTokenClosing, true, true, TLevelExpectations.ELevelExpectationsAboveLevelNumber, 0, TAssociatedBehaviour.EBehaviourNone ); + RegisterClosingToken( templateBracketTokenClosing, templateBracketTokenOpening, true, true, TLevelExpectations.ELevelExpectationsAboveLevelNumber, 0, TAssociatedBehaviour.EBehaviourNone ); + + // Define our argument separation token(s). + TAssociatedBehaviour flags = TAssociatedBehaviour.EBehaviourNone; + flags |= TAssociatedBehaviour.EBehaviourCreateSubTree; + flags |= TAssociatedBehaviour.EBehaviourRemoveReduntantBracketing; + // + SymToken commaDelimiterToken = new SymToken( ",", SymToken.TClass.EClassSymbol, SymToken.TType.ETypeUnidentified ); + RegisterArgumentSeparatorToken( commaDelimiterToken, new SymTokenBalancerMatchCriteria( SymToken.NullToken(), false, true, TLevelExpectations.ELevelExpectationsAtLevel, 1, flags ) ); + RegisterArgumentSeparatorToken( commaDelimiterToken, new SymTokenBalancerMatchCriteria( SymToken.NullToken(), true, true, TLevelExpectations.ELevelExpectationsAboveLevelNumber, 1, TAssociatedBehaviour.EBehaviourNone ) ); + } + + public virtual SymArgument MakeArgument() + { + SymNode levelNodeToObtainArgumentsFrom = CurrentNode; + + // Try to work out whether we have a leve node at the current + // scope which should be preferred t + object levelNodeObject = levelNodeToObtainArgumentsFrom.ChildByType( typeof(SymTokenBalancerMarkerLevelNode) ); + if ( levelNodeObject != null ) + { + levelNodeToObtainArgumentsFrom = (SymNode) levelNodeObject; + } + + return MakeArgument( levelNodeToObtainArgumentsFrom ); + } + + public virtual SymArgument MakeArgument( SymNode aLevelToMakeArgumentsFrom ) + { + SymArgument argument = new SymArgument(); + + // Convert (recursively) any emitted elements to real tokens + if ( aLevelToMakeArgumentsFrom is SymTokenBalancerMarkerLevelNode ) + { + SymTokenBalancerMarkerLevelNode levelNode = (SymTokenBalancerMarkerLevelNode) aLevelToMakeArgumentsFrom; + levelNode.ConvertEmittedElementsToRealTokenNodes( true /*recurse*/ ); + } + + // Now actually obtain the argument tokens + int count = aLevelToMakeArgumentsFrom.ChildCount; + int i = 0; + // + while( i < count ) + { + SymNode n = aLevelToMakeArgumentsFrom[ 0 ]; + + // We always remove any other nodes, irrespective of their type. + // This is to ensure that the document tree does not get cluttered + // with redundant argument token info. + n.Remove(); + + // Now we decide what to do... + if ( n is SymTokenBalancerMarkerArgumentNode ) + { + // We've reached the argument itself. This is the + // signal to stop processing. We remove the argument node + // since its not relevant to the production of the tree. + break; + } + else if ( n is SymTokenBalancerMarkerLevelNode ) + { + // Create a new sub-argument node and copy over the + // children. + SymTokenBalancerMarkerLevelNode levelNode = (SymTokenBalancerMarkerLevelNode) n; + SymArgumentSubLevel subLevel = levelNode.AsArgumentSubLevel( true ); + argument.CurrentNode.Add( subLevel ); + } + else if ( n is SymTokenBalancerNodeEmittedElement ) + { + System.Diagnostics.Debug.Assert( false ); // shouldn't get here anymore! + } + else if ( n is SymNodeToken ) + { + // Node is implicitly removed since it transfers + // from one tree to another. + argument.CurrentNode.Add( n ); + } + + count = aLevelToMakeArgumentsFrom.ChildCount; + } + // + SymTokenUtils.RemoveWhiteSpace( argument, true ); + return argument; + } + + public string MakeFunctionName() + { + StringBuilder name = new StringBuilder(); + + // Pull out all the level one tokens from the balancer. These form + // the function/define name. + foreach( SymNode n in DocumentTree ) + { + if ( n is SymTokenBalancerMarkerNode ) + { + // Not part of the name + break; + } + else if ( n is SymTokenBalancerNodeEmittedElement ) + { + // Not part of the name - also, this is indicator to stop iterating! + break; + } + else if ( n is SymNodeToken ) + { + SymNodeToken tokenNode = (SymNodeToken) n; + name.Append( tokenNode.Token.Value ); + } + } + + return name.ToString(); + } + #endregion + + #region API - registration + public void RegisterArgumentSeparatorToken( SymToken aToken, SymTokenBalancerMatchCriteria aCriteria ) + { + SymToken copy = new SymToken( aToken ); + copy.Tag = aCriteria; + // + if ( IsTokenExactMatch( copy, iArgumentSeparators ) == false ) + { + iArgumentSeparators.Append( copy ); + } + } + #endregion + + #region From SymTokenBalancer + public override bool OfferToken( SymToken aToken ) + { + bool consumed = false; + int currentLevelNumber = CurrentLevelNumber; + + // Check for bracket matches + SymTokenBalancerMatchCriteria tokenExtendedInfo; + if ( IsArgumentSeparatorMatch( aToken, out tokenExtendedInfo, currentLevelNumber ) ) + { + ArgumentStarted( aToken, tokenExtendedInfo ); + consumed = true; + } + + // If it wasn't an arg token or it was, but it wasn't at the + // correct (expected) level, then give it to the base class + // to handle. + if ( consumed == false ) + { + consumed = base.OfferToken( aToken ); + } + // + return consumed; + } + #endregion + + #region Notification framework + protected virtual void NotifyArgumentAvailable( SymArgument aArgument, SymToken aDelimitingToken ) + { + if ( EventArgumentAvailableHandler != null ) + { + EventArgumentAvailableHandler( aArgument, aDelimitingToken ); + } + } + #endregion + + #region New internal framework + protected virtual void ArgumentStarted( SymToken aToken, SymTokenBalancerMatchCriteria aCriteria ) + { + System.Diagnostics.Debug.Write( aToken.Value ); + + int currentLevelNumber = CurrentLevelNumber; + + // Perform any base class end level behaviour + PerformEndLevelBehaviour( CurrentNode, aCriteria ); + + // Add the emit node (the rest of the code will work out whether it needs to quote it when the final + // tree is formed). + SymTokenBalancerNodeEmittedElement argEmitElement = new SymTokenBalancerNodeEmittedElement( aToken, aCriteria ); + DocumentTree.CurrentNode.Add( argEmitElement ); + + // Always add the argument node + SymTokenBalancerMarkerArgumentNode argNode = new SymTokenBalancerMarkerArgumentNode( aCriteria ); + DocumentTree.CurrentNode.Add( argNode ); + + if ( aCriteria.IsAssociatedBehaviourCreateSubTree ) + { + // Make a new argument definition based upon the tokens we have in + // the main document tree. + SymArgument argument = MakeArgument( DocumentTree.CurrentNode ); + + // Then notify the observer + NotifyArgumentAvailable( argument, aToken ); + } + } + #endregion + + #region Internal utility methods + protected bool IsArgumentSeparatorMatch( SymToken aToken, out SymTokenBalancerMatchCriteria aCriteria, int aLevelNumber ) + { + aCriteria = null; + bool matchFound = false; + // + int index = iArgumentSeparators.IndexOf( aToken ); + while( index >= 0 && matchFound == false ) + { + SymToken token = iArgumentSeparators[ index ]; + System.Diagnostics.Debug.Assert ( token.Tag != null && token.Tag is SymTokenBalancerMatchCriteria ); + SymTokenBalancerMatchCriteria criteria = (SymTokenBalancerMatchCriteria) token.Tag; + + if ( criteria.Matches( aLevelNumber ) ) + { + aCriteria = criteria; + matchFound = true; + } + else + { + index = iArgumentSeparators.IndexOf( aToken, index+1 ); + } + } + + return matchFound; + } + + #endregion + + #region Data members + private SymTokenContainer iArgumentSeparators = new SymTokenContainer(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Workers/SymParserWorker.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/Framework/Workers/SymParserWorker.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Token; + +namespace SymBuildParsingLib.Parser.Framework.Workers +{ + public abstract class SymParserWorker + { + #region Enumerations + public enum TTokenConsumptionType + { + ETokenNotConsumed = 0, + ETokenConsumed + }; + #endregion + + #region Constructors & destructor + public SymParserWorker( SymParserWorkerContext aContext ) + : this( aContext, 0 ) + { + } + + public SymParserWorker( SymParserWorkerContext aContext, int aPriority ) + { + iWorkerContext = aContext; + iPriority = aPriority; + } + #endregion + + #region API + public virtual SymParserWorker.TTokenConsumptionType OfferToken( SymToken aToken ) + { + SymParserWorker.TTokenConsumptionType consumptionType = TTokenConsumptionType.ETokenNotConsumed; + // + int count = iChildren.Count; + for( int i=0; i 0 ); + // + SymNodeConditionalExpression top = ConditionalExpressionPeek(); + iCondExpResultStack.Pop(); + return top; + } + + public SymNodeConditionalExpression ConditionalExpressionPeek() + { + SymNodeConditionalExpression top = null; + // + if ( iCondExpResultStack.Count > 0 ) + { + top = (SymNodeConditionalExpression) iCondExpResultStack.Peek(); + } + // + return top; + } + #endregion + + #region Data members + private SymPreProcessorWorker iMainWorker; + private Stack iCondExpResultStack = new Stack(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorker.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorker.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Parser.Framework; +using SymBuildParsingLib.Parser.Framework.Workers; +using SymBuildParsingLib.Parser.Framework.Nodes; +using SymBuildParsingLib.Parser.PreProcessor.Parser; + +namespace SymBuildParsingLib.Parser.PreProcessor.Workers +{ + public class SymPreProcessorWorker : SymParserWorker + { + #region Constructors & destructor + public SymPreProcessorWorker( SymParserWorkerContext aContext ) + : base( aContext, 1000 ) + { + } + #endregion + + #region From SymParserWorker + public override SymParserWorker.TTokenConsumptionType OfferToken( SymToken aToken ) + { + TTokenConsumptionType ret = TTokenConsumptionType.ETokenNotConsumed; + + #region Identify preprocessor tokens + if ( aToken.Class == SymToken.TClass.EClassPreProcessor ) + { + if ( ChildCount == 0 ) + { + if ( aToken.Value == "#" ) + { + // Always consume initial preprocessor tokens... + ret = TTokenConsumptionType.ETokenConsumed; + } + else + { + // Try to find a new child worker to handle this kind + // of data. + SymParserWorker worker = CreateWorkerByTokenType( aToken ); + // + if ( worker != null ) + { + System.Diagnostics.Debug.WriteLine( "SymPreProcessorWorker.OfferToken() - FOUND HANDLER FOR: " + aToken.Value ); + + AddChild( worker ); + ret = TTokenConsumptionType.ETokenConsumed; + } + } + } + } + #endregion + + // Give it to the children + if ( ret == TTokenConsumptionType.ETokenNotConsumed ) + { + // Check whether we're inside a conditional expression skip state. + bool allowedToOffer = Parser.ConditionalExpressionValue; + if ( allowedToOffer ) + { + ret = base.OfferToken( aToken ); + } + } + // + return ret; + } + #endregion + + #region Internal methods + private SymParserWorker CreateWorkerByTokenType( SymToken aToken ) + { + // Find a worker to handle the token type + SymParserWorker worker = null; + SymParserWorkerContext context = new SymParserWorkerContext( WorkerContext, this, aToken ); + // + switch( aToken.Value ) + { + // Simple preprocessor operations + case "define": + worker = new SymPreProcessorWorkerDefine( context ); + break; + case "undef": + break; + case "include": + worker = new SymPreProcessorWorkerInclude( context ); + break; + + // Conditionality + case "if": + worker = new SymPreProcessorWorkerIf( context ); + break; + case "ifdef": + worker = new SymPreProcessorWorkerIfdef( context ); + break; + case "ifndef": + worker = new SymPreProcessorWorkerIfndef( context ); + break; + case "else": + worker = new SymPreProcessorWorkerElse( context ); + break; + case "elif": + worker = new SymPreProcessorWorkerElseIf( context ); + break; + case "endif": + worker = new SymPreProcessorWorkerEndif( context ); + break; + + // Skip unhandled preprocessor directives + default: + worker = new SymParserWorkerConsumer( context, SymToken.TClass.EClassNewLine ); + break; + } + // + return worker; + } + #endregion + + #region Internal properties + private SymPreProcessorParser Parser + { + get + { + return (SymPreProcessorParser) WorkerContext.Parser; + } + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerConditionalExpression.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerConditionalExpression.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Parser.Framework; +using SymBuildParsingLib.Parser.Framework.Nodes; +using SymBuildParsingLib.Parser.Framework.Workers; +using SymBuildParsingLib.Parser.PreProcessor.Nodes; +using SymBuildParsingLib.Parser.PreProcessor.Parser; + +namespace SymBuildParsingLib.Parser.PreProcessor.Workers +{ + public class SymPreProcessorWorkerConditionalExpression : SymParserWorkerConditionalExpression + { + #region Constructors & destructor + public SymPreProcessorWorkerConditionalExpression( SymParserWorkerContext aContext ) + : base( aContext ) + { + System.Diagnostics.Debug.Assert( aContext.Document.CurrentNode is SymNodeConditionalExpression ); + + // Inform the parser about the conditional expression node. It will use this + // as a means of identifying whether to skip tokens until a positive branch is identified. + SymPreProcessorParser parser = (SymPreProcessorParser) aContext.Parser; + parser.ConditionalExpressionPush( aContext.Document.CurrentNode as SymNodeConditionalExpression ); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerDefine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerDefine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,360 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Parser.Framework; +using SymBuildParsingLib.Parser.Framework.Utils; +using SymBuildParsingLib.Parser.Framework.Workers; +using SymBuildParsingLib.Parser.PreProcessor.Nodes; +using SymBuildParsingLib.Common.Objects; +using SymbianTree; + +namespace SymBuildParsingLib.Parser.PreProcessor.Workers +{ + public sealed class SymPreProcessorWorkerDefine : SymParserWorkerConsumer + { + #region Constructors & destructor + public SymPreProcessorWorkerDefine( SymParserWorkerContext aContext ) + : base( aContext, SymToken.TClass.EClassNewLine ) + { + iFunctionParser.RegisterFunctionParserTokens(); + + // Set up event handlers + iFunctionParser.EventArgumentAvailableHandler += new SymBuildParsingLib.Parser.Framework.Utils.SymFunctionParser.ArgumentAvailable( FunctionParserEventArgumentAvailableHandler ); + iFunctionParser.EventLevelStarted += new SymBuildParsingLib.Token.SymTokenBalancer.LevelChangeEventHandler( TokenBalancerEventLevelStarted ); + iFunctionParser.EventLevelFinished += new SymBuildParsingLib.Token.SymTokenBalancer.LevelChangeEventHandler( TokenBalancerEventLevelFinished ); + iFunctionParser.EventLevelsBalanced += new SymBuildParsingLib.Token.SymTokenBalancer.LevelsBalancedEventHandler( TokenBalancerEventLevelsBalanced ); + iFunctionParser.EventLevelsImbalanced += new SymBuildParsingLib.Token.SymTokenBalancer.LevelsImbalancedEventHandler( TokenBalancerEventLevelsImbalanced ); + } + #endregion + + #region Internal enumerations + private enum TState + { + EStateInitialWhiteSpace = 0, + EStateDefineName, + EStateDefineArguments, + EStateMiddleWhiteSpace, + EStateDefineValue + } + #endregion + + #region From SymParserWorker + public override SymParserWorker.TTokenConsumptionType OfferToken( SymToken aToken ) + { + SymParserWorker.TTokenConsumptionType ret = SymParserWorker.TTokenConsumptionType.ETokenNotConsumed; + // + while( ret == SymParserWorker.TTokenConsumptionType.ETokenNotConsumed ) + { + TState currentState = State; + switch( State ) + { + case TState.EStateInitialWhiteSpace: + ret = OnStateInitialWhiteSpace( aToken ); + break; + case TState.EStateDefineName: + ret = OnStateDefineName( aToken ); + break; + case TState.EStateDefineArguments: + ret = OnStateDefineArguments( aToken ); + break; + case TState.EStateMiddleWhiteSpace: + ret = OnStateMiddleWhiteSpace( aToken ); + break; + case TState.EStateDefineValue: + ret = OnStateDefineValue( aToken ); + break; + default: + break; + } + + TState newState = State; + bool statesDidNotChange = ( currentState == newState ); + if ( statesDidNotChange ) + { + // If the state handlers didn't want the token, then we + // offer it to the base class instead + if ( ret == SymParserWorker.TTokenConsumptionType.ETokenNotConsumed ) + { + ret = base.OfferToken( aToken ); + } + } + } + + return ret; + } + #endregion + + #region From SymParserWorkerConsumer + protected override void HandleTerminatingConditionMatch( SymToken aToken ) + { + switch( State ) + { + case TState.EStateInitialWhiteSpace: + break; + case TState.EStateDefineName: + MakeDefineName(); + break; + case TState.EStateDefineArguments: + break; + case TState.EStateMiddleWhiteSpace: + break; + case TState.EStateDefineValue: + MakeDefineValue(); + break; + default: + break; + } + + // Do we have a valid define? + if ( iDefine.IsValid ) + { + SymNodePreProcessorDefine defineNode = new SymNodePreProcessorDefine(); + defineNode.DefineDefinition = iDefine; + // + WorkerContext.CurrentNode.Add( defineNode ); + WorkerContext.DefineDirectory.Add( iDefine ); + } + } + #endregion + + #region Internal properties + private TState State + { + get { return iState; } + set { iState = value; } + } + #endregion + + #region Internal state handlers + private SymParserWorker.TTokenConsumptionType OnStateInitialWhiteSpace( SymToken aToken ) + { + SymParserWorker.TTokenConsumptionType ret = SymParserWorker.TTokenConsumptionType.ETokenNotConsumed; + // + if ( aToken.Class == SymToken.TClass.EClassWhiteSpace ) + { + // Skip leading whitespace + ret = SymParserWorker.TTokenConsumptionType.ETokenConsumed; + } + else + { + // Change state + State = TState.EStateDefineName; + ResetTokenContainer(); + } + // + return ret; + } + + private SymParserWorker.TTokenConsumptionType OnStateDefineName( SymToken aToken ) + { + SymParserWorker.TTokenConsumptionType ret = SymParserWorker.TTokenConsumptionType.ETokenNotConsumed; + // + if ( aToken.Class == SymToken.TClass.EClassWhiteSpace ) + { + // Got some whitespace - so we're going to bail + MakeDefineName(); + State = TState.EStateMiddleWhiteSpace; + } + else if ( aToken.Class == SymToken.TClass.EClassNewLine || aToken.Class == SymToken.TClass.EClassContinuation ) + { + // Do nothing - new line is handled by base class (so we must not consume it) + // and continuations are ignored. + } + else + { + // Keep reading tokens until we hit some whitespace + bool consumed = iFunctionParser.OfferToken( aToken ); + if ( consumed == true ) + { + ret = SymParserWorker.TTokenConsumptionType.ETokenConsumed; + } + } + // + return ret; + } + + private SymParserWorker.TTokenConsumptionType OnStateDefineArguments( SymToken aToken ) + { + SymParserWorker.TTokenConsumptionType ret = SymParserWorker.TTokenConsumptionType.ETokenNotConsumed; + // + if ( aToken.Class == SymToken.TClass.EClassWhiteSpace && iFunctionParser.CurrentLevelNumber == 0 ) + { + // Got some whitespace - so we're going to bail + MakeDefineArgument(); + State = TState.EStateMiddleWhiteSpace; + } + else if ( aToken.Class == SymToken.TClass.EClassNewLine || aToken.Class == SymToken.TClass.EClassContinuation ) + { + // Do nothing - new line is handled by base class (so we must not consume it) + // and continuations are ignored. + } + else + { + // Keep reading tokens until we hit some whitespace + bool consumed = iFunctionParser.OfferToken( aToken ); + if ( consumed == true ) + { + ret = SymParserWorker.TTokenConsumptionType.ETokenConsumed; + } + } + // + return ret; + } + + private SymParserWorker.TTokenConsumptionType OnStateMiddleWhiteSpace( SymToken aToken ) + { + SymParserWorker.TTokenConsumptionType ret = SymParserWorker.TTokenConsumptionType.ETokenNotConsumed; + // + if ( aToken.Class == SymToken.TClass.EClassWhiteSpace ) + { + // Skip leading whitespace + ret = SymParserWorker.TTokenConsumptionType.ETokenConsumed; + } + else + { + // Change state + State = TState.EStateDefineValue; + ResetTokenContainer(); + } + // + return ret; + } + + private SymParserWorker.TTokenConsumptionType OnStateDefineValue( SymToken aToken ) + { + SymParserWorker.TTokenConsumptionType ret = SymParserWorker.TTokenConsumptionType.ETokenNotConsumed; + // + if ( aToken.Class != SymToken.TClass.EClassNewLine ) + { + iTokens.Append( aToken ); + ret = SymParserWorker.TTokenConsumptionType.ETokenConsumed; + } + // + return ret; + } + #endregion + + #region Internal token balancer/function parser event handlers + private void FunctionParserEventArgumentAvailableHandler( SymArgument aArgument, SymToken aDelimitingToken ) + { + MakeDefineArgument( aArgument ); + } + + private void TokenBalancerEventLevelStarted( int aLevelCount, SymNode aOldLevel, SymNode aNewLevel ) + { + switch( State ) + { + case TState.EStateDefineName: + MakeDefineName(); + State = TState.EStateDefineArguments; + break; + case TState.EStateDefineArguments: + break; + case TState.EStateDefineValue: + case TState.EStateInitialWhiteSpace: + case TState.EStateMiddleWhiteSpace: + default: + System.Diagnostics.Debug.Assert( false ); + break; + } + } + + private void TokenBalancerEventLevelFinished( int aLevelCount, SymNode aOldLevel, SymNode aNewLevel ) + { + switch( State ) + { + case TState.EStateDefineName: + MakeDefineName(); + State = TState.EStateDefineArguments; + break; + case TState.EStateDefineArguments: + if ( aLevelCount == 0 ) + { + MakeDefineArgument(); + State = TState.EStateMiddleWhiteSpace; + } + break; + case TState.EStateDefineValue: + case TState.EStateInitialWhiteSpace: + case TState.EStateMiddleWhiteSpace: + default: + System.Diagnostics.Debug.Assert( false ); + break; + } + } + + private void TokenBalancerEventLevelsBalanced() + { + } + + private void TokenBalancerEventLevelsImbalanced() + { + //TODO + } + #endregion + + #region Internal temp buffer related methods + public void ResetTokenContainer() + { + iTokens.Reset(); + iFunctionParser.Reset(); + } + + public void AddToken( SymToken aToken ) + { + iTokens.Append( aToken ); + } + #endregion + + #region Misc internal helpers + private void MakeDefineName() + { + iDefine.Name = iFunctionParser.MakeFunctionName(); + } + + private void MakeDefineArgument() + { + SymArgument argument = iFunctionParser.MakeArgument(); + MakeDefineArgument( argument ); + } + + private void MakeDefineArgument( SymArgument aArgument ) + { + // Convert generic argument into define-specific argument + SymDefineArgument defineArgument = new SymDefineArgument( aArgument ); + iDefine.AddArgument( defineArgument ); + } + + private void MakeDefineValue() + { + iDefine.Value = iTokens; + iTokens = new SymTokenContainer(); + } + #endregion + + #region Data members + private TState iState = TState.EStateInitialWhiteSpace; + private SymDefineDefinition iDefine = new SymDefineDefinition(); + private SymTokenContainer iTokens = new SymTokenContainer(); + private SymFunctionParser iFunctionParser = new SymFunctionParser(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerElses.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerElses.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Parser.Framework; +using SymBuildParsingLib.Parser.Framework.Nodes; +using SymBuildParsingLib.Parser.Framework.Workers; +using SymBuildParsingLib.Parser.PreProcessor.Nodes; + +namespace SymBuildParsingLib.Parser.PreProcessor.Workers +{ + public class SymPreProcessorWorkerElse : SymParserWorker + { + #region Constructors & destructor + public SymPreProcessorWorkerElse( SymParserWorkerContext aContext ) + : base( aContext ) + { + // When the else token is reached, we must work back up the tree + // looking for the previous (i.e. most recent) conditional expression + // node. + SymNodeConditionalExpression condExpNode = SymParserWorkerConditionalExpression.FindMostRecentConditionalExpression( aContext.Document.CurrentNode ); + if ( condExpNode == null ) + { + throw new Exception( "Unable to locate most recent condition expression during ELSE handling" ); + } + + // There must always be a positive condition node and some kind of condition + if ( condExpNode.ChildTypeExists( typeof(SymNodeCondition) ) == false ) + { + throw new Exception( "No child condition node found during ELSE handling" ); + } + + // Make the conditional expression the current node + aContext.Document.CurrentNode = condExpNode; + + // Make a new condition worker. The condition worker creates a new condition node + // which becomes the new current node. + SymParserWorkerContext context = new SymParserWorkerContext( aContext.Document.Context, this ); + SymParserWorkerCondition conditionWorker = new SymParserWorkerCondition( context, new SymNodePreProcessorCondition( aContext.CurrentToken.Value ) ); + AddChild( conditionWorker ); + + // If we didn't find any appropriately handled condition object, then + // we make this the catch-all condition (with no expression to evaluate) + if ( condExpNode.HasPositiveBranch == false ) + { + } + } + #endregion + + #region From SymParserWorker + public override void RemoveChild( SymParserWorker aWorker ) + { + base.RemoveChild( aWorker ); + RemoveSelf(); + } + #endregion + } + + public class SymPreProcessorWorkerElseIf : SymParserWorker + { + #region Constructors & destructor + public SymPreProcessorWorkerElseIf( SymParserWorkerContext aContext ) + : base( aContext ) + { + // When the else token is reached, we must work back up the tree + // looking for the previous (i.e. most recent) conditional expression + // node. + SymNodeConditionalExpression condExpNode = SymParserWorkerConditionalExpression.FindMostRecentConditionalExpression( aContext.Document.CurrentNode ); + if ( condExpNode == null ) + { + throw new Exception( "Unable to locate most recent condition expression during ELSE IF handling" ); + } + + // There must always be a positive condition node and some kind of condition + if ( condExpNode.ChildTypeExists( typeof(SymNodeCondition) ) == false ) + { + throw new Exception( "No child condition node found during ELSE IF handling" ); + } + + // Make the conditional expression the current node + aContext.Document.CurrentNode = condExpNode; + + // Make a new condition worker. The condition worker creates a new condition node + // which becomes the new current node. + SymParserWorkerContext context = new SymParserWorkerContext( aContext.Document.Context, this ); + SymParserWorkerCondition conditionWorker = new SymParserWorkerCondition( context, new SymNodePreProcessorCondition( aContext.CurrentToken.Value ) ); + AddChild( conditionWorker ); + } + #endregion + + #region From SymParserWorker + public override void RemoveChild( SymParserWorker aWorker ) + { + base.RemoveChild( aWorker ); + RemoveSelf(); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerEndif.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerEndif.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Parser.Framework; +using SymBuildParsingLib.Parser.Framework.Nodes; +using SymBuildParsingLib.Parser.Framework.Workers; +using SymBuildParsingLib.Parser.PreProcessor.Parser; + +namespace SymBuildParsingLib.Parser.PreProcessor.Workers +{ + public class SymPreProcessorWorkerEndif : SymParserWorker + { + #region Constructors & destructor + public SymPreProcessorWorkerEndif( SymParserWorkerContext aContext ) + : base( aContext ) + { + // When the endif token is reached, we must work back up the tree + // looking for the previous (i.e. most recent) conditional expression + // node. + SymNodeConditionalExpression condExpNode = SymParserWorkerConditionalExpression.FindMostRecentConditionalExpression( aContext.Document.CurrentNode ); + if ( condExpNode == null ) + { + throw new Exception( "Unable to locate most recent condition expression during ENDIF handling" ); + } + + // There must always be a positive condition node and some kind of condition + if ( condExpNode.ChildTypeExists( typeof(SymNodeCondition) ) == false ) + { + throw new Exception( "No child condition node found during ENDIF handling" ); + } + + // We change the current node to be the parent of the conditional expression. + // Any new tokens will appear as siblings + aContext.Document.CurrentNode = condExpNode.Parent; + + // Make sure we tell the parser that it can pop off this conditional expression node. + SymPreProcessorParser parser = (SymPreProcessorParser) aContext.Parser; + SymNodeConditionalExpression poppedExpression = parser.ConditionalExpressionPop(); + System.Diagnostics.Debug.Assert( poppedExpression == condExpNode ); + + // Job done - dequeue + RemoveSelf(); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerIfs.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerIfs.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Parser.Framework; +using SymBuildParsingLib.Parser.Framework.Workers; +using SymBuildParsingLib.Parser.PreProcessor.Nodes; + +namespace SymBuildParsingLib.Parser.PreProcessor.Workers +{ + public class SymPreProcessorWorkerIf : SymPreProcessorWorkerConditionalExpression + { + #region Constructors & destructor + public SymPreProcessorWorkerIf( SymParserWorkerContext aContext ) + : base( aContext ) + { + // The base class will make a new conditional expression node at the current document position. + // It will change the parent node to be this new node. We must make a new condition worker + // that will handle reading the condition arguments. + SymParserWorkerContext context = new SymParserWorkerContext( WorkerContext.Document.Context, this ); + SymParserWorkerCondition conditionWorker = new SymParserWorkerCondition( context, new SymNodePreProcessorCondition( aContext.CurrentToken.Value ) ); + AddChild( conditionWorker ); + } + #endregion + } + + public class SymPreProcessorWorkerIfdef : SymPreProcessorWorkerConditionalExpression + { + #region Constructors & destructor + public SymPreProcessorWorkerIfdef( SymParserWorkerContext aContext ) + : base( aContext ) + { + // The base class will make a new conditional expression node at the current document position. + // It will change the parent node to be this new node. We must make a new condition worker + // that will handle reading the condition arguments. + SymParserWorkerContext context = new SymParserWorkerContext( WorkerContext.Document.Context, this ); + SymParserWorkerCondition conditionWorker = new SymParserWorkerCondition( context, new SymNodePreProcessorCondition( aContext.CurrentToken.Value ) ); + AddChild( conditionWorker ); + } + #endregion + } + + + public class SymPreProcessorWorkerIfndef : SymPreProcessorWorkerConditionalExpression + { + #region Constructors & destructor + public SymPreProcessorWorkerIfndef( SymParserWorkerContext aContext ) + : base( aContext ) + { + // The base class will make a new conditional expression node at the current document position. + // It will change the parent node to be this new node. We must make a new condition worker + // that will handle reading the condition arguments. + SymParserWorkerContext context = new SymParserWorkerContext( WorkerContext.Document.Context, this ); + SymParserWorkerCondition conditionWorker = new SymParserWorkerCondition( context, new SymNodePreProcessorCondition( aContext.CurrentToken.Value ) ); + AddChild( conditionWorker ); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerInclude.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Parser/PreProcessor/Workers/SymPreProcessorWorkerInclude.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Common.Objects; +using SymBuildParsingLib.Parser.Framework.Parser; +using SymBuildParsingLib.Parser.Framework.Workers; +using SymBuildParsingLib.Parser.Framework.Document; +using SymBuildParsingLib.Parser.PreProcessor.Nodes; + +namespace SymBuildParsingLib.Parser.PreProcessor.Workers +{ + public sealed class SymPreProcessorWorkerInclude : SymParserWorkerConsumer + { + #region Constructors & destructor + public SymPreProcessorWorkerInclude( SymParserWorkerContext aContext ) + : base( aContext, SymToken.TClass.EClassNewLine, SymParserWorkerConsumer.TDyingAction.EWhenDyingMakeAbsoluteParentNodeCurrent ) + { + // Make a new child node for the include + iIncludeNode = new SymNodePreProcessorInclude(); + aContext.Document.CurrentNode.Add( iIncludeNode ); + aContext.Document.CurrentNode = iIncludeNode; + } + #endregion + + #region From SymParserWorkerConsumer + protected override void HandleTerminatingConditionMatch( SymToken aToken ) + { + // Update the include so that it contains a fully resolved path + iIncludeNode.IncludeDefinition.AdjustRelativeInclude( WorkerContext.Parser.FileName ); + + // We've now a fully resolved file name which we can parse, should + // we desire... + string includeFile = iIncludeNode.IncludeDefinition.Location; + if ( Utils.SymFileSystemUtils.FileExists( includeFile ) ) + { + // Make a new document context + SymParserDocumentContext subDocumentContext = new SymParserDocumentContext( includeFile, WorkerContext ); + + // Use the existing document, but with a new context + WorkerContext.Document.PushContext( subDocumentContext ); + + // Make a new carbon copy of this parser (whatever concrete type it may be) + SymParserBase subParser = WorkerContext.Parser.CarbonCopy( new object[] { WorkerContext.Document } ); + + // Make the waiting object + SymParserWaiter waiter = new SymParserWaiter( subParser ); + + // Now parse the file and wait for the result + subParser.Parse(); + waiter.Wait(); + + // Restore the original context + WorkerContext.Document.PopContext(); + } + } + #endregion + + #region From SymParserWorker + public override SymParserWorker.TTokenConsumptionType OfferToken( SymToken aToken ) + { + TTokenConsumptionType ret = TTokenConsumptionType.ETokenNotConsumed; + System.Diagnostics.Debug.Assert( WorkerContext.Document.CurrentNode is SymNodePreProcessorInclude ); + + // Only consume tokens whilst we're unsure of the include type (system vs user). + if ( iIncludeNode.IncludeDefinition.Type == SymIncludeDefinition.TType.ETypeUndefined ) + { + if ( aToken.Class == SymToken.TClass.EClassQuotation ) + { + // Must be a user include if its a quotation that we're handling + iIncludeNode.IncludeDefinition.Type = SymIncludeDefinition.TType.ETypeUser; + ret = TTokenConsumptionType.ETokenConsumed; + } + else if ( aToken.Class == SymToken.TClass.EClassSymbol && aToken.Value == "<" ) + { + // Consume it, but don't absorb it + iIncludeNode.IncludeDefinition.Type = SymIncludeDefinition.TType.ETypeSystem; + ret = TTokenConsumptionType.ETokenConsumed; + } + } + else if ( iIncludeNode.IncludeDefinition.Type != SymIncludeDefinition.TType.ETypeUndefined ) + { + // Only consume the tokens whilst we've not yet identified the include + // definition location. + if ( iIncludeNode.IncludeDefinition.Location.Length == 0 ) + { + if ( iIncludeNode.IncludeDefinition.Type == SymIncludeDefinition.TType.ETypeSystem && aToken.Class == SymToken.TClass.EClassSymbol && aToken.Value == ">" ) + { + iIncludeNode.IncludeDefinition.Location = iWorkingIncludePath.ToString(); + } + else if ( iIncludeNode.IncludeDefinition.Type == SymIncludeDefinition.TType.ETypeUser && aToken.Class == SymToken.TClass.EClassQuotation && aToken.Type != SymToken.TType.ETypeUnidentified ) + { + iIncludeNode.IncludeDefinition.Location = iWorkingIncludePath.ToString(); + } + else + { + iWorkingIncludePath.Append( aToken.Value ); + } + } + } + + // Base class will dequeue us once we reach the new line + ret = base.OfferToken( aToken ); + return ret; + } + #endregion + + #region Data members + private StringBuilder iWorkingIncludePath = new StringBuilder(); + private readonly SymNodePreProcessorInclude iIncludeNode; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Stream/SymStream.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Stream/SymStream.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Text; +using System.Collections; +using System.Diagnostics; + +namespace SymBuildParsingLib +{ + #region Exceptions + public class SymParserStreamExceptionInvalidRewindAmount : Exception + { + public SymParserStreamExceptionInvalidRewindAmount( string aMessage ) + : base( aMessage ) + { + } + } + #endregion + + public class SymStream + { + #region Constructors & destructor + public SymStream( string aFileName ) + { + iFileName = aFileName; + iFileStream = new FileStream( aFileName, System.IO.FileMode.Open ); + iStream = new StreamReader( iFileStream ); + iFileData = new Stack( 1024 * 20 ); + } + #endregion + + #region API + public char PeekChar() + { + Debug.Assert( !EOF ); + // + char ret = (char) iStream.Peek(); + // + if ( iPushedBackCharacters.Count > 0 ) + { + ret = (char) iPushedBackCharacters.Peek(); + } + return ret; + } + + public char ReadChar() + { + Debug.Assert( !EOF ); + // + char ret; + // + if ( iPushedBackCharacters.Count > 0 ) + { + ret = (char) iPushedBackCharacters.Pop(); + } + else + { + ret = (char) iStream.Read(); + } + // + iFileData.Push( ret ); + ++iPosition; + // + return ret; + } + + public void RewindChar() + { + RewindChars( 1 ); + } + + public void RewindChars( int aRewindCount ) + { + long newPos = Position - aRewindCount; + if ( aRewindCount < 0 ) + throw new SymParserStreamExceptionInvalidRewindAmount( "Rewind specifier must be >= 0" ); + else if ( newPos < 0 || newPos >= Size ) + throw new SymParserStreamExceptionInvalidRewindAmount( "Rewind specifier takes stream position beyond scope of file" ); + + for( int i=0; i= fileSize ); + return atEnd; + } + } + #endregion + + #region Constants + private const int KStreamEOF = -1; + #endregion + + #region Data members + private readonly string iFileName; + private StreamReader iStream; + private FileStream iFileStream; + private Stack iPushedBackCharacters = new Stack( 1024 ); + private Stack iFileData; + private long iPosition; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/SymBuildParsingLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/SymBuildParsingLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,307 @@ + + + Local + 8.0.30729 + 2.0 + {76F24131-B56D-4519-A8E7-42AA80D19688} + Debug + AnyCPU + + + + + SymBuildParsingLib + + + JScript + Grid + IE50 + false + Library + SymBuildParsingLib + OnBuildSuccess + + + + + + + 0.0 + + + bin\Debug\ + false + 285212672 + false + + + DEBUG;TRACE + + + true + 4096 + false + + + false + false + false + false + 4 + full + prompt + + + bin\Release\ + false + 285212672 + false + + + TRACE + + + false + 4096 + false + + + true + false + false + false + 4 + none + prompt + + + + Microsoft.JScript + + + Microsoft.Vsa + + + System + + + System.Data + + + System.Drawing + + + System.Windows.Forms + + + System.XML + + + SymbianTree + {BC8ED243-4E7D-4952-9733-E377D335C564} + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/SymBuildParsingLib.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/SymBuildParsingLib.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ + + + 7.10.3077 + Debug + AnyCPU + + + + + + + 0 + ProjectFiles + 0 + + + false + false + false + false + false + + + Project + + + + + + + + + + + true + + + false + false + false + false + false + + + Project + + + + + + + + + + + true + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymToken.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymToken.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,266 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; +using SymBuildParsingLib.Utils; + +namespace SymBuildParsingLib.Token +{ + public class SymToken + { + #region Enumerations + public enum TClass + { + // The lexer only deals at this level of abstraction + EClassNull = 0, + EClassWhiteSpace, + EClassAlphaNumeric, + EClassSymbol, + EClassNewLine, + + // The grouper also can identify these types + EClassComment, + EClassQuotation, + EClassContinuation, + EClassPreProcessor, + }; + + public enum TType + { + ETypeUnidentified = 0, + ETypeCommentFullLine, + ETypeCommentBlock, + ETypeQuotationSingle, + ETypeQuotationDouble, + ETypeAlphaNumericNormal, + ETypeAlphaNumericUnderscore, + } + #endregion + + #region Constructors & destructor + public static SymToken NullToken() + { + return new SymToken( "", TClass.EClassNull, new SymTextPosition() ); + } + + public SymToken( string aValue, TClass aClass, TType aType ) + { + iValue = aValue; + iClass = aClass; + iType = aType; + } + + public SymToken( string aValue, TClass aClass, SymTextPosition aPosition ) + { + iValue = aValue; + iClass = aClass; + iPosition = aPosition; + } + + public SymToken( SymToken aToken ) + { + iValue = aToken.Value; + iClass = aToken.Class; + iType = aToken.Type; + iPosition = aToken.Position; + iTag = aToken.Tag; + } + #endregion + + #region API + public void RefineTokenClass() + { + if ( Class == SymToken.TClass.EClassSymbol ) + { + if ( Value.Length == 1 ) + { + if ( Value == "\"" ) + { + Class = SymToken.TClass.EClassQuotation; + } + else if ( Value == "\'" ) + { + Class = SymToken.TClass.EClassQuotation; + } + else if ( Value == "_" ) + { + Class = SymToken.TClass.EClassAlphaNumeric; + } + else if ( Value == "#" ) + { + Class = SymToken.TClass.EClassPreProcessor; + } + } + } + } + + public void RefineTokenType() + { + if ( Type == SymToken.TType.ETypeUnidentified ) + { + if ( Class == SymToken.TClass.EClassQuotation ) + { + if ( Value.Length == 1 ) + { + if ( Value == "\"" ) + { + Type = SymToken.TType.ETypeQuotationDouble; + } + else if ( Value == "\'" ) + { + Type = SymToken.TType.ETypeQuotationSingle; + } + } + } + else if ( Class == SymToken.TClass.EClassAlphaNumeric ) + { + if ( Value.Length == 1 && Value == "_" ) + { + Type = SymToken.TType.ETypeAlphaNumericUnderscore; + } + else + { + Type = SymToken.TType.ETypeAlphaNumericNormal; + } + } + } + } + + public void Combine( SymToken aToken ) + { + if ( aToken.Value == ")" || Value == ")" ) + { + int x = 9; + } + + System.Diagnostics.Debug.Assert( Class != SymToken.TClass.EClassNull ); + System.Diagnostics.Debug.Assert( aToken.CombiningAllowed == true ); + System.Diagnostics.Debug.Assert( CombiningAllowed == true ); + // + ForceCombine( aToken ); + } + + public void ForceCombine( SymToken aToken ) + { + System.Diagnostics.Debug.Assert( Class != SymToken.TClass.EClassNull ); + // + string newValue = iValue + aToken.Value; + iValue = newValue; + } + #endregion + + #region Properties + public bool CombiningAllowed + { + get + { + // We don't permit combining for new lines at all. + // However, other combining is permitted (irrespective of class type). + bool okayToCombine = ( Class != TClass.EClassNewLine ); + // + if ( Value.Length == 1 ) + { + // Check its not a disallowed character + int index = KDisallowedCombiningCharacters.IndexOf( Value[ 0 ] ); + okayToCombine = ( index < 0 ); + } + // + return okayToCombine; + } + } + + public string Value + { + get { return iValue; } + } + + public TClass Class + { + get { return iClass; } + set + { + iClass = value; + + // When changing from some other type to a continuation, then + // we also ensure we preseve the new line value + if ( iClass == SymToken.TClass.EClassContinuation ) + { + iValue = @"\" + System.Environment.NewLine; + } + } + } + + public TType Type + { + get { return iType; } + set { iType = value; } + } + + public SymTextPosition Position + { + get { return iPosition; } + } + + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + return Value; + } + + public override bool Equals( object aObject ) + { + bool same = false; + // + if ( aObject is SymToken ) + { + SymToken otherToken = (SymToken) aObject; + // + if ( otherToken.Class == Class ) + { + if ( otherToken.Type == Type ) + { + same = ( otherToken.Value == Value ); + } + } + } + // + return same; + } + #endregion + + #region Internal Constants + private string KDisallowedCombiningCharacters = "!()\'\";"; + #endregion + + #region Data members + private string iValue; + private TClass iClass = TClass.EClassNull; + private TType iType = TType.ETypeUnidentified; + private object iTag; + private SymTextPosition iPosition = new SymTextPosition(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenBalancer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenBalancer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,812 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; +using SymBuildParsingLib.Tree; +using SymbianTree; + +namespace SymBuildParsingLib.Token +{ + public class SymTokenBalancer + { + #region Observer interface + public delegate void LevelsBalancedEventHandler(); + public delegate void LevelsImbalancedEventHandler(); + public delegate void LevelChangeEventHandler( int aLevelCount, SymNode aOldLevel, SymNode aNewLevel ); + #endregion + + #region Events + public event LevelChangeEventHandler EventLevelStarted; + public event LevelChangeEventHandler EventLevelFinished; + public event LevelsBalancedEventHandler EventLevelsBalanced; + public event LevelsImbalancedEventHandler EventLevelsImbalanced; + #endregion + + #region Constructors & destructor + public SymTokenBalancer() + { + Reset(); + System.Diagnostics.Debug.IndentSize = 1; + } + #endregion + + #region API + public void RegisterBalancerTokens() + { + RegisterBalancerTokens( false ); + } + + public virtual void RegisterBalancerTokens( bool aEmitLevelZeroBrackets ) + { + // These are the important tokens relating to function arguments + SymToken bracketTokenOpening = new SymToken( "(", SymToken.TClass.EClassSymbol, SymToken.TType.ETypeUnidentified ); + SymToken bracketTokenClosing = new SymToken( ")", SymToken.TClass.EClassSymbol, SymToken.TType.ETypeUnidentified ); + + // When parsing a function name and arguments, we want to start a new level when we see the first opening + // brace, but we don't want to emit the token. + RegisterOpeningToken( bracketTokenOpening, bracketTokenClosing, aEmitLevelZeroBrackets, true, TLevelExpectations.ELevelExpectationsAtLevel, 0, TAssociatedBehaviour.EBehaviourRemoveReduntantBracketing ); + RegisterClosingToken( bracketTokenClosing, bracketTokenOpening, aEmitLevelZeroBrackets, true, TLevelExpectations.ELevelExpectationsAtLevel, 0, TAssociatedBehaviour.EBehaviourRemoveReduntantBracketing ); + + // For other brackets, we want to reduce the complexity by removing any redundant entries + RegisterOpeningToken( bracketTokenOpening, bracketTokenClosing, true, true, TLevelExpectations.ELevelExpectationsAboveLevelNumber, 0, TAssociatedBehaviour.EBehaviourRemoveReduntantBracketing ); + RegisterClosingToken( bracketTokenClosing, bracketTokenOpening, true, true, TLevelExpectations.ELevelExpectationsAboveLevelNumber, 0, TAssociatedBehaviour.EBehaviourRemoveReduntantBracketing ); + } + + public virtual bool OfferToken( SymToken aToken ) + { + bool consumed = false; + int currentLevelNumber = CurrentLevelNumber; + SymTokenBalancerMatchCriteria tokenExtendedInfo; + + // Check for bracket matches + if ( IsOpeningTokenMatch( aToken, out tokenExtendedInfo, currentLevelNumber ) ) + { + LevelStarted( aToken, tokenExtendedInfo ); + consumed = true; + } + else if ( IsClosingTokenMatch( aToken, out tokenExtendedInfo, currentLevelNumber ) ) + { + LevelFinished( aToken, tokenExtendedInfo ); + consumed = true; + } + + // Always consume the token if it didn't match + if ( ! consumed ) + { + AddToCurrentLevel( aToken ); + consumed = true; + } + // + return consumed; + } + + public virtual void Reset() + { + iTree = new SymTokenBalancerDocument(); + } + #endregion + + #region API - registration + public void RegisterOpeningToken( SymToken aToken, SymToken aDiametricToken, bool aEmit, bool aStartsNewLevel, TLevelExpectations aLevelExpectations, int aAssociatedLevel, TAssociatedBehaviour aBehaviour ) + { + SymTokenBalancerMatchCriteria criteria = new SymTokenBalancerMatchCriteria( aDiametricToken, aEmit, aStartsNewLevel, aLevelExpectations, aAssociatedLevel, aBehaviour ); + RegisterOpeningToken( aToken, criteria ); + } + + public void RegisterOpeningToken( SymToken aToken, SymTokenBalancerMatchCriteria aCriteria ) + { + SymToken copy = new SymToken( aToken ); + copy.Tag = aCriteria; + // + if ( IsTokenExactMatch( copy, iOpeningTokens ) == false ) + { + iOpeningTokens.Append( copy ); + } + } + + public void RegisterClosingToken( SymToken aToken, SymToken aDiametricToken, bool aEmit, bool aStartsNewLevel, TLevelExpectations aLevelExpectations, int aAssociatedLevel, TAssociatedBehaviour aBehaviour ) + { + SymTokenBalancerMatchCriteria criteria = new SymTokenBalancerMatchCriteria( aDiametricToken, aEmit, aStartsNewLevel, aLevelExpectations, aAssociatedLevel, aBehaviour ); + RegisterClosingToken( aToken, criteria ); + } + + public void RegisterClosingToken( SymToken aToken, SymTokenBalancerMatchCriteria aCriteria ) + { + SymToken copy = new SymToken( aToken ); + copy.Tag = aCriteria; + // + if ( IsTokenExactMatch( copy, iClosingTokens ) == false ) + { + iClosingTokens.Append( copy ); + } + } + #endregion + + #region Properties - level related + public int CurrentLevelNumber + { + get + { + int depth = iTree.CurrentNode.Depth; + return depth; + } + } + + public SymNode CurrentNode + { + get { return iTree.CurrentNode; } + } + + public SymTokenBalancerDocument DocumentTree + { + get { return iTree; } + } + #endregion + + #region Notification framework + protected virtual void NotifyEventLevelStarted( int aLevelCount, SymNode aOldLevel, SymNode aNewLevel ) + { + if ( EventLevelStarted != null ) + { + EventLevelStarted( aLevelCount, aOldLevel, aNewLevel ); + } + } + + protected virtual void NotifyEventLevelFinished( int aLevelCount, SymNode aOldLevel, SymNode aNewLevel ) + { + if ( EventLevelFinished != null ) + { + EventLevelFinished( aLevelCount, aOldLevel, aNewLevel ); + } + } + + protected virtual void NotifyEventLevelsImbalanced() + { + if ( EventLevelsImbalanced != null ) + { + EventLevelsImbalanced(); + } + } + #endregion + + #region Utility methods + protected bool IsTokenExactMatch( SymToken aToken, SymTokenContainer aContainerToSearch ) + { + bool ret = false; + // + foreach( SymToken t in aContainerToSearch ) + { + if ( t.Equals( aToken ) ) + { + if ( aToken.Tag != null && t.Tag != null ) + { + if ( ( aToken.Tag is SymTokenBalancerMatchCriteria ) && ( t.Tag is SymTokenBalancerMatchCriteria ) ) + { + SymTokenBalancerMatchCriteria extendedInfo1 = (SymTokenBalancerMatchCriteria) aToken.Tag; + SymTokenBalancerMatchCriteria extendedInfo2 = (SymTokenBalancerMatchCriteria) t.Tag; + // + if ( extendedInfo1.Equals( extendedInfo2 ) ) + { + ret = true; + break; + } + } + } + } + } + // + return ret; + } + + protected bool IsOpeningTokenMatch( SymToken aToken, out SymTokenBalancerMatchCriteria aCriteria, int aLevelNumber ) + { + aCriteria = null; + bool matchFound = false; + // + int index = iOpeningTokens.IndexOf( aToken ); + while( index >= 0 && matchFound == false ) + { + SymToken token = iOpeningTokens[ index ]; + System.Diagnostics.Debug.Assert ( token.Tag != null && token.Tag is SymTokenBalancerMatchCriteria ); + SymTokenBalancerMatchCriteria criteria = (SymTokenBalancerMatchCriteria) token.Tag; + + if ( criteria.Matches( aLevelNumber ) ) + { + aCriteria = criteria; + matchFound = true; + } + else + { + index = iOpeningTokens.IndexOf( aToken, index+1 ); + } + } + + return matchFound; + } + + protected bool IsClosingTokenMatch( SymToken aToken, out SymTokenBalancerMatchCriteria aCriteria, int aLevelNumber ) + { + aCriteria = null; + bool matchFound = false; + // + int index = iClosingTokens.IndexOf( aToken ); + while( index >= 0 && matchFound == false ) + { + SymToken token = iClosingTokens[ index ]; + System.Diagnostics.Debug.Assert ( token.Tag != null && token.Tag is SymTokenBalancerMatchCriteria ); + SymTokenBalancerMatchCriteria criteria = (SymTokenBalancerMatchCriteria) token.Tag; + + if ( criteria.Matches( aLevelNumber ) ) + { + aCriteria = criteria; + matchFound = true; + } + else + { + index = iClosingTokens.IndexOf( aToken, index+1 ); + } + } + + return matchFound; + } + + protected static int CountTokenByType( SymNode aNodeWithChildren, SymToken.TClass aClass ) + { + int count = 0; + // + foreach( SymNode n in aNodeWithChildren ) + { + bool isNodeToken = ( n is SymNodeToken ); + // + if ( isNodeToken ) + { + bool isSpecial = ( ( n is SymTokenBalancerNode ) || ( n is SymTokenBalancerNodeEmittedElement ) ); + // + if ( isSpecial == false ) + { + SymToken t = ((SymNodeToken) n).Token; + // + if ( t.Class == aClass ) + { + ++count; + } + } + } + } + // + return count; + } + + protected bool LevelCanBeMergedWithParent( SymTokenBalancerMarkerLevelNode aLevelNode ) + { + #region Example + // We can replace the opening bracket, the level marker and the closing bracket + // with the level marker's child. + // + // E.g. + // ( = opening bracket + // * = level marker + // ) = closing bracket + // V = 'real' node value + // + // This: + // + // ( -- * -- ) + // | + // V + // + // Can become: + // + // V + // + // + // Or this: + // + // ( -- * -- ) + // | + // [ -- * -- ] + // | + // V + // + // Can become: + // + // [ -- * -- ] + // | + // V + // + #endregion + System.Diagnostics.Debug.Assert( aLevelNode.HasPrevious && aLevelNode.HasNext ); + System.Diagnostics.Debug.Assert( aLevelNode.Previous is SymTokenBalancerNodeEmittedElement && aLevelNode.Next is SymTokenBalancerNodeEmittedElement ); + // + bool ret = false; + // + SymTokenBalancerNodeEmittedElement previous = (SymTokenBalancerNodeEmittedElement) aLevelNode.Previous; + SymTokenBalancerNodeEmittedElement next = (SymTokenBalancerNodeEmittedElement) aLevelNode.Next; + + // We should be able to remove these brackets, providing they are diametrically oposites. + SymTokenBalancerMatchCriteria matchInfo; + if ( IsOpeningTokenMatch( previous.Token, out matchInfo, CurrentLevelNumber ) ) + { + // We've now got the match info for this opening token. We can compare the + // match info's diametric token against the closing token to check that they + // really are equal and oposite. + if ( matchInfo.DiametricToken.Equals( next.Token ) ) + { + // Check whether the children are suitable for coalescing + int grandChildCount = aLevelNode.ChildCount; + int numberOfWhiteSpaceGrandChildren = CountTokenByType( aLevelNode, SymToken.TClass.EClassWhiteSpace ); + int nonWhiteSpaceGrandChildrenCount = grandChildCount - numberOfWhiteSpaceGrandChildren; + + if ( nonWhiteSpaceGrandChildrenCount == 1 ) + { + // If there is just a single non-whitespace token then we are able to + // coalesce this branch + ret = true; + } + else if ( nonWhiteSpaceGrandChildrenCount == 3 ) + { + // Branch contains several non-whitespace children. Must check further + // to see if they are simply bracketed regions themselves + object levelObject = aLevelNode.ChildByType( typeof( SymTokenBalancerMarkerLevelNode ) ); + if ( levelObject != null ) + { + SymTokenBalancerMarkerLevelNode childLevel = (SymTokenBalancerMarkerLevelNode) levelObject; + // + if ( childLevel.HasPrevious && childLevel.HasNext ) + { + ret = ( childLevel.Previous is SymTokenBalancerNodeEmittedElement && childLevel.Next is SymTokenBalancerNodeEmittedElement ); + } + } + else + { + ret = true; + } + } + } + } + // + return ret; + } + + protected void SimplifyLevel( SymTokenBalancerMarkerLevelNode aLevel ) + { + System.Diagnostics.Debug.Assert( aLevel.IsRoot == false && aLevel.HasParent ); + SymNode parent = aLevel.Parent; + int levelNumber = parent.Depth; + // + int childCount = parent.ChildCount; + while( --childCount >= 0 ) + { + SymNode possibleLevelNode = parent[ childCount ]; + + // We're looking to remove redundant bracketing from either side of the level + // node. First check if we have a level node... + if ( possibleLevelNode is SymTokenBalancerMarkerLevelNode ) + { + // Then check whether it has a previous and a next node. These should + // be the SymTokenBalancerNodeEmittedElement nodes + if ( possibleLevelNode.HasPrevious && possibleLevelNode.HasNext ) + { + if ( possibleLevelNode.Previous is SymTokenBalancerNodeEmittedElement && possibleLevelNode.Next is SymTokenBalancerNodeEmittedElement ) + { + if ( LevelCanBeMergedWithParent( possibleLevelNode as SymTokenBalancerMarkerLevelNode ) ) + { + SymTokenBalancerNodeEmittedElement previous = (SymTokenBalancerNodeEmittedElement) possibleLevelNode.Previous; + SymTokenBalancerNodeEmittedElement next = (SymTokenBalancerNodeEmittedElement) possibleLevelNode.Next; + + // Insert value node prior to previous node (which is the opening bracket token). + parent.InsertChildrenFrom( possibleLevelNode, previous.Previous ); + + // Remove the opening bracket token + previous.Remove(); + + // Remove the level marker token + possibleLevelNode.Remove(); + + // Remove the closing bracket token. + next.Remove(); + } + } + } + } + } + } + #endregion + + #region Internal level manipulation methods + protected virtual void LevelStarted( SymToken aToken, SymTokenBalancerMatchCriteria aMatchCriteria ) + { + System.Diagnostics.Debug.Write( System.Environment.NewLine + aToken.Value ); + + // Always store the node element so that we can balance brackets + SymTokenBalancerNodeEmittedElement node = new SymTokenBalancerNodeEmittedElement( aToken, aMatchCriteria ); + iTree.CurrentNode.Add( node ); + + // Store the token (with the level) so we can check for open/close mis-matches + SymTokenBalancerMarkerLevelNode levelNode = new SymTokenBalancerMarkerLevelNode( aMatchCriteria ); + iTree.CurrentNode.Add( levelNode ); + + SymNode oldLevel = iTree.CurrentNode; + SymNode newLevel = levelNode; + NotifyEventLevelStarted( CurrentLevelNumber, oldLevel, newLevel ); + + iTree.CurrentNode = levelNode; + } + + protected virtual void LevelFinished( SymToken aToken, SymTokenBalancerMatchCriteria aMatchCriteria ) + { + #region Example + + // #define TEST1((( B )+( C ))+(E)) + + #region Key + // |y| = level y + // [x] = token of value 'x' + // [*] = level marker node + // [@] = (current) level marker node + // [,] = argument node + // [(] = opening level emitted token node + // [)] = closing level emitted token node + #endregion + + #region 1) First wave of opening level tokens processed... + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [*] + // | + // |2| [(] [*] + // | + // |3| [(] [@] + // | + // |4| B + // + #endregion + + #region 2) Add closing level token to level |3|, which means that we can now + // attempt to simplify level |4|. Level |4| does not contain any child + // level nodes, so there is nothing to do here. + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [*] + // | + // |2| [(] [@] + // | + // |3| [(] [*] [)] + // | + // |4| [ ] [B] [ ] + // + #endregion + + #region 3) Add plus symbol. This obviously becomes a child of the current node, + // i.e. a child of level |2|. + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [*] + // | + // |2| [(] [@] + // | + // |3| [(] [*] [)] [+] + // | + // |4| [ ] [B] [ ] + // + #endregion + + #region 4) Start new opening level node on level |3|. The newly added level node + // on level |3| becomes the current node. + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [*] + // | + // |2| [(] [*] + // | + // |3| [(] [*] [)] [+] [(] [@] + // | | + // |4| [ ] [B] [ ] + // + #endregion + + #region 5) Add the tokens near the 'C' to level |4| + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [*] + // | + // |2| [(] [*] + // | + // |3| [(] [*] [)] [+] [(] [@] + // | | + // |4| [ ] [B] [ ] [ ] [C] [ ] + // + #endregion + + #region 6) Add closing level token to level |3|, which means that we can now + // attempt to simplify level |4|, this time the [C] branch. + // Since this branch does not contain any sub-level nodes, there is nothing + // to be done and therefore levels |3| and |4| remain unchanged. + // The level node at level |2| becomes the current node. + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [*] + // | + // |2| [(] [@] + // | + // |3| [(] [*] [)] [+] [(] [*] [)] + // | | + // |4| [ ] [B] [ ] [ ] [C] [ ] + // + #endregion + + #region 7a) Add closing level token to level |2|, which means that we can now + // attempt to simplify level |3|. + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [*] + // | + // |2| [(] [@] [)] + // | + // |3| [(] [*] [)] [+] [(] [*] [)] + // | | + // |4| [ ] [B] [ ] [ ] [C] [ ] + // + #endregion + + #region 7b) We iterate through all the child level nodes of level |3| looking + // to see if any of their children are simple enough to merge up into level + // |3| itself. There are two level nodes in level |3| and both contain + // children that are considered simple enough to merge up. This is because + // they contain only a single non-whitespace node so we can simplify the level by + // merging [B] from level |4| into level |3|. Likewise for [C]. + // + // This means that the bracketry on level |3| is redundant since level + // |4| contains two sets of only a single non-whitespace token. Level |4| + // is therefore entirely removed. + // + // The node at level |1| becomes the current node now. + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [@] + // | + // |2| [(] [*] [)] + // | + // |3| [ ] [B] [ ] [+] [ ] [C] [ ] + // + #endregion + + #region 8) Add the plus symbol to level |2|. Then we start a new level + // as a result of adding the opening bracket prior to 'E.' + // This new level node at level |2| now becomes the current node. + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [*] + // | + // |2| [(] [*] [)] [+] [(] [@] + // | | + // |3| [ ] [B] [ ] [+] [ ] [C] [ ] + // + #endregion + + #region 9) Now add the 'E' token to level |3|. + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [*] + // | + // |2| [(] [*] [)] [+] [(] [@] + // | | + // |3| [ ] [B] [ ] [+] [ ] [C] [ ] [E] + #endregion + + #region 10) We then add the closing bracket to level |2| which means + // that we can attempt to simplify level |3|'s 'E' branch. There's nothing + // to do though, since it doesn't contain any child level nodes. + // The level node at level |1| again becomes current. + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [@] + // | + // |2| [(] [*] [)] [+] [(] [*] [)] + // | | + // |3| [ ] [B] [ ] [+] [ ] [C] [ ] [E] + #endregion + + #region 11a) We then add the closing bracket to level |1| which means + // that we can attempt to simplify level |2| entirely. This is the + // situation prior to simplification. + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [@] [)] + // | + // |2| [(] [*] [)] [+] [(] [*] [)] + // | | + // |3| [ ] [B] [ ] [+] [ ] [C] [ ] [E] + #endregion + + #region 11b) The two level nodes have been taged as *1 and *2 to make it + // easier to explain the process. First we attempt to simplify level *1. + // However, since its children consist of more than a single non-whitespace + // token, we cannot make level |3|'s " B + C " branch as a replacement + // for the bracket *1 tokens. Therefore this remains unchanged + // + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [@] [)] + // | + // |2| [(] [*1] [)] [+] [(] [*2] [)] + // | | + // |3| [ ] [B] [ ] [+] [ ] [C] [ ] [E] + #endregion + + #region 11c) The level *2 node, however, contains only a single non-whitespace + // child token, so it can be simplified. The level *2 node is replaced by + // its child (E). + // + // The final tree looks like this, with the root as the current node once more: + // + // + // |0| [@ROOT@] + // | + // |1| [TEST] [(] [*] [)] + // | + // |2| [(] [*] [)] [+] [E] + // | + // |3| [ ] [B] [ ] [+] [ ] [C] [ ] + #endregion + + #endregion + + System.Diagnostics.Debug.Write( aToken.Value ); + System.Diagnostics.Debug.WriteLine( " " ); + + // First of all, check if the current node has a parent. If we're at the root + // node and we see a closing token, then we've got an imbalanced stack. + if ( iTree.CurrentNode.IsRoot ) + { + NotifyEventLevelsImbalanced(); + } + else + { + // We expect the parent to be a level node + System.Diagnostics.Debug.Assert( iTree.CurrentNode is SymTokenBalancerMarkerLevelNode ); + + // Notify that we're about to change levels + SymTokenBalancerMarkerLevelNode currentLevel = (SymTokenBalancerMarkerLevelNode) iTree.CurrentNode; + SymNode newLevel = currentLevel.Parent; + + // The new level should not be null in this case + System.Diagnostics.Debug.Assert( newLevel != null ); + + // Check whether the closing token type is the same type as was used to start + // the level. E.g. for this case is "([ANDMORE)]" which has a mis-match + // between the opening and closing braces on each level. We can't simplify this + // during the 'end level behaviour' stage. + bool levelsBalanced = currentLevel.MatchCriteria.DiametricToken.Equals( aToken ); + + // Switch levels + iTree.CurrentNode = newLevel; + + // We have to refetch up-to-date match info, since we've changed levels, and the match + // info that was used to enter this method is associated with the previous level + // (not the new level number, which is now one less). + SymTokenBalancerMatchCriteria matchCriteria; + if ( IsClosingTokenMatch( aToken, out matchCriteria, CurrentLevelNumber ) == false ) + { + matchCriteria = aMatchCriteria; + } + + // Always store the node element so that we can balance brackets + SymTokenBalancerNodeEmittedElement node = new SymTokenBalancerNodeEmittedElement( aToken, matchCriteria ); + iTree.CurrentNode.Add( node ); + + // We have finished the current level. E.g. see step 6. Need to simplify level |2|, where possible. + PerformEndLevelBehaviour( currentLevel ); + + if ( levelsBalanced ) + { + // Notify that we've finished some level + NotifyEventLevelFinished( CurrentLevelNumber, currentLevel, newLevel ); + } + else + { + // Imbalance + NotifyEventLevelsImbalanced(); + } + } + } + + protected virtual void AddToCurrentLevel( SymToken aToken ) + { + System.Diagnostics.Debug.Write( aToken.Value ); + + SymNodeToken node = new SymNodeToken( aToken ); + iTree.CurrentNode.Add( node ); + } + + #endregion + + #region End level behaviour related + protected void PerformEndLevelBehaviour( SymTokenBalancerMarkerLevelNode aLevel ) + { + PerformEndLevelBehaviour( aLevel, aLevel.MatchCriteria ); + } + + protected virtual void PerformEndLevelBehaviour( SymNode aLevel, SymTokenBalancerMatchCriteria aCriteria ) + { + #region Example step (11a) from LevelFinished method + // + // We then add the closing bracket to level |1| which means + // that we can attempt to simplify level |2| entirely. This is the + // situation prior to simplification. + // + // |0| [ROOT] + // | + // |1| [TEST] [(] [@] [)] + // | + // |2| [(] [*] [)] [+] [(] [*] [)] + // | | + // |3| [ ] [B] [ ] [+] [ ] [C] [ ] [E] + // + // aLevel would be the @ node at level |1|. + // + // We remove redundant bracketing from our children, i.e. those on level |2|, not from our own level. + // Our parent takes care of removing this level's redundant bracketing (when it's level is completed) + // or then when an argument separator token is handled. + // + // We must iterate through level |1|'s children to find other level nodes. We check whether each + // child level node can be simplified by checking its children (i.e. our grandchildren). + // + #endregion + + if ( aCriteria.IsAssociatedBehaviourRemoveRedundantBracketing ) + { + int index = 0; + object childLevelNodeObject = aLevel.ChildByType( typeof(SymTokenBalancerMarkerLevelNode), ref index ); + while( childLevelNodeObject != null ) + { + SymTokenBalancerMarkerLevelNode childLevelNode = (SymTokenBalancerMarkerLevelNode) childLevelNodeObject; + if ( childLevelNode.CanBeSubsumed ) + { + childLevelNode.Subsume(); + } + + // Try to find next level node + ++index; + childLevelNodeObject = aLevel.ChildByType( typeof(SymTokenBalancerMarkerLevelNode), ref index ); + } + } + } + #endregion + + #region Data members + private SymTokenBalancerDocument iTree; + private SymTokenContainer iOpeningTokens = new SymTokenContainer(); + private SymTokenContainer iClosingTokens = new SymTokenContainer(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenBalancerMatchCriteria.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenBalancerMatchCriteria.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; +using SymBuildParsingLib.Tree; +using SymbianTree; + +namespace SymBuildParsingLib.Token +{ + #region Enumerations + public enum TLevelExpectations + { + ELevelExpectationsAny = 0, + ELevelExpectationsAtLevel, + ELevelExpectationsBelowLevelNumber, + ELevelExpectationsAboveLevelNumber + } + + [Flags] + public enum TAssociatedBehaviour + { + EBehaviourNone = 0, + EBehaviourRemoveReduntantBracketing = 1, + EBehaviourCreateSubTree = 2 + } + #endregion + + public class SymTokenBalancerMatchCriteria + { + #region Constructors & destructor + public SymTokenBalancerMatchCriteria( SymToken aDiametricToken, bool aEmit, bool aChangesLevel, TLevelExpectations aLevelExpectations, int aAssociatedLevel, TAssociatedBehaviour aAssociatedBehaviour ) + { + iDiametricToken = aDiametricToken; + iEmit = aEmit; + iChangesLevel = aChangesLevel; + iLevelExpectations = aLevelExpectations; + iAssociatedLevel = aAssociatedLevel; + iAssociatedBehaviour = aAssociatedBehaviour; + } + #endregion + + #region API + public bool Matches( int aLevel ) + { + bool matches = false; + // + switch( iLevelExpectations ) + { + default: + case TLevelExpectations.ELevelExpectationsAny: + matches = true; + break; + case TLevelExpectations.ELevelExpectationsAtLevel: + matches = ( aLevel == iAssociatedLevel ); + break; + case TLevelExpectations.ELevelExpectationsBelowLevelNumber: + matches = ( aLevel < iAssociatedLevel ); + break; + case TLevelExpectations.ELevelExpectationsAboveLevelNumber: + matches = ( aLevel > iAssociatedLevel ); + break; + } + // + return matches; + } + #endregion + + #region Properties + public SymToken DiametricToken + { + get { return iDiametricToken; } + } + + public bool Emit + { + get { return iEmit; } + } + + public bool ChangesLevel + { + get { return iChangesLevel; } + } + + public int AssociatedLevel + { + get { return iAssociatedLevel; } + } + + public TLevelExpectations LevelExpectations + { + get { return iLevelExpectations; } + } + + public TAssociatedBehaviour AssociatedBehaviour + { + get { return iAssociatedBehaviour; } + } + #endregion + + #region Properties - associated behaviour bitflag helpers + public bool IsAssociatedBehaviourRemoveRedundantBracketing + { + get { return ( iAssociatedBehaviour & TAssociatedBehaviour.EBehaviourRemoveReduntantBracketing ) == TAssociatedBehaviour.EBehaviourRemoveReduntantBracketing; } + } + + public bool IsAssociatedBehaviourCreateSubTree + { + get { return ( iAssociatedBehaviour & TAssociatedBehaviour.EBehaviourCreateSubTree ) == TAssociatedBehaviour.EBehaviourCreateSubTree; } + } + #endregion + + #region From System.Object + public override bool Equals( object aObject ) + { + bool same = false; + // + if ( aObject is SymTokenBalancerMatchCriteria ) + { + SymTokenBalancerMatchCriteria otherInfo = (SymTokenBalancerMatchCriteria) aObject; + // + same = ( Emit == otherInfo.Emit ) && + ( ChangesLevel == otherInfo.ChangesLevel ) && + ( LevelExpectations == otherInfo.LevelExpectations ) && + ( AssociatedLevel == otherInfo.AssociatedLevel ) && + ( AssociatedBehaviour == otherInfo.AssociatedBehaviour ); + } + // + return same; + } + #endregion + + #region Constants + public const int KAssociatedLevelDefault = 1; + #endregion + + #region Data members + private readonly SymToken iDiametricToken; + private readonly bool iEmit; + private readonly bool iChangesLevel; + private readonly TLevelExpectations iLevelExpectations = TLevelExpectations.ELevelExpectationsAny; + private readonly int iAssociatedLevel = KAssociatedLevelDefault; + private readonly TAssociatedBehaviour iAssociatedBehaviour; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenBalancerNodes.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenBalancerNodes.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,619 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; +using SymBuildParsingLib.Tree; +using SymBuildParsingLib.Token; +using SymBuildParsingLib.Common.Objects; +using SymbianTree; + +namespace SymBuildParsingLib.Token +{ + #region SymTokenBalancerDocument + public class SymTokenBalancerDocument : SymTokenDocument + { + #region Constructors & destructor + public SymTokenBalancerDocument() + { + } + #endregion + + #region Internal framework API + protected override void ExtractToContainer( SymNode aNode, SymTokenContainer aContainer ) + { + if ( aNode is SymTokenBalancerNodeEmittedElement ) + { + SymTokenBalancerNodeEmittedElement node = (SymTokenBalancerNodeEmittedElement) aNode; + node.AddToContainerIfEmittable( aContainer ); + } + } + + protected override void ExtractToDocument( SymNode aNode, SymTokenDocument aDocument ) + { + if ( aNode is SymTokenBalancerNodeEmittedElement ) + { + SymTokenBalancerNodeEmittedElement node = (SymTokenBalancerNodeEmittedElement) aNode; + node.AddToDocumentIfEmittable( aDocument ); + } + } + + protected override bool NodeIsExtractable( SymNode aNode ) + { + bool ret = false; + // + if ( aNode is SymTokenBalancerNodeEmittedElement ) + { + SymTokenBalancerNodeEmittedElement node = (SymTokenBalancerNodeEmittedElement) aNode; + ret = node.Emit; + } + // + return ret; + } + #endregion + } + #endregion + + #region SymTokenBalancerNode + public class SymTokenBalancerNode : SymNodeToken + { + #region Constructors & destructor + public SymTokenBalancerNode( SymToken aToken ) + : base( aToken ) + { + } + #endregion + } + #endregion + + #region SymTokenBalancerMarkerNode + public class SymTokenBalancerMarkerNode : SymNodeAddAsChild + { + #region Constructors & destructor + public SymTokenBalancerMarkerNode( SymTokenBalancerMatchCriteria aMatchCriteria ) + { + iMatchCriteria = aMatchCriteria; + } + #endregion + + #region Properties + public SymTokenBalancerMatchCriteria MatchCriteria + { + get { return iMatchCriteria; } + } + #endregion + + #region Data members + private readonly SymTokenBalancerMatchCriteria iMatchCriteria; + #endregion + } + #endregion + + #region SymTokenBalancerMarkerLevelNode + public class SymTokenBalancerMarkerLevelNode : SymTokenBalancerMarkerNode + { + #region Constructors & destructor + public SymTokenBalancerMarkerLevelNode( SymTokenBalancerMatchCriteria aMatchCriteria ) + : base( aMatchCriteria ) + { + } + #endregion + + #region From SymNode + public override void Replace( SymNode aReplacement ) + { + if ( HasPrevious && Previous is SymTokenBalancerNodeEmittedElement ) + { + Previous.Remove(); + } + if ( HasNext && Next is SymTokenBalancerNodeEmittedElement ) + { + Next.Remove(); + } + + base.Replace( aReplacement ); + } + #endregion + + #region API + public SymArgumentSubLevel AsArgumentSubLevel( bool aRecurse ) + { + SymArgumentSubLevel ret = new SymArgumentSubLevel( this ); + // + if ( aRecurse ) + { + foreach( SymNode child in ret ) + { + if ( child is SymTokenBalancerMarkerLevelNode ) + { + SymTokenBalancerMarkerLevelNode markerNode = (SymTokenBalancerMarkerLevelNode) child; + SymArgumentSubLevel subLevel = markerNode.AsArgumentSubLevel( aRecurse ); + ret.InsertChild( subLevel, markerNode ); + markerNode.Remove(); + } + } + } + // + return ret; + } + + public void ConvertEmittedElementsToRealTokenNodes( bool aRecurse ) + { + int i = ChildCount; + // + while( i > 0 ) + { + SymNode child = this[ --i ]; + // + if ( child is SymTokenBalancerNodeEmittedElement ) + { + SymTokenBalancerNodeEmittedElement emittedElement = (SymTokenBalancerNodeEmittedElement) child; + if ( emittedElement.Emit ) + { + SymNodeToken replacement = new SymNodeToken( emittedElement.Token ); + InsertChild( replacement, child ); + } + child.Remove(); + } + else if ( child is SymTokenBalancerMarkerLevelNode && aRecurse ) + { + SymTokenBalancerMarkerLevelNode childLevel = (SymTokenBalancerMarkerLevelNode) child; + childLevel.ConvertEmittedElementsToRealTokenNodes( aRecurse ); + } + } + } + + public int CountTokenByType( SymToken.TClass aClass ) + { + int count = 0; + // + foreach( SymNode n in this ) + { + if ( n is SymNodeToken ) + { + bool isSpecial = ( n is SymTokenBalancerNode ); + // + if ( isSpecial == false ) + { + SymToken t = ((SymNodeToken) n).Token; + // + if ( t.Class == aClass ) + { + ++count; + } + } + } + } + // + return count; + } + + public void Subsume() + { + System.Diagnostics.Debug.Assert( IsComplete ); + // + SymTokenBalancerNodeEmittedElement previous = EmittedElementPrevious; + SymTokenBalancerNodeEmittedElement next = EmittedElementNext; + + // Insert all my children as siblings of myself (i.e. make my parent's + // grandchildren its direct children - i.e. promote them up the tree + // by one level). + SymNode parent = Parent; + ArrayList parentsChildren = Parent.Children; + parent.InsertChildrenFrom( this /* my children */, previous.Previous /* move them before the opening bracket */); + + // Remove the opening bracket token + previous.Remove(); + + // Remove the closing bracket token. + next.Remove(); + + // Remove the level marker token, i.e myself + Remove(); + } + #endregion + + #region Properties + public bool CanBeSubsumed + { + get + { + bool canBeSubsumed = false; + // + if ( IsComplete ) + { + if ( AreLocalEmittedNodesDiametricallyOposite ) + { + bool isSimple = IsSimple; + // + if ( isSimple ) + { + // Deal with the case whereby we have something like this: ([SOMETHINGELSE]) + if ( ( Parent is SymTokenBalancerMarkerLevelNode) && ChildCountLevelNodes == 0 ) + { + // We don't have any child level nodes and our parent is a level (it always sound be in any case). + SymTokenBalancerMarkerLevelNode parent = (SymTokenBalancerMarkerLevelNode) Parent; + if ( parent.IsComplete ) + { + // Check whether the parent is a function. If it is, then we don't want to subsume the children. + bool isFunc = parent.IsFunction; + if ( isFunc == false ) + { + // The parent is complete, which means we can compare this level's open and closing tokens + // with the parents. + canBeSubsumed = ( parent.EmittedElementPrevious.Token.Equals( EmittedElementPrevious.Token ) && + parent.EmittedElementNext.Token.Equals( EmittedElementNext.Token ) ); + } + } + else + { + canBeSubsumed = true; + } + + } + else + { + canBeSubsumed = true; + } + } + else + { + // Check whether our children contains at least a single argument separator node. + // If it does, we can't allow it to be subsumed. + if ( ChildCountArgumentNodes == 0 ) + { + if ( Parent is SymTokenBalancerMarkerLevelNode ) + { + SymTokenBalancerMarkerLevelNode parent = (SymTokenBalancerMarkerLevelNode) Parent; + bool parentIsSimple = parent.IsSimple; + canBeSubsumed = parentIsSimple; + } + } + } + } + } + // + return canBeSubsumed; + } + } + + public bool IsFunction + { + get + { + #region Example + // + // [FUNC_NAME] [(] [*] [)] + // | + // [alpha_numeric_child] + // + #endregion + + bool bracketsAreCorrect = false; + bool hasFunctionName = false; + bool childIsValid = false; + // + if ( AreLocalEmittedNodesDiametricallyOposite ) + { + // Check that the previous node is a function name + if ( Previous.HasPrevious ) + { + SymNode previousPrevious = Previous.Previous; + if ( previousPrevious is SymNodeToken ) + { + SymNodeToken nodeToken = (SymNodeToken) previousPrevious; + hasFunctionName = (nodeToken.Token.Class == SymToken.TClass.EClassAlphaNumeric ); + } + } + + // Check that the brackets are ( and ) + bracketsAreCorrect = ( EmittedElementPrevious.Token.Value == "(" && EmittedElementNext.Token.Value == ")" ); + + // Check that the level node has but one child and that it + // is alphanumeric in nature. + if ( ChildCountByType( typeof(SymNodeToken) ) > 0 ) + { + foreach( SymNode child in this ) + { + if ( child is SymNodeToken ) + { + SymNodeToken tokenNode = (SymNodeToken) child; + // + if ( tokenNode.Token.Class == SymToken.TClass.EClassAlphaNumeric ) + { + childIsValid = true; + break; + } + } + } + } + } + + bool isFunction = (bracketsAreCorrect && hasFunctionName && childIsValid ); + return isFunction; + } + } + + public bool IsSimple + { + get + { + bool isSimple = false; + // + if ( IsFunction ) + { + isSimple = false; + } + else if ( ChildCountNonWhiteSpace == 1 ) + { + // My child is but a single node... + isSimple = true; + } + else if ( ChildCountWhiteSpace == ChildCount ) + { + // My children are just whitespace + isSimple = true; + } + else if ( ChildCountLevelNodes == 1 ) + { + int childCountLevelAndAssociatedEmittedNodes = ChildCountLevelAndAssociatedEmittedNodes; + int childCount = ChildCount; + int whiteSpaceCount = ChildCountWhiteSpace; + // + if ( (childCount - whiteSpaceCount) == childCountLevelAndAssociatedEmittedNodes ) + { + // Ignoring the whitespace nodes, all we had was a single level node plus its + // two associated emitted elements... + isSimple = true; + } + } + // + return isSimple; + } + } + + public bool IsComplete + { + get + { + bool complete = false; + + // Must have a next and a previous node. Next and previous must be + // emitted element nodes + if ( HasNext && HasPrevious ) + { + complete = ( Previous is SymTokenBalancerNodeEmittedElement && Next is SymTokenBalancerNodeEmittedElement ); + } + + return complete; + } + } + + public bool AreLocalEmittedNodesDiametricallyOposite + { + get + { + bool ret = false; + // + if ( IsComplete ) + { + SymTokenBalancerNodeEmittedElement previous = (SymTokenBalancerNodeEmittedElement) Previous; + SymTokenBalancerNodeEmittedElement next = (SymTokenBalancerNodeEmittedElement) Next; + // + if ( previous.MatchCriteria.DiametricToken.Equals( next.Token ) ) + { + // Paranoid + ret = ( next.MatchCriteria.DiametricToken.Equals( previous.Token ) ); + } + } + // + return ret; + } + } + + public SymNodeToken FunctionName + { + get + { + if ( IsFunction == false ) + { + throw new ArgumentException( "Level node is not a function node" ); + } + + System.Diagnostics.Debug.Assert( Previous.HasPrevious ); + System.Diagnostics.Debug.Assert( Previous.Previous is SymNodeToken ); + SymNodeToken functionNameToken = (SymNodeToken) Previous.Previous; + return functionNameToken; + } + } + + public SymTokenContainer ChildTokens + { + get + { + SymTokenContainer ret = new SymTokenContainer(); + // + foreach( SymNode c in this ) + { + if ( c is SymNodeToken ) + { + SymNodeToken t = (SymNodeToken) c; + ret.Append( t.Token ); + } + } + // + return ret; + } + } + + public int ChildCountWhiteSpace + { + get + { + return CountTokenByType( SymToken.TClass.EClassWhiteSpace ); + } + } + + public int ChildCountNonWhiteSpace + { + get + { + return ChildCount - ChildCountWhiteSpace; + } + } + + public int ChildCountLevelNodes + { + get + { + int count = ChildCountByType( typeof(SymTokenBalancerMarkerLevelNode) ); + return count; + } + } + + public int ChildCountLevelAndAssociatedEmittedNodes + { + get + { + int count = 0; + // + int index = 0; + object childLevelNodeObject = ChildByType( typeof(SymTokenBalancerMarkerLevelNode), ref index ); + while( childLevelNodeObject != null ) + { + // Count is incremented by one each time we find a level node + SymTokenBalancerMarkerLevelNode childLevelNode = (SymTokenBalancerMarkerLevelNode) childLevelNodeObject; + ++count; + + // It should always have a previous token. + System.Diagnostics.Debug.Assert( childLevelNode.HasPrevious ); + if ( childLevelNode.Previous is SymTokenBalancerNodeEmittedElement ) + { + ++count; + } + + // It may have a next node, assuming its complete... + if ( childLevelNode.HasNext ) + { + if ( childLevelNode.Next is SymTokenBalancerNodeEmittedElement ) + { + ++count; + } + } + + // Move to next child level node + ++index; + childLevelNodeObject = ChildByType( typeof(SymTokenBalancerMarkerLevelNode), ref index ); + } + // + return count; + } + } + + public int ChildCountArgumentNodes + { + get + { + int count = ChildCountByType( typeof(SymTokenBalancerMarkerArgumentNode) ); + return count; + } + } + + public SymTokenBalancerNodeEmittedElement EmittedElementPrevious + { + get + { + return (SymTokenBalancerNodeEmittedElement) Previous; + } + } + + public SymTokenBalancerNodeEmittedElement EmittedElementNext + { + get + { + return (SymTokenBalancerNodeEmittedElement) Next; + } + } + + #endregion + + #region Internal methods + #endregion + } + #endregion + + #region SymTokenBalancerMarkerArgumentNode + public class SymTokenBalancerMarkerArgumentNode : SymTokenBalancerMarkerNode + { + #region Constructors & destructor + public SymTokenBalancerMarkerArgumentNode( SymTokenBalancerMatchCriteria aMatchCriteria ) + : base( aMatchCriteria ) + { + } + #endregion + } + #endregion + + #region SymTokenBalancerNodeEmittedElement + public class SymTokenBalancerNodeEmittedElement : SymTokenBalancerMarkerNode + { + #region Constructors & destructor + public SymTokenBalancerNodeEmittedElement( SymToken aToken, SymTokenBalancerMatchCriteria aMatchCriteria ) + : base( aMatchCriteria ) + { + iToken = aToken; + } + #endregion + + #region API + public void AddToDocumentIfEmittable( SymDocument aDocument ) + { + if ( Emit ) + { + SymNodeToken node = new SymNodeToken( Token ); + aDocument.CurrentNode.Add( node ); + } + } + + public void AddToContainerIfEmittable( SymTokenContainer aContainer ) + { + if ( Emit ) + { + aContainer.Append( Token ); + } + } + #endregion + + #region Properties + public SymToken Token + { + get { return iToken; } + } + + public bool Emit + { + get { return MatchCriteria.Emit; } + } + #endregion + + #region Data members + private readonly SymToken iToken; + #endregion + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenContainer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenContainer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,208 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; + +namespace SymBuildParsingLib.Token +{ + public class SymTokenContainer : IEnumerable + { + #region Observer interface + public delegate void TokenHandler( SymToken aNewToken ); + #endregion + + #region Events + public event TokenHandler iTokenHandlers; + #endregion + + #region Constructors & destructor + public SymTokenContainer() + { + } + + public SymTokenContainer( SymTokenContainer aCopy ) + { + foreach( SymToken t in aCopy ) + { + Append( t ); + } + } + #endregion + + #region API + public void Append( SymToken aToken ) + { + iTokens.Add( aToken ); + // + if ( iTokenHandlers != null ) + { + iTokenHandlers( aToken ); + } + } + + public SymToken PopTail() + { + System.Diagnostics.Debug.Assert( Count > 0 ); + SymToken ret = PeekTail; + iTokens.RemoveAt( iTokens.Count - 1 ); + return ret; + } + + public SymToken PopHead() + { + System.Diagnostics.Debug.Assert( Count > 0 ); + SymToken ret = PeekHead; + iTokens.RemoveAt( 0 ); + return ret; + } + + public void Reset() + { + iTokens.Clear(); + } + + public void Remove( int aIndex ) + { + iTokens.RemoveAt( aIndex ); + } + #endregion + + #region Query API + public bool IsPresent( SymToken aToken ) + { + int index = IndexOf( aToken ); + return ( index >= 0 && index < Count ); + } + + public int IndexOf( SymToken aToken ) + { + int index = iTokens.IndexOf( aToken ); + return index; + } + + public int IndexOf( SymToken aToken, int aStartIndex ) + { + int index = iTokens.IndexOf( aToken, aStartIndex ); + return index; + } + + public int LastIndexOf( SymToken aToken ) + { + int index = iTokens.LastIndexOf( aToken ); + return index; + } + + public int LastIndexOf( SymToken aToken, int aStartIndex ) + { + int index = iTokens.LastIndexOf( aToken, aStartIndex ); + return index; + } + + public int TokenCount( SymToken aTokenToCount ) + { + int count = 0; + // + foreach( SymToken t in this ) + { + if ( t.Equals( aTokenToCount ) ) + { + ++count; + } + } + // + return count; + } + #endregion + + #region Properties + public SymToken PeekHead + { + get + { + // System.Diagnostics.Debug.Assert( Count > 0 ); - bloody visual debugger stuffs this assert up. + SymToken ret = null; + // + if ( Count > 0 ) + { + ret = (SymToken) iTokens[ 0 ]; + } + // + return ret; + } + } + + public SymToken PeekTail + { + get + { + // System.Diagnostics.Debug.Assert( Count > 0 ); - bloody visual debugger stuffs this assert up. + SymToken ret = null; + // + if ( Count > 0 ) + { + ret = (SymToken) iTokens[ iTokens.Count - 1 ]; + } + // + return ret; + } + } + + public int Count + { + get { return iTokens.Count; } + } + + public string CoalescedTokenValue + { + get + { + StringBuilder ret = new StringBuilder(); + // + foreach( SymToken token in this ) + { + ret.Append( token ); + } + // + return ret.ToString(); + } + } + #endregion + + #region IEnumerable Members + IEnumerator IEnumerable.GetEnumerator() + { + return new SymTokenContainerEnumerator( this ); + } + #endregion + + #region Indexers + public SymToken this[ int aIndex ] + { + get + { + return (SymToken) iTokens[ aIndex ]; + } + } + #endregion + + #region Data members + private ArrayList iTokens = new ArrayList( 250 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenContainerEnumerator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenContainerEnumerator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.Collections; + +namespace SymBuildParsingLib.Token +{ + internal class SymTokenContainerEnumerator : IEnumerator + { + #region Constructors & destructor + public SymTokenContainerEnumerator( SymTokenContainer aContainer ) + { + iContainer = aContainer; + } + #endregion + + #region IEnumerator Members + void IEnumerator.Reset() + { + iEnumeratorIndex = -1; + } + + object IEnumerator.Current + { + get + { + return iContainer[ iEnumeratorIndex ]; + } + } + + bool IEnumerator.MoveNext() + { + return ( ++iEnumeratorIndex < iContainer.Count ); + } + #endregion + + #region Data members + private int iEnumeratorIndex = -1; + private readonly SymTokenContainer iContainer; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenDocument.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenDocument.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,155 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections; +using SymBuildParsingLib.Tree; +using SymbianTree; + +namespace SymBuildParsingLib.Token +{ + public class SymTokenDocument : SymDocument + { + #region Constructors & destructor + public SymTokenDocument() + { + } + #endregion + + #region API + public string ChildrenAsString( bool aIgnoreWhiteSpace, bool aRecurse ) + { + SymNodeEnumeratorChildren enumerator = new SymNodeEnumeratorChildren( this ); + string ret = EnumerateNodesAsString( enumerator, aIgnoreWhiteSpace, aRecurse ); + return ret.ToString(); + } + + public SymTokenContainer ExtractTokensAsContainer( bool aIgnoreWhiteSpace, bool aRecurse ) + { + SymTokenContainer container = new SymTokenContainer(); + // + SymNodeEnumeratorChildren enumerator = new SymNodeEnumeratorChildren( this ); + ExtractTokens( enumerator, aIgnoreWhiteSpace, aRecurse, container ); + // + return container; + } + + public SymTokenDocument ExtractTokensAsDocument( bool aIgnoreWhiteSpace, bool aRecurse ) + { + SymTokenDocument doc = new SymTokenDocument(); + // + SymNodeEnumeratorChildren enumerator = new SymNodeEnumeratorChildren( this ); + ExtractTokens( enumerator, aIgnoreWhiteSpace, aRecurse, doc ); + // + return doc; + } + #endregion + + #region Utility methods + public string EnumerateNodesAsString( IEnumerable aEnumerable, bool aIgnoreWhiteSpace, bool aRecurse ) + { + // Flatten the tokens into a container + SymTokenContainer container = new SymTokenContainer(); + ExtractTokens( aEnumerable, aIgnoreWhiteSpace, aRecurse, container ); + + // Convert the container to a string + string ret = container.CoalescedTokenValue; + return ret; + } + + public void ExtractTokens( IEnumerable aEnumerable, bool aIgnoreWhiteSpace, bool aRecurse, SymTokenContainer aContainer ) + { + foreach( SymNode node in aEnumerable ) + { + if ( node.HasChildren ) + { + if ( aRecurse ) + { + ExtractTokens( node, aIgnoreWhiteSpace, aRecurse, aContainer ); + } + else + { + // Ignore - its just a placeholder for child nodes + } + } + else if ( node is SymNodeToken ) + { + SymNodeToken tokenNode = (SymNodeToken) node; + if ( !( aIgnoreWhiteSpace && tokenNode.Token.Class == SymToken.TClass.EClassWhiteSpace ) || aIgnoreWhiteSpace == false ) + { + aContainer.Append( tokenNode.Token ); + } + } + else if ( NodeIsExtractable( node ) ) + { + ExtractToContainer( node, aContainer ); + } + } + } + + public void ExtractTokens( IEnumerable aEnumerable, bool aIgnoreWhiteSpace, bool aRecurse, SymTokenDocument aDocument ) + { + foreach( SymNode node in aEnumerable ) + { + if ( node.HasChildren ) + { + if ( aRecurse ) + { + SymNode newLevelNode = new SymNodeAddAsChild(); + aDocument.CurrentNode.Add( newLevelNode ); + aDocument.CurrentNode = newLevelNode; + ExtractTokens( node, aIgnoreWhiteSpace, aRecurse, aDocument ); + aDocument.MakeParentCurrent(); + } + else + { + // Ignore - its just a placeholder for child nodes and we're not recursing + } + } + else if ( node is SymNodeToken ) + { + SymNodeToken tokenNode = (SymNodeToken) node; + if ( !( aIgnoreWhiteSpace && tokenNode.Token.Class == SymToken.TClass.EClassWhiteSpace ) || aIgnoreWhiteSpace == false ) + { + SymNodeToken copy = new SymNodeToken( tokenNode.Token ); + aDocument.CurrentNode.Add( copy ); + } + } + else if ( NodeIsExtractable( node ) ) + { + ExtractToDocument( node, aDocument ); + } + } + } + #endregion + + #region Internal framework API + protected virtual void ExtractToContainer( SymNode aNode, SymTokenContainer aContainer ) + { + } + + protected virtual void ExtractToDocument( SymNode aNode, SymTokenDocument aDocument ) + { + } + + protected virtual bool NodeIsExtractable( SymNode aNode ) + { + return false; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Token/SymTokenUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using SymBuildParsingLib.Tree; +using SymbianTree; + +namespace SymBuildParsingLib.Token +{ + public class SymTokenUtils + { + #region Trim functions + public static SymNode TrimEntireTree( SymNode aNode ) + { + return Trim( aNode, true ); + } + + public static SymNode Trim( SymNode aNode ) + { + return Trim( aNode, false ); + } + + public static void RemoveWhiteSpace( SymNode aNode, bool aRecurse ) + { + int count = aNode.ChildCount; + for( int i=count-1; i>=0; i-- ) + { + SymNode basicNode = aNode[ i ]; + + // If the node is whitespace, then remove it + if ( basicNode is SymNodeToken ) + { + SymNodeToken tokenNode = (SymNodeToken) basicNode; + bool isWhiteSpace = ( tokenNode.Token.Class == SymToken.TClass.EClassWhiteSpace ); + // + if ( isWhiteSpace ) + { + System.Diagnostics.Debug.Assert( basicNode.HasChildren == false ); + basicNode.Remove(); + } + } + + // Remove whitespace from this node's children + if ( basicNode.HasChildren && aRecurse ) + { + RemoveWhiteSpace( basicNode, aRecurse ); + } + } + } + #endregion + + #region Internal methods + public static SymNode Trim( SymNode aNode, bool aRecurse ) + { + // Forward pass + while( aNode.HasChildren ) + { + SymNode n = aNode.FirstChild; + + if ( n is SymNodeToken ) + { + SymNodeToken nodeToken = (SymNodeToken) n; + bool isWhiteSpace = ( nodeToken.Token.Class == SymToken.TClass.EClassWhiteSpace ); + // + if ( isWhiteSpace ) + { + System.Diagnostics.Debug.Assert( n.HasChildren == false ); + nodeToken.Remove(); + } + else + { + break; + } + } + else + { + break; + } + } + + // Backward pass + while( aNode.HasChildren ) + { + SymNode n = aNode.LastChild; + + if ( n is SymNodeToken ) + { + SymNodeToken nodeToken = (SymNodeToken) n; + bool isWhiteSpace = ( nodeToken.Token.Class == SymToken.TClass.EClassWhiteSpace ); + // + if ( isWhiteSpace ) + { + System.Diagnostics.Debug.Assert( n.HasChildren == false ); + nodeToken.Remove(); + } + else + { + break; + } + } + else + { + break; + } + } + + // Child pass + if ( aRecurse ) + { + foreach( SymNode n in aNode ) + { + if ( n.HasChildren ) + { + Trim( n, aRecurse ); + } + } + } + + return aNode; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Tree/SymNodeToken.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Tree/SymNodeToken.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections; +using System.Xml; +using SymBuildParsingLib.Token; +using SymbianTree; + +namespace SymBuildParsingLib.Tree +{ + public class SymNodeToken : SymNodeAddAsChild + { + #region Constructors & destructor + public SymNodeToken( SymToken aToken ) + { + Data = aToken; + } + #endregion + + #region API + public virtual int CountTokenByType( SymToken.TClass aClass ) + { + int count = 0; + // + foreach( SymNode n in this ) + { + if ( n is SymNodeToken ) + { + SymToken t = ((SymNodeToken) n).Token; + // + if ( t.Class == aClass ) + { + ++count; + } + } + } + // + return count; + } + #endregion + + #region Properties - data + public SymToken Token + { + get { return (SymToken) Data; } + set { Data = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + return Token.ToString(); + } + + public override bool Equals( object aObject ) + { + bool same = false; + // + if ( aObject is SymNodeToken ) + { + SymNodeToken otherToken = (SymNodeToken) aObject; + // + same = otherToken.Token.Equals( Token ); + } + // + return same; + } + #endregion + + #region XML + public override void ExternaliseAsXML( XmlWriter aSink ) + { + if ( Token != null ) + { + aSink.WriteAttributeString( "value", Token.Value ); + } + else + { + aSink.WriteAttributeString( "value", "" ); + } + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymEnvironment.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymEnvironment.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; + +namespace SymBuildParsingLib.Utils +{ + public class SymEnvironment + { + #region API + public static string EpocRoot + { + get + { + //string ret = System.Environment.GetEnvironmentVariable( KSymEpocRootEnvVarName ); + string ret = RootPath; + return ret; + } + } + + public static string Epoc32IncludePath + { + get + { + string ret = iRootPath + KSymEpoc32IncludePath; + return ret; + } + } + + public static string Epoc32Path + { + get + { + string ret = iRootPath + KSymEpoc32Path; + return ret; + } + } + + public static string Epoc32DataPath + { + get { return iRootPath + KSymEpoc32DataPath; } + } + + public static string RootPath + { + get { return iRootPath; } + set { iRootPath = value; } + } + #endregion + + #region Internal constants + private const string KSymEpocRootEnvVarName = "EPOCROOT"; + private const string KSymEpoc32Path = "\\EPOC32"; + private const string KSymEpoc32IncludePath = "\\EPOC32\\Include\\"; + private const string KSymEpoc32DataPath = "\\EPOC32\\Data\\"; + #endregion + + #region Data members + private static string iRootPath = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymExpressionEvaluator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymExpressionEvaluator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using Microsoft.JScript; +using Microsoft.JScript.Vsa; +using Microsoft.Vsa; + + +namespace SymBuildParsingLib.Utils +{ + public class SymExpressionEvaluator + { + #region API + public static object Evaluate( string aExpression ) + { + object ret = null; + // + try + { + ret = Microsoft.JScript.Eval.JScriptEvaluate( aExpression, iScriptEngine ); + } + catch (Exception) + { + ret = false; + } + // + return ret; + } + + public static bool EvaluateAsBoolean( string aExpression ) + { + bool ret = false; + // + object result = Evaluate( aExpression ); + // + if ( result != null ) + { + if ( result is bool ) + { + ret = (bool) result; + } + else + { + // Anything non-NULL that is not a bool will be treated + // as 'true' + ret = true; + } + } + else + { + // Null evaluation so we'll treat that as 'false' + ret = false; + } + // + return ret; + } + #endregion + + #region Data members + private static VsaEngine iScriptEngine = VsaEngine.CreateEngine(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymFileNameCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymFileNameCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections; +using System.Collections.Specialized; + +namespace SymBuildParsingLib.Utils +{ + public class SymFileNameCollection + { + #region Constructors & destructor + public SymFileNameCollection() + { + } + #endregion + + #region API + public void Add( string aFileName ) + { + bool exists = File.Exists( aFileName ); + if ( exists ) + { + bool isPresent = IsPresent( aFileName ); + if ( isPresent == false ) + { + iFiles.Add( aFileName.ToLower(), aFileName ); + } + } + + } + + public void Remove( string aFileName ) + { + bool isPresent = IsPresent( aFileName ); + if ( isPresent == false ) + { + iFiles.Remove( aFileName.ToLower() ); + } + } + + public bool IsPresent( string aFileName ) + { + bool isPresent = iFiles.ContainsKey( aFileName.ToLower() ); + return isPresent; + } + #endregion + + #region Properties + public int Count + { + get { return iFiles.Count; } + } + + public string this[ int aIndex ] + { + get + { + String[] keys = new String[ iFiles.Count ]; + iFiles.Keys.CopyTo( keys, 0 ); + // + string key = keys[ aIndex]; + string file = iFiles[ key ]; + // + return file; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private StringDictionary iFiles = new StringDictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymFileSystemUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymFileSystemUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,236 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; + +namespace SymBuildParsingLib.Utils +{ + public class SymFileSystemUtils + { + public static bool FileExists( string aFileName ) + { + FileInfo info = new FileInfo( aFileName ); + return info.Exists; + } + + public static bool IsDriveValid( string aDrive ) + { + bool valid = false; + // + if ( aDrive.Length > 0 ) + { + valid = IsDriveValid( aDrive[ 0 ] ); + } + // + return valid; + } + + public static bool IsDriveValid( char aDrive ) + { + string driveAsLowerCaseString = new string( aDrive, 1 ).ToLower(); + int drive = (int) driveAsLowerCaseString[ 0 ]; + // + int firstDrive = (int) 'a'; + int lastDrive = (int) 'z'; + // + bool valid = ( drive >= firstDrive && drive <= lastDrive ); + return valid; + } + + public static string AddPathSeparator( string aDir ) + { + string ret = aDir.Trim(); + // + int length = ret.Length; + if ( length > 0 ) + { + if ( ret[ length - 1 ] != Path.DirectorySeparatorChar ) + { + ret += Path.DirectorySeparatorChar; + } + } + // + return ret; + } + + public static string DirectoryFromPath( string aName ) + { + // C:\system\data\wibble.txt + // Returns C:\System\Data\ + string ret = Path.GetDirectoryName( aName ) + Path.DirectorySeparatorChar; + return ret; + } + + public static string DriveFromPath( string aName ) + { + // C:\\system\\data\\wibble.txt => C: + string drive = "C:"; + // + if ( Path.IsPathRooted( aName ) == true ) + { + drive = Path.GetPathRoot( aName ); + + // Check its got a drive + if ( drive.Length < 2 || drive[ 1 ] != ':' ) + { + throw new ArgumentException( "Path \'" + aName + "\' does not have a drive as its root" ); + } + + drive = drive.Substring( 0, 2 ); + } + else + { + throw new ArgumentException( "Path \'" + aName + "\' does not contain a root" ); + } + // + return drive; + } + + public static string PopDir( string aDir ) + { + string ret = DirectoryFromPath( aDir ); + ret = AddPathSeparator( ret ); + + DirectoryInfo info = new DirectoryInfo( ret ); + ret = info.Parent.FullName; + ret = AddPathSeparator( ret ); + + return ret; + } + + public static string MergePaths( string aBasePath, string aOtherPath ) + { + #region Examples + // "X:\Wibble\" + "+Build\Generated" => "X:\\EPOC32\Build\Generated"; + // "X:\Wibble\" + "..\something\" => "X:\something\" + // "X:\Wibble\" + "..something\" => "X:\Wibble\something" + // "X:\Wibble\" + "\something\" => "X:\something\" + // "X:\Wibble\" + ".\something\" => "X:\wibble\something\" + // "X:\Wibble\" + "something\" => "X:\wibble\something\" + // "X:\Wibble\" + "." => "X:\Wibble\" + // "X:\Wibble\" + "\" => "X:\Wibble\" + // "X:\Wibble\" + "a" => "X:\Wibble\a" + // "X:\Wibble\Whatsit.txt" + "X:\Wibble\" => "X:\Wibble\" + // "X:\Wibble\Whatsit.txt" + "NextWibble.txt" => "X:\Wibble\NextWibble.txt" + #endregion + string otherPath = aOtherPath; + // + string ret = aBasePath.Trim(); + ret = DirectoryFromPath(ret); + ret = AddPathSeparator(ret); + // + int length = otherPath.Length; + if (length >= 1) + { + char firstChar = otherPath[0]; + if ( firstChar == '.' ) + { + bool needToPushRemainder = false; + bool finishedCheckingForDirPops = false; + // + while( finishedCheckingForDirPops == false ) + { + // Assume we only go around once + finishedCheckingForDirPops = true; + firstChar = otherPath[0]; + length = otherPath.Length; + // + if ( firstChar == '.' ) + { + if ( length >= 2 ) + { + char secondChar = otherPath[1]; + if ( secondChar == '.' ) + { + // Keep popping directories from the base path (now stored in 'ret') + // while there are "..\" sub-strings remaining at the start of the + // "other path" + ret = PopDir(ret); + + // Tidy up the "otherPath" to remove the two dots which we just parsed + int subStringPos = 2; + if (length >= 3 && otherPath[2] == '\\') + { + subStringPos = 3; + } + // + needToPushRemainder = true; + otherPath = otherPath.Substring( subStringPos ); + finishedCheckingForDirPops = false; + } + } + } + } + + if ( needToPushRemainder ) + { + ret += otherPath; + } + } + else if ( firstChar == '\\' ) + { + if (length > 1) + { + // Root path + ret = DriveFromPath( ret ); + ret += otherPath; + } + } + else if ( firstChar == '+' && otherPath.Length > 0 ) + { + // Need to add epoc root and then EPOC32, then the path without the + + string actualPathPart = otherPath.Substring(1); + if ( actualPathPart.Length > 0 && actualPathPart[0] == '\\' ) + { + actualPathPart = actualPathPart.Substring(1); + } + + string epocRootValue = SymEnvironment.EpocRoot; + ret = DriveFromPath(ret); + ret += AddPathSeparator( epocRootValue ); + ret += AddPathSeparator( SymEnvironment.Epoc32Path ); + ret += AddPathSeparator( actualPathPart ); + } + else + { + if ( otherPath[ length-1 ] == '\\' ) + { + // Assume we already have a complete path + ret = otherPath; + } + else + { + ret += otherPath; + } + } + } + + /* + const string nameAndExt = FileNameAndExtension(ret); + const bool containsDot = (nameAndExt.find_last_of('.') != string::npos); + if (!FileExists(ret) && ret.length() && ret[ret.length()-1] != '\\' && containsDot) + { + cout << "WARNING - possible file merge error:" << endl; + cout << "\tMerging: " << aBasePath << " with: " << aOtherPath << endl; + cout << "\t\t -> " << ret << endl << endl; + } + */ + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymSemaphore.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymSemaphore.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,404 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Threading; + +namespace SymBuildParsingLib.Utils +{ + // + // Author: William Stacey (staceyw@mvps.org) + // Date: 06/10/04 + // The Dijkstra semaphore (also called a counting + // semaphore) is used to control access to + // a set of resources. A Dijkstra semaphore + // has a count associated with it and each + // Acquire() call reduces the count. A thread + // that tries to Acquire() the semaphore + // with a zero count blocks until someone else + // calls Release() to increase the count. + // + // + // + public sealed class SymSemaphore + { + #region Constructors + // + // Creates semaphore object with a maxCount + // and set initial count to maxCount. + // + // + // Maximum count for the semaphore object. + // This value must be greater than zero. + // + public SymSemaphore(int maxCount) : this(maxCount, maxCount) + { + } + + // + // Creates semaphore object with + // a maximum count and initial count. + // + // + // Maximum count for the semaphore object. + // This value must be greater than zero. + // + // + // Initial count for the semaphore object. + // This value must be zero or greater + // and less than or equal to maximumCount. + // + public SymSemaphore(int initialCount, int maxCount) + { + if ( initialCount < 0 ) + throw new + ArgumentOutOfRangeException("initialCount must be >= 0."); + if ( maxCount < 1 ) + throw new ArgumentOutOfRangeException("maxCount must be >= 1."); + if ( initialCount > maxCount) + throw new + ArgumentOutOfRangeException("initialCount" + + " must be <= maxCount."); + count = initialCount; + this.maxCount = maxCount; + syncLock = new object(); + starvationLock = new object(); + } + + #endregion + + #region Properties + // + // Gets the current available count (or slots) + // in the semaphore. A count of zero means that no slots + // are available and calls to Acquire will block until + // other thread(s) call Release. + // Example: + // A semaphore with a count of 2 will allow + // 2 more Acquire calls before blocking. + // + public int Count + { + get + { + lock(syncLock) + { + return count; + } + } + } + + // + // Gets the maximum count of the semaphore + // set during construction. + // + public int MaxCount + { + get { return maxCount; } + } + + #endregion + + #region Public Methods + + // + // Acquires semaphore and decrements count by 1. + // If count is zero, this will + // block indefinitely until another thread executes + // a Release() to increase the count. + // + // true if the call returned because + // the caller reacquired the lock for the + // specified object. This method does not return + // if the lock is not reacquired. + public bool Wait() + { + return Wait(Timeout.Infinite); + } + + // + // Returns a value indicating if Semephore + // can be acquired within the timeout period. + // + // true if the lock was acquired before + // the specified time elapsed; otherwise, false. + // + // The value of the millisecondsTimeout parameter + // is negative, and is not equal to Infinite. + // + public bool Wait(int millisecondsTimeout) + { + lock(syncLock) + { + // Use spin lock instead of an if test, to handle + // rogue/barging threads that can enter + // syncLock before a thread that was notified by a pulse. + // That rogue thread would + // decrease the count, then our "Pulsed" thread + // would regain the lock and continue and + // decrease the count to -1 which is an error. + // The while loop/test prevents this. + while ( count == 0 ) + try + { + if (!Monitor.Wait(syncLock, millisecondsTimeout)) + return false; + } + catch + { + // If we get interupted or aborted, + // we may have been pulsed before. + // If we just exit, that pulse would get lost and + // possibly result in a "live" lock + // where other threads are waiting + // on syncLock, and never get a pulse. + // Regenerate a Pulse as we consumed it. + // Even if we did not get + // pulsed, this does not hurt as any thread + // will check again for count = 0. + Monitor.Pulse(syncLock); + // Rethrow the exception for caller. + // Now semaphore state is same as if + // this call never happened. Caller must + // decide how to handle exception. + throw; + } + count--; + if ( count == 0 ) + lock(starvationLock) { Monitor.PulseAll(starvationLock); } + return true; + } + } + + // + // Acquires all the semaphores and brings + // count to zero. This has the effect + // of block other threads until we release one or more slots. + // + // + // + // true if the acquired maxCount slots. + // This method does not return until + // all slots are acquired. + public bool WaitAll() + { + // Aquires all slots or blocks for Timeout.Infinite. + return WaitAll(Timeout.Infinite); + } + + // + // Tries to acquire (maxCount) slots + // in semaphore. If any single attempt to + // acquire a semaphore slot exceeds + // millisecondsTimeout, then return is false. + // Return is true if we acquire maxCount slots. + // Normally this method would be paired + // with the ReleaseAll method. + // + // + // true if maxCount slots are acquired + // before the specified time elapsed; + // otherwise, false. + public bool WaitAll(int millisecondsTimeout) + { + int slotsGot = 0; + int elapsedMS = 0; + DateTime start = DateTime.Now; + int timeout = millisecondsTimeout; + for (int i = 0; i < maxCount; i++) + { + try + { + if (! Wait(timeout) ) + { + // Could not acquire all slots, + // release any we may already have got. + if ( slotsGot > 0 ) + Signal(slotsGot); + return false; + } + else + { + elapsedMS = (int)((TimeSpan) + (DateTime.Now - start)).TotalMilliseconds; + timeout = millisecondsTimeout - elapsedMS; + // Next wait will be a smaller timeout. + + if ( timeout < 0 ) + timeout = 0; + // Next Acquire will return + // false if we have to wait; + + slotsGot++; + // If we get all remaining slots + // with no timeout, we just keep going. + } + } + catch + { + // Catch any exception during Acquire wait. + if ( slotsGot > 0 ) + Signal(slotsGot); + throw; + } + } // end for. + // Count is not zero, so notify any/all starvation consumers. + lock(starvationLock) { Monitor.PulseAll(starvationLock); } + return true; + } + + // + // Increases the count of the semaphore object by one. + // + public void Signal() + { + Signal(1); + } + + // + // Increases the count of the semaphore + // object by a specified amount. + // + // Amount by which the semaphore + // object's current count is to be increased. + // + // The releaseCount must be one or greater. + // + // + // The releaseCount would cause + // the semaphore's count to exceed maxCount. + // + public void Signal(int releaseCount) + { + if ( releaseCount < 1 ) + throw new + ArgumentOutOfRangeException("releaseCount must be >= 1."); + + lock(syncLock) + { + if ( (count + releaseCount) > maxCount ) + throw new + ArgumentOutOfRangeException("releaseCount" + + " would cause the semaphore's count to exceed maxCount."); + count += releaseCount; + Monitor.PulseAll(syncLock); + } + } + + // + // Returns indication if we could + // release one slot in the semaphore. + // + // true if we released + // one slot; otherwise false. + public bool TryRelease() + { + return TryRelease(1); + } + + // + // Returns indication if we could release + // releaseCount slots in the semaphore. + // + // + // true if we released releaseCount + // slots; otherwise false. + public bool TryRelease(int releaseCount) + { + if ( releaseCount <= 0 ) + return false; + + lock(syncLock) + { + if ( (count + releaseCount) > maxCount ) + return false; + else + count += releaseCount; + Monitor.PulseAll(syncLock); + return true; + } + } + + // + // Releases all remaining semaphores + // not currently owned. This would normally be + // called by a thread that previously + // called AcquireAll(). Note: Be carefull when + // using this method as it will release + // all threads waiting on an Aquire method, + // which may or may not be what you want. + // An alternative would be to spin on + // TryRelease() until it returns false. + // + public void ReleaseAll() + { + lock(syncLock) + { + count = maxCount; + Monitor.PulseAll(syncLock); + // We PulseAll instead of calling pulse + // with exact number of times needed. + // This can be slightly inefficient, + // but is safe and simple. + // See http://www.mcs.drexel.edu/~shartley/ + // MCS361/Lectures/designingJavaSemaphore.html + } + } + + // + // This method blocks the calling thread + // until the semaphore count drops to zero. + // A drop to zero will not be recognized + // if a release happens before this call. + // You can use this to get notified when + // semephore's count reaches zero. This + // is also known as a "reverse-sensing" semaphore. + // + public void WaitForStarvation() + { + lock(starvationLock) + { + // We will block until count is 0. + // We use Interlocked just to be sure + // we test for zero correctly as we + // are not in the syncLock context. + if ( Interlocked.CompareExchange(ref count, 0, 0) != 0 ) + Monitor.Wait(starvationLock); + // Any Exception during wait will + // just go to caller. Do not need to signal + // any other threads as PulseAll(starvationLock) is used. + // Also note we don't do a spin + // while() test as we only care that + // count *did go to zero at some instant. + } + } + #endregion + + #region Data members + // Current count available. + private int count; + // Max slots in the semaphore. + private int maxCount; + // Object used for sync. + private readonly object syncLock; + // Object used for starvation sync. + private readonly object starvationLock; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymTextPosition.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymBuildParsingLib/Utils/SymTextPosition.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; + +namespace SymBuildParsingLib.Utils +{ + public class SymTextPosition + { + #region Constructors & destructor + public SymTextPosition() + { + iLine = 1; + iColumn = 1; + } + + public SymTextPosition( long aLine, long aColumn ) + { + iLine = aLine; + iColumn = aColumn; + } + + public SymTextPosition( SymTextPosition aCopy ) + { + iLine = aCopy.Line; + iColumn = aCopy.Column; + } + #endregion + + #region API + public void Inc() + { + iColumn++; + } + + public void Inc( int aColumnAmount ) + { + iColumn += aColumnAmount; + } + + public void NewLine() + { + iLine++; + iColumn = 1; + } + #endregion + + #region Properties + public long Line + { + get { return iLine; } + set { iLine = value; } + } + + public long Column + { + get { return iColumn; } + set { iColumn = value; } + } + #endregion + + #region Data members + private long iLine; + private long iColumn; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/DbgEnginePlugin/CodePlugin.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/DbgEnginePlugin/CodePlugin.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Code; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianCodeLib.SourceManagement; +using SymbianCodeLib.SourceManagement.Source; +using SymbianCodeLib.SourceManagement.Provisioning; + +namespace SymbianCodeLib.DbgEnginePlugin +{ + internal class CodePlugin : DbgEngineCode, ITracer + { + #region Constructors + public CodePlugin( DbgEngine aEngine ) + : base( aEngine ) + { + iSourceManager = new CodeSourceManager( this ); + iProvisioningManager = new CodeSourceProviderManager( this, aEngine.IdAllocator ); + } + #endregion + + #region From DbgSymbolEngine + public override bool IsReady + { + get { return true; } + } + + public override string Name + { + get { return "DbgPluginCode"; } + } + + public override bool IsSupported( string aFileName, out string aType ) + { + CodeSourceProvider provider = iProvisioningManager.GetProvider( aFileName ); + // + if ( provider != null ) + { + aType = provider.Name; + } + else + { + aType = string.Empty; + } + // + return provider != null; + } + + public override DbgPluginPrimer CreatePrimer() + { + return new CodePrimer( this ); + } + + public override void PrepareToPrime( DbgEntityList aEntities ) + { + List fileNames = new List(); + foreach ( DbgEntity entity in aEntities ) + { + fileNames.Add( entity.FullName ); + } + + ProvisioningManager.PrepareToCreateSources( fileNames ); + } + + protected override DbgPluginView DoCreateView( string aName ) + { + CodeView ret = new CodeView( aName, this ); + return ret; + } + + protected override void DoClear() + { + if ( iSourceManager != null ) + { + iSourceManager.Dispose(); + } + iSourceManager = new CodeSourceManager( this ); + } + #endregion + + #region API + #endregion + + #region Properties + internal CodeSourceManager SourceManager + { + get { return iSourceManager; } + } + + internal CodeSourceProviderManager ProvisioningManager + { + get { return iProvisioningManager; } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iProvisioningManager.Dispose(); + iSourceManager.Dispose(); + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private CodeSourceManager iSourceManager; + private readonly CodeSourceProviderManager iProvisioningManager; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/DbgEnginePlugin/CodePrimer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/DbgEnginePlugin/CodePrimer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,360 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.CodeSegments; +using SymbianDebugLib.Entity; +using SymbianDebugLib.PluginAPI; +using SymbianCodeLib.SourceManagement.Source; +using SymbianCodeLib.SourceManagement.Provisioning; + +namespace SymbianCodeLib.DbgEnginePlugin +{ + internal class CodePrimer : DbgPluginPrimer + { + #region Constructors + public CodePrimer( CodePlugin aPlugin ) + : base( aPlugin ) + { + } + #endregion + + #region From DbgPluginPrimer + public override void Add( DbgEntity aEntity ) + { + CodeSourceProvider provider = null; + // + if ( aEntity.FSEntity.IsFile ) + { + if ( aEntity.Exists && aEntity.FSEntity.IsValid ) + { + provider = ProvisioningManager.GetProvider( aEntity.FSEntity.FullName ); + } + // + if ( provider != null ) + { + using ( CodeSourceCollection sources = provider.CreateSources( aEntity.FullName ) ) + { + // Make sure the time to read attribute is setup in alignment with + // whether the entity was explicitly added by the user or found implicitly + // by scanning. + if ( aEntity.WasAddedExplicitly == false ) + { + foreach ( CodeSource source in sources ) + { + // This means, don't read this source until it is actually + // referenced by the client. I.e. until the client activates + // a code segment that refers to this + source.TimeToRead = CodeSource.TTimeToRead.EReadWhenNeeded; + } + } + + // Ownership is transferred + iSources.AddRange( sources ); + sources.Clear(); + } + } + else + { + throw new NotSupportedException( "Specified file type is not supported" ); + } + } + else + { + throw new ArgumentException( "SymbianCodeLib does not support directory entities" ); + } + } + + public override void Prime( TSynchronicity aSynchronicity ) + { + CodePlugin plugin = this.Plugin; + + // Wipe any state ready for new priming attempt + base.OnPrepareToPrime(); + if ( base.ResetEngineBeforePriming ) + { + plugin.Clear(); + } + + // Report the "priming started event" prior to adding the sources + base.ReportEvent( TPrimeEvent.EEventPrimingStarted, null ); + + // Any sources already registered with the source manager at the start of a new + // priming request are assumed to already be complete. + RecordAlreadyCompletedSources(); + + // Initially, whilst adding the sources to the source manager, we'll + // operate synchronously. This prevents us from triggering the read + // operation in the SourceAdded callback below. + iSynchronicity = TSynchronicity.ESynchronous; + + // Listen to source manager events in case any new sources are + // created whilst reading those we already know about. + CodeSourceManager sourceManager = this.SourceManager; + sourceManager.SourceAdded += new CodeSourceManager.SourceEventHandler( SourceManager_SourceAdded ); + sourceManager.SourceRemoved += new CodeSourceManager.SourceEventHandler( SourceManager_SourceRemoved ); + + // Tell the source manager which sources we are reading. This also will + // call our event handler (added above) so that we can observe source events. + CodeSourceCollection sources = iSources; + iSources = new CodeSourceCollection(); + sourceManager.AddRange( sources ); + + // If we're operating asynchronously, then the loop below will potentially + // complete quite quickly. This means that any (new/additional) sources which + // are created (asynchronously) whilst reading is underway will not themselves + // be read. + // + // Therefore, we store the synchronisation mode as a data member, and when + // 'SourceAdded' is called, if operating asynchronously, we'll also initiate + // a read operation for the source (as soon as it is added). + // + // If we're operating synchronously, then this isn't important. Because we're + // behaving synchronously, the loop below will only process one source at a + // time (before waiting) and therefore even if that source adds new/additional + // sources to the source manager, we'll catch them as soon as we move the + // next iteration around the loop. + iSynchronicity = aSynchronicity; + + // TODO: possibly re-write this so that it uses two separate code paths + // for synchronous and asynchronous priming? By trying to use one path + // this code looks rather complex and isn't terribly robust. + try + { + // Now we can start the sources running. + int count = iSourcesYetToBePrimed.Count; + while ( count > 0 ) + { + // Get the head source and remove it from the pending list + CodeSource source = iSourcesYetToBePrimed[ 0 ]; + iSourcesYetToBePrimed.Remove( source ); + + // If the source wants to read it's data immediately, then activated + // it right now... + if ( source.TimeToRead == CodeSource.TTimeToRead.EReadWhenPriming ) + { + source.Read( aSynchronicity ); + } + else + { + // This source will read it's data on it's own terms so skip + // it to ensure that we can track when all the other sources + // (that do actually read their files now..) are ready. + Skip( source ); + } + + count = iSourcesYetToBePrimed.Count; + } + } + catch( Exception e ) + { + // If priming failed, report completion before rethrowing... + OnPrimeComplete(); + throw e; + } + } + + protected override void OnPrimeComplete() + { + System.Diagnostics.Debug.Assert( iSourcesYetToBePrimed.Count == 0 ); + try + { + SourceManager.SourceAdded -= new CodeSourceManager.SourceEventHandler( SourceManager_SourceAdded ); + SourceManager.SourceRemoved -= new CodeSourceManager.SourceEventHandler( SourceManager_SourceRemoved ); + // + base.OnPrimeComplete(); + } + finally + { + SourceEventsUnsubscribe(); + } + } + + protected override int Count + { + get + { + int count = SourceManager.Count; + return count; + } + } + #endregion + + #region API + #endregion + + #region Properties + internal CodePlugin Plugin + { + get { return base.Engine as CodePlugin; } + } + + internal CodeSourceManager SourceManager + { + get { return Plugin.SourceManager; } + } + + internal CodeSourceProviderManager ProvisioningManager + { + get { return Plugin.ProvisioningManager; } + } + #endregion + + #region Event handlers + private void SourceManager_SourceAdded( CodeSource aSource ) + { + base.Engine.Trace( "[CodePrimer] SourceManager_SourceAdded - aSource: {0}, time to read: {1}", aSource, aSource.TimeToRead ); + + aSource.EventHandler += new CodeSource.EventHandlerFunction( Source_EventHandler ); + bool needToSave = true; + + // If we're in async mode and the source wants to be read immediately + // then kick it off. If we're operating in sync mode, then this will + // be done as part of the loop within 'Prime'. + if ( iSynchronicity == TSynchronicity.EAsynchronous ) + { + if ( aSource.TimeToRead == CodeSource.TTimeToRead.EReadWhenPriming ) + { + aSource.Read( iSynchronicity ); + } + else + { + // This source will read it's data on it's own terms so skip + // it to ensure that we can track when all the other sources + // (that do actually read their files now..) are ready. + Skip( aSource ); + } + + // We don't need to add it to the 'yet to be primed' list because + // it's either been 'read' or then it only supports read-on-demand. + needToSave = false; + } + + if ( needToSave ) + { + lock ( iSourcesYetToBePrimed ) + { + iSourcesYetToBePrimed.Add( aSource ); + } + } + + base.Engine.Trace( string.Format( "[SourceManager_SourceAdded] {0}, srcCount: {1}, yetToBePrimed: {2}", aSource.URI, SourceManager.Count, iSourcesYetToBePrimed.Count ) ); + } + + private void SourceManager_SourceRemoved( CodeSource aSource ) + { + base.Engine.Trace( string.Format( "[SourceManager_SourceRemoved] START - {0}, srcCount: {1}, yetToBePrimed: {2}", aSource.URI, SourceManager.Count, iSourcesYetToBePrimed.Count ) ); + + aSource.EventHandler -= new CodeSource.EventHandlerFunction( Source_EventHandler ); + + base.RemoveFromCompleted( aSource ); + lock ( iSourcesYetToBePrimed ) + { + iSourcesYetToBePrimed.Remove( aSource ); + } + + // Check for completion since removing a source might mean that we've now + // reached completed state (if it was the last one that we were waiting for) + bool amComplete = base.IsComplete; + if ( amComplete ) + { + CheckForCompletion( amComplete ); + } + + base.Engine.Trace( string.Format( "[SourceManager_SourceRemoved] END - {0}, srcCount: {1}, yetToBePrimed: {2}, amComplete: {3}", aSource.URI, SourceManager.Count, iSourcesYetToBePrimed.Count, amComplete ) ); + } + + private void Source_EventHandler( CodeSource.TEvent aEvent, CodeSource aSource, object aData ) + { + bool primeCompleted = false; + + // Map source event onto a primer event + if ( aEvent == CodeSource.TEvent.EReadingProgress ) + { + base.SaveLatestProgress( aSource, (int) aData ); + } + + // If all sources are complete, then are we also done? + if ( aEvent == CodeSource.TEvent.EReadingComplete ) + { + // We don't need to listen to this source anymore + aSource.EventHandler -= new CodeSource.EventHandlerFunction( Source_EventHandler ); + + // Source is 100% complete now. + base.SaveLatestProgress( aSource, 100 ); + + // It's complete, so record as such so that we can tell when all the sources + // are now ready. + primeCompleted = base.AddToCompleted( aSource ); + } + + CheckForCompletion( primeCompleted ); + } + #endregion + + #region Internal methods + private void Skip( CodeSource aSource ) + { + System.Diagnostics.Debug.Assert( aSource.TimeToRead == CodeSource.TTimeToRead.EReadWhenNeeded ); + bool primeCompleted = base.AddToCompleted( aSource ); + CheckForCompletion( primeCompleted ); + } + + private void SourceEventsUnsubscribe() + { + foreach ( CodeSource source in SourceManager ) + { + source.EventHandler -= new CodeSource.EventHandlerFunction( Source_EventHandler ); + } + } + + private void CheckForCompletion( bool aAmIComplete ) + { + // Report any progress + base.ReportProgressIfNeeded( aAmIComplete ); + + // Tidy up and report completion + if ( aAmIComplete ) + { + OnPrimeComplete(); + } + } + + private void RecordAlreadyCompletedSources() + { + CodeSourceManager sourceManager = this.SourceManager; + foreach ( CodeSource source in sourceManager ) + { + base.AddToCompleted( source ); + } + } + #endregion + + #region Data members + private TSynchronicity iSynchronicity = TSynchronicity.ESynchronous; + private CodeSourceCollection iSources = new CodeSourceCollection(); + private CodeSourceCollection iSourcesYetToBePrimed = new CodeSourceCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/DbgEnginePlugin/CodeView.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/DbgEnginePlugin/CodeView.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.Debug.Code; +using SymbianStructuresLib.CodeSegments; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Code; +using SymbianCodeLib.QueryAPI; +using SymbianCodeLib.Relocator; +using SymbianCodeLib.DbgEnginePlugin; +using SymbianCodeLib.SourceManagement.Source; +using SymbianCodeLib.SourceManagement.Provisioning; + +namespace SymbianCodeLib.DbgEnginePlugin +{ + public class CodeView : DbgViewCode + { + #region Constructors + internal CodeView( string aToken, CodePlugin aPlugin ) + : base( aToken, aPlugin ) + { + iRelocator = new CodeRelocator( aPlugin ); + iQueryAPI = new CodeQueryAPI( iRelocator ); + } + #endregion + + #region From DbgPluginView + public override bool Contains( uint aAddress ) + { + bool ret = iQueryAPI.Contains( aAddress ); + return ret; + } + + public override bool Activate( CodeSegDefinition aCodeSegment ) + { + bool activated = ActivateAndGetCollection( aCodeSegment ) != null; + return activated; + } + + public override bool Deactivate( CodeSegDefinition aCodeSegment ) + { + return iRelocator.Deactivate( aCodeSegment ); + } + + public override bool IsReady + { + get + { + // For a view to be ready we must have at least one + // activated, i.e. 'ready' symbol source. + int count = 0; + + // Check with dynamic activations + foreach ( CodeSourceAndCollection pair in iRelocator ) + { + if ( pair.Source.TimeToRead == CodeSource.TTimeToRead.EReadWhenPriming ) + { + ++count; + break; // No need to count anymore + } + } + + // Try to find any fixed activation entries + if ( count == 0 ) + { + CodeSourceManager allSources = this.SourceManager; + foreach ( CodeSource source in allSources ) + { + count += source.CountActivated; + if ( count > 0 ) + { + break; + } + } + } + + return ( count > 0 ); + } + } + #endregion + + #region From DbgViewCode + public override CodeCollection ActivateAndGetCollection( CodeSegDefinition aCodeSegment ) + { + CodeCollection ret = iRelocator.Activate( aCodeSegment ); + return ret; + } + + protected override bool DoGetInstructions( uint aAddress, TArmInstructionSet aInstructionSet, int aCount, out IArmInstruction[] aInstructions ) + { + bool ret = iQueryAPI.GetInstructions( aAddress, aInstructionSet, aCount, out aInstructions ); + return ret; + } + + public override IArmInstruction ConvertToInstruction( uint aAddress, TArmInstructionSet aInstructionSet, uint aRawValue ) + { + CodePlugin plugin = this.Plugin; + IArmInstruction[] ret = plugin.ProvisioningManager.InstructionLibrary.ConvertToInstructions( aInstructionSet, new uint[ 1 ] { aRawValue }, aAddress ); + System.Diagnostics.Debug.Assert( ret != null && ret.Length == 1 ); + return ret[ 0 ]; + } + #endregion + + #region API + #endregion + + #region Properties + internal CodeSourceManager SourceManager + { + get { return Plugin.SourceManager; } + } + #endregion + + #region Internal methods + internal CodePlugin Plugin + { + get { return base.Engine as CodePlugin; } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iRelocator.Dispose(); + } + } + #endregion + + #region Data members + private readonly CodeQueryAPI iQueryAPI; + private readonly CodeRelocator iRelocator; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Plugins/CLPluginSymbianOS/CLPluginImg.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Plugins/CLPluginSymbianOS/CLPluginImg.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,78 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {3878E434-8B76-4127-BA89-68A90DA6E69A} + Library + Properties + CLPluginImg + CLPluginImg.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB} + SymbianImageLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {A041EDFE-A120-4100-A0A6-FB1984D80815} + SymbianCodeLib + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Plugins/CLPluginSymbianOS/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Plugins/CLPluginSymbianOS/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "CLPluginImg" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia" )] +[assembly: AssemblyProduct( "CLPluginImg" )] +[assembly: AssemblyCopyright( "Copyright © Nokia 2009" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "bbb034fa-776e-4a08-a95e-1c507f81e038" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Plugins/CLPluginSymbianOS/Provider/ImgSourceProvider.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Plugins/CLPluginSymbianOS/Provider/ImgSourceProvider.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Debug.Code; +using SymbianCodeLib.SourceManagement.Source; +using SymbianCodeLib.SourceManagement.Provisioning; +using SymbianUtils.FileTypes; +using SymbianUtils; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Content; +using CLPluginImg.Reader; +using CLPluginImg.Source; + +namespace CLPluginImg.Provider +{ + public class ImgSourceProvider : CodeSourceProvider + { + #region Constructors + public ImgSourceProvider( CodeSourceProviderManager aManager ) + : base( aManager ) + { + } + #endregion + + #region From SymSourceProvider + public override CodeSourceCollection CreateSources( string aFileName ) + { + SIImage image = SIImage.New( base.Tracer, aFileName ); + if ( image == null ) + { + throw new NotSupportedException( "The specified image file is not supported" ); + } + + // We need to make a source and (single) collection for each content object within the image. + // This enables relocation support when an image is actually used (i.e. read & decompress code + // on demand, rather than up front). + CodeSourceCollection sources = new CodeSourceCollection(); + // + foreach ( SIContent content in image ) + { + CodeCollection collection = CodeCollection.New( base.IdAllocator, aFileName, content.FileName ); + collection.IsRelocatable = content.IsRelocationSupported; + + // The URI must be unique + string uri = string.Format( "{0} [{1}]", aFileName, content.FileName ); + ImgSource source = new ImgSource( uri, this, collection, content ); + sources.Add( source ); + } + // + return sources; + } + + public override SymFileTypeList FileTypes + { + get + { + SymFileTypeList ret = new SymFileTypeList(); + // + ret.Add( new SymFileType( ".img", "Symbian OS Image Files" ) ); + // + return ret; + } + } + + public override string Name + { + get { return "SYMBIAN OS IMAGE"; } + } + #endregion + + #region Properties + #endregion + + #region Event handlers + + #endregion + + #region Internal constants + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Plugins/CLPluginSymbianOS/Reader/ImgReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Plugins/CLPluginSymbianOS/Reader/ImgReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Code; +using SymbianStructuresLib.Debug.Code.Interfaces; +using SymbianCodeLib.SourceManagement.Source; +using SymbianCodeLib.SourceManagement.Provisioning; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Content; +using CLPluginImg.Source; +using CLPluginImg.Provider; + +namespace CLPluginImg.Reader +{ + internal class ImgReader : DisposableObject + { + #region Constructors + public ImgReader( ImgSource aSource, ITracer aTracer ) + { + iSource = aSource; + iImageContent = aSource.ImageContent; + iImageContent.DecompressionEvent += new SIContent.DecompressionEventHandler( ImageContent_PreparationEvent ); + } + #endregion + + #region API + public void Read( TSynchronicity aSynchronicity ) + { + iImageContent.PrepareContent( aSynchronicity ); + } + #endregion + + #region Properties + protected CodeCollection Collection + { + get + { + SymbianUtils.SymDebug.SymDebugger.Assert( iSource.Count == 1 ); + return iSource[ 0 ]; + } + } + #endregion + + #region Event handlers + private void ImageContent_PreparationEvent( SIContent.TDecompressionEvent aEvent, SIContent aFile, object aData ) + { + switch ( aEvent ) + { + case SIContent.TDecompressionEvent.EEventDecompressionStarting: + iSource.ReportEvent( CodeSource.TEvent.EReadingStarted ); + break; + case SIContent.TDecompressionEvent.EEventDecompressionProgress: + iSource.ReportEvent( CodeSource.TEvent.EReadingProgress,( aData != null && aData is Int32 ) ? (int) aData : 0 ); + break; + case SIContent.TDecompressionEvent.EEventDecompressionComplete: + OnComplete(); + break; + } + } + #endregion + + #region Internal methods + private void OnComplete() + { + iSource.ReportEvent( CodeSource.TEvent.EReadingComplete ); + this.Dispose(); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iImageContent.DecompressionEvent -= new SIContent.DecompressionEventHandler( ImageContent_PreparationEvent ); + } + } + #endregion + + #region Data members + private readonly CodeSource iSource; + private readonly SIContent iImageContent; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Plugins/CLPluginSymbianOS/Source/ImgSource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Plugins/CLPluginSymbianOS/Source/ImgSource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,144 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Code; +using SymbianStructuresLib.Debug.Code.Interfaces; +using SymbianCodeLib.SourceManagement.Source; +using SymbianCodeLib.SourceManagement.Provisioning; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.FileTypes; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Content; +using SymbianImageLib.ROM.Image; +using CLPluginImg.Provider; +using CLPluginImg.Reader; + +namespace CLPluginImg.Source +{ + internal class ImgSource : CodeSource, ICodeCollectionInstructionConverter + { + #region Constructors + public ImgSource( string aURI, CodeSourceProvider aProvider, CodeCollection aCollection, SIContent aImageContent ) + : base( aURI, aProvider ) + { + iImageContent = aImageContent; + + // Make sure we receive any requests from the collection object for code. + aCollection.IfaceInstructionConverter = this; + aCollection.IsRelocatable = aImageContent.IsRelocationSupported; + + // XIP content should be read during priming. + TTimeToRead timeToRead = TTimeToRead.EReadWhenPriming; + if ( aImageContent.IsRelocationSupported ) + { + timeToRead = TTimeToRead.EReadWhenNeeded; + } + else + { + // If the image is fixed, then so is the collection base address + aCollection.Relocate( aImageContent.RelocationAddress ); + } + + // Must add the collection *after* setting it's properties + base.TimeToRead = timeToRead; + base.Add( aCollection ); + } + #endregion + + #region From CodeSource + protected override void DoRead( TSynchronicity aSynchronicity ) + { + ImgReader reader = new ImgReader( this, Provider.Tracer ); + reader.Read( aSynchronicity ); + } + + protected override void OnReadComplete() + { + try + { + base.OnReadComplete(); + } + finally + { + System.Diagnostics.Debug.Assert( base.Count == 1 ); + CodeCollection col = this[ 0 ]; + bool codeAvailable = col.IsCodeAvailable; + // + if ( iImageContent != null && codeAvailable == false ) + { + // Update the underlying collection with it. + col.Code = iImageContent.GetAllData(); + + // Don't need this anymore + iImageContent.Dispose(); + iImageContent = null; + } + } + } + #endregion + + #region Properties + public SIContent ImageContent + { + get { return iImageContent; } + } + + public new ImgSourceProvider Provider + { + get + { + ImgSourceProvider provider = (ImgSourceProvider) base.Provider; + return provider; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iImageContent != null ) + { + iImageContent.Dispose(); + iImageContent = null; + } + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private SIContent iImageContent; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "d9e6c6d9-09c9-4e6d-9864-fc2a7b2eb3b9" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/QueryAPI/CodeQueryAPI.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/QueryAPI/CodeQueryAPI.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,178 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianUtils.Range; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Code; +using SymbianStructuresLib.Debug.Common.FileName; +using SymbianCodeLib.SourceManagement.Source; +using SymbianCodeLib.Relocator; + +namespace SymbianCodeLib.QueryAPI +{ + internal class CodeQueryAPI : IEnumerable + { + #region Constructors + internal CodeQueryAPI( CodeRelocator aRelocator ) + { + iRelocator = aRelocator; + } + #endregion + + #region API + public bool Contains( uint aAddress ) + { + // First check with the relocated/activated symbol collections, + // i.e. RAM-loaded code that has been fixed up. + bool ret = iRelocator.CollectionList.Contains( aAddress ); + if ( ret == false ) + { + // Wasn't a relocated symbol collection, so search through + // all sources for ROM/XIP symbols that might match. + foreach ( CodeSource source in SourceManager ) + { + if ( source.Contains( aAddress ) ) + { + ret = true; + break; + } + } + } + // + return ret; + } + + public bool GetInstructions( uint aAddress, TArmInstructionSet aInstructionSet, int aCount, out IArmInstruction[] aInstructions ) + { + // First check with the relocated/activated code collections, + // i.e. RAM-loaded code that has been fixed up. + bool ret = iRelocator.CollectionList.GetInstructions( aAddress, aInstructionSet, aCount, out aInstructions ); + if ( ret == false ) + { + foreach ( CodeSource source in SourceManager ) + { + if ( source.Contains( aAddress ) ) + { + ret = source.ProvideInstructions( aAddress, aInstructionSet, aCount, out aInstructions ); + break; + } + } + } + // + return ret; + } + #endregion + + #region Properties + public CodeCollection this[ CodeSegDefinition aCodeSeg ] + { + get + { + CodeCollection ret = null; + CodeSourceAndCollection pair = SourceManager[ aCodeSeg ]; + if ( pair != null ) + { + ret = pair.Collection; + } + return ret; + } + } + + public CodeCollection this[ PlatformFileName aFileName ] + { + get + { + CodeCollection ret = null; + // + foreach ( CodeSource source in SourceManager ) + { + CodeCollection col = source[ aFileName ]; + if ( col != null ) + { + ret = col; + break; + } + } + // + return ret; + } + } + #endregion + + #region Internal methods + internal CodeSourceManager SourceManager + { + get { return iRelocator.SourceManager; } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + // This gives us explicit activations + CodeCollectionList list = iRelocator.CollectionList; + foreach ( CodeCollection col in list ) + { + yield return col; + } + + // Next we need fixed collections + IEnumerable fixedCols = iRelocator.SourceManager.GetFixedCollectionEnumerator(); + foreach ( CodeCollection col in fixedCols ) + { + if ( col.IsFixed ) + { + yield return col; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + // This gives us explicit activations + CodeCollectionList list = iRelocator.CollectionList; + foreach ( CodeCollection col in list ) + { + yield return col; + } + + // Next we need fixed collections + IEnumerable fixedCols = iRelocator.SourceManager.GetFixedCollectionEnumerator(); + foreach ( CodeCollection col in fixedCols ) + { + if ( col.IsFixed ) + { + yield return col; + } + } + } + #endregion + + #region Data members + private readonly CodeRelocator iRelocator; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Relocator/CodeRelocator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/Relocator/CodeRelocator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,227 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianStructuresLib.Debug.Code; +using SymbianStructuresLib.CodeSegments; +using SymbianCodeLib.DbgEnginePlugin; +using SymbianCodeLib.SourceManagement.Source; +using SymbianCodeLib.QueryAPI; + +namespace SymbianCodeLib.Relocator +{ + internal class CodeRelocator : DisposableObject, IEnumerable + { + #region Constructors + public CodeRelocator( CodePlugin aPlugin ) + { + iPlugin = aPlugin; + } + #endregion + + #region API + public CodeCollection Activate( CodeSegDefinition aCodeSegment ) + { + CodeCollection ret = null; + + // Find the corresponding Code seg + CodeSourceAndCollection pair = SourceManager[ aCodeSegment ]; + if ( pair != null ) + { + CodeCollection col = pair.Collection; + if ( col.IsFixed ) + { + // Cannot activate a fixed Code segment - TODO: should this return "true", i.e. already activated? + } + else + { + bool safe = CheckSafeToActivate( aCodeSegment ); + if ( safe ) + { + // Deep copy the collection + CodeCollection dupe = CodeCollection.NewCopy( iPlugin.ProvisioningManager.IdAllocator, col ); + + // Set new process-specific relocated base address. This causes the underlying code to be + // decompressed/read if not already done so. + dupe.Relocate( aCodeSegment.Base ); + + // At this point, the code owned by 'col' will have definitely been read (if available) + // and that means col.IsCodeAvailable is probably true. However, dupe.IsCodeAvailable + // is almost certainly false so we may need to copy the code over... + if ( dupe.IsCodeAvailable == false && col.IsCodeAvailable == true ) + { + dupe.Code = col.Code; + } + System.Diagnostics.Debug.Assert( dupe.IsCodeAvailable == col.IsCodeAvailable ); + + // Save so that we can unload it later + pair = new CodeSourceAndCollection( pair, dupe ); + AddToActivationList( pair, aCodeSegment ); + + // We managed to activate a binary, so return the collection + ret = dupe; + + iPlugin.Trace( "[C] ACTIVATE - {0}", aCodeSegment ); + } + } + } + // + return ret; + } + + public bool Deactivate( CodeSegDefinition aCodeSegment ) + { + bool activated = iActivationLUT.ContainsKey( aCodeSegment ); + // + if ( activated ) + { + CodeSourceAndCollection pair = iActivationLUT[ aCodeSegment ]; + // + iActivatedCollections.Remove( pair.Collection ); + iActivationLUT.Remove( aCodeSegment ); + // + iPlugin.Trace( "[C] DEACTIVATE - {0} @ {1}", pair.Collection.FileName, aCodeSegment ); + } + // + return activated; + } + #endregion + + #region Properties + public CodeCollectionList CollectionList + { + get { return iActivatedCollections; } + } + + public int Count + { + get + { + System.Diagnostics.Debug.Assert( iActivatedCollections.Count == iActivationLUT.Count ); + return iActivationLUT.Count; + } + } + #endregion + + #region Internal methods + internal CodePlugin Plugin + { + get { return iPlugin; } + } + + internal CodeSourceManager SourceManager + { + get { return Plugin.SourceManager; } + } + + private void AddToActivationList( CodeSourceAndCollection aEntry, CodeSegDefinition aCodeSegment ) + { + lock ( iActivatedCollections ) + { + iActivatedCollections.Add( aEntry.Collection ); + } + lock ( iActivationLUT ) + { + iActivationLUT.Add( aCodeSegment, aEntry ); + } + } + + private bool CheckSafeToActivate( CodeSegDefinition aCodeSegment ) + { + lock ( iActivationLUT ) + { + bool alreadyExists = iActivationLUT.ContainsKey( aCodeSegment ); + if ( alreadyExists ) + { + // Specified Code segment already activated + return false; + } + else + { + // We must check that there's no overlap in activation ranges between Code segments. + foreach ( KeyValuePair kvp in iActivationLUT ) + { + AddressRange range = kvp.Key; + if ( range.Contains( aCodeSegment ) ) + { + // Overlaps with existing activated Code segment + return false; + } + } + } + // + return true; + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( KeyValuePair kvp in iActivationLUT ) + { + yield return kvp.Value; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair kvp in iActivationLUT ) + { + yield return kvp.Value; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + foreach ( CodeCollection col in iActivatedCollections ) + { + // Fixed collections are immediately discarded + if ( !col.IsFixed ) + { + col.Dispose(); + } + } + + iActivatedCollections.Clear(); + iActivationLUT.Clear(); + } + } + #endregion + + #region Data members + private readonly CodePlugin iPlugin; + private CodeCollectionList iActivatedCollections = new CodeCollectionList(); + private Dictionary iActivationLUT = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Provisioning/CodeSourceProvider.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Provisioning/CodeSourceProvider.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.Debug.Common.Id; +using SymbianStructuresLib.Debug.Common.Interfaces; +using SymbianCodeLib.DbgEnginePlugin; +using SymbianCodeLib.SourceManagement.Source; +using SymbianInstructionLib.Arm.Library; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianCodeLib.SourceManagement.Provisioning +{ + public abstract class CodeSourceProvider : DisposableObject + { + #region Constructors + protected CodeSourceProvider( CodeSourceProviderManager aManager ) + { + iManager = aManager; + } + #endregion + + #region Framework API + public virtual bool IsSupported( string aFileName ) + { + SymFileTypeList fileTypes = FileTypes; + string extension = Path.GetExtension( aFileName ); + // + bool ret = fileTypes.IsSupported( extension ); + return ret; + } + + public virtual CodeSourceCollection CreateSources( string aName ) + { + throw new NotSupportedException( "Support not implemented by " + this.GetType().ToString() ); + } + + public abstract SymFileTypeList FileTypes + { + get; + } + + public abstract string Name + { + get; + } + + public virtual string GetFileName( CodeSource aSource ) + { + string ret = aSource.URI; + return ret; + } + + public virtual void PrepareToCreateSources( IEnumerable aFileNames ) + { + } + #endregion + + #region API + public IArmInstruction[] ConvertToInstructions( TArmInstructionSet aInstructionSet, uint[] aRawInstructions, uint aStartingAddress ) + { + IArmInstruction[] ret = iManager.InstructionLibrary.ConvertToInstructions( aInstructionSet, aRawInstructions, aStartingAddress ); + return ret; + } + + public bool SourceRemove( CodeSource aSource ) + { + CodeSourceManager manager = iManager.Plugin.SourceManager; + bool removed = manager.Remove( aSource ); + return removed; + } + + public bool SourceAdd( CodeSource aSource ) + { + CodeSourceManager manager = iManager.Plugin.SourceManager; + bool added = manager.Add( aSource ); + return added; + } + #endregion + + #region Properties + public ITracer Tracer + { + get { return iManager; } + } + + public IPlatformIdAllocator IdAllocator + { + get { return iManager.IdAllocator; } + } + + public ArmLibrary InstructionLibrary + { + get { return iManager.InstructionLibrary; } + } + + public int SourceCount + { + get { return iManager.Plugin.SourceManager.Count; } + } + + protected CodeSourceProviderManager ProvisioningManager + { + get { return iManager; } + } + #endregion + + #region Data members + private readonly CodeSourceProviderManager iManager; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Provisioning/CodeSourceProviderManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Provisioning/CodeSourceProviderManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,196 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianUtils.PluginManager; +using SymbianStructuresLib.Debug.Common.Interfaces; +using SymbianInstructionLib.Arm.Library; +using SymbianInstructionLib.Arm.Instructions.Common; +using SymbianCodeLib.DbgEnginePlugin; +using SymbianCodeLib.SourceManagement.Source; + +namespace SymbianCodeLib.SourceManagement.Provisioning +{ + public class CodeSourceProviderManager : DisposableObject, IEnumerable, ITracer + { + #region Constructors + internal CodeSourceProviderManager( CodePlugin aPlugin, IPlatformIdAllocator aIdAllocator ) + { + iPlugin = aPlugin; + iIdAllocator = aIdAllocator; + iInstructionLibrary = new ArmLibrary(); + // + iProviders.Load( new object[] { this } ); + } + #endregion + + #region API + public SymFileTypeList SupportedFileTypes() + { + SymFileTypeList ret = new SymFileTypeList(); + // + foreach ( CodeSourceProvider provider in iProviders ) + { + SymFileTypeList list = provider.FileTypes; + ret.AddRange( list ); + } + // + return ret; + } + + public CodeSourceProvider GetProvider( string aFileName ) + { + CodeSourceProvider ret = null; + // + foreach ( CodeSourceProvider provider in iProviders ) + { + bool canRead = provider.IsSupported( aFileName ); + if ( canRead ) + { + ret = provider; + break; + } + } + // + return ret; + } + + public IEnumerator GetSourceEnumerator() + { + return iPlugin.SourceManager.GetEnumerator(); + } + + public void PrepareToCreateSources( IEnumerable aFileNames ) + { + foreach ( CodeSourceProvider provider in iProviders ) + { + provider.PrepareToCreateSources( aFileNames ); + } + } + #endregion + + #region Properties + public int Count + { + get { return iProviders.Count; } + } + + public IPlatformIdAllocator IdAllocator + { + get { return iIdAllocator; } + } + + public ArmLibrary InstructionLibrary + { + get + { + return iInstructionLibrary; + } + } + + public CodeSourceProvider this[ string aName ] + { + get + { + CodeSourceProvider ret = null; + // + foreach ( CodeSourceProvider prov in iProviders ) + { + if ( prov.Name == aName ) + { + ret = prov; + break; + } + } + // + return ret; + } + } + + public CodeSourceProvider this[ int aIndex ] + { + get { return iProviders[ aIndex ]; } + } + + internal CodePlugin Plugin + { + get { return iPlugin; } + } + #endregion + + #region Internal methods + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( CodeSourceProvider prov in iProviders ) + { + yield return prov; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CodeSourceProvider prov in iProviders ) + { + yield return prov; + } + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + iPlugin.Trace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iPlugin.Trace( aFormat, aParams ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iProviders.Unload(); + iProviders.Dispose(); + } + } + #endregion + + #region Data members + private readonly CodePlugin iPlugin; + private readonly IPlatformIdAllocator iIdAllocator; + private readonly ArmLibrary iInstructionLibrary; + private PluginManager iProviders = new PluginManager(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Source/CodeSource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Source/CodeSource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,494 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Threading; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Code; +using SymbianStructuresLib.Debug.Code.Interfaces; +using SymbianStructuresLib.Debug.Common.FileName; +using SymbianCodeLib.SourceManagement.Provisioning; + +namespace SymbianCodeLib.SourceManagement.Source +{ + public abstract class CodeSource : DisposableObject, IEnumerable, ICodeCollectionRelocationHandler, ICodeCollectionInstructionConverter + { + #region Delegates & events + public delegate void EventHandlerFunction( TEvent aEvent, CodeSource aSource, object aData ); + public event EventHandlerFunction EventHandler; + #endregion + + #region Enumerations + public enum TEvent + { + EReadingStarted = 0, + EReadingProgress, + EReadingComplete + } + + public enum TTimeToRead + { + EReadWhenPriming = 0, + EReadWhenNeeded // i.e. relocated + } + #endregion + + #region Constructors + public CodeSource( string aURI, CodeSourceProvider aProvider ) + { + iURI = aURI; + iProvider = aProvider; + } + #endregion + + #region API + public virtual void Read( TSynchronicity aSynchronicity ) + { + bool isReading = this.IsReadInProgress; + if ( isReading ) + { + // Another thread is already reading this source. + // If the caller asked for asynchronous reading, then when the + // other thread completes the read the caller (in this thread) + // will be notified via the normal event callback framework - in which + // case we need do nothing at all - just let the other thread get on with it. + // + // If, on the other hand, the caller requested a synchronous read, then they + // will expect the code to be ready at the point in time which we return to them. + // + // In this situation, we should block this method until the code becomes ready. + if ( aSynchronicity == TSynchronicity.ESynchronous ) + { + while ( this.IsReadInProgress ) + { + System.Threading.Thread.Sleep( 0 ); + } + } + } + else + { + DoRead( aSynchronicity ); + } + } + + public virtual void Add( CodeCollection aCollection ) + { + // We can always do this task + aCollection.IfaceInstructionConverter = this; + + // We want to be told if the collection changes it's relocation state. + aCollection.RelocationStatusChanged += new CodeCollection.RelocationStatusChangeHandler( Collection_RelocationStatusChanged ); + + lock ( iCollectionsAll ) + { + iCollectionsAll.Add( aCollection ); + } + + CategoriseCollection( aCollection ); + } + + public virtual void Remove( CodeCollection aCollection ) + { + aCollection.RelocationStatusChanged -= new CodeCollection.RelocationStatusChangeHandler( Collection_RelocationStatusChanged ); + // + lock ( iCollectionsAll ) + { + iCollectionsAll.Remove( aCollection ); + } + lock ( iAlwaysActivatedCollections ) + { + iAlwaysActivatedCollections.Remove( aCollection ); + } + } + + public virtual bool Contains( uint aAddress ) + { + return iAlwaysActivatedCollections.Contains( aAddress ); + } + + public virtual bool ProvideInstructions( uint aAddress, TArmInstructionSet aInstructionSet, int aCount, out IArmInstruction[] aInstructions ) + { + lock ( iAlwaysActivatedCollections ) + { + bool ret = iAlwaysActivatedCollections.GetInstructions( aAddress, aInstructionSet, aCount, out aInstructions ); + return ret; + } + } + + protected abstract void DoRead( TSynchronicity aSynchronicity ); + + protected virtual void OnAddedToCollection( CodeSourceCollection aCollection ) + { + ++iReferenceCount; + } + + protected virtual void OnRemovedFromCollection( CodeSourceCollection aCollection ) + { + if ( --iReferenceCount <= 0 ) + { + this.Dispose(); + } + } + + protected virtual void OnPrepareForRelocation( CodeCollection aCollection, uint aOldBase, uint aNewBase ) + { + // If we read our data during priming, then we don't need to do anything... otherwise, we should + // read the data now. + // + // However, don't initiate a read if we already have obtained code for the specified collection + // (this can be the case if we are relocating a cloned code collection which has already been activated + // itself in the past). + if ( aCollection.IsCodeAvailable == false ) + { + System.Diagnostics.Debug.Assert( this.IsReady == false ); + // + if ( TimeToRead == TTimeToRead.EReadWhenNeeded ) + { + this.Read( TSynchronicity.ESynchronous ); + } + } + } + + protected virtual void OnReadComplete() + { + } + #endregion + + #region API - framework + public void ReportEvent( TEvent aEvent ) + { + ReportEvent( aEvent, null ); + } + + public void ReportEvent( TEvent aEvent, object aData ) + { + PreProcessEvent( aEvent ); + + // Cascade + if ( EventHandler != null ) + { + EventHandler( aEvent, this, aData ); + } + } + #endregion + + #region Properties + public int Count + { + get { return iCollectionsAll.Count; } + } + + public string URI + { + get + { + lock ( iURI ) + { + return iURI; + } + } + set + { + lock ( iURI ) + { + iURI = value; + } + } + + } + + public string FileName + { + get { return iProvider.GetFileName( this ); } + } + + public TTimeToRead TimeToRead + { + get { return iTimeToRead; } + set + { + iTimeToRead = value; + } + } + + public CodeSourceProvider Provider + { + get + { + lock ( iProvider ) + { + return iProvider; + } + } + } + + public CodeCollection this[ int aIndex ] + { + get { return iCollectionsAll[ aIndex ]; } + } + + public virtual CodeCollection this[ CodeSegDefinition aCodeSegment ] + { + get + { + CodeCollection ret = iCollectionsAll[ aCodeSegment ]; + return ret; + } + } + + public virtual CodeCollection this[ PlatformFileName aFileName ] + { + get + { + lock ( iCollectionsAll ) + { + CodeCollection ret = iCollectionsAll[ aFileName ]; + return ret; + } + } + } + + public bool IsReady + { + get + { + lock ( iFlagsSyncRoot ) + { + bool ret = ( iFlags & TFlags.EFlagsIsReady ) != 0; + return ret; + } + } + set + { + lock ( iFlagsSyncRoot ) + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsReady; + } + else + { + iFlags &= ~TFlags.EFlagsIsReady; + } + } + } + } + + public bool IsReadInProgress + { + get + { + lock ( iFlagsSyncRoot ) + { + bool ret = ( iFlags & TFlags.EFlagsIsReadInProgress ) != 0; + return ret; + } + } + set + { + lock ( iFlagsSyncRoot ) + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsReadInProgress; + } + else + { + iFlags &= ~TFlags.EFlagsIsReadInProgress; + } + } + } + } + #endregion + + #region Event handlers + private void Collection_RelocationStatusChanged( CodeCollection aCollection ) + { + CategoriseCollection( aCollection ); + } + #endregion + + #region Internal methods + internal int CountActivated + { + get { return iAlwaysActivatedCollections.Count; } + } + + internal void AddedToCollection( CodeSourceCollection aCollection ) + { + OnAddedToCollection( aCollection ); + } + + internal void RemovedFromCollection( CodeSourceCollection aCollection ) + { + OnRemovedFromCollection( aCollection ); + } + + private void CategoriseCollection( CodeCollection aCollection ) + { + // Reset state + lock ( iAlwaysActivatedCollections ) + { + iAlwaysActivatedCollections.Remove( aCollection ); + aCollection.IfaceRelocationHandler = null; + } + + // Collections which do not move from their pre-determined base address + // are transparently "activated" which means that they will be queried + // automatically during symbolic look up. + if ( aCollection.IsFixed ) + { + lock ( iAlwaysActivatedCollections ) + { + iAlwaysActivatedCollections.Add( aCollection ); + } + } + else + { + // Otherwise, we must wait until the client relocates the code + // and then we will be called back. During the callback processing + // we'll load the code (if needed) and fixup the base address. + aCollection.IfaceRelocationHandler = this; + } + } + + private void PreProcessEvent( TEvent aEvent ) + { + switch ( aEvent ) + { + case TEvent.EReadingStarted: + IsReady = false; + IsReadInProgress = true; + break; + case TEvent.EReadingComplete: + IsReady = true; + IsReadInProgress = false; + OnReadComplete(); + break; + } + } + #endregion + + #region Internal enumerations + [Flags] + private enum TFlags + { + EFlagsNone = 0, + EFlagsIsReady = 1, + EFlagsIsReadInProgress = 2 + } + #endregion + + #region From ICodeCollectionRelocationHandler + public void PrepareForRelocation( CodeCollection aCollection, uint aOldBase, uint aNewBase ) + { + OnPrepareForRelocation( aCollection, aOldBase, aNewBase ); + } + #endregion + + #region From ICodeCollectionInstructionConverter + public IArmInstruction[] ConvertRawValuesToInstructions( TArmInstructionSet aInstructionSet, uint[] aRawValues, uint aStartingAddress ) + { + IArmInstruction[] ret = iProvider.ConvertToInstructions( aInstructionSet, aRawValues, aStartingAddress ); + return ret; + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( CodeCollection col in iCollectionsAll ) + { + yield return col; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CodeCollection col in iCollectionsAll ) + { + yield return col; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + int count = iCollectionsAll.Count; + for ( int i = count - 1; i >= 0; i-- ) + { + CodeCollection col = iCollectionsAll[ i ]; + Remove( col ); + col.Dispose(); + } + + // These should both be empty in any case + iCollectionsAll.Clear(); + iAlwaysActivatedCollections.Clear(); + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return URI; + } + + public override int GetHashCode() + { + return URI.GetHashCode(); + } + + public override bool Equals( object aObject ) + { + if ( aObject is CodeSource ) + { + CodeSource other = (CodeSource) aObject; + bool ret = ( string.Compare( other.URI, this.URI, StringComparison.CurrentCultureIgnoreCase ) == 0 ); + return ret; + } + // + return base.Equals( aObject ); + } + #endregion + + #region Data members + private readonly CodeSourceProvider iProvider; + private string iURI = string.Empty; + private int iReferenceCount = 0; + private TTimeToRead iTimeToRead = TTimeToRead.EReadWhenPriming; + private CodeCollectionList iCollectionsAll = new CodeCollectionList(); + private CodeCollectionList iAlwaysActivatedCollections = new CodeCollectionList(); + private object iFlagsSyncRoot = new object(); + private TFlags iFlags = TFlags.EFlagsNone; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Source/CodeSourceAndCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Source/CodeSourceAndCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianStructuresLib.Debug.Code; +using SymbianStructuresLib.CodeSegments; +using SymbianCodeLib.DbgEnginePlugin; + +namespace SymbianCodeLib.SourceManagement.Source +{ + public class CodeSourceAndCollection + { + #region Constructors + internal CodeSourceAndCollection( CodeSource aSource, CodeCollection aCollection ) + { + System.Diagnostics.Debug.Assert( aSource != null && aCollection != null ); + // + iSource = aSource; + iCollection = aCollection; + } + + internal CodeSourceAndCollection( CodeSourceAndCollection aCopy ) + { + iSource = aCopy.Source; + iCollection = aCopy.Collection; + } + + internal CodeSourceAndCollection( CodeSourceAndCollection aCopy, CodeCollection aCollection ) + { + iSource = aCopy.Source; + iCollection = aCollection; + } + #endregion + + #region Properties + public CodeSource Source + { + get { return iSource; } + internal set { iSource = value; } + } + + public CodeCollection Collection + { + get { return iCollection; } + internal set { iCollection = value; } + } + #endregion + + #region Data members + private CodeSource iSource; + private CodeCollection iCollection; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Source/CodeSourceCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Source/CodeSourceCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,213 @@ +/* +* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Collections; + +namespace SymbianCodeLib.SourceManagement.Source +{ + public class CodeSourceCollection : DisposableObject, IEnumerable + { + #region Constructors + public CodeSourceCollection() + { + } + + public CodeSourceCollection( CodeSource aSource ) + { + Add( aSource ); + } + #endregion + + #region API + public void Clear() + { + lock ( iSources ) + { + IList list = iSources.Values; + int count = list.Count; + for ( int i = count - 1; i >= 0; i-- ) + { + CodeSource source = list[ i ]; + Remove( source ); + } + } + } + + public bool Add( CodeSource aSource ) + { + bool added = false; + // + lock ( iSources ) + { + if ( Contains( aSource ) == false ) + { + string uri = aSource.URI; + iSources.Add( uri, aSource ); + added = true; + } + else + { + System.Diagnostics.Debug.WriteLine( "**** WARNING **** discarding duplicate source: " + aSource ); + } + } + // + if ( added ) + { + OnAdded( aSource ); + } + // + return added; + } + + public void AddRange( IEnumerable aSources ) + { + foreach ( CodeSource source in aSources ) + { + Add( source ); + } + } + + public bool Remove( CodeSource aSource ) + { + bool ret = false; + CodeSource source = null; + // + lock( iSources ) + { + string uri = aSource.URI; + // + if ( iSources.TryGetValue( uri, out source ) ) + { + ret = iSources.Remove( uri ); + } + } + + // Notify outside of the lock + if ( source != null ) + { + OnRemoved( source ); + } + // + return ret; + } + + public bool Contains( string aURI ) + { + lock ( iSources ) + { + return iSources.ContainsKey( aURI ); + } + } + + public bool Contains( CodeSource aSource ) + { + return Contains( aSource.URI ); + } + #endregion + + #region Properties + public int Count + { + get + { + lock ( iSources ) + { + return iSources.Count; + } + } + } + + public bool IsEmpty + { + get { return Count == 0; } + } + + public CodeSource this[ int aIndex ] + { + get + { + lock ( iSources ) + { + string key = iSources.Keys[ aIndex ]; + return iSources[ key ]; + } + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( KeyValuePair kvp in iSources ) + { + yield return kvp.Value; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair kvp in iSources ) + { + yield return kvp.Value; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + foreach ( KeyValuePair kvp in iSources ) + { + CodeSource source = kvp.Value; + source.Dispose(); + } + + Clear(); + } + } + #endregion + + #region Internal methods + protected virtual void OnAdded( CodeSource aSource ) + { + aSource.AddedToCollection( this ); + } + + protected virtual void OnRemoved( CodeSource aSource ) + { + aSource.RemovedFromCollection( this ); + } + #endregion + + #region Data members + private SortedList iSources = new SortedList(); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Source/CodeSourceManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SourceManagement/Source/CodeSourceManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Code; +using SymbianCodeLib.DbgEnginePlugin; + +namespace SymbianCodeLib.SourceManagement.Source +{ + internal class CodeSourceManager : CodeSourceCollection + { + #region Delegates & events + public delegate void SourceEventHandler( CodeSource aSource ); + public event SourceEventHandler SourceAdded = null; + public event SourceEventHandler SourceRemoved = null; + #endregion + + #region Constructors + public CodeSourceManager( CodePlugin aPlugin ) + { + iPlugin = aPlugin; + } + #endregion + + #region API + public IEnumerable GetFixedCollectionEnumerator() + { + foreach ( CodeSource source in this ) + { + foreach ( CodeCollection col in source ) + { + if ( col.IsFixed ) + { + yield return col; + } + } + } + } + #endregion + + #region Properties + public CodeSourceAndCollection this[ CodeSegDefinition aCodeSeg ] + { + get + { + CodeSourceAndCollection ret = null; + // + foreach ( CodeSource source in this ) + { + CodeCollection col = source[ aCodeSeg ]; + if ( col != null ) + { + ret = new CodeSourceAndCollection( source, col ); + break; + } + } + // + return ret; + } + } + #endregion + + #region From CodeSourceCollection + protected override void OnAdded( CodeSource aSource ) + { + base.OnAdded( aSource ); + if ( SourceAdded != null ) + { + SourceAdded( aSource ); + } + } + + protected override void OnRemoved( CodeSource aSource ) + { + base.OnRemoved( aSource ); + if ( SourceRemoved != null ) + { + SourceRemoved( aSource ); + } + } + #endregion + + #region Data members + private readonly CodePlugin iPlugin; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SymbianCodeLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SymbianCodeLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,121 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {A041EDFE-A120-4100-A0A6-FB1984D80815} + Library + Properties + SymbianCodeLib + SymbianCodeLib.plugin + + + 2.0 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + TRACE;DEBUG + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {EB93FD74-17C6-44B2-8384-4D58DC210F77} + SymbianInstructionLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SymbianCodeLib.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianCodeLib/SymbianCodeLib.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + en-US + false + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Engine/DbgEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Engine/DbgEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,484 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileSystem; +using SymbianUtils.Settings; +using SymbianStructuresLib.Debug.Common.Id; +using SymbianStructuresLib.Debug.Common.Interfaces; +using SymbianStructuresLib.CodeSegments; +using SymbianDebugLib.Entity; +using SymbianDebugLib.Entity.Manager; +using SymbianDebugLib.Entity.Descriptors; +using SymbianDebugLib.Entity.Configurations; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types.Code; +using SymbianDebugLib.PluginAPI.Types.Trace; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianDebugLib.PluginAPI.Types.KeyBindings; +using SymbianDebugLib.PluginAPI.Types.MetaDataConfig; +using SymbianDebugLib.ValidationRules; + +namespace SymbianDebugLib.Engine +{ + public class DbgEngine : DisposableObject, IEnumerable, ITracer + { + #region Enumerations + public enum TEvent + { + EPrimingStarted = 0, + EPrimingComplete + } + #endregion + + #region Delegates & events + public delegate void OperationHandler( DbgEngine aEngine, TEvent aEvent ); + public delegate void EventHandler( DbgEngine aEngine, DbgEntity aEntity, object aContext ); + // + public event EventHandler EntityAdded; + public event EventHandler EntityRemoved; + public event EventHandler EntitiesCleared; + public event EventHandler EntityPrimingStarted; + public event EventHandler EntityPrimingProgress; + public event EventHandler EntityPrimingComplete; + public event OperationHandler EngineOperation; + #endregion + + #region Constructors + public DbgEngine() + : this( null ) + { + } + + public DbgEngine( ITracer aTracer ) + { + iTracer = aTracer; + + // Initialise the settings object + iSettings = new XmlSettings( KDbgEngineXmlSettingsFileName ); + iSettings.Restore(); + + iEntityManager = new DbgEntityManager( this ); + iPluginManager = new DbgPluginManager( this ); + iConfigManager = new DbgEntityConfigManager( this ); + iValidationManager = new DbgValidationManager( this ); + iDescriptorManager = new DbgEntityDescriptorManager( this ); + } + #endregion + + #region API - setup phase + public void Clear() + { + iCurrentConfig = null; + iEntityManager.Clear(); + } + + public DbgEntity Add( string aEntityFullName ) + { + return Add( new FileInfo( aEntityFullName ) ); + } + + public DbgEntity Add( FileInfo aFile ) + { + return iEntityManager.AddFile( aFile ); + } + + public void AddRange( IEnumerable aEntities ) + { + foreach ( FileInfo entity in aEntities ) + { + Add( entity ); + } + } + + public void AddRange( IEnumerable aFiles ) + { + foreach ( string file in aFiles ) + { + Add( file ); + } + } + + public bool Contains( string aEntityFullName ) + { + FSEntity entity = FSEntity.New( aEntityFullName ); + return Contains( entity ); + } + + public bool Contains( FSEntity aFSEntity ) + { + return iEntityManager.Contains( aFSEntity ); + } + + public void Remove( DbgEntity aEntity ) + { + EntityManager.Remove( aEntity ); + } + + public void Prime( TSynchronicity aSynchronicity ) + { + if ( EngineOperation != null ) + { + EngineOperation( this, TEvent.EPrimingStarted ); + } + + // Reset the plugins + Code.Clear(); + Symbols.Clear(); + + // Categorise the prime list by plugin + Dictionary list = new Dictionary(); + foreach ( DbgEntity entity in iEntityManager ) + { + // Might be null. + DbgPluginEngine plugin = entity.PluginEngine; + if ( plugin != null ) + { + // Find correct list + DbgEntityList pluginEntityList = null; + if ( list.ContainsKey( plugin ) ) + { + pluginEntityList = list[ plugin ]; + } + else + { + pluginEntityList = new DbgEntityList( this ); + list.Add( plugin, pluginEntityList ); + } + + // Now add the entry + pluginEntityList.Add( entity ); + } + } + + // Finally, we can tell all the plugins about the files they are about to receive + foreach ( KeyValuePair kvp in list ) + { + kvp.Key.PrepareToPrime( kvp.Value ); + } + + // Now prime the individual entities + foreach ( DbgEntity entity in iEntityManager ) + { + entity.Prime( aSynchronicity ); + } + + if ( EngineOperation != null ) + { + EngineOperation( this, TEvent.EPrimingComplete ); + } + } + + public bool IsReadyToPrime( out string aErrorList ) + { + bool valid = iValidationManager.IsValid( DbgValidationRule.TOperation.EOperationPrime, out aErrorList ); + // + if ( valid ) + { + valid = EntityManager.IsReadyToPrime( out aErrorList ); + } + // + return valid; + } + #endregion + + #region API - child engine & views + public DbgEngineCode Code + { + get { return iPluginManager.Code; } + } + + public DbgEngineSymbol Symbols + { + get { return iPluginManager.Symbols; } + } + + public DbgEngineTrace TraceDictionaries + { + get { return iPluginManager.TraceDictionaries; } + } + + public DbgEngineKeyBindings KeyBindings + { + get { return iPluginManager.KeyBindings; } + } + + public DbgEngineMetaDataConfig MetaDataConfig + { + get { return iPluginManager.MetaDataConfig; } + } + + public DbgEngineView CreateView( string aName ) + { + return CreateView( aName, new CodeSegDefinitionCollection() ); + } + + public DbgEngineView CreateView( string aName, CodeSegDefinitionCollection aCodeSegments ) + { + return CreateView( aName, aCodeSegments, TDbgViewDeactivationType.EDoNothing ); + } + + public DbgEngineView CreateView( string aName, CodeSegDefinitionCollection aCodeSegments, TDbgViewDeactivationType aDeactivationType ) + { + DbgEngineView ret = new DbgEngineView( this, aName, aCodeSegments, aDeactivationType ); + return ret; + } + #endregion + + #region API - settings + public void XmlSettingsSave() + { + iSettings.Save( KDbgEngineXmlSettingsRootNodeName, iEntityManager ); + iSettings.Store(); + } + + public void XmlSettingsLoad() + { + iSettings.Load( KDbgEngineXmlSettingsRootNodeName, iEntityManager ); + } + #endregion + + #region Properties + public int Count + { + get { return iEntityManager.Count; } + } + + public bool Verbose + { + get { return iVerbose; } + set { iVerbose = value; } + } + + public DbgEntity this[ int aIndex ] + { + get { return iEntityManager[ aIndex ]; } + } + + public DbgEntityManager EntityManager + { + get { return iEntityManager; } + } + + public DbgEntityConfigManager ConfigManager + { + get { return iConfigManager; } + } + + public DbgEntityDescriptorManager DescriptorManager + { + get { return iDescriptorManager; } + } + + public bool IsUsingConfiguration + { + get { return iCurrentConfig != null; } + } + + public DbgEntityConfig CurrentConfiguration + { + get { return iCurrentConfig; } + internal set { iCurrentConfig = value; } + } + + public TDbgUiMode UiMode + { + get { return iDescriptorManager.UiMode; } + set + { + iDescriptorManager.UiMode = value; + } + } + + public FSExtensionList FileTypeExtensions + { + get { return DescriptorManager.Extensions; } + } + + public XmlSettings Settings + { + get { return iSettings; } + } + + public FSEntity[] FileSystemEntities + { + get { return EntityManager.FileSystemEntities; } + } + + public IPlatformIdAllocator IdAllocator + { + get { return iIdAllocator; } + } + #endregion + + #region Internal constants + private const string KDbgEngineXmlSettingsFileName = "DbgEngineSettings.xml"; + private const string KDbgEngineXmlSettingsRootNodeName = "DbgEngine"; + #endregion + + #region Internal event propagation methods + internal void OnAdded( DbgEntity aEntity ) + { + try + { + if ( EntityAdded != null ) + { + EntityAdded( this, aEntity, null ); + } + } + catch ( Exception ) + { + } + } + + internal void OnRemoved( DbgEntity aEntity ) + { + try + { + if ( EntityRemoved != null ) + { + EntityRemoved( this, aEntity, null ); + } + } + catch ( Exception ) + { + } + } + + internal void OnPrimingStarted( DbgEntity aEntity ) + { + try + { + if ( EntityPrimingStarted != null ) + { + EntityPrimingStarted( this, aEntity, null ); + } + } + catch ( Exception ) + { + } + } + + internal void OnPrimingProgress( DbgEntity aEntity, int aValue ) + { + try + { + if ( EntityPrimingProgress != null ) + { + EntityPrimingProgress( this, aEntity, aValue ); + } + } + catch ( Exception ) + { + } + } + + internal void OnPrimingComplete( DbgEntity aEntity ) + { + try + { + if ( EntityPrimingComplete != null ) + { + EntityPrimingComplete( this, aEntity, null ); + } + } + catch ( Exception ) + { + } + } + + internal void OnCleared() + { + try + { + if ( EntitiesCleared != null ) + { + EntitiesCleared( this, null, null ); + } + } + catch ( Exception ) + { + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( DbgEntity e in iEntityManager ) + { + yield return e; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( DbgEntity e in iEntityManager ) + { + yield return e; + } + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + if ( iTracer != null ) + { + iTracer.Trace( aMessage ); + } + } + + public void Trace( string aFormat, params object[] aParams ) + { + Trace( string.Format( aFormat, aParams ) ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iPluginManager.Dispose(); + iConfigManager.Dispose(); + } + } + #endregion + + #region Data members + private readonly ITracer iTracer; + private readonly XmlSettings iSettings; + private readonly DbgEntityManager iEntityManager; + private readonly DbgPluginManager iPluginManager; + private readonly DbgEntityConfigManager iConfigManager; + private readonly DbgValidationManager iValidationManager; + private readonly DbgEntityDescriptorManager iDescriptorManager; + private PlatformIdAllocator iIdAllocator = new PlatformIdAllocator(); + private DbgEntityConfig iCurrentConfig = null; + private bool iVerbose; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Engine/DbgEngineView.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Engine/DbgEngineView.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianUtils.FileSystem.FilePair; +using SymbianStructuresLib.CodeSegments; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Code; +using SymbianDebugLib.PluginAPI.Types.Symbol; + +namespace SymbianDebugLib.Engine +{ + public class DbgEngineView : DisposableObject + { + #region Constructors + internal DbgEngineView( DbgEngine aEngine, string aName, CodeSegDefinitionCollection aCodeSegments, TDbgViewDeactivationType aDeactivationType ) + { + iName = aName; + iEngine = aEngine; + iDeactivationType = aDeactivationType; + iCodeSegments = new CodeSegDefinitionCollection( aCodeSegments ); + // + iViewCode = (DbgViewCode) EngineCode.CreateView( iName ); + if ( iViewCode != null ) + { + iViewCode.Activate( aCodeSegments ); + } + // + iViewSymbols = (DbgViewSymbol) EngineSymbols.CreateView( iName ); + if ( iViewSymbols != null ) + { + iViewSymbols.Activate( aCodeSegments ); + } + } + #endregion + + #region API + public bool SerializeTaggedCollections( FileNamePairCollection aFilesToSave ) + { + bool savedSyms = Symbols.SerializeTaggedCollections( aFilesToSave ); + bool savedCode = Code.SerializeTaggedCollections( aFilesToSave ); + // + return ( savedCode || savedSyms ); + } + #endregion + + #region Properties + public string Name + { + get + { + return iName; + } + } + + public DbgViewCode Code + { + get + { + if ( iViewCode == null ) + { + throw new NotSupportedException(); + } + // + return iViewCode; + } + } + + public DbgViewSymbol Symbols + { + get + { + if ( iViewSymbols == null ) + { + throw new NotSupportedException(); + } + // + return iViewSymbols; + } + } + + public DbgEngineCode EngineCode + { + get { return iEngine.Code; } + } + + public DbgEngineSymbol EngineSymbols + { + get { return iEngine.Symbols; } + } + #endregion + + #region Operators + public static implicit operator DbgViewCode( DbgEngineView aView ) + { + return aView.Code; + } + + public static implicit operator DbgViewSymbol( DbgEngineView aView ) + { + return aView.Symbols; + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iViewCode != null ) + { + if ( iDeactivationType == TDbgViewDeactivationType.EDeactivateWhenDisposed ) + { + iViewCode.Deactivate( iCodeSegments ); + } + // + iViewCode.Dispose(); + iViewCode = null; + } + if ( iViewSymbols != null ) + { + if ( iDeactivationType == TDbgViewDeactivationType.EDeactivateWhenDisposed ) + { + iViewSymbols.Deactivate( iCodeSegments ); + } + // + iViewSymbols.Dispose(); + iViewSymbols = null; + } + } + } + #endregion + + #region From System.Object + public override int GetHashCode() + { + return iName.GetHashCode(); + } + + public override string ToString() + { + return iName; + } + #endregion + + #region Data members + private readonly string iName; + private readonly DbgEngine iEngine; + private readonly CodeSegDefinitionCollection iCodeSegments; + private readonly TDbgViewDeactivationType iDeactivationType; + private DbgViewCode iViewCode; + private DbgViewSymbol iViewSymbols; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Engine/DbgPluginManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Engine/DbgPluginManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Code; +using SymbianDebugLib.PluginAPI.Types.Trace; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianDebugLib.PluginAPI.Types.KeyBindings; +using SymbianDebugLib.PluginAPI.Types.MetaDataConfig; + +namespace SymbianDebugLib.Engine +{ + internal class DbgPluginManager : DisposableObject + { + #region Constructors + public DbgPluginManager( DbgEngine aEngine ) + { + iEngine = aEngine; + // + FindImplementations(); + } + #endregion + + #region API + #endregion + + #region Properties + public DbgEngineCode Code + { + get { return iCode; } + } + + public DbgEngineSymbol Symbols + { + get { return iSymbols; } + } + + public DbgEngineKeyBindings KeyBindings + { + get { return iKeyBindings; } + } + + public DbgEngineTrace TraceDictionaries + { + get { return iTraceDictionaries; } + } + + public DbgEngineMetaDataConfig MetaDataConfig + { + get { return iMetaDataConfig; } + } + #endregion + + #region Internal methods + private void FindImplementations() + { + FindImplementationCode(); + FindImplementationTraces(); + FindImplementationSymbols(); + FindImplementationKeyBindings(); + FindImplementationMetaDataConfig(); + } + + private void FindImplementationSymbols() + { + iSymbols = DbgEngineSymbol.New( iEngine ); + System.Diagnostics.Debug.Assert( iSymbols != null ); + } + + private void FindImplementationCode() + { + iCode = DbgEngineCode.New( iEngine ); + System.Diagnostics.Debug.Assert( iCode != null ); + } + + private void FindImplementationTraces() + { + iTraceDictionaries = DbgEngineTrace.New( iEngine ); + System.Diagnostics.Debug.Assert( iTraceDictionaries != null ); + } + + private void FindImplementationMetaDataConfig() + { + iMetaDataConfig = DbgEngineMetaDataConfig.New( iEngine ); + System.Diagnostics.Debug.Assert( iMetaDataConfig != null ); + } + + private void FindImplementationKeyBindings() + { + iKeyBindings = DbgEngineKeyBindings.New( iEngine ); + System.Diagnostics.Debug.Assert( iKeyBindings != null ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iSymbols != null ) + { + iSymbols.Dispose(); + iSymbols = null; + } + if ( iCode != null ) + { + iCode.Dispose(); + iCode = null; + } + if ( iTraceDictionaries != null ) + { + iTraceDictionaries.Dispose(); + iTraceDictionaries = null; + } + if ( iKeyBindings != null ) + { + iKeyBindings.Dispose(); + iKeyBindings = null; + } + if ( iMetaDataConfig != null ) + { + iMetaDataConfig.Dispose(); + iMetaDataConfig = null; + } + } + } + #endregion + + #region Data members + private readonly DbgEngine iEngine; + private DbgEngineCode iCode; + private DbgEngineSymbol iSymbols; + private DbgEngineTrace iTraceDictionaries; + private DbgEngineKeyBindings iKeyBindings; + private DbgEngineMetaDataConfig iMetaDataConfig; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Missing/Icon.png Binary file crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Missing/Icon.png has changed diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Missing/MissingDescriptor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Missing/MissingDescriptor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Drawing; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Entity; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Primer; +using SymbianDebugLib.Entity.Descriptors; +using SymbianDebugLib.PluginAPI.Types; + +namespace SymbianDebugLib.Entity.BuiltIn.Missing +{ + public class MissingDescriptor : DbgEntityDescriptor + { + #region Constructors + public MissingDescriptor( DbgEntityDescriptorManager aManager ) + : base( aManager ) + { + } + #endregion + + #region From DbgEntityDescriptor + public override DbgEntity Create( FSEntity aEntity ) + { + // Returns null if not supported + MissingEntity ret = MissingEntity.New( this, aEntity ); + return ret; + } + + public override DbgEntity Create( XmlSettingCategory aSettingsCategory ) + { + MissingEntity ret = MissingEntity.New( this, aSettingsCategory ); + return ret; + } + + public override Image Icon + { + get { return Properties.Resources.MissingIcon; } + } + + public override DbgEntityDescriptor.TFileSystemBrowserType FileSystemBrowserType + { + get { return TFileSystemBrowserType.EFiles; } + } + + public override string CategoryName + { + get { return "Missing"; } + } + + public override int DisplayOrder + { + get { return int.MinValue + 10; } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Missing/MissingEntity.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Missing/MissingEntity.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Drawing; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Entity; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Descriptors; +using SymbianDebugLib.PluginAPI.Types; + +namespace SymbianDebugLib.Entity.BuiltIn.Missing +{ + public class MissingEntity : DbgEntity + { + #region Static constructors + public static MissingEntity New( DbgEntityDescriptor aDescriptor, FSEntity aFSEntity ) + { + MissingEntity ret = null; + // + if ( aFSEntity.IsFile && !aFSEntity.Exists ) + { + ret = new MissingEntity( aDescriptor, aFSEntity ); + } + // + return ret; + } + + public static MissingEntity New( DbgEntityDescriptor aDescriptor, XmlSettingCategory aSettingsCategory ) + { + MissingEntity ret = null; + // + if ( aSettingsCategory.Contains( KSettingsKeyFileName ) ) + { + string fileName = aSettingsCategory[ KSettingsKeyFileName ]; + ret = New( aDescriptor, FSEntity.New( fileName ) ); + } + // + return ret; + } + #endregion + + #region Constants + public const string KSettingsKeyFileName = "MissingFileName"; + #endregion + + #region Constructors + private MissingEntity( DbgEntityDescriptor aDescriptor, FSEntity aFSEntity ) + : base( aDescriptor, aFSEntity ) + { + } + #endregion + + #region From DbgEntity + public override void Save( XmlSettingCategory aCategory ) + { + aCategory[ KSettingsKeyFileName ] = base.FSEntity.FullName; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Unsupported/Icon.png Binary file crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Unsupported/Icon.png has changed diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Unsupported/UnsupportedDescriptor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Unsupported/UnsupportedDescriptor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Drawing; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Entity; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Primer; +using SymbianDebugLib.Entity.Descriptors; +using SymbianDebugLib.PluginAPI.Types; + +namespace SymbianDebugLib.Entity.BuiltIn.Unsupported +{ + public class UnsupportedDescriptor : DbgEntityDescriptor + { + #region Constructors + public UnsupportedDescriptor( DbgEntityDescriptorManager aManager ) + : base( aManager ) + { + } + #endregion + + #region From DbgEntityDescriptor + public override DbgEntity Create( FSEntity aEntity ) + { + // Returns null if not supported + DbgEntity ret = UnsupportedEntity.New( this, aEntity ); + return ret; + } + + public override DbgEntity Create( XmlSettingCategory aSettingsCategory ) + { + DbgEntity ret = UnsupportedEntity.New( this, aSettingsCategory ); + return ret; + } + + public override Image Icon + { + get { return Properties.Resources.UnsupportedIcon; } + } + + public override DbgEntityDescriptor.TFileSystemBrowserType FileSystemBrowserType + { + get { return TFileSystemBrowserType.EFiles; } + } + + public override string CategoryName + { + get { return "Not Supported"; } + } + + public override int DisplayOrder + { + get { return int.MinValue; } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Unsupported/UnsupportedEntity.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/BuiltIn/Unsupported/UnsupportedEntity.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Drawing; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Entity; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Descriptors; +using SymbianDebugLib.PluginAPI.Types; + +namespace SymbianDebugLib.Entity.BuiltIn.Unsupported +{ + public class UnsupportedEntity : DbgEntity + { + #region Static constructors + public static UnsupportedEntity New( DbgEntityDescriptor aDescriptor, FSEntity aFSEntity ) + { + UnsupportedEntity ret = null; + // + if ( aFSEntity.Exists ) + { + ret = new UnsupportedEntity( aDescriptor, aFSEntity ); + } + // + return ret; + } + + public static UnsupportedEntity New( DbgEntityDescriptor aDescriptor, XmlSettingCategory aSettingsCategory ) + { + UnsupportedEntity ret = null; + // + if ( aSettingsCategory.Contains( KSettingsKeyFileName ) ) + { + string fileName = aSettingsCategory[ KSettingsKeyFileName ]; + ret = New( aDescriptor, FSEntity.New( fileName ) ); + } + // + return ret; + } + #endregion + + #region Constants + public const string KSettingsKeyFileName = "UnsupportedFileName"; + #endregion + + #region Constructors + private UnsupportedEntity( DbgEntityDescriptor aDescriptor, FSEntity aFSEntity ) + : base( aDescriptor, aFSEntity ) + { + } + #endregion + + #region From DbgEntity + public override void Save( XmlSettingCategory aCategory ) + { + aCategory[ KSettingsKeyFileName ] = base.FSEntity.FullName; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Configurations/DbgEntityConfig.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Configurations/DbgEntityConfig.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,217 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Drawing; +using SymbianUtils; +using SymbianUtils.FileSystem; +using SymbianUtils.Settings; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Primer; +using SymbianDebugLib.PluginAPI; + +namespace SymbianDebugLib.Entity.Configurations +{ + public class DbgEntityConfig : IEnumerable + { + #region Constructors + public DbgEntityConfig( DbgEntityConfigManager aManager ) + { + iManager = aManager; + } + #endregion + + #region Classes + public sealed class CfgFile + { + #region Constructors + public CfgFile( string aFileName ) + { + iFileNameAndPath = aFileName; + } + #endregion + + #region API + public void AddId( string aId ) + { + iId.Add( aId ); + } + + public bool Contains( DbgEntityConfigIdentifier aId ) + { + bool ret = iId.Contains( aId ); + return ret; + } + #endregion + + #region Properties + public string FileNameAndPath + { + get { return iFileNameAndPath; } + } + #endregion + + #region Data members + private string iFileNameAndPath = string.Empty; + private DbgEntityConfigIdentifier iId = new DbgEntityConfigIdentifier(); + #endregion + } + + public sealed class CfgSet : IEnumerable + { + #region Constructors + public CfgSet( string aSetName ) + { + iSetName = aSetName; + } + #endregion + + #region API + public void Add( CfgFile aFile ) + { + iFiles.Add( aFile ); + } + + public bool Contains( DbgEntityConfigIdentifier aId ) + { + bool ret = false; + // + foreach ( CfgFile file in iFiles ) + { + if ( file.Contains( aId ) ) + { + ret = true; + break; + } + } + // + return ret; + } + #endregion + + #region Properties + public string Name + { + get { return iSetName; } + } + + public int Count + { + get { return iFiles.Count; } + } + + public CfgFile this[ int aIndex ] + { + get { return iFiles[ aIndex ]; } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( CfgFile f in iFiles ) + { + yield return f; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CfgFile f in iFiles ) + { + yield return f; + } + } + #endregion + + #region Data members + private readonly string iSetName; + private List iFiles = new List(); + #endregion + } + #endregion + + #region API + public bool Contains( DbgEntityConfigIdentifier aId ) + { + bool ret = false; + // + foreach ( KeyValuePair kvp in iSets ) + { + if ( kvp.Value.Contains( aId ) ) + { + ret = true; + break; + } + } + // + return ret; + } + + public void Add( CfgSet aSet ) + { + CfgSet ret = null; + if ( iSets.TryGetValue( aSet.Name, out ret ) ) + { + throw new ArgumentException( "Specified set already registered" ); + } + // + iSets.Add( aSet.Name, aSet ); + } + #endregion + + #region Properties + public DbgEngine Engine + { + get { return Manager.Engine; } + } + + protected DbgEntityConfigManager Manager + { + get { return iManager; } + } + #endregion + + #region Internal methods + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( KeyValuePair< string, CfgSet> kvp in iSets ) + { + yield return kvp.Value; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair kvp in iSets ) + { + yield return kvp.Value; + } + } + #endregion + + #region Data members + private readonly DbgEntityConfigManager iManager; + private Dictionary iSets = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Configurations/DbgEntityConfigIdentifier.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Configurations/DbgEntityConfigIdentifier.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Text; + +namespace SymbianDebugLib.Entity.Configurations +{ + public class DbgEntityConfigIdentifier + { + #region Constructors + public DbgEntityConfigIdentifier() + { + } + + public DbgEntityConfigIdentifier( string aId ) + { + Add( aId ); + } + + public DbgEntityConfigIdentifier( uint aId ) + { + Add( aId.ToString( "x8" ) ); + } + #endregion + + #region API + public void Add( string aId ) + { + if ( iIds.ContainsKey( aId ) == false ) + { + iIds.Add( aId, aId ); + } + } + + public bool Contains( DbgEntityConfigIdentifier aId ) + { + int matchCount = 0; + // + foreach ( string key in aId.iIds.Keys ) + { + if ( Contains( key ) ) + { + ++matchCount; + } + } + // + bool ret = matchCount > 0 && ( matchCount == this.Count ); + return ret; + } + + public bool Contains( string aIdText ) + { + bool ret = iIds.ContainsKey( aIdText ); + return ret; + } + #endregion + + #region Properties + public int Count + { + get { return iIds.Count; } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + foreach ( string key in iIds.Keys ) + { + ret.Append( key + ", " ); + } + + if ( ret.Length > 0 ) + { + ret.Remove( ret.Length - 2, 2 ); + } + + return ret.ToString(); + } + #endregion + + #region Data members + private StringDictionary iIds = new StringDictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Configurations/DbgEntityConfigManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Configurations/DbgEntityConfigManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianUtils; +using SymbianUtils.PluginManager; +using SymbianUtils.FileSystem; +using SymbianUtils.Settings; +using SymbianDebugLib.Engine; + +namespace SymbianDebugLib.Entity.Configurations +{ + public class DbgEntityConfigManager : DisposableObject + { + #region Constructors + internal DbgEntityConfigManager( DbgEngine aEngine ) + { + iEngine = aEngine; + } + #endregion + + #region API + public void Clear() + { + lock ( iConfigurations ) + { + iConfigurations.Clear(); + } + } + + public void Add( DbgEntityConfig aConfiguration ) + { + lock ( iConfigurations ) + { + iConfigurations.Add( aConfiguration ); + } + } + + public void SwitchConfigurationSynchronously( DbgEntityConfigIdentifier aId ) + { + // Try to find a config that matches the specified value + DbgEntityConfig config = ConfigById( aId ); + if ( config == null ) + { + // Unload any old data and return + iEngine.Clear(); + iEngine.Trace( "WARNING: DbgEntityConfigManager could not load config id: " + aId.ToString() ); + } + else + { + if ( config == iEngine.CurrentConfiguration ) + { + // Nothing to do + } + else + { + // Unload any old data + iEngine.Clear(); + + // Prepare list of files + List files = new List(); + foreach ( DbgEntityConfig.CfgSet set in config ) + { + foreach ( DbgEntityConfig.CfgFile file in set ) + { + files.Add( file.FileNameAndPath ); + } + } + iEngine.AddRange( files ); + iEngine.Prime( TSynchronicity.ESynchronous ); + } + } + } + #endregion + + #region Event handlers + #endregion + + #region Properties + public int Count + { + get + { + lock ( iConfigurations ) + { + return iConfigurations.Count; + } + } + } + + internal DbgEngine Engine + { + get { return iEngine; } + } + #endregion + + #region Internal methods + private DbgEntityConfig ConfigById( DbgEntityConfigIdentifier aId ) + { + DbgEntityConfig ret = null; + // + lock ( iConfigurations ) + { + foreach ( DbgEntityConfig cfg in iConfigurations ) + { + if ( cfg.Contains( aId ) ) + { + ret = cfg; + break; + } + } + } + // + return ret; + } + #endregion + + #region Data members + private readonly DbgEngine iEngine; + private List iConfigurations = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/DbgEntity.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/DbgEntity.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,302 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Primer; +using SymbianDebugLib.Entity.Descriptors; +using SymbianDebugLib.PluginAPI; + +namespace SymbianDebugLib.Entity +{ + public abstract class DbgEntity : DisposableObject + { + #region Enumerations + public enum TEvent + { + EEventPrimingStarted = 0, + EEventPrimingProgress, + EEventPrimingComplete, + EEventRemoved + } + + public enum TConfigurationSuccess + { + ESuccessful = 0, + EFailed + } + #endregion + + #region Delegates & events + public delegate void EventHandler( DbgEntity aEntity, string aCategory, TEvent aEvent, object aContext1, object aContext2 ); + public event EventHandler EventObserver; + #endregion + + #region Constructors + protected DbgEntity( DbgEntityDescriptor aDescriptor, FSEntity aFSEntity ) + { + iDescriptor = aDescriptor; + iEntity = aFSEntity; + iResult = new DbgEntityPrimerResult( this ); + } + #endregion + + #region API + internal void Prime( TSynchronicity aSynchronicity ) + { + iIsPrimed = false; + iDescriptor.Prime( this, aSynchronicity ); + } + #endregion + + #region Framework API + public virtual bool Exists + { + get + { + bool ret = false; + // + if ( iEntity != null ) + { + ret = iEntity.Exists; + } + // + return ret; + } + } + + public virtual bool IsConfigurable + { + get { return false; } + } + + public virtual bool IsReadyToPrime( out string aErrorList ) + { + aErrorList = string.Empty; + return true; + } + + public virtual TConfigurationSuccess Configure() + { + return TConfigurationSuccess.ESuccessful; + } + + public virtual object CustomOperation( string aName, object aParam1, object aParam2 ) + { + throw new NotSupportedException(); + } + + public virtual void Save( XmlSettingCategory aCategory ) + { + } + + public virtual void Load( XmlSettingCategory aCategory ) + { + } + + public virtual string FullName + { + get { return FSEntity.FullName; } + } + + public virtual void OnRemoved() + { + } + + public virtual DbgPluginEngine PluginEngine + { + get + { + return null; + } + } + #endregion + + #region Properties + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + + public bool IsPrimed + { + get { return iIsPrimed; } + } + + public FSEntity FSEntity + { + get { return iEntity; } + } + + public bool IsUnsupported + { + get + { + return ( this is SymbianDebugLib.Entity.BuiltIn.Unsupported.UnsupportedEntity ); + } + } + + public bool WasAddedExplicitly + { + get { return iWasAddedExplicitly; } + set { iWasAddedExplicitly = value; } + } + + public string CategoryName + { + get { return iDescriptor.CategoryName; } + } + + public DbgEntityDescriptor Descriptor + { + get { return iDescriptor; } + } + + public DbgEntityPrimerResult PrimerResult + { + get { return iResult; } + internal set { iResult = value; } + } + + public TDbgUiMode UiMode + { + get { return Descriptor.UiMode; } + } + #endregion + + #region Priming event propgation + internal void OnPrimeStart( IDbgEntityPrimer aPrimer ) + { + // First tell engine + Descriptor.Engine.OnPrimingStarted( this ); + try + { + // Next, tell observer + if ( EventObserver != null ) + { + EventObserver( this, this.CategoryName, TEvent.EEventPrimingStarted, null, null ); + } + } + catch ( Exception ) + { + } + } + + internal void OnPrimeProgress( IDbgEntityPrimer aPrimer, int aValue ) + { + // First tell engine + Descriptor.Engine.OnPrimingProgress( this, aValue ); + try + { + if ( EventObserver != null ) + { + EventObserver( this, this.CategoryName, TEvent.EEventPrimingProgress, aValue, null ); + } + } + catch ( Exception ) + { + } + } + + internal void OnPrimeComplete( IDbgEntityPrimer aPrimer ) + { + // We are now considered "primed" + iIsPrimed = true; + + // Next tell engine + Descriptor.Engine.OnPrimingComplete( this ); + try + { + // Next, tell observer + if ( EventObserver != null ) + { + EventObserver( this, this.CategoryName, TEvent.EEventPrimingComplete, aPrimer.PrimeErrorMessage, aPrimer.PrimeException ); + } + } + catch ( Exception ) + { + } + } + #endregion + + #region Operators + public static implicit operator FSEntity( DbgEntity aEntity ) + { + FSEntity ret = null; + // + if ( aEntity.FSEntity != null ) + { + ret = aEntity.FSEntity; + } + // + return ret; + } + #endregion + + #region Internal properties + protected DbgEngine Engine + { + get { return Descriptor.Engine; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override int GetHashCode() + { + return this.FSEntity.GetHashCode(); + } + + public override bool Equals( object aObject ) + { + if ( aObject != null ) + { + if ( aObject is DbgEntity ) + { + DbgEntity other = (DbgEntity) aObject; + // + return ( other.FSEntity == this.FSEntity ); + } + } + // + return base.Equals( aObject ); + } + + public override string ToString() + { + return this.FSEntity.FullName; + } + #endregion + + #region Data members + private readonly DbgEntityDescriptor iDescriptor; + private DbgEntityPrimerResult iResult; + private object iTag = null; + private FSEntity iEntity = null; + private bool iIsPrimed = false; + private bool iWasAddedExplicitly = true; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Descriptor/DbgEntityDescriptor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Descriptor/DbgEntityDescriptor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,207 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Drawing; +using SymbianUtils; +using SymbianUtils.FileSystem; +using SymbianUtils.Settings; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Primer; +using SymbianDebugLib.PluginAPI; + +namespace SymbianDebugLib.Entity.Descriptors +{ + public abstract class DbgEntityDescriptor : IComparable + { + #region Enumerations + public enum TFileSystemBrowserType + { + EFiles = 0, + EDirectories + } + + public enum TUnderlyingType + { + ETypeUnknown = -1, + ETypeSymbols = 0, + ETypeCode, + ETypeConfigMetaData, + ETypeKeyBindings, + ETypeTraceDictionaries + } + #endregion + + #region Constructors + protected DbgEntityDescriptor( DbgEntityDescriptorManager aManager ) + { + iManager = aManager; + } + #endregion + + #region Framework API + public abstract DbgEntity Create( FSEntity aEntity ); + + public abstract DbgEntity Create( XmlSettingCategory aSettingsCategory ); + + public virtual Image Icon + { + get { return null; } + } + + public abstract TFileSystemBrowserType FileSystemBrowserType + { + get; + } + + public abstract string CategoryName + { + get; + } + + public abstract int DisplayOrder + { + get; + } + + public virtual FSExtensionList Extensions + { + get { return new FSExtensionList(); } + } + + public virtual void OnUiModeChanged() + { + } + + public virtual TUnderlyingType UnderlyingType + { + get { return TUnderlyingType.ETypeUnknown; } + } + + public virtual void OnCleared() + { + } + #endregion + + #region API + internal void Prime( DbgEntity aEntity, TSynchronicity aSynchronicity ) + { + // Make a new result + aEntity.PrimerResult = new DbgEntityPrimerResult( aEntity ); + + // The primer to use + IDbgEntityPrimer primer = null; + + // We can't sensibly prime if we don't have a plugin engine associated with the + // entity. + DbgPluginEngine plugin = aEntity.PluginEngine; + if ( plugin != null ) + { + // Get primer object + switch ( UiMode ) + { + case TDbgUiMode.EUiDisabled: + primer = new DbgEntityPrimerSilent( aEntity, plugin ); + break; + default: + case TDbgUiMode.EUiEnabled: + primer = new DbgEntityPrimerUi( aEntity, plugin ); + break; + } + } + else + { + primer = new DbgEntityPrimerNull( aEntity ); + Engine.Trace( "WARNING: Entity {0} does not supply plugin engine", aEntity.FullName ); + } + + // Make sure we indicate that we actually atttempted to prime + // the entity. + aEntity.PrimerResult.PrimeAttempted = true; + + // And prime away + primer.Prime( aSynchronicity ); + } + #endregion + + #region Properties + public DbgEngine Engine + { + get { return Manager.Engine; } + } + + public TDbgUiMode UiMode + { + get { return iManager.UiMode; } + } + + protected DbgEntityDescriptorManager Manager + { + get { return iManager; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override bool Equals( object aObject ) + { + if ( aObject != null ) + { + if ( aObject is DbgEntityDescriptor ) + { + DbgEntityDescriptor other = (DbgEntityDescriptor) aObject; + return other.CategoryName == this.CategoryName; + } + } + // + return base.Equals( aObject ); + } + + public override string ToString() + { + return CategoryName; + } + + public override int GetHashCode() + { + return CategoryName.GetHashCode(); + } + #endregion + + #region From IComparable + public int CompareTo( DbgEntityDescriptor aOther ) + { + int ret = 1; + // + if ( aOther != null ) + { + ret = this.DisplayOrder.CompareTo( aOther.DisplayOrder ); + } + // + return ret; + } + #endregion + + #region Data members + private readonly DbgEntityDescriptorManager iManager; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Descriptor/DbgEntityDescriptorManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Descriptor/DbgEntityDescriptorManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,208 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.PluginManager; +using SymbianUtils.FileSystem; +using SymbianUtils.Settings; +using SymbianDebugLib.Engine; + +namespace SymbianDebugLib.Entity.Descriptors +{ + public class DbgEntityDescriptorManager : IEnumerable, IComparer + { + #region Constructors + internal DbgEntityDescriptorManager( DbgEngine aEngine ) + { + iEngine = aEngine; + // + iDescriptors.Load( new object[] { this } ); + iDescriptors.Sort( this ); + // + BuildExtensionList(); + } + #endregion + + #region API + internal DbgEntity Create( XmlSettingCategory aSettingsCategory ) + { + DbgEntity ret = null; + // + foreach ( DbgEntityDescriptor descriptor in iDescriptors ) + { + try + { + ret = descriptor.Create( aSettingsCategory ); + if ( ret != null ) + { + break; + } + } + catch ( Exception ) + { + } + } + // + return ret; + } + + internal DbgEntity Create( FSEntity aFSEntity ) + { + DbgEntity ret = FindDescriptorAndCreateEntry( aFSEntity ); + return ret; + } + #endregion + + #region Properties + public int Count + { + get { return iDescriptors.Count; } + } + + public TDbgUiMode UiMode + { + get { return iUiMode; } + set + { + if ( iUiMode != value ) + { + iUiMode = value; + foreach ( DbgEntityDescriptor descriptor in iDescriptors ) + { + descriptor.OnUiModeChanged(); + } + } + } + } + + public FSExtensionList Extensions + { + get { return iAllExtensions; } + } + + public DbgEngine Engine + { + get { return iEngine; } + } + + public DbgEntityDescriptor this[ int aIndex ] + { + get { return iDescriptors[ aIndex ]; } + } + + public DbgEntityDescriptor this[ string aCategoryName ] + { + get + { + DbgEntityDescriptor ret = null; + // + foreach ( DbgEntityDescriptor descriptor in iDescriptors ) + { + if ( descriptor.CategoryName.ToUpper() == aCategoryName.ToUpper() ) + { + ret = descriptor; + break; + } + } + // + return ret; + } + } + #endregion + + #region Internal methods + private void BuildExtensionList() + { + foreach ( DbgEntityDescriptor descriptor in iDescriptors ) + { + FSExtensionList extensions = descriptor.Extensions; + iAllExtensions.AddRange( extensions ); + } + } + + private DbgEntity FindDescriptorAndCreateEntry( FSEntity aFSEntity ) + { + DbgEntity ret = null; + // + foreach ( DbgEntityDescriptor descriptor in iDescriptors ) + { + try + { + ret = descriptor.Create( aFSEntity ); + if ( ret != null ) + { + break; + } + } + catch ( Exception ) + { + } + } + // + return ret; + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( DbgEntityDescriptor d in iDescriptors ) + { + yield return d; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( DbgEntityDescriptor d in iDescriptors ) + { + yield return d; + } + } + #endregion + + #region From IComparer + public int Compare( DbgEntityDescriptor aLeft, DbgEntityDescriptor aRight ) + { + int ret = -1; + // + if ( aLeft == null || aRight == null ) + { + if ( aRight == null ) + { + ret = 1; + } + } + else + { + ret = ( aLeft.DisplayOrder.CompareTo( aRight.DisplayOrder ) * -1 ); + } + // + return ret; + } + #endregion + + #region Data members + private readonly DbgEngine iEngine; + private TDbgUiMode iUiMode = TDbgUiMode.EUiEnabled; + private FSExtensionList iAllExtensions = new FSExtensionList(); + private PluginManager iDescriptors = new PluginManager( 2 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/List/DbgEntityList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/List/DbgEntityList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Descriptors; + +namespace SymbianDebugLib.Entity +{ + public class DbgEntityList : DisposableObject, IEnumerable + { + #region Constructors + internal DbgEntityList( DbgEngine aEngine ) + { + iEngine = aEngine; + } + #endregion + + #region API + public virtual void Add( DbgEntity aEntity ) + { + iEntities.Add( aEntity ); + } + + public virtual DbgEntity Remove( DbgEntity aEntity ) + { + Predicate predicate = delegate( DbgEntity entity ) { return entity == aEntity; }; + DbgEntity found = iEntities.Find( predicate ); + if ( found != null ) + { + iEntities.Remove( found ); + } + // + return found; + } + + public bool Contains( FSEntity aFSEntity ) + { + bool ret = false; + // + foreach ( DbgEntity e in iEntities ) + { + if ( e.FSEntity == aFSEntity ) + { + ret = true; + break; + } + } + // + return ret; + } + #endregion + + #region Properties + public int Count + { + get { return iEntities.Count; } + } + + public DbgEntity this[ int aIndex ] + { + get { return iEntities[ aIndex ]; } + } + + public DbgEngine Engine + { + get { return iEngine; } + } + + public string[] FileNames + { + get + { + List ret = new List(); + foreach ( DbgEntity e in iEntities ) + { + ret.Add( e.FullName ); + } + return ret.ToArray(); + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + foreach ( DbgEntity entity in iEntities ) + { + entity.Dispose(); + } + } + } + #endregion + + #region Internal properties + #endregion + + #region Internal methods + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( DbgEntity e in iEntities ) + { + yield return e; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( DbgEntity e in iEntities ) + { + yield return e; + } + } + #endregion + + #region Data members + private readonly DbgEngine iEngine; + private List iEntities = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/List/DbgEntityListCategorised.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/List/DbgEntityListCategorised.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Descriptors; + +namespace SymbianDebugLib.Entity +{ + public class DbgEntityListCategorised : DbgEntityList + { + #region Constructors + internal DbgEntityListCategorised( DbgEngine aEngine, DbgEntityDescriptor aDescriptor ) + : base( aEngine ) + { + iDescriptor = aDescriptor; + } + #endregion + + #region API + public override void Add( DbgEntity aEntity ) + { + if ( aEntity.CategoryName != this.CategoryName ) + { + throw new ArgumentException(); + } + else{ + base.Add( aEntity ); + } + } + #endregion + + #region Properties + public string CategoryName + { + get { return iDescriptor.CategoryName; } + } + + public DbgEntityDescriptor Descriptor + { + get { return iDescriptor; } + } + #endregion + + #region Event handlers + #endregion + + #region Internal properties + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly DbgEntityDescriptor iDescriptor; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Manager/DbgEntityManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Manager/DbgEntityManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,324 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.Entity.Descriptors; + +namespace SymbianDebugLib.Entity.Manager +{ + public class DbgEntityManager : IEnumerable, IXmlSettingsExtended + { + #region Constructors + internal DbgEntityManager( DbgEngine aEngine ) + { + iEngine = aEngine; + } + #endregion + + #region API + public void Clear() + { + foreach ( KeyValuePair kvp in iLists ) + { + DbgEntityListCategorised list = kvp.Value; + + // Tell the descriptor it is being cleared + list.Descriptor.OnCleared(); + + // Get rid of the list + list.Dispose(); + } + // + iLists.Clear(); + iDisplayOrderList.Clear(); + Engine.OnCleared(); + } + + public DbgEntity Add( FSEntity aFSEntity ) + { + DbgEntityDescriptorManager descManager = Engine.DescriptorManager; + // + DbgEntity entity = descManager.Create( aFSEntity ); + if ( entity != null ) + { + SaveEntity( entity ); + } + // + return entity; + } + + public DbgEntity AddFile( FileInfo aFile ) + { + return Add( new FSEntityFile( aFile ) ); + } + + public DbgEntity AddDirectory( DirectoryInfo aDirectory ) + { + return Add( new FSEntityDirectory( aDirectory ) ); + } + + public void Remove( DbgEntity aEntity ) + { + DbgEntityDescriptor descriptor = aEntity.Descriptor; + if ( descriptor != null ) + { + DbgEntityListCategorised list; + if ( iLists.TryGetValue( descriptor.CategoryName, out list ) ) + { + // Try to find the entity from the list and, if found, + // destroy it. + using ( DbgEntity removed = list.Remove( aEntity ) ) + { + if ( removed != null ) + { + // Tell the entity + removed.OnRemoved(); + + // Tell everybody else + Engine.OnRemoved( removed ); + } + } + } + if ( iDisplayOrderList.TryGetValue( descriptor, out list ) ) + { + iDisplayOrderList.Remove( descriptor ); + } + } + } + + public bool IsReadyToPrime( out string aErrorList ) + { + bool ready = true; + aErrorList = string.Empty; + // + foreach ( DbgEntity e in this ) + { + if ( !e.IsReadyToPrime( out aErrorList ) ) + { + ready = false; + break; + } + } + // + return ready; + } + + public bool Contains( FSEntity aFSEntity ) + { + bool ret = false; + // + foreach ( KeyValuePair kvp in iDisplayOrderList ) + { + DbgEntityListCategorised list = kvp.Value; + if ( list.Contains( aFSEntity ) ) + { + ret = true; + break; + } + } + // + return ret; + } + #endregion + + #region Properties + public int Count + { + get + { + int ret = 0; + // + foreach ( KeyValuePair kvp in iDisplayOrderList ) + { + ret += kvp.Value.Count; + } + // + return ret; + } + } + + public DbgEntity this[ int aIndex ] + { + get + { + int i = 0; + DbgEntity ret = null; + // + foreach ( KeyValuePair kvp in iDisplayOrderList ) + { + DbgEntityListCategorised list = kvp.Value; + int listCount = list.Count; + if ( aIndex < ( i + listCount ) ) + { + ret = list[ aIndex - i ]; + break; + } + else + { + i += listCount; + } + } + // + if ( ret == null ) + { + throw new ArgumentException( "aIndex is out of range" ); + } + // + return ret; + } + } + + public DbgEngine Engine + { + get { return iEngine; } + } + + public FSEntity[] FileSystemEntities + { + get + { + List entities = new List(); + // + foreach ( DbgEntity e in this ) + { + FSEntity clone = FSEntity.New( e ); + entities.Add( clone ); + } + // + return entities.ToArray(); + } + } + #endregion + + #region Event handlers + #endregion + + #region Settings related + public void XmlSettingsSave( XmlSettings aSettings, string aCategory ) + { + aSettings.Clear(); + aSettings[ aCategory, "__Count" ] = Count; + int index = 0; + foreach ( DbgEntity entity in this ) + { + string entityCategory = string.Format( "DbgEntity_{0:d5}", index++ ); + + // Get the category where we'll save the settings for this entity to... + XmlSettingCategory category = aSettings[ entityCategory ]; + + // Save entity specific settings + entity.Save( category ); + } + } + + public void XmlSettingsLoad( XmlSettings aSettings, string aCategory ) + { + Clear(); + // + int count = aSettings.Load( aCategory, "__Count", 0 ); + for ( int i = 0; i < count; i++ ) + { + try + { + // Create category name and try to obtain it... + string entityCategory = string.Format( "DbgEntity_{0:d5}", i ); + XmlSettingCategory category = aSettings[ entityCategory ]; + if ( category != null ) + { + // Make a new entity object based upon the type + DbgEntityDescriptorManager descManager = Engine.DescriptorManager; + DbgEntity entity = descManager.Create( category ); + if ( entity != null ) + { + SaveEntity( entity ); + } + } + } + catch ( Exception ) + { + } + } + } + #endregion + + #region Internal properties + #endregion + + #region Internal methods + private void SaveEntity( DbgEntity aEntity ) + { + // Check if the dictionary already contains an entity descriptor list + DbgEntityDescriptor descriptor = aEntity.Descriptor; + DbgEntityListCategorised list; + if ( !iLists.TryGetValue( descriptor.CategoryName, out list ) ) + { + list = new DbgEntityListCategorised( Engine, descriptor ); + + // We create two lists. One sorts and indexes by display order, the other indexes by category. + iLists.Add( descriptor.CategoryName, list ); + if ( !iDisplayOrderList.ContainsKey( descriptor ) ) + { + iDisplayOrderList.Add( descriptor, list ); + } + } + + // Add to list + list.Add( aEntity ); + + // Notify engine + Engine.OnAdded( aEntity ); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( KeyValuePair kvp in iDisplayOrderList ) + { + foreach ( DbgEntity e in kvp.Value ) + { + yield return e; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair kvp in iDisplayOrderList ) + { + foreach ( DbgEntity e in kvp.Value ) + { + yield return e; + } + } + } + #endregion + + #region Data members + private readonly DbgEngine iEngine; + private SortedList iDisplayOrderList = new SortedList(); + private Dictionary iLists = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/DbgEntityPrimerNull.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/DbgEntityPrimerNull.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianUtils; +using SymbianUtils.PluginManager; +using SymbianUtils.FileSystem; +using SymbianUtils.Settings; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI; + +namespace SymbianDebugLib.Entity.Primer +{ + internal class DbgEntityPrimerNull : IDbgEntityPrimer + { + #region Constructors + public DbgEntityPrimerNull( DbgEntity aEntity ) + { + iEntity = aEntity; + } + #endregion + + #region From IDbgEntityPrimer + public void Prime( TSynchronicity aSynchronicity ) + { + // Doesn't do anything + iEntity.OnPrimeStart( this ); + iEntity.OnPrimeComplete( this ); + } + + public string PrimeErrorMessage + { + get { return string.Empty; } + } + + public Exception PrimeException + { + get { return null; } + internal set { } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly DbgEntity iEntity; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/DbgEntityPrimerResult.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/DbgEntityPrimerResult.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.PluginManager; +using SymbianUtils.FileSystem; +using SymbianUtils.Settings; +using SymbianDebugLib.Engine; +using SymbianUtils; + +namespace SymbianDebugLib.Entity.Primer +{ + public class DbgEntityPrimerResult + { + #region Constructors + internal DbgEntityPrimerResult( DbgEntity aEntity ) + { + iEntity = aEntity; + } + #endregion + + #region API + #endregion + + #region Properties + public bool PrimeAttempted + { + get { return iPrimeAttempted; } + internal set { iPrimeAttempted = value; } + } + + public bool PrimedOkay + { + get + { + bool ret = false; + // + if ( iPrimeAttempted ) + { + ret = ( iPrimeException == null ); + } + // + return ret; + } + } + + public string PrimeErrorMessage + { + get + { + string ret = string.Empty; + // + if ( PrimedOkay == false ) + { + ret = string.Format( "Could not process debug entity \'{0}\'", iEntity ); + } + // + return ret; + } + } + + public Exception PrimeException + { + get { return iPrimeException; } + internal set { iPrimeException = value; } + } + + public DbgEntity Entity + { + get { return iEntity; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly DbgEntity iEntity; + private bool iPrimeAttempted = false; + private Exception iPrimeException = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/DbgEntityPrimerSilent.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/DbgEntityPrimerSilent.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianUtils; +using SymbianUtils.PluginManager; +using SymbianUtils.FileSystem; +using SymbianUtils.Settings; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI; + +namespace SymbianDebugLib.Entity.Primer +{ + internal class DbgEntityPrimerSilent : IDbgEntityPrimer + { + #region Constructors + public DbgEntityPrimerSilent( DbgEntity aEntity, DbgPluginEngine aPlugin ) + { + iEntity = aEntity; + iPlugin = aPlugin; + + // Make a new primer and seed it with the entity. + iPrimer = aPlugin.CreatePrimer(); + iPrimer.Add( aEntity ); + + // Listen to plugin primer events + iPrimer.EventHandler += new DbgPluginPrimer.PrimeEventHandler( PrimerPlugin_EventHandler ); + } + #endregion + + #region From IDbgEntityPrimer + public void Prime( TSynchronicity aSynchronicity ) + { + PrimeException = null; + // + try + { + iPrimer.Prime( aSynchronicity ); + } + catch ( Exception e ) + { + OnPrimeStart(); + PrimeException = e; + OnPrimeComplete(); + } + } + + public string PrimeErrorMessage + { + get { return iEntity.PrimerResult.PrimeErrorMessage; } + } + + public Exception PrimeException + { + get { return iEntity.PrimerResult.PrimeException; } + internal set { iEntity.PrimerResult.PrimeException = value; } + } + #endregion + + #region Properties + public bool PrimedOkay + { + get { return iEntity.PrimerResult.PrimedOkay; } + } + + public DbgEntity Entity + { + get { return iEntity; } + } + + public DbgPluginEngine Plugin + { + get { return iPlugin; } + } + #endregion + + #region Event handlers + private void PrimerPlugin_EventHandler( DbgPluginPrimer.TPrimeEvent aEvent, object aData ) + { + switch ( aEvent ) + { + case DbgPluginPrimer.TPrimeEvent.EEventPrimingStarted: + OnPrimeStart(); + break; + case DbgPluginPrimer.TPrimeEvent.EEventPrimingProgress: + if ( aData != null && ( aData is int ) ) + { + int prog = (int) aData; + OnPrimeProgress( prog ); + } + break; + case DbgPluginPrimer.TPrimeEvent.EEventPrimingComplete: + OnPrimeComplete(); + break; + } + } + #endregion + + #region Event cascading + protected void OnPrimeStart() + { + bool sent = ( ( iFlags & TFlags.EFlagsSentEventStart ) == TFlags.EFlagsSentEventStart ); + if ( !sent ) + { + iEntity.OnPrimeStart( this ); + iFlags |= TFlags.EFlagsSentEventStart; + } + } + + protected void OnPrimeProgress( int aValue ) + { + iEntity.OnPrimeProgress( this, aValue ); + } + + protected void OnPrimeComplete() + { + bool sent = ( ( iFlags & TFlags.EFlagsSentEventComplete ) == TFlags.EFlagsSentEventComplete ); + if ( !sent ) + { + // Update entity's primer results + iEntity.OnPrimeComplete( this ); + iFlags |= TFlags.EFlagsSentEventComplete; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal enumerations + [Flags] + private enum TFlags + { + EFlagsNone = 0, + EFlagsSentEventStart = 1, + EFlagsSentEventComplete = 2 + } + #endregion + + #region Data members + private readonly DbgEntity iEntity; + private readonly DbgPluginEngine iPlugin; + private readonly DbgPluginPrimer iPrimer; + private TFlags iFlags = TFlags.EFlagsNone; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/DbgEntityPrimerUi.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/DbgEntityPrimerUi.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace SymbianDebugLib.Entity.Primer +{ + partial class DbgEntityPrimerUi + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + private System.Windows.Forms.Timer iTimer_OpStart; + private System.Windows.Forms.ProgressBar iProgressBar; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.iProgressBar = new System.Windows.Forms.ProgressBar(); + this.iTimer_OpStart = new System.Windows.Forms.Timer( this.components ); + this.SuspendLayout(); + // + // iProgressBar + // + this.iProgressBar.Location = new System.Drawing.Point( 8, 8 ); + this.iProgressBar.Name = "iProgressBar"; + this.iProgressBar.Size = new System.Drawing.Size( 376, 24 ); + this.iProgressBar.TabIndex = 0; + // + // iTimer_OpStart + // + this.iTimer_OpStart.Interval = 10; + this.iTimer_OpStart.Tick += new System.EventHandler( this.Timer_OpStart_Tick ); + // + // SymbolReaderProgressDialog + // + this.AutoScaleBaseSize = new System.Drawing.Size( 5, 13 ); + this.ClientSize = new System.Drawing.Size( 392, 39 ); + this.ControlBox = false; + this.Controls.Add( this.iProgressBar ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "DbgEntityPrimerUi"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = " Preparing..."; + this.ResumeLayout( false ); + } + + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/DbgEntityPrimerUi.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/DbgEntityPrimerUi.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,215 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using SymbianUtils; +using SymbianUtils.PluginManager; +using SymbianUtils.FileSystem; +using SymbianUtils.Settings; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI; + +namespace SymbianDebugLib.Entity.Primer +{ + public partial class DbgEntityPrimerUi : Form, IDbgEntityPrimer + { + #region Constructors + public DbgEntityPrimerUi( DbgEntity aEntity, DbgPluginEngine aPlugin ) + { + iEntity = aEntity; + iPlugin = aPlugin; + + // Make a new primer and seed it with the entity. + iPrimer = aPlugin.CreatePrimer(); + iPrimer.Add( aEntity ); + + // Listen to plugin primer events + iPrimer.EventHandler += new DbgPluginPrimer.PrimeEventHandler( PrimerPlugin_EventHandler ); + // + this.InitializeComponent(); + this.Text = string.Format( "Preparing: [{0}]", Path.GetFileName( aEntity.FullName ) ); + } + #endregion + + #region From IDbgEntityPrimer + public void Prime( TSynchronicity aSynchronicity ) + { + // Timer initiates operation + iTimer_OpStart.Tag = aSynchronicity; + iTimer_OpStart.Start(); + + // Show the dialog + base.ShowDialog(); + } + + public string PrimeErrorMessage + { + get { return iEntity.PrimerResult.PrimeErrorMessage; } + } + + public Exception PrimeException + { + get { return iEntity.PrimerResult.PrimeException; } + internal set { iEntity.PrimerResult.PrimeException = value; } + } + #endregion + + #region Event handlers + private void Timer_OpStart_Tick( object sender, EventArgs aArgs ) + { + iTimer_OpStart.Stop(); + iTimer_OpStart.Enabled = false; + // + TSynchronicity syncMode = (TSynchronicity) iTimer_OpStart.Tag; + PrimeException = null; + + // If requested to prime asynchronously then we don't need to + // do anything because this will return immediately and the + // prime will run in a background thread. + // + // On the other hand, if requesting synchronous priming then + // we need to spawn a worker thread or else the progress dialog + // will not redraw (since the synchronous operation runs within + // the context of the thread in which the synchronous prime request + // originates). + switch ( syncMode ) + { + case TSynchronicity.EAsynchronous: + RunPrime( TSynchronicity.EAsynchronous ); + break; + case TSynchronicity.ESynchronous: + ThreadPool.QueueUserWorkItem( new WaitCallback( RunSyncPrimeInWorkerThread ) ); + break; + default: + throw new NotSupportedException( "Unsupported synchronicity" ); + } + } + #endregion + + #region Event handlers + private void PrimerPlugin_EventHandler( DbgPluginPrimer.TPrimeEvent aEvent, object aData ) + { + System.Diagnostics.Debug.WriteLine( string.Format( "PrimerPlugin - event handler - {0} - {1}", aEvent, aData ) ); + if ( InvokeRequired ) + { + DbgPluginPrimer.PrimeEventHandler callback = new DbgPluginPrimer.PrimeEventHandler( PrimerPlugin_EventHandler ); + this.BeginInvoke( callback, new object[] { aEvent, aData } ); + } + else + { + switch ( aEvent ) + { + case DbgPluginPrimer.TPrimeEvent.EEventPrimingStarted: + iProgressBar.Maximum = 100; //% + iProgressBar.Minimum = 0; //% + iProgressBar.Value = 0; + OnPrimeStart(); + break; + case DbgPluginPrimer.TPrimeEvent.EEventPrimingProgress: + if ( aData != null && ( aData is int ) ) + { + int prog = (int) aData; + OnPrimeProgress( prog ); + iProgressBar.Value = prog; + } + break; + case DbgPluginPrimer.TPrimeEvent.EEventPrimingComplete: + iProgressBar.Value = 100; + OnPrimeComplete(); + Close(); + break; + } + } + // + Application.DoEvents(); + } + #endregion + + #region Event cascading + protected void OnPrimeStart() + { + bool sent = ( ( iFlags & TFlags.EFlagsSentEventStart ) == TFlags.EFlagsSentEventStart ); + if ( !sent ) + { + iEntity.OnPrimeStart( this ); + iFlags |= TFlags.EFlagsSentEventStart; + } + } + + protected void OnPrimeProgress( int aValue ) + { + iEntity.OnPrimeProgress( this, aValue ); + } + + protected void OnPrimeComplete() + { + bool sent = ( ( iFlags & TFlags.EFlagsSentEventComplete ) == TFlags.EFlagsSentEventComplete ); + if ( !sent ) + { + // Update entity's primer results + iEntity.OnPrimeComplete( this ); + iFlags |= TFlags.EFlagsSentEventComplete; + } + } + #endregion + + #region Internal enumerations + [Flags] + private enum TFlags + { + EFlagsNone = 0, + EFlagsSentEventStart = 1, + EFlagsSentEventComplete = 2 + } + #endregion + + #region Internal methods + private void RunSyncPrimeInWorkerThread( object aNotUsed ) + { + RunPrime( TSynchronicity.ESynchronous ); + } + + private void RunPrime( TSynchronicity aSynchronicity ) + { + try + { + iPrimer.Prime( aSynchronicity ); + } + catch ( Exception e ) + { + OnPrimeStart(); + PrimeException = e; + OnPrimeComplete(); + } + } + #endregion + + #region Data members + private readonly DbgEntity iEntity; + private readonly DbgPluginEngine iPlugin; + private readonly DbgPluginPrimer iPrimer; + private TFlags iFlags = TFlags.EFlagsNone; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/IDbgEntityPrimer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Entity/Primer/IDbgEntityPrimer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianUtils; +using SymbianUtils.PluginManager; +using SymbianUtils.FileSystem; +using SymbianUtils.Settings; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI; + +namespace SymbianDebugLib.Entity.Primer +{ + internal interface IDbgEntityPrimer + { + void Prime( TSynchronicity aSynchronicity ); + + string PrimeErrorMessage + { + get; + } + + Exception PrimeException + { + get; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Code/DbgEngineCode.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Code/DbgEngineCode.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.PluginManager; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; + +namespace SymbianDebugLib.PluginAPI.Types.Code +{ + public abstract class DbgEngineCode : DbgPluginEngine + { + #region Factory function + public static DbgEngineCode New( DbgEngine aEngine ) + { + PluginManager loader = new PluginManager( 1 ); + loader.Load( new object[] { aEngine } ); + // + DbgEngineCode ret = null; + foreach ( DbgEngineCode engine in loader ) + { + if ( engine is DbgEngineCodeStub && loader.Count > 1 ) + { + continue; + } + else + { + ret = engine; + break; + } + } + // + return ret; + } + #endregion + + #region Constructors + protected DbgEngineCode( DbgEngine aEngine ) + : base( aEngine ) + { + } + #endregion + + #region Framework API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Code/DbgEngineCodeStub.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Code/DbgEngineCodeStub.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Code; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; + +namespace SymbianDebugLib.PluginAPI.Types.Code +{ + internal class DbgEngineCodeStub : DbgEngineCode + { + #region Constructors + public DbgEngineCodeStub( DbgEngine aEngine ) + : base( aEngine ) + { + } + #endregion + + #region From DbgCodeEngine + public override bool IsReady + { + get { return false; } + } + + public override string Name + { + get { return "Code Engine Stub"; } + } + + public override bool IsSupported( string aFileName, out string aType ) + { + aType = string.Empty; + return false; + } + + public override DbgPluginPrimer CreatePrimer() + { + throw new NotImplementedException(); + } + + protected override DbgPluginView DoCreateView( string aName ) + { + return null; + } + + protected override void DoClear() + { + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Code/DbgViewCode.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Code/DbgViewCode.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Range; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Code; + +namespace SymbianDebugLib.PluginAPI.Types.Code +{ + public abstract class DbgViewCode : DbgPluginView, IArmInstructionProvider + { + #region Constructors + protected DbgViewCode( string aName, DbgPluginEngine aEngine ) + : base( aName, aEngine ) + { + } + #endregion + + #region From IArmInstructionProvider + public uint GetDataUInt32( uint aAddress ) + { + uint ret = 0; + IArmInstruction[] inst = null; + // + bool available = GetInstructions( aAddress, TArmInstructionSet.EARM, 1, out inst ); + if ( available && inst.Length >= 1 ) + { + ret = inst[ 0 ].AIRawValue; + } + // + return ret; + } + + public ushort GetDataUInt16( uint aAddress ) + { + ushort ret = 0; + IArmInstruction[] inst = null; + // + bool available = GetInstructions( aAddress, TArmInstructionSet.ETHUMB, 1, out inst ); + if ( available && inst.Length >= 1 ) + { + ret = inst[ 0 ].AIRawValue; + } + // + return ret; + } + + public bool IsInstructionAddressValid( uint aAddress ) + { + return Contains( aAddress ); + } + + public bool GetInstructions( uint aAddress, TArmInstructionSet aInstructionSet, int aCount, out IArmInstruction[] aInstructions ) + { + return DoGetInstructions( aAddress, aInstructionSet, aCount, out aInstructions ); + } + #endregion + + #region Framework API + public abstract CodeCollection ActivateAndGetCollection( CodeSegDefinition aCodeSegment ); + + public abstract IArmInstruction ConvertToInstruction( uint aAddress, TArmInstructionSet aInstructionSet, uint aRawValue ); + + protected abstract bool DoGetInstructions( uint aAddress, TArmInstructionSet aInstructionSet, int aCount, out IArmInstruction[] aInstructions ); + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/DbgPluginEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/DbgPluginEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; + +namespace SymbianDebugLib.PluginAPI +{ + public abstract class DbgPluginEngine : DisposableObject, ITracer + { + #region Constructors + protected DbgPluginEngine( DbgEngine aEngine ) + { + iEngine = aEngine; + } + #endregion + + #region API + public void Clear() + { + foreach ( DbgPluginView view in iViews ) + { + view.Dispose(); + } + System.Diagnostics.Debug.Assert( iViews.Count == 0 ); + iViews.Clear(); + // + DoClear(); + } + + public bool IsSupported( string aFileName ) + { + string notNeeded; + return IsSupported( aFileName, out notNeeded ); + } + + public DbgPluginView CreateView( string aName ) + { + DbgPluginView ret = this.DoCreateView( aName ); + return ret; + } + #endregion + + #region API - framework + public abstract bool IsReady + { + get; + } + + public abstract string Name + { + get; + } + + public abstract DbgPluginPrimer CreatePrimer(); + + public abstract bool IsSupported( string aFileName, out string aType ); + + public virtual object CustomOperation( string aName, object aParam1, object aParam2 ) + { + throw new NotSupportedException(); + } + + public virtual void PrepareToPrime( DbgEntityList aEntities ) + { + } + + protected abstract DbgPluginView DoCreateView( string aName ); + + protected abstract void DoClear(); + #endregion + + #region API - views + internal void CloseView( DbgPluginView aView ) + { + iViews.Remove( aView ); + } + #endregion + + #region Properties + public DbgEngine Engine + { + get { return iEngine; } + } + #endregion + + #region Internal methods + #endregion + + #region ITracer Members + public void Trace( string aMessage ) + { + iEngine.Trace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iEngine.Trace( aFormat, aParams ); + } + #endregion + + #region Data members + private readonly DbgEngine iEngine; + private List iViews = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/DbgPluginPrimer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/DbgPluginPrimer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,219 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianUtils.PluginManager; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; + +namespace SymbianDebugLib.PluginAPI +{ + public abstract class DbgPluginPrimer + { + #region Enumerations + public enum TPrimeEvent + { + EEventPrimingStarted = 0, + EEventPrimingProgress, + EEventPrimingComplete + } + #endregion + + #region Delegates & events + public delegate void PrimeEventHandler( TPrimeEvent aEvent, object aData ); + public event PrimeEventHandler EventHandler; + #endregion + + #region Constructors + protected DbgPluginPrimer( DbgPluginEngine aEngine ) + { + iEngine = aEngine; + } + #endregion + + #region Framework API + public abstract void Add( DbgEntity aEntity ); + + public abstract void Prime( TSynchronicity aSynchronicity ); + + protected abstract int Count + { + get; + } + #endregion + + #region Properties + public bool ResetEngineBeforePriming + { + get { return iResetEngineBeforePriming; } + set { iResetEngineBeforePriming = value; } + } + + protected bool IsComplete + { + get + { + int completedCount = 0; + lock ( iCompleted ) + { + completedCount = iCompleted.Count; + } + int totalCount = Count; + bool primeCompleted = ( completedCount == totalCount ); + return primeCompleted; + } + } + #endregion + + #region Framework API + protected DbgPluginEngine Engine + { + get { return iEngine; } + } + #endregion + + #region Internal framework methods + protected virtual void OnPrepareToPrime() + { + lock ( iCompleted ) + { + iCompleted.Clear(); + } + lock ( iSourceProgressValues ) + { + iSourceProgressValues.Clear(); + } + iLastReportedProgress = -1; + } + + protected virtual void OnPrimeComplete() + { + lock ( iSourceProgressValues ) + { + iSourceProgressValues.Clear(); + } + lock ( iCompleted ) + { + iCompleted.Clear(); + } + // + ReportEvent( TPrimeEvent.EEventPrimingComplete, null ); + } + + protected void ReportProgressIfNeeded( bool aEntireOperationComplete ) + { + int newProgress = ( aEntireOperationComplete ? 100 : TotalProgress ); + if ( newProgress > iLastReportedProgress ) + { + // Set to max completion value if all sources are finished. + if ( aEntireOperationComplete ) + { + newProgress = 100; + } + + iLastReportedProgress = newProgress; + ReportEvent( TPrimeEvent.EEventPrimingProgress, newProgress ); + } + } + + protected bool AddToCompleted( object aEntity ) + { + lock ( iCompleted ) + { + iCompleted.Add( aEntity ); + } + // + bool primeCompleted = primeCompleted = this.IsComplete; + SaveLatestProgress( aEntity, 100 ); + return primeCompleted; + } + + protected void RemoveFromCompleted( object aEntity ) + { + lock ( iCompleted ) + { + iCompleted.Remove( aEntity ); + } + lock ( iSourceProgressValues ) + { + if ( iSourceProgressValues.ContainsKey( aEntity ) ) + { + iSourceProgressValues.Remove( aEntity ); + } + } + } + + protected void SaveLatestProgress( object aEntity, int aProgress ) + { + lock ( iSourceProgressValues ) + { + if ( !iSourceProgressValues.ContainsKey( aEntity ) ) + { + iSourceProgressValues.Add( aEntity, aProgress ); + } + else + { + iSourceProgressValues[ aEntity ] = aProgress; + } + } + } + + protected void ReportEvent( TPrimeEvent aEvent, object aData ) + { + if ( EventHandler != null ) + { + EventHandler( aEvent, aData ); + } + } + + protected int TotalProgress + { + get + { + long combined = 0; + // + lock ( iSourceProgressValues ) + { + foreach ( KeyValuePair kvp in iSourceProgressValues ) + { + combined += kvp.Value; + } + } + + // Scale by number of objects that are reporting progress + int count = Count; + long maxCompletionValue = ( count * 100 ); + // + float scaled = ((float) combined ) / (float) maxCompletionValue; + return (int) ( scaled * 100.0f ); + } + } + #endregion + + #region Data members + private readonly DbgPluginEngine iEngine; + private List iCompleted = new List(); + private Dictionary iSourceProgressValues = new Dictionary(); + private int iLastReportedProgress = -1; + private bool iResetEngineBeforePriming = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/DbgPluginView.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/DbgPluginView.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianUtils.FileSystem.FilePair; +using SymbianStructuresLib.CodeSegments; + +namespace SymbianDebugLib.PluginAPI +{ + public abstract class DbgPluginView : DisposableObject + { + #region Constructors + protected DbgPluginView( string aName, DbgPluginEngine aEngine ) + { + iName = aName; + iEngine = aEngine; + } + #endregion + + #region API - frameowork + public abstract bool Contains( uint aAddress ); + + public virtual void Activate( IEnumerable aCodeSegments ) + { + foreach ( CodeSegDefinition codeSeg in aCodeSegments ) + { + Activate( codeSeg ); + } + } + + public abstract bool Activate( CodeSegDefinition aCodeSegment ); + + public virtual void Deactivate( IEnumerable aCodeSegments ) + { + foreach ( CodeSegDefinition cs in aCodeSegments ) + { + Deactivate( cs ); + } + } + + public abstract bool Deactivate( CodeSegDefinition aCodeSegment ); + + public virtual object CustomOperation( string aName, object aParam1, object aParam2 ) + { + throw new NotSupportedException(); + } + + public virtual bool SerializeTaggedCollections( FileNamePairCollection aFilesToSave ) + { + return false; + } + + public abstract bool IsReady + { + get; + } + #endregion + + #region Properties + public string Name + { + get { return iName; } + } + + protected DbgPluginEngine Engine + { + get { return iEngine; } + } + #endregion + + #region Internal methods + internal static int GetHashCode( string aName ) + { + int ret = aName.GetHashCode(); + return ret; + } + #endregion + + #region From System.Object + public override int GetHashCode() + { + return iName.GetHashCode(); + } + + public override string ToString() + { + string ret = string.Format( "DbgPluginView: [{0}]", iName ); + return ret; + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iEngine.CloseView( this ); + } + } + #endregion + + #region Data members + private readonly string iName; + private readonly DbgPluginEngine iEngine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/KeyBindings/DbgEngineKeyBindings.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/KeyBindings/DbgEngineKeyBindings.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; +using SymbianUtils.PluginManager; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; + +namespace SymbianDebugLib.PluginAPI.Types.KeyBindings +{ + public abstract class DbgEngineKeyBindings : DbgPluginEngine + { + #region Factory function + public static DbgEngineKeyBindings New( DbgEngine aEngine ) + { + PluginManager loader = new PluginManager( 1 ); + loader.Load( new object[] { aEngine } ); + // + DbgEngineKeyBindings ret = null; + foreach ( DbgEngineKeyBindings engine in loader ) + { + if ( engine is DbgEngineKeyBindingsStub && loader.Count > 1 ) + { + continue; + } + else + { + ret = engine; + break; + } + } + // + return ret; + } + #endregion + + #region Constructors + protected DbgEngineKeyBindings( DbgEngine aEngine ) + : base( aEngine ) + { + } + #endregion + + #region API + public void LoadFromFile( string aFileName ) + { + using ( StreamReader reader = new StreamReader( new FileStream( aFileName, FileMode.Open, FileAccess.Read ) ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + Match m = KRegEx.Match( line ); + if ( m.Success ) + { + int scanCode = int.Parse( m.Groups[ "ScanCode" ].Value, System.Globalization.NumberStyles.HexNumber ); + string value = m.Groups[ "Interpretation" ].Value; + // + if ( iTable.ContainsKey( scanCode ) == false ) + { + iTable.Add( scanCode, value ); + } + } + line = reader.ReadLine(); + } + } + } + #endregion + + #region From DbgPluginEngine + protected override void DoClear() + { + iTable.Clear(); + } + #endregion + + #region Properties + public bool IsKeyBindingTableAvailable + { + get { return iTable.Count > 0; } + } + + public string this[ int aScanCode ] + { + get + { + string ret = KUnknownKey; + // + if ( iTable.TryGetValue( aScanCode, out ret ) == false ) + { + ret = KUnknownKey; + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + private const string KUnknownKey = "Unknown Key"; + private static readonly Regex KRegEx = new Regex( + "0x(?[0-9a-fA-F]{4})\\=(?.+)\r\n", + RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + #endregion + + #region Data members + private Dictionary iTable = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/KeyBindings/DbgEngineKeyBindingsStub.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/KeyBindings/DbgEngineKeyBindingsStub.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Code; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; + +namespace SymbianDebugLib.PluginAPI.Types.KeyBindings +{ + internal class DbgEngineKeyBindingsStub : DbgEngineKeyBindings + { + #region Constructors + public DbgEngineKeyBindingsStub( DbgEngine aEngine ) + : base( aEngine ) + { + } + #endregion + + #region From DbgCodeEngine + public override bool IsReady + { + get { return false; } + } + + public override string Name + { + get { return "Key Binding Engine Stub"; } + } + + public override bool IsSupported( string aFileName, out string aType ) + { + aType = string.Empty; + return false; + } + + public override DbgPluginPrimer CreatePrimer() + { + throw new NotImplementedException(); + } + + protected override DbgPluginView DoCreateView( string aName ) + { + return null; + } + + protected override void DoClear() + { + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/MetaDataConfig/DbgEngineMetaDataConfig.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/MetaDataConfig/DbgEngineMetaDataConfig.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.PluginManager; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; + +namespace SymbianDebugLib.PluginAPI.Types.MetaDataConfig +{ + public abstract class DbgEngineMetaDataConfig : DbgPluginEngine + { + #region Factory function + public static DbgEngineMetaDataConfig New( DbgEngine aEngine ) + { + PluginManager loader = new PluginManager( 1 ); + loader.Load( new object[] { aEngine } ); + // + DbgEngineMetaDataConfig ret = null; + foreach ( DbgEngineMetaDataConfig engine in loader ) + { + if ( engine is DbgEngineMetaDataConfigStub && loader.Count > 1 ) + { + continue; + } + else + { + ret = engine; + break; + } + } + // + return ret; + } + #endregion + + #region Constructors + protected DbgEngineMetaDataConfig( DbgEngine aEngine ) + : base( aEngine ) + { + } + #endregion + + #region From DbgPluginEngine + protected override void DoClear() + { + base.Engine.ConfigManager.Clear(); + } + #endregion + + #region Properties + public bool IsConfigurationDataAvailable + { + get { return base.Engine.ConfigManager.Count > 0; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/MetaDataConfig/DbgEngineMetaDataConfigStub.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/MetaDataConfig/DbgEngineMetaDataConfigStub.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Code; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; + +namespace SymbianDebugLib.PluginAPI.Types.MetaDataConfig +{ + internal class DbgEngineMetaDataConfigStub : DbgEngineMetaDataConfig + { + #region Constructors + public DbgEngineMetaDataConfigStub( DbgEngine aEngine ) + : base( aEngine ) + { + } + #endregion + + #region From DbgCodeEngine + public override bool IsReady + { + get { return false; } + } + + public override string Name + { + get { return "Meta-Data Config Engine Stub"; } + } + + public override bool IsSupported( string aFileName, out string aType ) + { + aType = string.Empty; + return false; + } + + public override DbgPluginPrimer CreatePrimer() + { + throw new NotImplementedException(); + } + + protected override DbgPluginView DoCreateView( string aName ) + { + return null; + } + + protected override void DoClear() + { + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Symbol/DbgEngineSymbol.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Symbol/DbgEngineSymbol.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.PluginManager; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; + +namespace SymbianDebugLib.PluginAPI.Types.Symbol +{ + public abstract class DbgEngineSymbol : DbgPluginEngine + { + #region Factory function + public static DbgEngineSymbol New( DbgEngine aEngine ) + { + PluginManager loader = new PluginManager( 1 ); + loader.Load( new object[] { aEngine } ); + // + DbgEngineSymbol ret = null; + foreach ( DbgEngineSymbol engine in loader ) + { + if ( engine is DbgEngineSymbolStub && loader.Count > 1 ) + { + continue; + } + else + { + ret = engine; + break; + } + } + // + return ret; + } + #endregion + + #region Constructors + protected DbgEngineSymbol( DbgEngine aEngine ) + : base( aEngine ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Symbol/DbgEngineSymbolStub.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Symbol/DbgEngineSymbolStub.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; + +namespace SymbianDebugLib.PluginAPI.Types.Symbol +{ + internal class DbgEngineSymbolStub : DbgEngineSymbol + { + #region Constructors + public DbgEngineSymbolStub( DbgEngine aEngine ) + : base( aEngine ) + { + } + #endregion + + #region From DbgEngineSymbol + public override bool IsReady + { + get { return false; } + } + + public override string Name + { + get { return "Symbol Engine Stub"; } + } + + public override bool IsSupported( string aFileName, out string aType ) + { + aType = string.Empty; + return false; + } + + public override DbgPluginPrimer CreatePrimer() + { + throw new NotImplementedException(); + } + + protected override DbgPluginView DoCreateView( string aName ) + { + throw new NotImplementedException(); + } + + protected override void DoClear() + { + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Symbol/DbgViewSymbol.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Symbol/DbgViewSymbol.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Debug.Common.FileName; + +namespace SymbianDebugLib.PluginAPI.Types.Symbol +{ + public abstract class DbgViewSymbol : DbgPluginView, IEnumerable + { + #region Constructors + protected DbgViewSymbol( string aName, DbgPluginEngine aEngine ) + : base( aName, aEngine ) + { + iPlainTextAPI = new DbgSymbolViewText( this ); + } + #endregion + + #region Framework API + public abstract SymbianStructuresLib.Debug.Symbols.Symbol Lookup( uint aAddress, out SymbolCollection aCollection ); + + public abstract SymbolCollection CollectionByAddress( uint aAddress ); + + public abstract SymbolCollection ActivateAndGetCollection( CodeSegDefinition aCodeSegment ); + + public abstract SymbolCollection this[ CodeSegDefinition aCodeSeg ] + { + get; + } + + public abstract SymbolCollection this[ PlatformFileName aFileName ] + { + get; + } + + protected abstract IEnumerator GetEnumeratorSymbolCollection(); + #endregion + + #region Properties + public SymbianStructuresLib.Debug.Symbols.Symbol this[ uint aAddress ] + { + get + { + SymbolCollection col = null; + return Lookup( aAddress, out col ); + } + } + + public DbgSymbolViewText PlainText + { + get { return iPlainTextAPI; } + } + #endregion + + #region Internal methods + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return GetEnumeratorSymbolCollection(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumeratorSymbolCollection(); + } + #endregion + + #region Data members + private readonly DbgSymbolViewText iPlainTextAPI; + #endregion + } + + #region Plain Text API helper + public sealed class DbgSymbolViewText + { + #region Constructors + internal DbgSymbolViewText( DbgViewSymbol aView ) + { + iView = aView; + } + #endregion + + #region API + public bool Lookup( uint aAddress, out uint aStartingAddress, out string aSymbolName ) + { + uint addrEnd = 0; + bool found = Lookup( aAddress, out aStartingAddress, out addrEnd, out aSymbolName ); + return found; + } + + public bool Lookup( uint aAddress, out uint aStartingAddress, out uint aEndingAddress, out string aSymbolName ) + { + aStartingAddress = 0; + aEndingAddress = 0; + aSymbolName = string.Empty; + // + SymbianStructuresLib.Debug.Symbols.Symbol sym = iView[ aAddress ]; + // + if ( sym != null ) + { + aStartingAddress = sym.Address; + aEndingAddress = sym.EndAddress; + aSymbolName = sym.Name; + } + // + return ( sym != null ); + } + #endregion + + #region Properties + public string this[ uint aAddress ] + { + get + { + uint addrStart = 0; + string symName = string.Empty; + bool found = Lookup( aAddress, out addrStart, out symName ); + return symName; + } + } + #endregion + + #region Data members + private readonly DbgViewSymbol iView; + #endregion + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Trace/DbgEngineTrace.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Trace/DbgEngineTrace.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.PluginManager; +using SymbianStructuresLib.Debug.Trace; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; + +namespace SymbianDebugLib.PluginAPI.Types.Trace +{ + public abstract class DbgEngineTrace : DbgPluginEngine + { + #region Factory function + public static DbgEngineTrace New( DbgEngine aEngine ) + { + PluginManager loader = new PluginManager( 1 ); + loader.Load( new object[] { aEngine } ); + // + DbgEngineTrace ret = null; + foreach ( DbgEngineTrace engine in loader ) + { + if ( engine is DbgEngineTraceStub && loader.Count > 1 ) + { + continue; + } + else + { + ret = engine; + break; + } + } + // + return ret; + } + #endregion + + #region Constructors + protected DbgEngineTrace( DbgEngine aEngine ) + : base( aEngine ) + { + } + #endregion + + #region From DbgPluginEngine + protected override DbgPluginView DoCreateView( string aName ) + { + // This engine doesn't support views. + throw new NotSupportedException(); + } + #endregion + + #region API + public abstract TraceLine[] Decode( byte[] aData ); + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Trace/DbgEngineTraceStub.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/PluginAPI/Trace/DbgEngineTraceStub.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; + +namespace SymbianDebugLib.PluginAPI.Types.Trace +{ + internal class DbgEngineTraceStub : DbgEngineTrace + { + #region Constructors + public DbgEngineTraceStub( DbgEngine aEngine ) + : base( aEngine ) + { + } + #endregion + + #region From DbgEngineTrace + public override bool IsReady + { + get { return false; } + } + + public override string Name + { + get { return "Trace Engine Stub"; } + } + + public override bool IsSupported( string aFileName, out string aType ) + { + aType = string.Empty; + return false; + } + + public override DbgPluginPrimer CreatePrimer() + { + throw new NotImplementedException(); + } + + public override SymbianStructuresLib.Debug.Trace.TraceLine[] Decode( byte[] aData ) + { + throw new NotImplementedException(); + } + + protected override void DoClear() + { + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/DbgEntCode.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/DbgEntCode.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,86 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054} + Library + Properties + DbgEntCode + DbgEntCode.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + True + True + Resources.resx + + + + + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Descriptor/CodeDescriptor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Descriptor/CodeDescriptor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Drawing; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Entity; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Primer; +using SymbianDebugLib.Entity.Descriptors; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Code; +using DbgEntCode.Entity; + +namespace DbgEntCode.Descriptor +{ + public class CodeDescriptor : DbgEntityDescriptor + { + #region Constructors + public CodeDescriptor( DbgEntityDescriptorManager aManager ) + : base( aManager ) + { + } + #endregion + + #region From DbgEntityDescriptor + public override DbgEntity Create( FSEntity aEntity ) + { + // Returns null if not supported + CodeEntity ret = CodeEntity.New( this, aEntity ); + return ret; + } + + public override DbgEntity Create( XmlSettingCategory aSettingsCategory ) + { + CodeEntity ret = CodeEntity.New( this, aSettingsCategory ); + return ret; + } + + public override Image Icon + { + get { return Properties.Resources.Icon; } + } + + public override DbgEntityDescriptor.TFileSystemBrowserType FileSystemBrowserType + { + get { return TFileSystemBrowserType.EFiles; } + } + + public override string CategoryName + { + get { return "Code"; } + } + + public override int DisplayOrder + { + get { return int.MaxValue - 40; } + } + + public override TUnderlyingType UnderlyingType + { + get { return TUnderlyingType.ETypeCode; } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Entity/CodeEntity.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Entity/CodeEntity.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Drawing; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Entity; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Descriptors; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types; +using DbgEntCode.Descriptor; + +namespace DbgEntCode.Entity +{ + public class CodeEntity : DbgEntity + { + #region Static constructors + public static CodeEntity New( CodeDescriptor aDescriptor, FSEntity aFSEntity ) + { + CodeEntity ret = null; + + // Validate that it's a supported file + if ( aFSEntity.Exists && aFSEntity.IsFile ) + { + string fileName = aFSEntity.FullName; + bool isCode = aDescriptor.Engine.Code.IsSupported( fileName ); + if ( isCode ) + { + ret = new CodeEntity( aDescriptor, aFSEntity ); + } + } + // + return ret; + } + + public static CodeEntity New( CodeDescriptor aDescriptor, XmlSettingCategory aSettingsCategory ) + { + CodeEntity ret = null; + // + if ( aSettingsCategory.Contains( KSettingsKeyFileName ) ) + { + string fileName = aSettingsCategory[ KSettingsKeyFileName ]; + ret = New( aDescriptor, FSEntity.New( fileName ) ); + } + // + return ret; + } + #endregion + + #region Constants + public const string KSettingsKeyFileName = "CodeFileName"; + #endregion + + #region Constructors + private CodeEntity( DbgEntityDescriptor aDescriptor, FSEntity aFSEntity ) + : base( aDescriptor, aFSEntity ) + { + } + #endregion + + #region From DbgEntity + public override void Save( XmlSettingCategory aCategory ) + { + aCategory[ KSettingsKeyFileName ] = base.FSEntity.FullName; + } + + public override DbgPluginEngine PluginEngine + { + get + { + return base.Engine.Code; + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region From DisposableObject + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Gfx/Icon.png Binary file crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Gfx/Icon.png has changed diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "2704477e-de16-4ef7-9ade-2bcc70cfb5fa" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Properties/Resources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Properties/Resources.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DbgEntCode.Properties { + using System; + + + // + // A strongly-typed resource class, for looking up localized strings, etc. + // + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + // + // Returns the cached ResourceManager instance used by this class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DbgEntCode.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + // + // Overrides the current thread's CurrentUICulture property for all + // resource lookups using this strongly typed resource class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap Icon { + get { + object obj = ResourceManager.GetObject("Icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Properties/Resources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntCode/Properties/Resources.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Gfx\Icon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/DbgEntSymbol.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/DbgEntSymbol.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,84 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {51C62A41-992E-4158-8A32-228ED49BF71D} + Library + Properties + DbgEntSymbol + DbgEntSymbol.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + True + True + Resources.resx + + + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Descriptor/SymbolDescriptor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Descriptor/SymbolDescriptor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Drawing; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Entity; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Primer; +using SymbianDebugLib.Entity.Descriptors; +using SymbianDebugLib.PluginAPI.Types; +using DbgEntSymbol.Entity; + +namespace DbgEntSymbol.Descriptor +{ + public class SymbolDescriptor : DbgEntityDescriptor + { + #region Constructors + public SymbolDescriptor( DbgEntityDescriptorManager aManager ) + : base( aManager ) + { + } + #endregion + + #region From DbgEntityDescriptor + public override DbgEntity Create( FSEntity aEntity ) + { + // Returns null if not supported + SymbolEntity ret = SymbolEntity.New( this, aEntity ); + return ret; + } + + public override DbgEntity Create( XmlSettingCategory aSettingsCategory ) + { + SymbolEntity ret = SymbolEntity.New( this, aSettingsCategory ); + return ret; + } + + public override Image Icon + { + get { return Properties.Resources.Icon; } + } + + public override DbgEntityDescriptor.TFileSystemBrowserType FileSystemBrowserType + { + get { return TFileSystemBrowserType.EFiles; } + } + + public override string CategoryName + { + get { return "Symbols"; } + } + + public override int DisplayOrder + { + get { return int.MaxValue - 20; } + } + + public override TUnderlyingType UnderlyingType + { + get { return TUnderlyingType.ETypeSymbols; } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Entity/SymbolEntity.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Entity/SymbolEntity.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Drawing; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Entity; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity.Descriptors; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using DbgEntSymbol.Descriptor; + +namespace DbgEntSymbol.Entity +{ + public class SymbolEntity : DbgEntity + { + #region Static constructors + public static SymbolEntity New( DbgEntityDescriptor aDescriptor, FSEntity aFSEntity ) + { + SymbolEntity ret = null; + + // Validate that it's a supported file + if ( aFSEntity.Exists && aFSEntity.IsFile ) + { + string type = string.Empty; + DbgEngine engine = aDescriptor.Engine; + DbgEngineSymbol symbolEngine = engine.Symbols; + bool supported = symbolEngine.IsSupported( aFSEntity.FullName, out type ); + // + if ( supported ) + { + ret = new SymbolEntity( aDescriptor, aFSEntity ); + } + } + // + return ret; + } + + public static SymbolEntity New( DbgEntityDescriptor aDescriptor, XmlSettingCategory aSettingsCategory ) + { + SymbolEntity ret = null; + // + if ( aSettingsCategory.Contains( KSettingsKeyFileName ) ) + { + string fileName = aSettingsCategory[ KSettingsKeyFileName ]; + ret = New( aDescriptor, FSEntity.New( fileName ) ); + } + // + return ret; + } + #endregion + + #region Constants + public const string KSettingsKeyFileName = "SymbolFileName"; + #endregion + + #region Constructors + private SymbolEntity( DbgEntityDescriptor aDescriptor, FSEntity aFSEntity ) + : base( aDescriptor, aFSEntity ) + { + } + #endregion + + #region From DbgEntity + public override void Save( XmlSettingCategory aCategory ) + { + aCategory[ KSettingsKeyFileName ] = base.FSEntity.FullName; + } + + public override DbgPluginEngine PluginEngine + { + get { return base.Engine.Symbols; } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Gfx/Icon.png Binary file crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Gfx/Icon.png has changed diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "2704477e-de16-4ef7-9ade-2bcc70cfb5fa" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Properties/Resources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Properties/Resources.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace DbgEntSymbol.Properties { + using System; + + + // + // A strongly-typed resource class, for looking up localized strings, etc. + // + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + // + // Returns the cached ResourceManager instance used by this class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DbgEntSymbol.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + // + // Overrides the current thread's CurrentUICulture property for all + // resource lookups using this strongly typed resource class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap Icon { + get { + object obj = ResourceManager.GetObject("Icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Properties/Resources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Plugins/DbgEntSymbol/Properties/Resources.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Gfx\Icon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "c5fc4c07-e2da-4d20-96b3-f346748d35d9" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Properties/Resources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Properties/Resources.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,77 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SymbianDebugLib.Properties { + using System; + + + // + // A strongly-typed resource class, for looking up localized strings, etc. + // + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + // + // Returns the cached ResourceManager instance used by this class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SymbianDebugLib.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + // + // Overrides the current thread's CurrentUICulture property for all + // resource lookups using this strongly typed resource class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap MissingIcon { + get { + object obj = ResourceManager.GetObject("MissingIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap UnsupportedIcon { + get { + object obj = ResourceManager.GetObject("UnsupportedIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Properties/Resources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Properties/Resources.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\entity\builtin\missing\icon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Entity\BuiltIn\Unsupported\Icon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/SymbianDebugLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/SymbianDebugLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,159 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {796DD82D-9E7D-476D-B700-086CD9A893DA} + Library + Properties + SymbianDebugLib + SymbianDebugLib + + + 2.0 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + DbgEntityPrimerUi.cs + + + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + + + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/SymbianDebugLib.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/SymbianDebugLib.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + en-US + false + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Types/DbgUiMode.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Types/DbgUiMode.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianDebugLib +{ + public enum TDbgUiMode + { + EUiEnabled = 0, + EUiDisabled + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Types/DbgViewDeactivationType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Types/DbgViewDeactivationType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianDebugLib +{ + public enum TDbgViewDeactivationType + { + EDoNothing = 0, + EDeactivateWhenDisposed + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Utilities/DbgDirectoryScanner.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/Utilities/DbgDirectoryScanner.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.ComponentModel; +using SymbianUtils.FileSystem; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; + +namespace SymbianDebugLib.Utilities +{ + public class DbgDirectoryScanner : FSDirectoryScanner + { + #region Constructors + public DbgDirectoryScanner( DbgEngine aEngine ) + { + iEngine = aEngine; + } + #endregion + + #region From FSDirectoryScanner + protected override void OnFileLocated( FileInfo aFile ) + { + base.OnFileLocated( aFile ); + // + DbgEntity entity = iEngine.Add( aFile ); + if ( entity != null ) + { + // Files found this way are not explict + entity.WasAddedExplicitly = false; + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly DbgEngine iEngine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/ValidationRules/DbgValidationManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/ValidationRules/DbgValidationManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianUtils.PluginManager; +using SymbianDebugLib.Engine; + +namespace SymbianDebugLib.ValidationRules +{ + public class DbgValidationManager + { + #region Constructors + internal DbgValidationManager( DbgEngine aEngine ) + { + iEngine = aEngine; + iRules.Load( new object[] { this } ); + } + #endregion + + #region API + public bool IsValid( DbgValidationRule.TOperation aOperation, out string aErrorDescription ) + { + StringBuilder error = new StringBuilder(); + // + bool ret = true; + // + foreach ( DbgValidationRule rule in iRules ) + { + string errorText = string.Empty; + // + bool valid = rule.IsValid( aOperation, ref errorText ); + if ( !valid ) + { + ret &= valid; + error.AppendLine( errorText ); + } + } + // + aErrorDescription = error.ToString(); + return ret; + } + #endregion + + #region Properties + public DbgEngine Engine + { + get { return iEngine; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly DbgEngine iEngine; + private PluginManager iRules = new PluginManager(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/ValidationRules/DbgValidationRule.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianDebugLib/ValidationRules/DbgValidationRule.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; +using System.Reflection; +using SymbianDebugLib.Engine; + +namespace SymbianDebugLib.ValidationRules +{ + public abstract class DbgValidationRule + { + #region Enumerations + public enum TOperation + { + EOperationPrime = 0 + } + #endregion + + #region Constructors + protected DbgValidationRule( DbgValidationManager aValidationManager ) + { + iValidationManager = aValidationManager; + } + #endregion + + #region Abstract API + public abstract bool IsValid( TOperation aType, ref string aErrorDescription ); + #endregion + + #region Properties + protected DbgEngine Engine + { + get { return iValidationManager.Engine; } + } + + protected DbgValidationManager ValidationManager + { + get { return iValidationManager; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly DbgValidationManager iValidationManager; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/BranchDecoder/ETMBranchDecoder.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/BranchDecoder/ETMBranchDecoder.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,351 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Tracer; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianStructuresLib.Arm.SecurityMode; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.State; +using SymbianETMLib.Common.Config; + +namespace SymbianETMLib.Common.BranchDecoder +{ + internal abstract class ETMBranchDecoder : ITracer + { + #region Factory + public static ETMBranchDecoder New( ETMStateData aStateData ) + { + ETMBranchDecoder ret = null; + // + switch ( aStateData.Config.BranchCompressionScheme ) + { + default: + case TETMBranchCompressionScheme.EOriginal: + ret = new ETMBranchDecoderOriginal( aStateData ); + break; + case TETMBranchCompressionScheme.EAlternative: + ret = new ETMBranchDecoderAlternative( aStateData ); + break; + } + // + return ret; + } + #endregion + + #region Constructors + protected ETMBranchDecoder( ETMStateData aStateData ) + { + iStateData = aStateData; + iInstructionSet = aStateData.CurrentInstructionSet; + } + #endregion + + #region API + public void FlushChanges() + { + TArmInstructionSet originalInstructionSet = iStateData.CurrentInstructionSet; + SymAddress originalAddress = new SymAddress( iStateData.CurrentAddress.Address ); + + //if ( !IsLastInstructionCancelled ) + { + // Set known address + iStateData.SetKnownAddressBits( iBranchAddress.Address, + iBranchAddress.KnownBits, + TETMBranchType.EBranchExplicit ); + + // Handle a change in security mode + if ( iSecurityMode != TArmSecurityMode.EUnknown ) + { + iStateData.CurrentSecurityMode = iSecurityMode; + } + + if ( iExceptionType != TArmExceptionType.EUnknown ) + { + iStateData.CurrentException = iExceptionType; + } + + // Handle a change in instruction set + if ( iStateData.CurrentInstructionSet != iInstructionSet ) + { + iStateData.CurrentInstructionSet = iInstructionSet; + } + } + + DbgTrace( originalAddress, originalInstructionSet ); + } + + public void DecodeBranch() + { + System.Diagnostics.Debug.Assert( IsBranchAddressAvailable ); + System.Diagnostics.Debug.Assert( Count > 0 && Count <= 5 ); + // + if ( Count == 5 ) + { + DecodeFull(); + } + else + { + DecodePartial(); + } + } + #endregion + + #region Framework API + public abstract void Offer( SymByte aByte ); + + public abstract void DecodeException( SymByte aByte ); + + protected abstract void DecodeFull(); + + protected abstract void DecodePartial(); + + public virtual bool IsPacketComplete + { + get + { + // If the 7th bit is clear, then this might be + // the last byte. + // + // If: + // + // a) the number of bytes forming the branch packet + // is less than 5, then this is the last byte. + // + // b) the number of bytes forming the branch packet + // is 5, and + // i) bit 6 is clear => normal branch, this is the last byte + // ii) bit 7 is set => inline exception, but this is still the last byte. + // + bool ret = false; + bool bit7 = LastByte[ 7 ]; + // + switch ( iBytes.Count ) + { + default: + case 0: + ret = false; + break; + case 1: + case 2: + case 3: + case 4: + ret = ( bit7 == false ); // (a) + break; + case 5: + if ( bit7 ) + { + // (b), part (ii) + ret = true; + } + else + { + // (b), part (i) - i.e. bit 6 and 7 are both clear => normal branch byte + ret = ( LastByte[ 6 ] == false ); + } + break; + } + return ret; + } + } + + public virtual bool IsBranchAddressAvailable + { + get + { + // The branch address is only available once + // bit seven is clear, or then once we've reached + // an entire run of 5 bytes. + bool ret = false; + // + if ( Count == 5 ) + { + ret = true; + } + else + { + ret = ( LastByte[ 7 ] == false ); + } + // + return ret; + } + } + #endregion + + #region Internal API + protected void Save( SymByte aByte ) + { + iBytes.Add( aByte ); + } + #endregion + + #region Properties + public int Count + { + get { return iBytes.Count; } + } + + public bool IsLastInstructionCancelled + { + get { return iLastInstructionCancelled; } + protected set { iLastInstructionCancelled = value; } + } + + public SymByte this[ int aIndex ] + { + get { return iBytes[ aIndex ]; } + } + + public ETConfigBase Config + { + get { return iStateData.Config; } + } + + public TArmExceptionType ExceptionType + { + get { return iExceptionType; } + protected set { iExceptionType = value; } + } + + public TArmSecurityMode SecurityMode + { + get { return iSecurityMode; } + protected set { iSecurityMode = value; } + } + + public TArmInstructionSet InstructionSet + { + get { return iInstructionSet; } + protected set { iInstructionSet = value; } + } + + public SymAddressWithKnownBits BranchAddress + { + get { return iBranchAddress; } + protected set { iBranchAddress = value; } + } + #endregion + + #region Internal methods + protected SymByte LastByte + { + get + { + SymByte ret = new SymByte( 0 ); + // + int count = iBytes.Count; + if ( count > 0 ) + { + ret = iBytes[ count - 1 ]; + } + // + return ret; + } + } + + protected static int CompressionLeftShiftCount( TArmInstructionSet aIS ) + { + int ret = 2; + + // Interpret the bytes to form an address based upon current + // instruction set. + switch ( aIS ) + { + default: + case TArmInstructionSet.EARM: + break; + case TArmInstructionSet.ETHUMB: + ret = 1; + break; + case TArmInstructionSet.EJAZELLE: + ret = 0; + break; + } + // + return ret; + } + + private void DbgTrace( SymAddress aOriginalAddress, TArmInstructionSet aOriginalISet ) + { + if ( Count == 5 ) + { + DbgTrace( "BRANCH-F", aOriginalAddress, aOriginalISet ); + } + else + { + DbgTrace( "BRANCH-P", aOriginalAddress, aOriginalISet ); + } + } + + private void DbgTrace( string aType, SymAddress aOriginalAddress, TArmInstructionSet aOriginalISet ) + { + StringBuilder lines = new StringBuilder(); + lines.AppendLine( " " + aType ); + // + if ( iStateData.LastBranch.IsKnown ) + { + lines.AppendLine( string.Format( " using: {0} 0x{1} to go...", + iBranchAddress.AddressBinary, + iBranchAddress.AddressHex ) + ); + lines.AppendLine( string.Format( " from: {0} 0x{1} {2} 0x{3:x8} {4}", + aOriginalAddress.AddressBinary, + aOriginalAddress.AddressHex, + ETMDecodeState.MakeInstructionSetPrefix( aOriginalISet ), + aOriginalAddress, + iStateData.Engine.LookUpSymbol( aOriginalAddress ) ) + ); + lines.AppendLine( string.Format( " to: {0} 0x{1} {2} 0x{3:x8} {4}", + iStateData.CurrentAddress.AddressBinary, + iStateData.CurrentAddress.AddressHex, + ETMDecodeState.MakeInstructionSetPrefix( iStateData.CurrentInstructionSet ), + iStateData.CurrentAddress, + iStateData.Engine.LookUpSymbol( iStateData.CurrentAddress ) ) + ); + } + // + Trace( lines.ToString() ); + } + #endregion + + #region From ITracer + public void Trace( string aText ) + { + iStateData.Trace( aText ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iStateData.Trace( aFormat, aParams ); + } + #endregion + + #region Data members + private readonly ETMStateData iStateData; + private bool iLastInstructionCancelled = false; + private List iBytes = new List(); + private TArmExceptionType iExceptionType = TArmExceptionType.EUnknown; + private TArmSecurityMode iSecurityMode = TArmSecurityMode.EUnknown; + private TArmInstructionSet iInstructionSet = TArmInstructionSet.EARM; + private SymAddressWithKnownBits iBranchAddress = new SymAddressWithKnownBits(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/BranchDecoder/ETMBranchDecoderAlternative.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/BranchDecoder/ETMBranchDecoderAlternative.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Config; +using SymbianETMLib.Common.State; + +namespace SymbianETMLib.Common.BranchDecoder +{ + internal class ETMBranchDecoderAlternative : ETMBranchDecoderOriginal + { + #region Constructors + public ETMBranchDecoderAlternative( ETMStateData aManager ) + : base( aManager ) + { + } + #endregion + + #region From ETBBranchDecoder + protected override void DecodePartial() + { + int count = base.Count; + System.Diagnostics.Debug.Assert( count > 0 && count < 5 ); + + // According to Table 7-13, "Missing components of exception Branch address packets" + // then after a partial branch, we're always in "no exception" state + base.ExceptionType = TArmExceptionType.ENone; + + if ( count == 1 ) + { + // The single-byte packet is exactly the same as in the original encoding + base.DecodePartial(); + } + else + { + // We have full 5 bytes of address info. + SymMask maskFirst = new SymMask( 0x7E, SymMask.TShiftDirection.ERight, 1 ); + SymMask maskMiddle = new SymMask( 0x7F ); + SymMask maskLast = new SymMask( 0x3F ); + + SymByte b; + SymAddressWithKnownBits address = new SymAddressWithKnownBits(); + uint masked = 0; + + // First byte + b = base[ 0 ]; + address.KnownBits += 6; + address.Address |= maskFirst.Apply( b ); + + // Middle bytes, but not the last + for ( int i = 1; i < count-1; i++ ) + { + b = base[ i ]; + b = (byte) maskMiddle.Apply( b ); + masked = (uint) ( b << address.KnownBits ); + address.KnownBits += 7; + address.Address |= masked; + } + + // Last byte + b = base.LastByte; + address.KnownBits += 6; + address.Address |= maskLast.Apply( b ); + + // Shift entire address by shift count based upon current instruction set. + int isShift = ETMBranchDecoder.CompressionLeftShiftCount( base.InstructionSet ); + address.KnownBits += isShift; + address.Address <<= isShift; + + // Save address + base.BranchAddress = address; + } + } + + public override bool IsPacketComplete + { + get + { + bool ret = false; + // + SymByte lastByte = base.LastByte; + bool bit7 = lastByte[ 7 ]; + // + if ( bit7 ) + { + // If the 7th bit is set, then the interpretation is the same as in the original + // compression scheme, in which case we can use the base class call. + ret = base.IsPacketComplete; + } + else + { + if ( base.Count == 1 ) + { + // If the 7th bit is clear and this is the first byte, then this is also + // the only byte - no exception continuation byte follows. + ret = true; + } + else + { + // If the 7th bit is clear and the 6th bit is also clear, then this is + // the last byte. + bool bit6 = lastByte[ 6 ]; + ret = ( bit6 == false ); + } + } + // + return ret; + } + } + + public override bool IsBranchAddressAvailable + { + get + { + bool ret = base.IsBranchAddressAvailable; + return ret; + } + } + #endregion + + #region From ETBBranchDecoderOriginal + /* + protected override bool ContainsInlineException + { + get + { + // Not supported in alternative encoding + return false; + } + }*/ + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/BranchDecoder/ETMBranchDecoderOriginal.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/BranchDecoder/ETMBranchDecoderOriginal.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,342 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianStructuresLib.Arm.SecurityMode; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Config; +using SymbianETMLib.Common.State; +using SymbianETMLib.Common.Exception; + +namespace SymbianETMLib.Common.BranchDecoder +{ + internal class ETMBranchDecoderOriginal : ETMBranchDecoder + { + #region Constructors + public ETMBranchDecoderOriginal( ETMStateData aManager ) + : base( aManager ) + { + } + + static ETMBranchDecoderOriginal() + { + iMaskByte5_ARM = new SymMask( KMaskByte5_ARM ); + iMaskByte5_THUMB = new SymMask( KMaskByte5_THUMB ); + iMaskByte5_JAZELLE = new SymMask( KMaskByte5_JAZELLE ); + } + #endregion + + #region From ETBBranchDecoder + public override void Offer( SymByte aByte ) + { + base.Save( aByte ); + } + + protected override void DecodeFull() + { + // We have full 5 bytes of address info. + SymMask maskFirst = new SymMask( 0x7E, SymMask.TShiftDirection.ERight, 1 ); + SymMask maskMiddle = new SymMask( 0x7F ); + + SymByte b; + SymAddressWithKnownBits address = new SymAddressWithKnownBits(); + uint masked = 0; + + // First byte + b = base[ 0 ]; + address.KnownBits += 6; + address.Address |= maskFirst.Apply( b ); + + // Bytes 1, 2, 3 + for ( int i = 1; i <= 3; i++ ) + { + b = base[ i ]; + b = (byte) maskMiddle.Apply( b ); + masked = (uint) ( b << address.KnownBits ); + address.KnownBits += 7; + address.Address |= masked; + } + + // Last byte - mask depends on instruction set. + b = base[ 4 ]; + int lastByteAddressBits = 0; + if ( this.ContainsInlineException || iMaskByte5_ARM.IsMatch( b ) ) + { + // Inline exception indicates ARM. + base.InstructionSet = TArmInstructionSet.EARM; + lastByteAddressBits = 3; + } + else if ( iMaskByte5_THUMB.IsMatch( b ) ) + { + base.InstructionSet = TArmInstructionSet.ETHUMB; + lastByteAddressBits = 4; + } + else if ( iMaskByte5_JAZELLE.IsMatch( b ) ) + { + base.InstructionSet = TArmInstructionSet.EJAZELLE; + lastByteAddressBits = 5; + } + else + { + throw new ETMException( "ERROR: branch type unknown" ); + } + + // Now we can process the last byte + masked = b.LowestBits( lastByteAddressBits ); + masked <<= address.KnownBits; + address.KnownBits += lastByteAddressBits; + address.Address |= masked; + + // Shift entire address by shift count based upon current instruction set. + int isShift = ETMBranchDecoder.CompressionLeftShiftCount( base.InstructionSet ); + System.Diagnostics.Debug.Assert( address.KnownBits + isShift == 32 ); + address.KnownBits = 32; + address.Address <<= isShift; + + // Save address + base.BranchAddress = address; + + // We may also need to decode the inline exception + if ( ContainsInlineException ) + { + // Yup, line exception... + DecodeInlineException( base.LastByte ); + } + } + + protected override void DecodePartial() + { + // According to Table 7-13, "Missing components of exception Branch address packets" + // then after a partial branch, we're always in "no exception" state + base.ExceptionType = TArmExceptionType.ENone; + + // We have full 5 bytes of address info. + SymMask maskFirst = new SymMask( 0x7E, SymMask.TShiftDirection.ERight, 1 ); + SymMask maskMiddle = new SymMask( 0x7F ); + + SymByte b; + SymAddressWithKnownBits address = new SymAddressWithKnownBits(); + uint masked = 0; + int count = base.Count; + + // First byte + b = base[ 0 ]; + address.KnownBits += 6; + address.Address |= maskFirst.Apply( b ); + + // Bytes 1, 2, 3 + for ( int i = 1; i < count; i++ ) + { + b = base[ i ]; + b = (byte) maskMiddle.Apply( b ); + masked = (uint) ( b << address.KnownBits ); + address.KnownBits += 7; + address.Address |= masked; + } + + // Shift entire address by shift count based upon current instruction set. + int isShift = ETMBranchDecoder.CompressionLeftShiftCount( base.InstructionSet ); + address.KnownBits += isShift; + address.Address <<= isShift; + + // Save address + base.BranchAddress = address; + } + + public override void DecodeException( SymByte aByte ) + { + // In a continuation exception byte, bit 7 is always supposed + // to be clear, irrespective of whether original or alternative + // compression schemes are in use. + System.Diagnostics.Debug.Assert( aByte[ 7 ] == false ); + + // Instruction cancellation + base.IsLastInstructionCancelled = aByte[ 5 ]; + + // Security + base.SecurityMode = TArmSecurityMode.ESecure; + if ( aByte[ 0 ] ) + { + base.SecurityMode = TArmSecurityMode.ENotSecure; + } + + // Exception type + TArmExceptionType exceptionType = TArmExceptionType.EUnknown; + aByte = (byte) ( ( (byte) ( aByte & 0x1E ) ) >> 1 ); + switch ( aByte ) + { + case 0: + exceptionType = TArmExceptionType.ENone; + break; + case 1: + exceptionType = TArmExceptionType.EHaltingDebug; + break; + case 2: + exceptionType = TArmExceptionType.ESecureMonitorCall; + break; + default: + case 3: + throw new ETMException( "ERROR - reserved exception code during continuation byte" ); + case 4: + exceptionType = TArmExceptionType.EAsyncDataAbort; + break; + case 5: + exceptionType = TArmExceptionType.EJazelle; + break; + case 6: + case 7: + throw new ETMException( "ERROR - reserved exception code during continuation byte" ); + case 8: + exceptionType = TArmExceptionType.EProcessorReset; + break; + case 9: + exceptionType = TArmExceptionType.EUndefinedInstruction; + break; + case 10: + exceptionType = TArmExceptionType.ESVC; + break; + case 11: + exceptionType = TArmExceptionType.EPrefetchAbortOrSWBreakpoint; + break; + case 12: + exceptionType = TArmExceptionType.ESyncDataAbortOrSWWatchpoint; + break; + case 13: + exceptionType = TArmExceptionType.EGeneric; + break; + case 14: + exceptionType = TArmExceptionType.EIRQ; + break; + case 15: + exceptionType = TArmExceptionType.EFIQ; + break; + } + base.ExceptionType = exceptionType; + } + #endregion + + #region Properties + protected virtual bool ContainsInlineException + { + get + { + bool ret = false; + // + bool completeBranch = IsBranchAddressAvailable; + if ( completeBranch ) + { + ret = ( LastByte[ 7 ] ); + } + // + return ret; + } + } + #endregion + + #region Internal constants + protected const string KMaskByte5_ARM = "0#001###"; + protected const string KMaskByte5_THUMB = "0#01####"; + protected const string KMaskByte5_JAZELLE = "0#1#####"; + #endregion + + #region Internal methods + private void DecodeInlineException( SymByte aByte ) + { + // b1CEEExxx Exception executed in ARM state. + // + // The C bit is set to 1 if the exception cancels the last traced instruction. + // The EEE bits, bits [5:3], indicate the type of exception as shown in Table 7-9. + // Use of this format is deprecated in favor of using an Exception information byte. + + // Inline exception packets always indicate ARM mode + base.InstructionSet = TArmInstructionSet.EARM; + + // Was it a cancelling branch? + base.IsLastInstructionCancelled = aByte[ 6 ]; + + // Set back to no exception unless changed explicitly below. + base.ExceptionType = TArmExceptionType.ENone; + + // Get exception type + SymMask mask = new SymMask( "## 111 ###", SymMask.TShiftDirection.ERight, 3 ); + SymByte exceptionInfo = (byte) mask.Apply( aByte ); + + if ( exceptionInfo == 0 ) + { + // Have to work this out from the branch address + TArmExceptionVector vector = base.Config.MapToExceptionVector( base.BranchAddress.Address ); + switch ( vector ) + { + case TArmExceptionVector.EReset: + base.ExceptionType = TArmExceptionType.EProcessorReset; + break; + case TArmExceptionVector.EUndefinedInstruction: + base.ExceptionType = TArmExceptionType.EUndefinedInstruction; + break; + case TArmExceptionVector.ESVC: + base.ExceptionType = TArmExceptionType.ESVC; + break; + case TArmExceptionVector.EPrefetchAbort: + base.ExceptionType = TArmExceptionType.EPrefetchAbortOrSWBreakpoint; + break; + case TArmExceptionVector.EDataAbort: + base.ExceptionType = TArmExceptionType.ESyncDataAbortOrSWWatchpoint; + break; + default: + throw new ETMException( "ERROR - unable to extract exception type from branch address: 0x" + base.BranchAddress ); + } + } + else + { + switch ( exceptionInfo ) + { + case 1: + base.ExceptionType = TArmExceptionType.EIRQ; + break; + default: + case 2: + case 3: + throw new NotSupportedException( "Reserved exception type" ); + case 4: + base.ExceptionType = TArmExceptionType.EJazelle; + break; + case 5: + base.ExceptionType = TArmExceptionType.EFIQ; + break; + case 6: + base.ExceptionType = TArmExceptionType.EAsyncDataAbort; + break; + case 7: + base.ExceptionType = TArmExceptionType.EHaltingDebug; + break; + } + } + } + #endregion + + #region Data members + private static readonly SymMask iMaskByte5_ARM; + private static readonly SymMask iMaskByte5_THUMB; + private static readonly SymMask iMaskByte5_JAZELLE; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Buffer/ETBufferBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Buffer/ETBufferBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Exception; + +namespace SymbianETMLib.Common.Buffer +{ + public abstract class ETBufferBase + { + #region Constructors + protected ETBufferBase() + { + } + + protected ETBufferBase( string aFileName ) + { + byte[] buffer = File.ReadAllBytes( aFileName ); + AddRange( buffer ); + } + #endregion + + #region API + public void Clear() + { + iData.Clear(); + } + + public void AddRange( IEnumerable aBytes ) + { + iData.AddRange( aBytes ); + } + + public void PushBack( SymByte aByte ) + { + iData.Insert( 0, aByte.Value ); + } + + public SymByte Dequeue() + { + if ( IsEmpty ) + { + throw new ETMException( "ERROR - buffer is empty" ); + } + // + byte head = iData[ 0 ]; + iData.RemoveAt( 0 ); + return new SymByte( head ); + } + #endregion + + #region Properties + public bool IsEmpty + { + get { return iData.Count == 0; } + } + + public int Count + { + get { return iData.Count; } + } + #endregion + + #region Internal methods + protected List Data + { + get { return iData; } + set { iData = value; } + } + #endregion + + #region Data members + List iData = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Config/ETBEngineConfig.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Config/ETBEngineConfig.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using DecompressETB.Buffer; +using DecompressETB.State; +using DecompressETB.Types; + +namespace DecompressETB.Config +{ + public class ETBEngineConfig + { + #region Constructors + public ETBEngineConfig() + { + SetExceptionVector( TETBExceptionVector.EReset, 0 ); + SetExceptionVector( TETBExceptionVector.EUndefinedInstruction, 0 ); + SetExceptionVector( TETBExceptionVector.ESWI, 0 ); + SetExceptionVector( TETBExceptionVector.EPrefetchAbort, 0 ); + SetExceptionVector( TETBExceptionVector.EDataAbort, 0 ); + SetExceptionVector( TETBExceptionVector.EIRQ, 0 ); + SetExceptionVector( TETBExceptionVector.EFIQ, 0 ); + } + #endregion + + #region API + // + // Use this to seed the context id to thread name mapping + // + public void SetRegisterContextID( uint aID, string aName ) + { + if ( !iContextIDs.ContainsKey( aID ) ) + { + iContextIDs.Add( aID, aName ); + } + } + + public void SetExceptionVector( TETBExceptionVector aVector, uint aInstruction ) + { + if ( !iExceptionVectors.ContainsKey( aVector ) ) + { + iExceptionVectors.Add( aVector, aInstruction ); + } + else + { + iExceptionVectors[ aVector ] = aInstruction; + } + } + + public string GetContextID( uint aID ) + { + string ret = "Unknown Thread"; + // + if ( iContextIDs.ContainsKey( aID ) ) + { + ret = iContextIDs[ aID ]; + } + // + return ret; + } + + internal uint GetExceptionVector( TETBExceptionVector aVector ) + { + uint ret = iExceptionVectors[ aVector ]; + return ret; + } + + internal TETBExceptionVector MapToExceptionVector( uint aAddress ) + { + System.Diagnostics.Debug.Assert( IsExceptionVector( aAddress ) ); + // + TETBExceptionVector ret = TETBExceptionVector.EUndefinedInstruction; + // + uint baseAddress = (uint) ExceptionVectorLocation; + uint delta = aAddress - baseAddress; + switch ( delta ) + { + case (uint) TETBExceptionVector.EReset: + case (uint) TETBExceptionVector.EUndefinedInstruction: + case (uint) TETBExceptionVector.ESWI: + case (uint) TETBExceptionVector.EPrefetchAbort: + case (uint) TETBExceptionVector.EDataAbort: + case (uint) TETBExceptionVector.EIRQ: + case (uint) TETBExceptionVector.EFIQ: + ret = (TETBExceptionVector) delta; + break; + default: + throw new NotSupportedException( "Specified address is an unsupported vector location" ); + break; + } + // + return ret; + } + + internal bool IsExceptionVector( uint aAddress ) + { + bool ret = false; + + // Get current vector setting and also the vector address range + TETBExceptionVectorLocation type = ExceptionVectorLocation; + uint min = (uint) type; + uint max = min + (uint) TETBExceptionVector.EFIQ; + // + ret = ( aAddress >= min && aAddress <= max ); + // + return ret; + } + #endregion + + #region Properties + public bool Verbose + { + get { return iVerbose; } + set { iVerbose = value; } + } + + public uint ETMControlRegister + { + get { return iETMControlRegister; } + set { iETMControlRegister = value; } + } + + public uint SystemControlRegister + { + get { return iSystemControlRegister; } + set { iSystemControlRegister = value; } + } + + public int ContextIDSize + { + get + { + // Bits [15:14] define the context id size. + uint ret = iETMControlRegister & 0xC000; // b11000000 00000000 + ret >>= 14; + if ( ret > 0 ) + { + ++ret; + } + return (int) ret; + } + } + + public TETBExceptionVectorLocation ExceptionVectorLocation + { + get + { + TETBExceptionVectorLocation ret = TETBExceptionVectorLocation.ENormal; + uint mask = (uint) ( 1 << 13 ); + if ( ( iSystemControlRegister & mask ) == mask ) + { + ret = TETBExceptionVectorLocation.EHigh; + } + return ret; + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + private bool iVerbose = false; + private uint iETMControlRegister = 0xC000; // 4 byte context id + private uint iSystemControlRegister = 1 << 13; + private Dictionary iExceptionVectors = new Dictionary(); + private Dictionary iContextIDs = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Config/ETConfigBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Config/ETConfigBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,254 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Registers.EmbeddedTrace; +using SymbianStructuresLib.Arm.Registers.CoProcessor; +using SymbianETMLib.Common.Buffer; +using SymbianETMLib.Common.State; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Utilities; +using SymbianETMLib.Common.Exception; + +namespace SymbianETMLib.Common.Config +{ + public abstract class ETConfigBase + { + #region Constructors + protected ETConfigBase( ETBufferBase aBuffer ) + { + iBuffer = aBuffer; + // + RegisterETMControl = 0xC000; // 4 byte context id + RegisterSysConControl = 1 << 13; // Assume HIVECS; + // + SetExceptionVector( TArmExceptionVector.EReset, 0 ); + SetExceptionVector( TArmExceptionVector.EUndefinedInstruction, 0 ); + SetExceptionVector( TArmExceptionVector.ESVC, 0 ); + SetExceptionVector( TArmExceptionVector.EPrefetchAbort, 0 ); + SetExceptionVector( TArmExceptionVector.EDataAbort, 0 ); + SetExceptionVector( TArmExceptionVector.EIRQ, 0 ); + SetExceptionVector( TArmExceptionVector.EFIQ, 0 ); + } + #endregion + + #region API + public void AddContextIdMapping( uint aId, string aName ) + { + // Clean the context id so that it matches the kind of data + // we see on the phone. + uint id = aId & 0x0FFFFFFF; + + if ( !iContextIDs.ContainsKey( id ) ) + { + iContextIDs.Add( id, aName ); + } + } + + public void SetExceptionVector( TArmExceptionVector aVector, uint aInstruction ) + { + if ( !iExceptionVectors.ContainsKey( aVector ) ) + { + iExceptionVectors.Add( aVector, aInstruction ); + } + else + { + iExceptionVectors[ aVector ] = aInstruction; + } + } + + public string GetContextID( uint aID ) + { + string ret = "Unknown Thread"; + // + uint lastKey = 0; + // + foreach ( KeyValuePair kvp in iContextIDs ) + { + if ( kvp.Key > aID ) + { + if ( lastKey != 0 ) + { + ret = kvp.Value;//iContextIDs[ lastKey ]; + } + break; + } + else + { + lastKey = kvp.Key; + } + } + // + return ret; + } + #endregion + + #region API - internal + internal uint GetExceptionVector( TArmExceptionVector aVector ) + { + uint ret = iExceptionVectors[ aVector ]; + return ret; + } + + internal bool IsExceptionVector( uint aAddress ) + { + bool ret = false; + + // Get current vector setting and also the vector address range + TArmExceptionVectorLocation type = ExceptionVectorLocation; + uint min = (uint) type; + uint max = min + (uint) TArmExceptionVector.EFIQ; + // + ret = ( aAddress >= min && aAddress <= max ); + // + return ret; + } + + internal TArmExceptionVector MapToExceptionVector( uint aAddress ) + { + System.Diagnostics.Debug.Assert( IsExceptionVector( aAddress ) ); + // + TArmExceptionVector ret = TArmExceptionVector.EUndefinedInstruction; + // + uint baseAddress = (uint) ExceptionVectorLocation; + uint delta = aAddress - baseAddress; + switch ( delta ) + { + case (uint) TArmExceptionVector.EReset: + case (uint) TArmExceptionVector.EUndefinedInstruction: + case (uint) TArmExceptionVector.ESVC: + case (uint) TArmExceptionVector.EPrefetchAbort: + case (uint) TArmExceptionVector.EDataAbort: + case (uint) TArmExceptionVector.EIRQ: + case (uint) TArmExceptionVector.EFIQ: + ret = (TArmExceptionVector) delta; + break; + default: + throw new ETMException( "ERROR - specified address is an unsupported vector location" ); + } + // + return ret; + } + #endregion + + #region Properties + public bool Verbose + { + get { return iVerbose; } + set { iVerbose = value; } + } + + public bool BBCModeEnabled + { + get + { + // 10 0 0 000 00 01 + SymMask mask = new SymMask( "1 # ### ## ##" ); + uint val = mask.Apply( RegisterETMControl ); + return ( val != 0 ); + } + } + + public int ContextIDSize + { + get + { + // Bits [15:14] define the context id size. + uint ret = RegisterETMControl & 0xC000; // b11000000 00000000 + ret >>= 14; + if ( ret > 0 ) + { + ++ret; + } + return (int) ret; + } + } + + public uint RegisterETMControl + { + get { return iRegistersETM[ TArmRegisterType.EArmReg_ETM_Control ].Value; } + set { iRegistersETM[ TArmRegisterType.EArmReg_ETM_Control ].Value = value; } + } + + public uint RegisterETMId + { + get { return iRegistersETM[ TArmRegisterType.EArmReg_ETM_Id ].Value; } + set { iRegistersETM[ TArmRegisterType.EArmReg_ETM_Id ].Value = value; } + } + + public uint RegisterSysConControl + { + get { return iRegistersCoProSystemControl[ TArmRegisterType.EArmReg_SysCon_Control ].Value; } + set { iRegistersCoProSystemControl[ TArmRegisterType.EArmReg_SysCon_Control ].Value = value; } + } + + public TArmExceptionVectorLocation ExceptionVectorLocation + { + get + { + TArmExceptionVectorLocation ret = TArmExceptionVectorLocation.ENormal; + uint mask = (uint) ( 1 << 13 ); + if ( ( RegisterSysConControl & mask ) == mask ) + { + ret = TArmExceptionVectorLocation.EHigh; + } + return ret; + } + } + + internal TETMBranchCompressionScheme BranchCompressionScheme + { + get + { + TETMBranchCompressionScheme ret = TETMBranchCompressionScheme.EOriginal; + // 101011 100 1 0000 00001111 00001111 + SymMask mask = new SymMask( "1 #### ######## ########" ); + if ( mask.IsMatch( RegisterETMId ) ) + { + ret = TETMBranchCompressionScheme.EAlternative; + } + return ret; + } + } + #endregion + + #region Internal methods + protected ETBufferBase Buffer + { + get { return iBuffer; } + } + #endregion + + #region From System.Object + #endregion + + #region Data members + private readonly ETBufferBase iBuffer; + private bool iVerbose = false; + private ArmETMRegisterCollection iRegistersETM = new ArmETMRegisterCollection(); + private ArmCoProSystemControlRegisterCollection iRegistersCoProSystemControl = new ArmCoProSystemControlRegisterCollection(); + private Dictionary iExceptionVectors = new Dictionary(); + private SortedDictionary iContextIDs = new SortedDictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Engine/ETEngineBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Engine/ETEngineBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,239 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Tracer; +using SymbianUtils.BasicTypes; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianDebugLib.PluginAPI.Types.Code; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianStructuresLib.Arm.Disassembler; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Debug.Code; +using SymbianETMLib.Common.Buffer; +using SymbianETMLib.Common.State; +using SymbianETMLib.Common.Config; +using SymbianETMLib.Common.Utilities; +using SymbianETMLib.Common.Types; + +namespace SymbianETMLib.Common.Engine +{ + public class ETEngineBase : ITracer + { + #region Delegates & events + public delegate void BranchHandler( ETMBranch aBranch ); + public event BranchHandler Branch; + + public delegate void ExceptionModeHandler( TArmExceptionType aExceptionMode ); + public event ExceptionModeHandler Exception; + + public delegate void ContextSwitchHandler( uint aContextId, string aThreadName ); + public event ContextSwitchHandler ContextSwitch; + + public delegate void SynchronizationHandler( uint aPosition ); + public event SynchronizationHandler Synchronized; + #endregion + + #region Constructors + public ETEngineBase( ETBufferBase aBuffer, ETConfigBase aConfig ) + { + iBuffer = aBuffer; + iConfig = aConfig; + } + #endregion + + #region API + public void Decode() + { + int lastBufferCountValue = 0; + // + ETMStateData stateManager = new ETMStateData( this ); + while ( !iBuffer.IsEmpty ) + { + byte b = iBuffer.Dequeue(); + if ( iBuffer.Count != lastBufferCountValue ) + { + Trace( "[0x{0:x4}] byte: 0x{1:x2} {2}", + stateManager.PacketNumber, + b, + Convert.ToString( b, 2 ).PadLeft( 8, '0' ) + ); + } + // + lastBufferCountValue = iBuffer.Count; + stateManager.PrepareToHandleByte( b ); + } + } + + internal string LookUpSymbol( uint aAddress ) + { + StringBuilder line = new StringBuilder(); + // + if ( iDebugEngineView != null ) + { + SymbolCollection col = null; + Symbol sym = LookUpSymbol( aAddress, out col ); + // + if ( sym != null ) + { + line.AppendFormat( "0x{0:x8} {1} {2}", sym.Address, sym.ToStringOffset( aAddress ), sym.Name ); + } + else if ( col != null ) + { + line.AppendFormat( "Unknown Symbol from \'{0}\'", col.FileName.FileNameInHost ); + } + else + { + bool isExceptionVector = Config.IsExceptionVector( aAddress ); + if ( isExceptionVector ) + { + line.Append( "Exception Vector" ); + } + else + { + line.Append( "????" ); + } + } + } + // + return line.ToString(); + } + + internal Symbol LookUpSymbol( uint aAddress, out SymbolCollection aCollection ) + { + Symbol ret = null; + aCollection = null; + // + if ( iDebugEngineView != null ) + { + ret = iDebugEngineView.Symbols.Lookup( aAddress, out aCollection ); + } + // + return ret; + } + #endregion + + #region Properties + public ETBufferBase Buffer + { + get { return iBuffer; } + } + + public ETConfigBase Config + { + get { return iConfig; } + } + + public DbgEngineView DebugEngineView + { + get { return iDebugEngineView; } + set { iDebugEngineView = value; } + } + #endregion + + #region Internal event propgation methods + internal void OnExceptionModeChange( TArmExceptionType aNewException ) + { + if ( Exception != null ) + { + Exception( aNewException ); + } + } + + internal void OnBranch( uint aAddress, TArmInstructionSet aInstructionSet, TArmExceptionType aExceptionType, TETMBranchType aBranchType ) + { + if ( Branch != null ) + { + ETMBranch branch = new ETMBranch( new SymAddress( aAddress ), iBranchCounter, aBranchType, aInstructionSet, aExceptionType ); + + // Try to find a symbol + SymbolCollection col = null; + Symbol sym = LookUpSymbol( aAddress, out col ); + // + if ( sym != null ) + { + branch.Symbol = sym; + } + else if ( col != null ) + { + branch.SymbolText = string.Format( "Unknown Symbol from \'{0}\'", col.FileName.FileNameInHost ); + } + + // Cascade event + Branch( branch ); + } + + ++iBranchCounter; + } + + internal void OnContextSwitch( uint aNewContextId ) + { + if ( ContextSwitch != null ) + { + string threadName = iConfig.GetContextID( aNewContextId ); + ContextSwitch( aNewContextId, threadName ); + } + } + + internal void OnSynchronised( uint aOffset ) + { + if ( Synchronized != null ) + { + Synchronized( aOffset ); + } + } + #endregion + + #region From ITracer + public void Trace( string aText ) + { + if ( System.Diagnostics.Debugger.IsAttached ) + { + System.Diagnostics.Debug.WriteLine( aText ); + } + if ( iConfig.Verbose ) + { + System.Console.WriteLine( aText ); + } + } + + public void Trace( string aFormat, params object[] aParams ) + { + if ( iConfig.Verbose || System.Diagnostics.Debugger.IsAttached ) + { + string text = string.Format( aFormat, aParams ); + Trace( text ); + } + } + #endregion + + #region From System.Object + #endregion + + #region Data members + private readonly ETBufferBase iBuffer; + private readonly ETConfigBase iConfig; + private int iBranchCounter = 0; + private DbgEngineView iDebugEngineView; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Exception/ETMException.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Exception/ETMException.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Exception +{ + public class ETMException : System.Exception + { + #region Constructors + internal ETMException( string aMessage ) + : base( aMessage ) + { + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Base/ETMPcktBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Base/ETMPcktBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Utilities; + +namespace SymbianETMLib.Common.Packets +{ + public abstract class ETMPcktBase + { + #region Constructors + protected ETMPcktBase() + : this( 0 ) + { + } + + protected ETMPcktBase( SymByte aValue ) + { + iRawByte = aValue; + } + #endregion + + #region API + public bool IsBitSet( int aBitNumber ) + { + bool ret = RawByte[ aBitNumber ]; + return ret; + } + + protected SymByte CreateMask( string aBinary ) + { + return (byte) SymBitUtils.CreateMask( aBinary ); + } + + protected void SetMask( string aHigh, string aLow ) + { + SetMask( aHigh + aLow ); + } + + protected void SetMask( string aSignificantBitValues ) + { + iBitMask = SymBitUtils.CreateMask( aSignificantBitValues, out iBitValue ); + } + #endregion + + #region API - framework + public virtual bool Matches( SymByte aOpCode ) + { + uint masked = (byte) ( aOpCode & BitMask ); + if ( masked == BitValue ) + { + return true; + } + + return false; + } + + public virtual int Priority + { + get { return 0; } + } + #endregion + + #region Properties + public string Binary + { + get + { + StringBuilder ret = new StringBuilder(); + ret.Append( Convert.ToString( iRawByte, 2 ).PadLeft( 8, '0' ) ); + return ret.ToString(); + } + } + + public SymByte RawByte + { + get { return iRawByte; } + set { iRawByte = value; } + } + + protected SymByte BitMask + { + get { return iBitMask; } + } + + protected SymByte BitValue + { + get { return iBitValue; } + } + #endregion + + #region Data members + private SymByte iBitMask = 0; + private SymByte iBitValue = 0; + private SymByte iRawByte = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Factory/ETMPacketFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Factory/ETMPacketFactory.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; + +namespace SymbianETMLib.Common.Packets.Factory +{ + public static class ETMPacketFactory + { + public static ETMPcktBase Create( SymByte aByte ) + { + ETMPcktBase ret = null; + // + if ( iPackets.Count == 0 ) + { + CreatePackets(); + } + // + ret = FindPacket( aByte ); + // + return ret; + } + + #region Internal methods + private static void CreatePackets() + { + Type pluginType = typeof( ETMPcktBase ); + Assembly assembly = Assembly.GetExecutingAssembly(); + Type[] types = assembly.GetTypes(); + foreach ( Type type in types ) + { + if ( !type.IsAbstract && pluginType.IsAssignableFrom( type ) ) + { + ConstructorInfo ctor = type.GetConstructor( System.Type.EmptyTypes ); + if ( ctor != null ) + { + object instance = Activator.CreateInstance( type, null ); + if ( instance != null ) + { + iPackets.Add( (ETMPcktBase) instance ); + } + } + } + } + + // Sort the packets into priority order + Comparison comparer = delegate( ETMPcktBase aLeft, ETMPcktBase aRight ) + { + return ( aLeft.Priority.CompareTo( aRight.Priority ) * -1 ); + }; + iPackets.Sort( comparer ); + } + + private static ETMPcktBase FindPacket( SymByte aByte ) + { + ETMPcktBase ret = new ETMPcktUnknown(); + // + int count = iPackets.Count; + for ( int i = 0; i < count; i++ ) + { + ETMPcktBase packet = iPackets[ i ]; + if ( packet.Matches( aByte ) ) + { + ret = packet; + ret.RawByte = aByte; + break; + } + } + // + return ret; + } + #endregion + + #region Data members + private static List iPackets = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktASync.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktASync.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktASync : ETMPcktBase + { + #region Constructors + public ETMPcktASync() + { + } + #endregion + + #region API + public override bool Matches( SymByte aOpCode ) + { + return ( aOpCode.Value == 0 ); + } + #endregion + + #region From PcktBase + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktBranch.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktBranch.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Utilities; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktBranch : ETMPcktFiveByteRunBase + { + #region Constructors + public ETMPcktBranch() + : base( "#######1" ) + { + // In the first packet, bits 6:1 contain the payload. + // Bit 7 indicates whether another packet follows + // Bit 0 is forms the "branch packet" signature. + iExtractionMaskFirst = CreateMask( "01111110" ); + } + + public ETMPcktBranch( byte aValue ) + : this() + { + base.RawByte = aValue; + } + #endregion + + #region API + #endregion + + #region From PcktBase + public override int Priority + { + get { return int.MaxValue; } + } + #endregion + + #region Properties + public string ExtractedBitsFirstByte + { + get + { + byte raw = (byte) ( base.RawByte & iExtractionMaskFirst ); + raw >>= 1; + string ret = SymBitUtils.GetBits( raw ); + + // Only the first 6 bits are valid + return ret.Substring( 2, 6 ); + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + private readonly byte iExtractionMaskFirst; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktContextID.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktContextID.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktContextID : ETMPcktBase + { + #region Constructors + public ETMPcktContextID() + { + base.SetMask( "01101110" ); + } + #endregion + + #region API + #endregion + + #region From PcktBase + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktCycleCount.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktCycleCount.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktCycleCount : ETMPcktFiveByteRunBase + { + #region Constructors + public ETMPcktCycleCount() + : base( "00000100" ) + { + } + + public ETMPcktCycleCount( byte aValue ) + : this() + { + base.RawByte = aValue; + } + #endregion + + #region API + #endregion + + #region From PcktBase + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktExceptionEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktExceptionEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktExceptionEntry : ETMPcktBase + { + #region Constructors + public ETMPcktExceptionEntry() + { + base.SetMask( "01111110" ); + } + #endregion + + #region API + #endregion + + #region From PcktBase + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktExceptionExit.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktExceptionExit.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktExceptionExit : ETMPcktBase + { + #region Constructors + public ETMPcktExceptionExit() + { + base.SetMask( "01110110" ); + } + #endregion + + #region API + #endregion + + #region From PcktBase + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktFiveByteRunBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktFiveByteRunBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Utilities; +using SymbianETMLib.Common.Types; + +namespace SymbianETMLib.Common.Packets +{ + public abstract class ETMPcktFiveByteRunBase : ETMPcktBase + { + #region Constructors + static ETMPcktFiveByteRunBase() + { + // In subsequent packets, 7 bits are used and the top + // bit indicates whether or not another byte follows. + iExtractionMaskSubsequentOriginalScheme = new SymMask( "01111111" ); + iExtractionMaskSubsequentAlternativeScheme = new SymMask( "00111111" ); + } + + protected ETMPcktFiveByteRunBase( string aMask ) + { + base.SetMask( aMask ); + + } + #endregion + + #region API + internal string ExtractedBitsSubsequentBytes( TETMBranchCompressionScheme aScheme ) + { + byte raw = (byte) iExtractionMaskSubsequentOriginalScheme.Apply( base.RawByte ); + string ret = System.Convert.ToString( raw, 2 ); + return ret; + } + + public bool MoreToCome + { + get + { + bool ret = ( ( base.RawByte & 0x80 ) == 0x80 ); + return ret; + } + } + #endregion + + #region From PcktBase + public override int Priority + { + get { return int.MaxValue; } + } + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + private readonly static SymMask iExtractionMaskSubsequentOriginalScheme; + private readonly static SymMask iExtractionMaskSubsequentAlternativeScheme; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktISync.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktISync.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktISync : ETMPcktBase + { + #region Constructors + public ETMPcktISync() + { + base.SetMask( "00001000" ); + } + #endregion + + #region API + #endregion + + #region From PcktBase + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktISyncInformation.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktISyncInformation.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianETMLib.Common.Types; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktISyncInformation : ETMPcktBase + { + #region Enumerations + public enum TType + { + ENormal = 0, + ELoadOrStoreInProgress + } + + public enum TReasonCode + { + EPeriodic = 0, + ETracingEnabled = 1, + ETracingRestartedAfterOverflow = 2, + EProcessorExitedFromDebugState = 3 + } + #endregion + + #region Constructors + public ETMPcktISyncInformation( SymByte aByte ) + : base( aByte ) + { + } + #endregion + + #region API + #endregion + + #region From PcktBase + #endregion + + #region Properties + public TType Type + { + get + { + TType ret = TType.ENormal; + SymByte mask = base.CreateMask( "10000000" ); + if ( ( RawByte & mask ) == mask ) + { + ret = TType.ELoadOrStoreInProgress; + } + return ret; + } + } + + public bool IsSecure + { + get + { + bool ret = RawByte[ 3 ]; + return ret; + } + } + + public TArmInstructionSet InstructionSet + { + get + { + TArmInstructionSet ret = TArmInstructionSet.EARM; + // + if ( RawByte[ 4 ] ) + { + ret = TArmInstructionSet.EJAZELLE; + } + // + return ret; + } + } + + public TReasonCode ReasonCode + { + get + { + TReasonCode ret = TReasonCode.EPeriodic; + SymByte mask = base.CreateMask( "01100000" ); + SymByte val = RawByte & mask; + val = val.HighestBitsShiftedRight( 5 ); + ret = (TReasonCode) val.Value; + return ret; + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktIgnore.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktIgnore.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktIgnore : ETMPcktBase + { + #region Constructors + public ETMPcktIgnore() + { + base.SetMask( "01100110" ); + } + #endregion + + #region API + #endregion + + #region From PcktBase + public override int Priority + { + get { return int.MinValue + 1; } + } + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktNormalData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktNormalData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktNormalData : ETMPcktBase + { + #region Constructors + public ETMPcktNormalData() + { + base.SetMask( "00#0##10" ); + } + + public ETMPcktNormalData( SymByte aByte ) + : base( aByte ) + { + } + #endregion + + #region API + #endregion + + #region From PcktBase + public override int Priority + { + get + { + return int.MinValue + 3; + } + } + #endregion + + #region Properties + public int Size + { + get + { + SymMask mask = new SymMask( "1100", SymMask.TShiftDirection.ERight, 2 ); + int ret = (int) mask.Apply( base.RawByte ); + return ret; + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktOutOfOrderData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktOutOfOrderData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktOutOfOrderData : ETMPcktBase + { + #region Constructors + public ETMPcktOutOfOrderData() + { + base.SetMask( "0##0##00" ); + } + + public ETMPcktOutOfOrderData( SymByte aByte ) + : base( aByte ) + { + } + #endregion + + #region API + #endregion + + #region From PcktBase + public override int Priority + { + get + { + return int.MinValue + 2; + } + } + + public override bool Matches( SymByte aOpCode ) + { + bool ret = base.Matches( aOpCode ); + if ( ret ) + { + // Tag has to be > 0 + SymMask mask = new SymMask( "1100000", SymMask.TShiftDirection.ERight, 5 ); + uint tag = mask.Apply( aOpCode ); + ret = ( tag > 0 && tag < 4 ); + } + // + return ret; + } + #endregion + + #region Properties + public int Size + { + get + { + SymMask mask = new SymMask( "1100", SymMask.TShiftDirection.ERight, 2 ); + int ret = (int) mask.Apply( base.RawByte ); + return ret; + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktOutOfOrderPlaceholder.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktOutOfOrderPlaceholder.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktOutOfOrderPlaceholder : ETMPcktBase + { + #region Constructors + public ETMPcktOutOfOrderPlaceholder() + { + base.SetMask( "01#1##00" ); + } + #endregion + + #region API + #endregion + + #region From PcktBase + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktPHeaderBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktPHeaderBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Packets +{ + public abstract class ETMPcktPHeaderBase : ETMPcktBase + { + #region Enumerations + public enum TAtomType + { + EAtomNotApplicable = -1, + EAtomE_Passed = 0, + EAtomN_Failed, + EAtomW_CycleBoundary + } + #endregion + + #region Constructors + protected ETMPcktPHeaderBase() + { + } + #endregion + + #region API + #endregion + + #region From PcktBase + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktPHeaderFormat1.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktPHeaderFormat1.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Exception; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktPHeaderFormat1 : ETMPcktPHeaderBase + { + #region Constructors + public ETMPcktPHeaderFormat1() + { + // Format 1 P-header + // + // b1NEEEE00 None 0-15 x E, 0-1 x N + // Bits [5:2], shown as EEEE, are the count of E atoms. + // + base.SetMask( "1 # #### 00" ); + } + #endregion + + #region API + public int ConditionCount( ETMPcktPHeaderBase.TAtomType aAtomType ) + { + int ret = 0; + // + switch ( aAtomType ) + { + case ETMPcktPHeaderBase.TAtomType.EAtomE_Passed: + ret = ConditionCountFailed; + break; + case ETMPcktPHeaderBase.TAtomType.EAtomN_Failed: + ret = ConditionCountPassed; + break; + default: + case ETMPcktPHeaderBase.TAtomType.EAtomW_CycleBoundary: + throw new ETMException( "ERROR: cycle accurate mode is not supported" ); + } + // + return ret; + } + #endregion + + #region From PcktBase + #endregion + + #region Properties + public int ConditionCountFailed + { + get + { + int ret = 0; + // + SymMask mask = new SymMask( "#1 #### ##" ); + if ( mask.IsMatch( base.RawByte ) ) + { + ret = 1; + } + // + return ret; + } + } + + public int ConditionCountPassed + { + get + { + SymMask mask = new SymMask( "## 1111 ##" ); + byte val = (byte) mask.Apply( RawByte ); + val >>= 2; + int ret = System.Convert.ToInt32( val ); + return ret; + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktPHeaderFormat2.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktPHeaderFormat2.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktPHeaderFormat2 : ETMPcktPHeaderBase + { + #region Constructors + public ETMPcktPHeaderFormat2() + { + // Format 2 P-header: + // + // b1000 FF 10 + // 1 x (N/nE), 1 x (N/nE) + // Bit [3] represents the first instruction and bit [2] represents the second instruction. + // + // Important Note: + // + // This is the opposite bit encoding to the PHeader1 !!! - I.e. a '1' indicates fail (N) and + // a 0 indicates pass (E)!!! + // + // Example: + // + // A header of value b10001010 is encountered in the trace when cycle-accurate mode is disabled. This is a + // format 2 P-header representing the atoms NE. It indicates that one instruction was executed that failed its + // condition codes, followed by one instruction that passed its condition codes. + // + base.SetMask( "1000 ## 10" ); + } + + static ETMPcktPHeaderFormat2() + { + iAtomMask1 = new SymMask( "1###", SymMask.TShiftDirection.ERight, 3 ); + iAtomMask2 = new SymMask( "#1##", SymMask.TShiftDirection.ERight, 2 ); + } + #endregion + + #region API + #endregion + + #region From PcktBase + #endregion + + #region Properties + public ETMPcktPHeaderBase.TAtomType Atom1Type + { + get + { + uint val = iAtomMask1.Apply( base.RawByte ); + ETMPcktPHeaderBase.TAtomType ret = TAtomType.EAtomN_Failed; + if ( val == 0 ) + { + ret = ETMPcktPHeaderBase.TAtomType.EAtomE_Passed; + } + return ret; + } + } + + public ETMPcktPHeaderBase.TAtomType Atom2Type + { + get + { + uint val = iAtomMask2.Apply( base.RawByte ); + ETMPcktPHeaderBase.TAtomType ret = TAtomType.EAtomN_Failed; + if ( val == 0 ) + { + ret = ETMPcktPHeaderBase.TAtomType.EAtomE_Passed; + } + return ret; + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + private readonly static SymMask iAtomMask1; + private readonly static SymMask iAtomMask2; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktStoreFailed.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktStoreFailed.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktStoreFailed : ETMPcktBase + { + #region Constructors + public ETMPcktStoreFailed() + { + base.SetMask( "01010000" ); + } + #endregion + + #region API + #endregion + + #region From PcktBase + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktUnknown.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Packets/Implementations/ETMPcktUnknown.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Packets +{ + public class ETMPcktUnknown : ETMPcktBase + { + #region Constructors + public ETMPcktUnknown() + { + } + #endregion + + #region API + #endregion + + #region From PcktBase + public override int Priority + { + get { return int.MinValue; } + } + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Base/ETMDecodeState.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Base/ETMDecodeState.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Tracer; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianETMLib.Common.Types; + +namespace SymbianETMLib.Common.State +{ + public abstract class ETMDecodeState : ITracer + { + #region Constructors + protected ETMDecodeState( ETMStateData aStateData ) + { + iStateData = aStateData; + } + #endregion + + #region API + public virtual ETMDecodeState PrepareToHandleByte( SymByte aByte ) + { + iCurrentRawByte = aByte; + // + ETMDecodeState ret = HandleByte( aByte ); + return ret; + } + + public abstract ETMDecodeState HandleByte( SymByte aByte ); + + public static string MakeInstructionSetPrefix( TArmInstructionSet aInstructionSet ) + { + string instSet; + switch ( aInstructionSet ) + { + default: + case TArmInstructionSet.EARM: + instSet = "[A]"; + break; + case TArmInstructionSet.ETHUMB: + instSet = "[T]"; + break; + case TArmInstructionSet.EJAZELLE: + instSet = "[J]"; + break; + } + return instSet; + } + #endregion + + #region Properties + public byte CurrentRawByte + { + get { return iCurrentRawByte; } + } + + public string Binary + { + get + { + StringBuilder ret = new StringBuilder(); + ret.Append( Convert.ToString( CurrentRawByte, 2 ).PadLeft( 8, '0' ) ); + return ret.ToString(); + } + } + + protected ETMStateData StateData + { + get { return iStateData; } + } + #endregion + + #region Internal methods + protected StringBuilder MakeTracePacketPrefix( string aPacketName ) + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( " {0} [PKT] {1}", MakeInstructionSetPrefix( StateData.CurrentInstructionSet ), aPacketName.ToUpper().PadRight( 16, ' ' ) ); + return ret; + } + + protected virtual void DbgTrace( string aPrefix, string aPostfix ) + { + StringBuilder trace = MakeTracePacketPrefix( aPrefix ); + trace.AppendFormat( " - 0x{0:x8} [{1:d2}] {2} {3} {4}{5}", + StateData.CurrentAddress, + StateData.LastBranch.KnownBits, + StateData.CurrentAddress.AddressBinary, + StateData.LastBranch.IsKnown ? StateData.Engine.LookUpSymbol( StateData.CurrentAddress ) : string.Empty, + aPostfix, + System.Environment.NewLine + ); + // + Trace( trace.ToString() ); + } + + protected virtual void DbgTrace( string aPrefix ) + { + DbgTrace( aPrefix, string.Empty ); + } + #endregion + + #region From System.Object + #endregion + + #region From ITracer + public void Trace( string aText ) + { + iStateData.Engine.Trace( aText ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iStateData.Engine.Trace( aFormat, aParams ); + } + #endregion + + #region Data members + private readonly ETMStateData iStateData; + private byte iCurrentRawByte = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Data/ETMStateData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Data/ETMStateData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,319 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Tracer; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianStructuresLib.Arm.SecurityMode; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.Debug.Code; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Code; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Buffer; +using SymbianETMLib.Common.Engine; +using SymbianETMLib.Common.Config; +using SymbianETMLib.Common.Utilities; + +namespace SymbianETMLib.Common.State +{ + public class ETMStateData : ITracer + { + #region Constructors + internal ETMStateData( ETEngineBase aEngine ) + { + iEngine = aEngine; + iCurrentState = new ETMDecodeStateUnsynchronized( this ); + } + #endregion + + #region API + internal void PushBack( SymByte aByte ) + { + Buffer.PushBack( aByte ); + iCurrentRawByte = iLastRawByte; + --iPacketNumber; + } + + internal void PrepareToHandleByte( SymByte aByte ) + { + iLastRawByte = iCurrentRawByte; + iCurrentRawByte = aByte; + // + iCurrentState = iCurrentState.PrepareToHandleByte( aByte ); + System.Diagnostics.Debug.Assert( iCurrentState != null ); + // + ++iPacketNumber; + } + + internal void IncrementProcessedInstructionCounter() + { + ++iNumberOfProcessedInstructions; + } + + internal uint IncrementPC() + { + if ( !iLastBranch.IsUnknown ) + { + uint instructionSize = (uint) CurrentInstructionSet; + iPC.Address += instructionSize; + } + + // Increment the instruction counter irrespective of whether or not we + // know the program counter address + IncrementProcessedInstructionCounter(); + return iPC; + } + + internal ETMInstruction FetchInstruction( uint aAddress ) + { + ETMInstruction ret = new ETMInstruction( aAddress ); + // + bool gotCode = false; + if ( this.LastBranch.IsKnown && Engine.DebugEngineView != null ) + { + DbgViewCode codeView = Engine.DebugEngineView.Code; + + // In the case where we've been asked to fetch the code from the exception + // vector, then bypass the rom/rofs code entirely. + bool isExceptionVector = Config.IsExceptionVector( aAddress ); + if ( isExceptionVector ) + { + System.Diagnostics.Debug.Assert( this.CurrentInstructionSet == TArmInstructionSet.EARM ); + TArmExceptionVector vector = Config.MapToExceptionVector( aAddress ); + uint rawInstruction = Config.GetExceptionVector( vector ); + ret.Instruction = codeView.ConvertToInstruction( aAddress, TArmInstructionSet.EARM, rawInstruction ); + } + else + { + IArmInstruction[] instructions = null; + gotCode = codeView.GetInstructions( aAddress, CurrentInstructionSet, 1, out instructions ); + // + if ( gotCode ) + { + System.Diagnostics.Debug.Assert( instructions != null && instructions.Length == 1 ); + ret.Instruction = instructions[ 0 ]; + } + } + } + // + return ret; + } + + internal void SetUnsynchronized() + { + iSynchronized = false; + } + + internal void SetSynchronized() + { + if ( !iSynchronized ) + { + uint pos = iPacketNumber; + iEngine.OnSynchronised( pos ); + iSynchronized = true; + } + } + + // + // Set the known address bits of the program counter. We may not know all + // bits until an I-sync packet is reached, or then until we see a full 5-byte + // branch. + // + internal void SetKnownAddressBits( uint aAddress, int aNumberOfValidBits, TETMBranchType aBranchType ) + { + iLastBranch.SetKnownAddressBits( aAddress, aNumberOfValidBits ); + + iPC.Address = iLastBranch.Address; + iPC.KnownBits = iLastBranch.KnownBits; + + // If we know the full branch address, then inform the engine + if ( iPC.IsKnown ) + { + iEngine.OnBranch( iPC, iCurrentInstructionSet, iCurrentException, aBranchType ); + } + } + + internal void SetPC( uint aAddress ) + { + SetPC( aAddress, this.CurrentInstructionSet ); + } + + internal void SetPC( uint aAddress, TArmInstructionSet aInstructionSet ) + { + iPC.Address = aAddress; + iCurrentInstructionSet = aInstructionSet; + + // If BBC mode is enabled, i.e. branches are output even when a direct branch is taken + // then we don't need to emit a branch event when seeing a 'Direct' branch type. + bool isBBCModeEnabled = Config.BBCModeEnabled; + if ( isBBCModeEnabled == false && iPC.IsKnown ) + { + iEngine.OnBranch( iPC, iCurrentInstructionSet, iCurrentException, TETMBranchType.EBranchDirect ); + } + } + + internal void SetContextID( uint aValue ) + { + // Tidy up the raw value. + uint id = ( aValue >> 2 ); + if ( iCurrentContextId != id ) + { + iCurrentContextId = id; + iEngine.OnContextSwitch( iCurrentContextId ); + } + } + #endregion + + #region Properties + public uint PacketNumber + { + get { return iPacketNumber; } + } + + public int NumberOfProcessedInstructions + { + get { return iNumberOfProcessedInstructions; } + } + + public SymByte CurrentByte + { + get { return iCurrentRawByte; } + } + + public SymByte LastByte + { + get { return iLastRawByte; } + } + + public ETMDecodeState CurrentState + { + get { return iCurrentState; } + } + + public TArmExceptionType CurrentException + { + get { return iCurrentException; } + set + { + if ( iCurrentException != value ) + { + iCurrentException = value; + Engine.OnExceptionModeChange( iCurrentException ); + } + } + } + + public TArmSecurityMode CurrentSecurityMode + { + get { return iCurrentSecurityMode; } + set + { + if ( iCurrentSecurityMode != value ) + { + iCurrentSecurityMode = value; + Engine.OnExceptionModeChange( iCurrentException ); + } + } + } + + public TArmInstructionSet CurrentInstructionSet + { + get { return iCurrentInstructionSet; } + set + { + if ( iCurrentInstructionSet != value ) + { + iCurrentInstructionSet = value; + } + } + } + #endregion + + #region Internal properties + internal SymAddress CurrentAddress + { + get { return iPC; } + } + + internal SymAddressWithKnownBits LastBranch + { + get { return iLastBranch; } + } + + internal ETEngineBase Engine + { + get { return iEngine; } + } + + internal ETMInstruction LastInstruction + { + get { return iLastInstruction; } + set { iLastInstruction = value; } + } + + internal ETConfigBase Config + { + get { return iEngine.Config; } + } + + private ETBufferBase Buffer + { + get { return iEngine.Buffer; } + } + #endregion + + #region Internal constants + #endregion + + #region From ITracer + public void Trace( string aText ) + { + iEngine.Trace( aText ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iEngine.Trace( aFormat, aParams ); + } + #endregion + + #region From System.Object + #endregion + + #region Data members + private readonly ETEngineBase iEngine; + private bool iSynchronized = false; + private int iNumberOfProcessedInstructions = 0; + private uint iPacketNumber = 0; + private uint iCurrentContextId = uint.MaxValue; + private ETMInstruction iLastInstruction = new ETMInstruction(); + private SymAddressWithKnownBits iLastBranch = new SymAddressWithKnownBits(); + private SymAddressWithKnownBits iPC = new SymAddressWithKnownBits(); + private SymByte iCurrentRawByte = 0; + private SymByte iLastRawByte = 0; + private ETMDecodeState iCurrentState = null; + private TArmExceptionType iCurrentException = TArmExceptionType.EUnknown; + private TArmSecurityMode iCurrentSecurityMode = TArmSecurityMode.EUnknown; + private TArmInstructionSet iCurrentInstructionSet = TArmInstructionSet.EARM; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateASync.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateASync.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Packets; +using SymbianETMLib.Common.Exception; + +namespace SymbianETMLib.Common.State +{ + public class ETMDecodeStateASync : ETMDecodeState + { + #region Constructors + public ETMDecodeStateASync( ETMStateData aManager ) + : base( aManager ) + { + } + #endregion + + #region API + public override ETMDecodeState HandleByte( SymByte aByte ) + { + ETMDecodeState nextState = this; + // + if ( aByte == 0 ) + { + ++iASyncConsecutiveNullByteCount; + } + else if ( aByte == 0x80 && iASyncConsecutiveNullByteCount == 5 ) + { + // That's the start of the a-sync packet + iASyncConsecutiveNullByteCount = 0; + base.StateData.SetSynchronized(); + nextState = new ETMDecodeStateSynchronized( base.StateData ); + Trace(); + } + else + { + // Invalid byte + throw new ETMException( "ERROR - data is corrupt - expected null byte or end marker during A-SYNC" ); + } + // + return nextState; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void Trace() + { + base.DbgTrace( "A-SYNC", string.Empty ); + } + #endregion + + #region From System.Object + #endregion + + #region Data members + private int iASyncConsecutiveNullByteCount = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateBranch.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateBranch.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Packets; +using SymbianETMLib.Common.Utilities; +using SymbianETMLib.Common.BranchDecoder; + +namespace SymbianETMLib.Common.State +{ + public class ETMDecodeStateBranch : ETMDecodeState + { + #region Constructors + public ETMDecodeStateBranch( ETMStateData aManager ) + : base( aManager ) + { + iDecoder = ETMBranchDecoder.New( aManager ); + } + #endregion + + #region API + public override ETMDecodeState HandleByte( SymByte aByte ) + { + // Handle the byte + PerformStateOperation( aByte ); + + // Decide what to return based upon current state + ETMDecodeState nextState = this; + if ( iState == TState.EStateFinished ) + { + iDecoder.FlushChanges(); + nextState = new ETMDecodeStateSynchronized( base.StateData ); + } + + // Done. + return nextState; + } + #endregion + + #region Properties + #endregion + + #region Internal state handler + private enum TState + { + EStateBranch = 0, + EStateExceptionContinuation, + EStateFinished + } + + private void PerformStateOperation( SymByte aByte ) + { + switch ( iState ) + { + case TState.EStateBranch: + { + iDecoder.Offer( aByte ); + + // Decode the branch if we have all the info we need + if ( iDecoder.IsBranchAddressAvailable ) + { + iDecoder.DecodeBranch(); + + // Check if we expect an exception byte + if ( iDecoder.IsPacketComplete ) + { + // Nope, we're done + iState = TState.EStateFinished; + } + else + { + iState = TState.EStateExceptionContinuation; + } + } + break; + } + case TState.EStateExceptionContinuation: + { + iDecoder.DecodeException( aByte ); + iState = TState.EStateFinished; + break; + } + default: + case TState.EStateFinished: + System.Diagnostics.Debug.Assert( false ); + break; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly ETMBranchDecoder iDecoder; + private TState iState = TState.EStateBranch; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateContextID.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateContextID.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Packets; + +namespace SymbianETMLib.Common.State +{ + public class ETMDecodeStateContextID : ETMDecodeState + { + #region Constructors + public ETMDecodeStateContextID( ETMStateData aManager ) + : base( aManager ) + { + iContextIdBytesRequired = aManager.Config.ContextIDSize; + iBytesRemaining = iContextIdBytesRequired; + } + #endregion + + #region API + public override ETMDecodeState HandleByte( SymByte aByte ) + { + // TODO: test this + ETMDecodeState nextState = this; + // + int byteNumber = iContextIdBytesRequired - iBytesRemaining; + uint val = aByte.LShift( byteNumber * 8 ); + iContextId |= val; + // + if ( --iBytesRemaining == 0 ) + { + // Got everything + base.StateData.SetContextID( iContextId ); + nextState = new ETMDecodeStateSynchronized( base.StateData ); + } + // + return nextState; + } + #endregion + + #region Properties + public string ContextIDName + { + get + { + string ret = base.StateData.Config.GetContextID( iContextId ); + return ret; + } + } + #endregion + + #region Internal methods + private void Trace() + { + base.DbgTrace( "CONTEXT_ID", string.Format( "ID: {0} [{1}]", iContextId, ContextIDName ) ); + } + #endregion + + #region From System.Object + #endregion + + #region Data members + private readonly int iContextIdBytesRequired; + private uint iContextId = 0; + private int iBytesRemaining = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateCycleCount.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateCycleCount.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Packets; +using SymbianETMLib.Common.Utilities; + +namespace SymbianETMLib.Common.State +{ + public class ETMDecodeStateCycleCount : ETMDecodeState + { + #region Constructors + public ETMDecodeStateCycleCount( ETMStateData aManager ) + : base( aManager ) + { + } + #endregion + + #region API + public override ETMDecodeState HandleByte( SymByte aByte ) + { + ETMDecodeState nextState = new ETMDecodeStateSynchronized( base.StateData ); + + ETMPcktCycleCount cycle = new ETMPcktCycleCount( aByte ); + + // Always save the byte + iPreviousBytes.Add( aByte ); + + // Is the top bit set? if so, then another branch packet follows. + // If not, we're done. + if ( iPreviousBytes.Count == 5 ) + { + // Have obtained 5 bytes or then last byte of smaller run. + Flush(); + } + else if ( cycle.MoreToCome ) + { + nextState = this; + } + else + { + // Have obtained last byte of smaller run. + Flush(); + } + + // Done. + return nextState; + } + #endregion + + #region Properties + protected bool IsFullBranch + { + get { return iPreviousBytes.Count == 5; } + } + #endregion + + #region Internal methods + private void Flush() + { + // If we have a full 5 bytes, then mask off the top bits + // from the last byte because these are reserved. + int count = iPreviousBytes.Count; + if ( count == 5 ) + { + iPreviousBytes[ 4 ].Value = (byte) ( iPreviousBytes[ 4 ].Value & 0xF ); + } + + // Build final 32 bit value + uint counter = 0; + for ( int shift = 0; shift < count; shift++ ) + { + int shiftBits = shift * 8; + uint v = (uint) ( iPreviousBytes[ shift ] << shiftBits ); + counter |= v; + } + } + + private void Trace( uint aCounter ) + { + base.DbgTrace( "CYCLE_COUNT", string.Format( " - {0}", aCounter ) ); + } + #endregion + + #region Internal constants + protected const string KFifthByteMask_NormalStateBranchAddressArm = "00001xxx"; + protected const string KFifthByteMask_NormalStateBranchAddressThumb = "0001xxxx"; + protected const string KFifthByteMask_NormalStateBranchAddressJazelle = "001xxxxx"; + protected const string KFifthByteMask_Reserved1 = "00000xxx"; + protected const string KFifthByteMask_StateBranchWithFollowingExceptionArm = "01001xxx"; + protected const string KFifthByteMask_StateBranchWithFollowingExceptionThumb = "0101xxxx"; + protected const string KFifthByteMask_StateBranchWithFollowingExceptionJazelle = "011xxxxx"; + protected const string KFifthByteMask_Reserved2 = "01000xxx"; + protected const string KFifthByteMask_ExceptionInArmState = "1xxxxxxx"; + #endregion + + #region Data members + private List iPreviousBytes = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateISync.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateISync.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,177 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Packets; + +namespace SymbianETMLib.Common.State +{ + public class ETMDecodeStateISync : ETMDecodeState + { + #region Constructors + public ETMDecodeStateISync( ETMStateData aManager ) + : base( aManager ) + { + iContextIdBytesRequired = aManager.Config.ContextIDSize; + iBytesRemaining = iContextIdBytesRequired; + } + #endregion + + #region API + public override ETMDecodeState HandleByte( SymByte aByte ) + { + ETMDecodeState nextState = this; + // + switch ( iState ) + { + case TState.EStateHeader: + if ( base.StateData.Config.ContextIDSize != 0 ) + { + iState = TState.EStateContextId; + } + else + { + iState = TState.EStateInformation; + } + break; + case TState.EStateContextId: + OnContextByte( aByte ); + break; + case TState.EStateInformation: + OnInformationByte( aByte ); + break; + case TState.EStateAddress: + OnAddress( aByte ); + break; + default: + case TState.EStateIdle: + System.Diagnostics.Debug.Assert( false ); + break; + } + // + if ( iState == TState.EStateIdle ) + { + nextState = new ETMDecodeStateSynchronized( base.StateData ); + } + // + return nextState; + } + #endregion + + #region Properties + #endregion + + #region Internal enumerations + private enum TState + { + EStateHeader = 0, + EStateContextId, + EStateInformation, + EStateAddress, + EStateIdle + } + #endregion + + #region Internal methods + private void OnContextByte( SymByte aByte ) + { + int byteNumber = iContextIdBytesRequired - iBytesRemaining; + uint val = aByte.LShift( byteNumber * 8 ); + iContextId |= val; + + if ( --iBytesRemaining == 0 ) + { + base.StateData.SetContextID( iContextId ); + iState = TState.EStateInformation; + } + } + + private void OnInformationByte( SymByte aByte ) + { + iInformationByte = new ETMPcktISyncInformation( aByte ); + iState = TState.EStateAddress; + + // We're expecting 4 address bytes to follow. + iBytesRemaining = 4; + } + + private void OnAddress( SymByte aByte ) + { + int byteNumber = 4 - iBytesRemaining; + uint val = aByte.LShift( byteNumber * 8 ); + iAddress |= val; + + if ( --iBytesRemaining == 0 ) + { + // Save for tracing purposes + SymAddress originalAddress = new SymAddress( base.StateData.CurrentAddress.Address ); + TArmInstructionSet originalInstructionSet = base.StateData.CurrentInstructionSet; + + // Set new branch address + TArmInstructionSet newInstructionSet = iInformationByte.InstructionSet; + uint address = iAddress; + if ( ( address & 0x1 ) == 0x1 ) + { + // We branched to THUMB, hence change of instruction set... + address &= 0xFFFFFFFE; + newInstructionSet = TArmInstructionSet.ETHUMB; + } + + // Store address etc - always 32 bit full address during I-SYNC + base.StateData.CurrentInstructionSet = newInstructionSet; + base.StateData.SetKnownAddressBits( address, 32, TETMBranchType.EBranchExplicit ); + + // And output debug trace... + Trace( originalAddress, originalInstructionSet, base.StateData.CurrentAddress, newInstructionSet ); + + // We're done + iState = TState.EStateIdle; + } + } + + private void Trace( SymAddress aOriginalAddress, TArmInstructionSet aOriginalISet, SymAddress aNewAddress, TArmInstructionSet aNewISet ) + { + System.Diagnostics.Debug.Assert( base.StateData.LastBranch.IsKnown ); + // + StringBuilder lines = new StringBuilder(); + lines.AppendLine( " I-SYNC" ); + lines.AppendLine( string.Format( " from: {0} 0x{1:x8} {2}", ETMDecodeState.MakeInstructionSetPrefix( aOriginalISet ), aOriginalAddress, StateData.Engine.LookUpSymbol( aOriginalAddress ) ) ); + lines.AppendLine( string.Format( " to: {0} 0x{1:x8} {2}", ETMDecodeState.MakeInstructionSetPrefix( aNewISet ), aNewAddress, StateData.Engine.LookUpSymbol( aNewAddress ) ) ); + // + base.Trace( lines.ToString() ); + } + #endregion + + #region From System.Object + #endregion + + #region Data members + private readonly int iContextIdBytesRequired; + private TState iState = TState.EStateHeader; + private uint iContextId = 0; + private uint iAddress = 0; + private int iBytesRemaining = 0; + private ETMPcktISyncInformation iInformationByte = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateIgnore.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateIgnore.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Packets; + +namespace SymbianETMLib.Common.State +{ + public class ETMDecodeStateIgnore : ETMDecodeState + { + #region Constructors + public ETMDecodeStateIgnore( ETMStateData aManager ) + : base( aManager ) + { + } + #endregion + + #region API + public override ETMDecodeState HandleByte( SymByte aByte ) + { + ETMDecodeState nextState = new ETMDecodeStateSynchronized( base.StateData ); + Trace(); + return nextState; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void Trace() + { + StringBuilder lines = new StringBuilder(); + lines.AppendLine( " IGNORE" ); + base.Trace( lines.ToString() ); + } + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateOutOfOrderData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateOutOfOrderData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,117 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Packets; +using SymbianETMLib.Common.Utilities; + +namespace SymbianETMLib.Common.State +{ + public class ETMDecodeStateOutOfOrderData : ETMDecodeState + { + #region Constructors + public ETMDecodeStateOutOfOrderData( ETMStateData aManager ) + : base( aManager ) + { + } + #endregion + + #region API + public override ETMDecodeState HandleByte( SymByte aByte ) + { + ETMDecodeState nextState = this; + + if ( iSeenHeader == false ) + { + ETMPcktOutOfOrderData cycle = new ETMPcktOutOfOrderData( aByte ); + cycle.Matches( aByte ); + iDataByteCount = cycle.Size; + iSeenHeader = true; + } + else + { + iBytes.Add( aByte ); + // + if ( iBytes.Count == iDataByteCount ) + { + // Done + nextState = new ETMDecodeStateSynchronized( base.StateData ); + } + } + + // Done. + return nextState; + } + #endregion + + #region Properties + protected bool IsFullBranch + { + get { return iBytes.Count == 5; } + } + #endregion + + #region Internal methods + private void Flush() + { + // If we have a full 5 bytes, then mask off the top bits + // from the last byte because these are reserved. + int count = iBytes.Count; + if ( count == 5 ) + { + iBytes[ 4 ].Value = (byte) ( iBytes[ 4 ].Value & 0xF ); + } + + // Build final 32 bit value + uint counter = 0; + for ( int shift = 0; shift < count; shift++ ) + { + int shiftBits = shift * 8; + uint v = (uint) ( iBytes[ shift ] << shiftBits ); + counter |= v; + } + } + + private void Trace( uint aCounter ) + { + base.DbgTrace( "OoO_DATA", string.Empty ); + } + #endregion + + #region Internal constants + protected const string KFifthByteMask_NormalStateBranchAddressArm = "00001xxx"; + protected const string KFifthByteMask_NormalStateBranchAddressThumb = "0001xxxx"; + protected const string KFifthByteMask_NormalStateBranchAddressJazelle = "001xxxxx"; + protected const string KFifthByteMask_Reserved1 = "00000xxx"; + protected const string KFifthByteMask_StateBranchWithFollowingExceptionArm = "01001xxx"; + protected const string KFifthByteMask_StateBranchWithFollowingExceptionThumb = "0101xxxx"; + protected const string KFifthByteMask_StateBranchWithFollowingExceptionJazelle = "011xxxxx"; + protected const string KFifthByteMask_Reserved2 = "01000xxx"; + protected const string KFifthByteMask_ExceptionInArmState = "1xxxxxxx"; + #endregion + + #region Data members + private int iDataByteCount = 0; + private bool iSeenHeader = false; + private List iBytes = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStatePHeader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStatePHeader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,496 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Packets; +using SymbianETMLib.Common.Utilities; +using SymbianETMLib.Common.Exception; + +namespace SymbianETMLib.Common.State +{ + public class ETMDecodeStatePHeader : ETMDecodeState + { + #region Constructors + public ETMDecodeStatePHeader( ETMStateData aManager ) + : base( aManager ) + { + } + + static ETMDecodeStatePHeader() + { + // ARM branch instructions + iBranchMask_ARM_BOrBL = new SymMask( "#### 101 # ######## ######## ########" ); + iBranchMask_ARM_BLX_BranchToThumb = new SymMask( "1111 101 # ######## ######## ########" ); + + // THUMB branch instructions + iBranchMask_THUMB_B1 = new SymMask( "1101 #### ########" ); + iBranchMask_THUMB_B2 = new SymMask( "11100 ###########" ); + iBranchMask_THUMB_BLX_Part1 = new SymMask( "11110 ###########" ); // Multi-instruction branch + iBranchMask_THUMB_BLX_Part2 = new SymMask( "111#1 ###########" ); // Multi-instruction branch + } + #endregion + + #region API + public override ETMDecodeState HandleByte( SymByte aByte ) + { + ETMDecodeState nextState = new ETMDecodeStateSynchronized( base.StateData ); + // + ETMPcktBase packet = Packets.Factory.ETMPacketFactory.Create( aByte ); + if ( packet is ETMPcktPHeaderFormat1 ) + { + ETMPcktPHeaderFormat1 pHeader1 = (ETMPcktPHeaderFormat1) packet; + ProcessFormat1Conditions( pHeader1 ); + } + else if ( packet is ETMPcktPHeaderFormat2 ) + { + ETMPcktPHeaderFormat2 pHeader2 = (ETMPcktPHeaderFormat2) packet; + ProcessFormat2Conditions( pHeader2 ); + } + else + { + throw new ETMException( "ERROR: P-HEADER is not supported" ); + } + // + return nextState; + } + #endregion + + #region Properties + #endregion + + #region Internal enumerations + private enum TMultiPartThumbBranch + { + ETHUMBBL = 0x3, + ETHUMBBLX = 0x1, + } + #endregion + + #region Internal methods + private void ProcessFormat1Conditions( ETMPcktPHeaderFormat1 aHeader ) + { + string pass = aHeader.ConditionCountPassed > 0 ? string.Format( "{0} x PASS", aHeader.ConditionCountPassed ) : string.Empty; + string fail = aHeader.ConditionCountFailed > 0 ? string.Format( ", {0} x FAIL", aHeader.ConditionCountFailed ) : string.Empty; + base.Trace( "{0} - {1} {2}", base.MakeTracePacketPrefix( "P-HEADER(1)" ), pass, fail ); + + // Get the total number of instructions processed + int totalExecutedInstructionCount = aHeader.ConditionCountPassed + aHeader.ConditionCountFailed; + + // Trace passed instructions + for ( int i = 0; i < aHeader.ConditionCountPassed; i++ ) + { + uint address = base.StateData.CurrentAddress; + ETMInstruction instruction = base.StateData.FetchInstruction( address ); + // + TraceAtom( ETMPcktPHeaderBase.TAtomType.EAtomE_Passed, instruction ); + + // We will now check the current instruction to see if it's a branch. + // If it is, then we don't need to increment the instruction address, because + // the explicit branch will set a new PC location. + // + // Note that in the case of a thumb BLX, i.e. two 16-bit instructions which + // interpreted together form a +/-4mb branch address, we also need + // to ensure that the + bool branched = CheckForBranch( instruction ); + if ( !branched ) + { + base.StateData.IncrementPC(); + } + } + + // Trace and failed instructions + if ( aHeader.ConditionCountFailed > 0 ) + { + uint address = base.StateData.CurrentAddress; + ETMInstruction instruction = base.StateData.FetchInstruction( address ); + // + TraceAtom( ETMPcktPHeaderBase.TAtomType.EAtomN_Failed, instruction ); + base.StateData.IncrementPC(); + } + + // Spacer - to make the verbose output easier to read... + base.Trace( string.Empty ); + } + + private void ProcessFormat2Conditions( ETMPcktPHeaderFormat2 aHeader ) + { + string atom1TypeName = TraceAtomTypeName( aHeader.Atom1Type ); + string atom2TypeName = TraceAtomTypeName( aHeader.Atom2Type ); + base.Trace( "{0} - 1 x {1}, 1 x {2}", base.MakeTracePacketPrefix( "P-HEADER(2)" ), atom1TypeName, atom2TypeName ); + + // First instruction + { + uint address1 = base.StateData.CurrentAddress; + ETMInstruction inst1 = base.StateData.FetchInstruction( address1 ); + TraceAtom( aHeader.Atom1Type, inst1 ); + if ( aHeader.Atom1Type == ETMPcktPHeaderBase.TAtomType.EAtomE_Passed ) + { + bool branched = CheckForBranch( inst1 ); + if ( !branched ) + { + base.StateData.IncrementPC(); + } + } + else + { + base.StateData.IncrementPC(); + } + } + + // Second instruction + { + uint address2 = base.StateData.CurrentAddress; + ETMInstruction inst2 = base.StateData.FetchInstruction( address2 ); + TraceAtom( aHeader.Atom2Type, inst2 ); + if ( aHeader.Atom2Type == ETMPcktPHeaderBase.TAtomType.EAtomE_Passed ) + { + bool branched = CheckForBranch( inst2 ); + if ( !branched ) + { + base.StateData.IncrementPC(); + } + } + else + { + base.StateData.IncrementPC(); + } + } + + // Spacer - to make the verbose output easier to read... + base.Trace( string.Empty ); + } + + private bool HandleTHUMBMultiInstructionBranch( uint aInstruction1, uint aInstruction2 ) + { + bool branched = false; + + // THUMB multi branch with link exchange instruction - consumes 32 bits + // of the instruction pipeline, i.e. instructions @ aIndex and aIndex+1 both + // consumed. + // + // Check the signature is correct: + // + // NB: + // The first Thumb instruction has H == 10 and supplies the high part of the + // branch offset. This instruction sets up for the subroutine call and is + // shared between the BL and BLX forms. + // + // The second Thumb instruction has H == 11 (for BL) or H == 01 (for BLX). It + // supplies the low part of the branch offset and causes the subroutine call + // to take place. + // + // 15 14 13 12 11 10 0 + // ---------------------------------------------------- + // 1 1 1 H <--- offset_11 --> + // + // mask1 = 11 00000000000 + // value1 = 10 00000000000 + // 111 11 10111010101 + // mask2 = 1 00000000000 + // value2 = 1 00000000000 + // 111 10 11111111111 + bool inst1Valid = ( ( aInstruction1 & 0x1800 ) == 0x1000 ); + bool inst2Valid = ( ( aInstruction2 & 0x0800 ) == 0x0800 ); + + if ( inst1Valid && inst2Valid ) + { + TArmInstructionSet newInstructionSet = TArmInstructionSet.ETHUMB; + TMultiPartThumbBranch branchType = TMultiPartThumbBranch.ETHUMBBL; + if ( ( aInstruction2 & 0x1800 ) == 0x0800 ) + { + branchType = TMultiPartThumbBranch.ETHUMBBLX; + newInstructionSet = TArmInstructionSet.EARM; + } + + // We subtract two, because we're already handling the second instruction + // and the address is relative to the first. + uint address = base.StateData.CurrentAddress - 2; + + // 111 10 00000000100 + // 100000000000000 + // + int instImmediate1 = SignExtend11BitTo32BitTHUMB( aInstruction1 & 0x7FF, 12 ); + address = (uint) ( address + instImmediate1 ); + address += 4; + + // 111 01 11101011010 + // 11111111111 (0x7FF) + // 11101011010 = 0x75A * 2 = EB4 + // + // 111 01 11011100010 + // 11011100010 = 0X6E2 * 2 = DC4 + // + // + + // Second instruction + uint instImmediate2 = ( aInstruction2 & 0x7FF ) * 2; + address += instImmediate2; + + // For BLX, the resulting address is forced to be word-aligned by + // clearing bit[1]. + if ( branchType == TMultiPartThumbBranch.ETHUMBBLX ) + { + address = address & 0xFFFFFFFD; + } + + base.StateData.SetPC( address, newInstructionSet ); + branched = true; + } + else + { + // Oops. We ran out of instructions. This shouldn't ever happen + // assuming that the P-HEADER's are synched properly. + throw new ETMException( "ERROR - synchronisation lost with P-HEADERS - 2nd THUMB BLX instruction missing" ); + } + + return branched; + } + + private bool CheckForBranch( ETMInstruction aInstruction ) + { + bool branched = false; + TArmInstructionSet originalInstructionSet = base.StateData.CurrentInstructionSet; + SymAddress originalAddress = new SymAddress( base.StateData.CurrentAddress.Address ); + // + if ( base.StateData.LastBranch.IsKnown ) + { + uint address = base.StateData.CurrentAddress; + TArmInstructionSet instructionSet = base.StateData.CurrentInstructionSet; + // + if ( instructionSet == TArmInstructionSet.EARM ) + { + if ( iBranchMask_ARM_BOrBL.IsMatch( aInstruction ) ) + { + // 1110 101 0 111111111111111111111101 + int offset = SignExtend24BitTo32BitARM( aInstruction & 0x00FFFFFF ); + base.StateData.SetPC( (uint) ( address + offset ) ); + branched = true; + } + else if ( iBranchMask_ARM_BLX_BranchToThumb.IsMatch( aInstruction ) ) + { + // TODO: verify this - no data to test at the moment + int offset = SignExtend24BitTo32BitARM( aInstruction & 0x00FFFFFF ); + base.StateData.SetPC( (uint) ( address + offset ), TArmInstructionSet.ETHUMB ); + branched = true; + } + } + else if ( instructionSet == TArmInstructionSet.ETHUMB ) + { + if ( iBranchMask_THUMB_B1.IsMatch( aInstruction ) ) + { + // 15 14 13 12 11 -> 8 7 -> 0 + // ----------------------------------------- + // 1 1 0 1 cond signed_immed_8 + int offset = SignExtend8BitTo32BitTHUMB( aInstruction & 0xFF ); + base.StateData.SetPC( (uint) ( address + offset ) ); + branched = true; + } + else if ( iBranchMask_THUMB_B2.IsMatch( aInstruction ) ) + { + // 15 14 13 12 11 10 -> 0 + // ----------------------------------------- + // 1 1 0 1 1 signed_immed_11 + int offset = SignExtend11BitTo32BitTHUMB( aInstruction & 0x7FF ); + base.StateData.SetPC( (uint) ( address + offset ) ); + branched = true; + } + else + { + ETMInstruction inst1 = base.StateData.LastInstruction; + bool inst1Match = iBranchMask_THUMB_BLX_Part1.IsMatch( inst1.AIRawValue ); + ETMInstruction inst2 = aInstruction; + bool inst2Match = iBranchMask_THUMB_BLX_Part2.IsMatch( inst2.AIRawValue ); + // + if ( inst1Match && inst2Match ) + { + branched = HandleTHUMBMultiInstructionBranch( inst1.AIRawValue, inst2.AIRawValue ); + System.Diagnostics.Debug.Assert( branched == true ); + } + } + } + else + { + throw new NotSupportedException(); + } + } + if ( branched ) + { + base.StateData.IncrementProcessedInstructionCounter(); + TraceDirectBranch( originalAddress, originalInstructionSet, base.StateData.CurrentAddress, base.StateData.CurrentInstructionSet ); + } + + // Always cache the last processed instruction + base.StateData.LastInstruction = aInstruction; + return branched; + } + + private void TraceDirectBranch( SymAddress aOriginalAddress, TArmInstructionSet aOriginalISet, SymAddress aNewAddress, TArmInstructionSet aNewISet ) + { + StringBuilder lines = new StringBuilder(); + lines.AppendLine( " BRANCH-D" ); + // + if ( base.StateData.LastBranch.IsKnown ) + { + lines.AppendLine( string.Format( " from: {0} 0x{1:x8} {2}", ETMDecodeState.MakeInstructionSetPrefix( aOriginalISet ), aOriginalAddress, StateData.Engine.LookUpSymbol( aOriginalAddress ) ) ); + lines.AppendLine( string.Format( " to: {0} 0x{1:x8} {2}", ETMDecodeState.MakeInstructionSetPrefix( aNewISet ), aNewAddress, StateData.Engine.LookUpSymbol( aNewAddress ) ) ); + } + else + { + } + // + base.Trace( lines.ToString() ); + } + + #region Utilities + private static string TraceAtomTypeName( ETMPcktPHeaderBase.TAtomType aType ) + { + switch ( aType ) + { + default: + case ETMPcktPHeaderBase.TAtomType.EAtomNotApplicable: + return " "; + case ETMPcktPHeaderBase.TAtomType.EAtomE_Passed: + return " PASS "; + case ETMPcktPHeaderBase.TAtomType.EAtomN_Failed: + return "* FAIL *"; + case ETMPcktPHeaderBase.TAtomType.EAtomW_CycleBoundary: + return " CYBNDR "; + } + } + + private void TraceAtom( ETMPcktPHeaderBase.TAtomType aType, ETMInstruction aInstruction ) + { + string atomTypeName = TraceAtomTypeName( aType ); + // + StringBuilder text = new StringBuilder(); + text.AppendFormat( "{0} 0x{1}: {2} {3}", + base.StateData.NumberOfProcessedInstructions.ToString().PadLeft( 6, ' ' ), + base.StateData.CurrentAddress.AddressHex, + base.StateData.CurrentAddress.AddressBinary, + atomTypeName + ); + // + if ( base.StateData.LastBranch.IsKnown ) + { + string disasm = aInstruction.ToString(); + text.Append( " " + disasm ); + } + // + base.Trace( text.ToString() ); + } + + private static int SignExtend24BitTo32BitARM( uint aImmediate ) + { + int offset; + // + unchecked + { + if ( ( aImmediate & 0x00800000 ) == 0x00800000 ) + { + offset = (int) ( 0xff000000 | aImmediate ); + } + else + { + offset = (int) aImmediate; + } + } + // + offset <<= 2; + offset += 8; // pipeline + return offset; + } + + private static int SignExtend11BitTo32BitTHUMB( uint aImmediate ) + { + int offset = SignExtend11BitTo32BitTHUMB( aImmediate, 1 ); + offset += 4; // pipeline + return offset; + } + + private static int SignExtend11BitTo32BitTHUMB( uint aImmediate, int aLeftShiftCount ) + { + int offset; + // + unchecked + { + // 10 9 8 7 6 5 4 3 2 1 0 + // ---------------------------------- + // 1 0 0 0 0 0 0 0 0 0 0 + if ( ( aImmediate & 0x00000400 ) == 0x00000400 ) + { + // 11111111111111111111100000000000 + // 10000000000 + offset = (int) ( 0xFFFFF800 | aImmediate ); + } + else + { + offset = (int) aImmediate; + } + } + // + offset <<= aLeftShiftCount; + return offset; + } + + private static int SignExtend8BitTo32BitTHUMB( uint aImmediate ) + { + int offset; + // + unchecked + { + // 7 6 5 4 3 2 1 0 + // ------------------------ + // 1 0 0 0 0 0 0 0 + if ( ( aImmediate & 0x00000080 ) == 0x00000080 ) + { + // 11111111111111111111111100000000 + // 10000000 + offset = (int) ( 0xFFFFFF00 | aImmediate ); + } + else + { + offset = (int) aImmediate; + } + } + // + offset <<= 1; + offset += 4; // pipeline + return offset; + } + #endregion + + #endregion + + #region From System.Object + #endregion + + #region Data members + private static readonly SymMask iBranchMask_ARM_BOrBL; + private static readonly SymMask iBranchMask_ARM_BLX_BranchToThumb; + private static readonly SymMask iBranchMask_THUMB_B1; + private static readonly SymMask iBranchMask_THUMB_B2; + private static readonly SymMask iBranchMask_THUMB_BLX_Part1; + private static readonly SymMask iBranchMask_THUMB_BLX_Part2; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateSynchronized.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateSynchronized.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Packets; + +namespace SymbianETMLib.Common.State +{ + public class ETMDecodeStateSynchronized : ETMDecodeState + { + #region Constructors + public ETMDecodeStateSynchronized( ETMStateData aManager ) + : base( aManager ) + { + } + #endregion + + #region API + public override ETMDecodeState HandleByte( SymByte aByte ) + { + ETMDecodeState nextState = this; + // + ETMPcktBase packet = Packets.Factory.ETMPacketFactory.Create( aByte ); + if ( packet != null ) + { + if ( packet is ETMPcktBranch ) + { + nextState = new ETMDecodeStateBranch( base.StateData ); + base.StateData.PushBack( aByte ); + } + else if ( packet is ETMPcktIgnore ) + { + nextState = new ETMDecodeStateIgnore( base.StateData ); + base.StateData.PushBack( aByte ); + } + else if ( packet is ETMPcktISync ) + { + nextState = new ETMDecodeStateISync( base.StateData ); + base.StateData.PushBack( aByte ); + } + else if ( packet is ETMPcktPHeaderFormat1 || packet is ETMPcktPHeaderFormat2 ) + { + nextState = new ETMDecodeStatePHeader( base.StateData ); + base.StateData.PushBack( aByte ); + } + else if ( packet is ETMPcktASync ) + { + nextState = new ETMDecodeStateASync( base.StateData ); + base.StateData.PushBack( aByte ); + } + else if ( packet is ETMPcktOutOfOrderData ) + { + nextState = new ETMDecodeStateOutOfOrderData( base.StateData ); + base.StateData.PushBack( aByte ); + } + else if ( packet is ETMPcktCycleCount ) + { + nextState = new ETMDecodeStateCycleCount( base.StateData ); + } + else if ( packet is ETMPcktContextID ) + { + nextState = new ETMDecodeStateContextID( base.StateData ); + } + else + { + base.Trace( string.Format( "OP NOT HANDLED: {0:x2}", aByte ) ); + System.Diagnostics.Debug.Assert( false ); + } + } + else + { + base.Trace( string.Format( "WARNING: OP NOT RECOGNISED: {0:x2}", aByte ) ); + System.Diagnostics.Debug.Assert( false ); + } + // + return nextState; + } + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateUnsynchronized.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/State/Implementations/ETMDecodeStateUnsynchronized.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Types; + +namespace SymbianETMLib.Common.State +{ + public class ETMDecodeStateUnsynchronized : ETMDecodeState + { + #region Constructors + public ETMDecodeStateUnsynchronized( ETMStateData aManager ) + : base( aManager ) + { + } + #endregion + + #region API + public override ETMDecodeState HandleByte( SymByte aByte ) + { + ETMDecodeState nextState = this; + // + if ( aByte == 0 ) + { + ++iASyncConsecutiveNullByteCount; + } + else if ( aByte == 0x80 && iASyncConsecutiveNullByteCount == 5 ) + { + // That's the start of the a-sync packet + iASyncConsecutiveNullByteCount = 0; + base.StateData.SetSynchronized(); + nextState = new ETMDecodeStateSynchronized( base.StateData ); + Trace(); + } + else + { + iASyncConsecutiveNullByteCount = 0; + base.StateData.SetUnsynchronized(); + } + // + return nextState; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void Trace() + { + base.DbgTrace( "A-SYNC" ); + } + #endregion + + #region From System.Object + #endregion + + #region Data members + private int iASyncConsecutiveNullByteCount = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Types/ETMBranch.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Types/ETMBranch.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,200 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Debug.Symbols; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianStructuresLib.Arm.SecurityMode; +using SymbianETMLib.Common.Utilities; + +namespace SymbianETMLib.Common.Types +{ + public class ETMBranch + { + #region Constructors + public ETMBranch( SymAddress aAddress, int aNumber, TETMBranchType aType, TArmInstructionSet aInstructionSet, TArmExceptionType aExceptionType ) + { + iAddress = aAddress; + iNumber = aNumber; + iType = aType; + iInstructionSet = aInstructionSet; + iExceptionType = aExceptionType; + } + #endregion + + #region API + #endregion + + #region Properties + public SymAddress Address + { + get { return iAddress; } + } + + public int Number + { + get { return iNumber; } + } + + public TETMBranchType Type + { + get { return iType; } + } + + public TArmInstructionSet InstructionSet + { + get { return iInstructionSet; } + } + + public TArmExceptionType ExceptionType + { + get { return iExceptionType; } + } + + public Symbol Symbol + { + get { return iSymbol; } + set + { + if ( iSymbol != value ) + { + iFlags &= ~TFlags.EFlagsSymbolTextSetExplicitly; + iSymbol = value; + BuildSymbolText(); + } + } + } + + public uint SymbolAddressOffset + { + get + { + uint ret = 0; + if ( iSymbol != null ) + { + ret = iSymbol.Offset( iAddress ); + } + return ret; + } + } + + public string SymbolText + { + get { return iSymbolText; } + set + { + iSymbolText = value; + iFlags |= TFlags.EFlagsSymbolTextSetExplicitly; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + string ret = ToString( 0 ); + return ret; + } + + public string ToString( int aDepth ) + { + StringBuilder text = new StringBuilder(); + + // Counter + text.AppendFormat( "[{0:d4}] ", iNumber ); + + // Instruction set + text.Append( ETMEnumToTextConverter.ToString( this.InstructionSet ) ); + + // Exception mode + string processorState = ETMEnumToTextConverter.ToString( this.ExceptionType ); + text.AppendFormat( string.Format( " [{0}]", processorState ).PadRight( 33, ' ' ) ); + + // Address + text.AppendFormat( " @ 0x{0} ", iAddress.AddressHex ); + + // Symbol + if ( this.Symbol != null ) + { + text.AppendFormat( "[0x{0:x8} +0x{1:x4}] ", this.Symbol.Address, this.SymbolAddressOffset ); + } + else + { + text.Append( "[ ???????? +????] " ); + } + + // Add padding for depth + for ( int i = 0; i < aDepth; i++ ) + { + text.Append( " " ); + } + + // Finally, add the symbol + text.Append( this.SymbolText ); + + return text.ToString(); + } + #endregion + + #region Internal enumerations + [Flags] + private enum TFlags : byte + { + EFlagsNone = 0, + EFlagsSymbolTextSetExplicitly + } + #endregion + + #region Internal constants + private const string KUnknownSymbol = "????"; + #endregion + + #region Internal methods + private void BuildSymbolText() + { + if ( ( iFlags & TFlags.EFlagsSymbolTextSetExplicitly ) != TFlags.EFlagsSymbolTextSetExplicitly ) + { + if ( iSymbol != null ) + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "{0} [{1}]", iSymbol.Name, iSymbol.Object ); + iSymbolText = ret.ToString(); + } + else + { + iSymbolText = KUnknownSymbol; + } + } + } + #endregion + + #region Data members + private readonly int iNumber; + private readonly SymAddress iAddress; + private readonly TETMBranchType iType; + private readonly TArmInstructionSet iInstructionSet; + private readonly TArmExceptionType iExceptionType; + private Symbol iSymbol = null; + private string iSymbolText = string.Empty; + private TFlags iFlags = TFlags.EFlagsNone; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Types/ETMBranchType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Types/ETMBranchType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianETMLib.Common.Types +{ + internal enum TETMBranchCompressionScheme + { + EOriginal = 0, + EAlternative + } + + public enum TETMBranchType + { + EBranchDirect = 0, + EBranchExplicit + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Types/ETMInstruction.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Types/ETMInstruction.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianETMLib.Common.Utilities; +using SymbianStructuresLib.Arm.Instructions; + +namespace SymbianETMLib.Common.Types +{ + internal class ETMInstruction + { + #region Constructors + public ETMInstruction() + : this( 0 ) + { + } + + public ETMInstruction( uint aAddress ) + : this( aAddress, null ) + { + } + + public ETMInstruction( uint aAddress, IArmInstruction aInstruction ) + { + iAddress = new SymAddress( aAddress ); + iInstruction = aInstruction; + } + #endregion + + #region From System.Object + public override string ToString() + { + string ret = string.Empty; + if ( HaveInstruction ) + { + ret = iInstruction.ToString(); + } + return ret; + } + #endregion + + #region Properties + public bool HaveInstruction + { + get { return iInstruction != null; } + } + + public SymAddress Address + { + get { return iAddress; } + set { iAddress = value; } + } + + public uint AIRawValue + { + get + { + uint ret = 0; + if ( HaveInstruction ) + { + ret = iInstruction.AIRawValue; + } + return ret; + } + } + + public IArmInstruction Instruction + { + get { return iInstruction; } + set { iInstruction = value; } + } + #endregion + + #region Operators + public static implicit operator uint( ETMInstruction aInstruction ) + { + uint ret = aInstruction.AIRawValue; + return ret; + } + #endregion + + #region Data members + private SymAddress iAddress = new SymAddress(); + private IArmInstruction iInstruction = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Utilities/ETMEnumToTextConverter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Utilities/ETMEnumToTextConverter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianETMLib.Common.Types; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; + +namespace SymbianETMLib.Common.Utilities +{ + public static class ETMEnumToTextConverter + { + public static string ToString( TArmExceptionType aException ) + { + string mode = "???"; + // + switch ( aException ) + { + default: + case TArmExceptionType.EUnknown: + break; + case TArmExceptionType.ENone: + mode = "Normal"; + break; + case TArmExceptionType.EHaltingDebug: + mode = "Halting Debug"; + break; + case TArmExceptionType.ESecureMonitorCall: + mode = "Secure Monitor Call"; + break; + case TArmExceptionType.EAsyncDataAbort: + mode = "Data Abort"; + break; + case TArmExceptionType.EJazelle: + mode = "Jazelle"; + break; + case TArmExceptionType.EProcessorReset: + mode = "Reset"; + break; + case TArmExceptionType.EUndefinedInstruction: + mode = "Undefined Instruction"; + break; + case TArmExceptionType.ESVC: + mode = "SVC"; + break; + case TArmExceptionType.EPrefetchAbortOrSWBreakpoint: + mode = "Prefetch Abort / SW Breakpoint"; + break; + case TArmExceptionType.ESyncDataAbortOrSWWatchpoint: + mode = "Data Abort / SW Watchbpoint"; + break; + case TArmExceptionType.EGeneric: + mode = "Generic"; + break; + case TArmExceptionType.EIRQ: + mode = "IRQ"; + break; + case TArmExceptionType.EFIQ: + mode = "FIQ"; + break; + } + // + return mode; + } + + public static string ToString( TArmInstructionSet aInstructionSet ) + { + string ret = string.Empty; + // + switch ( aInstructionSet ) + { + case TArmInstructionSet.EARM: + ret = "[A]"; + break; + case TArmInstructionSet.ETHUMB: + ret = "[T]"; + break; + case TArmInstructionSet.EJAZELLE: + ret = "[J]"; + break; + default: + ret = "[?]"; + break; + } + // + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Utilities/ETMTextToEnumConverter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Utilities/ETMTextToEnumConverter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianETMLib.Common.Types; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianStructuresLib.Arm.Registers; + +namespace SymbianETMLib.Common.Utilities +{ + internal static class ETMTextToEnumConverter + { + public static TArmRegisterType ToRegisterType( string aText ) + { + TArmRegisterType ret = TArmRegisterType.EArmReg_Other; + // + string text = aText.ToUpper(); + if ( text == "ETB11_IDENTIFICATION" ) + { + ret = TArmRegisterType.EArmReg_ETB_Id; + } + else if ( text == "ETB11_RAM_DEPTH" ) + { + ret = TArmRegisterType.EArmReg_ETB_RamDepth; + } + else if ( text == "ETB11_RAM_WIDTH" ) + { + ret = TArmRegisterType.EArmReg_ETB_RamWidth; + } + else if ( text == "ETB11_STATUS" ) + { + ret = TArmRegisterType.EArmReg_ETB_Status; + } + else if ( text == "ETB11_RAM_WRITE_POINTER" ) + { + ret = TArmRegisterType.EArmReg_ETB_RamWritePointer; + } + else if ( text == "ETB11_TRIGGER_COUNTER" ) + { + ret = TArmRegisterType.EArmReg_ETB_TriggerCounter; + } + else if ( text == "ETB11_CONTROL" ) + { + ret = TArmRegisterType.EArmReg_ETB_Control; + } + else if ( text == "ETM_ETM_CONTROL" ) + { + ret = TArmRegisterType.EArmReg_ETM_Control; + } + else if ( text == "ETM_ETM_ID" ) + { + ret = TArmRegisterType.EArmReg_ETM_Id; + } + // + return ret; + } + + public static TArmExceptionVector ToExceptionVector( string aText ) + { + TArmExceptionVector ret = TArmExceptionVector.EUndefinedInstruction; + // + string text = aText.ToUpper(); + if ( text == "RST" ) + { + ret = TArmExceptionVector.EReset; + } + else if ( text == "UND" ) + { + ret = TArmExceptionVector.EUndefinedInstruction; + } + else if ( text == "SWI" ) + { + ret = TArmExceptionVector.ESVC; + } + else if ( text == "ETB11_STATUS" ) + { + ret = TArmExceptionVector.EPrefetchAbort; + } + else if ( text == "PRE" ) + { + ret = TArmExceptionVector.EPrefetchAbort; + } + else if ( text == "DAT" ) + { + ret = TArmExceptionVector.EDataAbort; + } + else if ( text == "IRQ" ) + { + ret = TArmExceptionVector.EIRQ; + } + else if ( text == "FIQ" ) + { + ret = TArmExceptionVector.EFIQ; + } + // + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Utilities/RVCTDiassemblyTool.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Utilities/RVCTDiassemblyTool.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,281 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using DecompressETB.Types; +using SymbianUtils.Range; + +namespace DecompressETB.Utilities +{ + public class RVCTDiassemblyUtility + { + #region Constructor + public RVCTDiassemblyUtility() + { + } + #endregion + + #region API + public string Disassemble( uint aAddress ) + { + string ret = "Unknown instruction"; + // + RVCTFunctionComparer comparer = new RVCTFunctionComparer(); + RVCTDisassemblyFunction temp = new RVCTDisassemblyFunction( aAddress ); + int pos = iFunctions.BinarySearch( temp, comparer ); + if ( pos >= 0 && pos < iFunctions.Count ) + { + temp = iFunctions[ pos ]; + System.Diagnostics.Debug.Assert( temp.AddressRange.Contains( aAddress ) ); + // + ret = temp[ aAddress ]; + } + // + return ret; + } + + public void Read( string aFileName, uint aGlobalBaseAddress ) + { + using ( StreamReader reader = new StreamReader( aFileName ) ) + { + RVCTDisassemblyFunction fn = LastFunction; + // + string line = reader.ReadLine(); + while ( line != null ) + { + Match m = null; + // + m = KRegExFunction.Match( line ); + if ( m.Success ) + { + if ( fn != null ) + { + fn.Finalise(); + + // Only save functions that contain disassembly + if ( fn.Count > 0 ) + { + iFunctions.Add( fn ); + } + } + + fn = new RVCTDisassemblyFunction( m.Groups[ "Name" ].Value, aGlobalBaseAddress ); + } + else if ( fn != null ) + { + fn.Offer( line ); + } + // + line = reader.ReadLine(); + } + + // Finalise any pending function + if ( fn != null ) + { + fn.Finalise(); + } + } + } + #endregion + + #region Properties + private RVCTDisassemblyFunction LastFunction + { + get + { + RVCTDisassemblyFunction ret = null; + int count = iFunctions.Count; + if ( count > 0 ) + { + ret = iFunctions[ count - 1 ]; + } + return ret; + } + } + #endregion + + #region Internal classes + class RVCTFunctionComparer : IComparer + { + public int Compare( RVCTDisassemblyFunction aLeft, RVCTDisassemblyFunction aRight ) + { + int ret = -1; + // + AddressRange lr = aLeft.AddressRange; + AddressRange rr = aRight.AddressRange; + // + if ( lr.Contains( rr ) || rr.Contains( lr ) ) + { + ret = 0; + } + else + { + ret = lr.CompareTo( rr ); + } + // + return ret; + } + } + #endregion + + #region Internal constants + private static readonly Regex KRegExFunction = new Regex( + @"^\s{4}(?[A-Za-z_0-9]+)$", + RegexOptions.Multiline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + #endregion + + #region Data members + private List iFunctions = new List(); + #endregion + } + + internal class RVCTDisassemblyFunction + { + #region Constructor + public RVCTDisassemblyFunction( string aName, uint aBaseAddress ) + { + iName = aName; + iBaseAddress = aBaseAddress; + } + + public RVCTDisassemblyFunction( uint aAddress ) + { + iName = string.Empty; + iBaseAddress = aAddress; + iAddressRange = new AddressRange( aAddress, aAddress ); + } + #endregion + + #region API + internal void Finalise() + { + int size = InstructionSize; + iAddressRange = new AddressRange( iFirstInstructionAddress, iFirstInstructionAddress + ( iInstructions.Count * size ) - 1 ); + } + + internal void Offer( string aLine ) + { + Match m = KRegExInstruction.Match( aLine ); + if ( m.Success ) + { + // get offset address + Group addressGroup = m.Groups[ "Address" ]; + uint address = uint.Parse( addressGroup.Value, System.Globalization.NumberStyles.HexNumber ) - KCodeBase; + + // Convert to global address + address += iBaseAddress; + if ( iFirstInstructionAddress == 0 ) + { + iFirstInstructionAddress = address; + } + + // Create record + string text = aLine.Substring( addressGroup.Index + addressGroup.Length + 1 ).Trim(); + iInstructions.Add( address, text ); + } + } + #endregion + + #region Properties + public int Count + { + get { return iInstructions.Count; } + } + + public int InstructionSize + { + get + { + int ret = 4; + // + if ( iInstructions.Count >= 2 ) + { + List addresses = new List(); + // + foreach ( KeyValuePair i in iInstructions ) + { + addresses.Add( i.Key ); + if ( addresses.Count == 2 ) + { + break; + } + } + // + if ( addresses.Count == 2 ) + { + int diff = (int) ( addresses[ 1 ] - addresses[ 0 ] ); + ret = diff; + } + } + // + return ret; + } + } + + public AddressRange AddressRange + { + get + { + return iAddressRange; + } + } + + internal string this[ uint aAddress ] + { + get + { + string ret = "??? No exact match"; + // + if ( iInstructions.ContainsKey( aAddress ) ) + { + ret = iInstructions[ aAddress ]; + } + // + return ret; + } + } + #endregion + + #region Internal constants + private const uint KCodeBase = 0x8000; + private static readonly Regex KRegExInstruction = new Regex( + "^\\s{8}\r\n0x(?
.{8}):\r\n\\s{4}\r\n(?.{8})\r\n" + + "\\s{4}\r\n(?.{4})\r\n\\s{4}\r\n(?\\p{Lu}*)\r\n\\s+\r\n" + + "(?.+)\r\n$", + RegexOptions.Multiline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + #endregion + + #region Data members + private readonly string iName; + private readonly uint iBaseAddress; + private uint iFirstInstructionAddress; + private AddressRange iAddressRange; + private Dictionary iInstructions = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/Buffer/ETBBuffer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/Buffer/ETBBuffer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Exception; +using SymbianETMLib.Common.Buffer; + +namespace SymbianETMLib.ETB.Buffer +{ + public class ETBBuffer : ETBufferBase + { + #region Constructors + public ETBBuffer() + { + } + + public ETBBuffer( string aFileName ) + : base( aFileName ) + { + } + #endregion + + #region API + public void Reorder( uint aAddressOfFirstByte ) + { + List data = base.Data; + // + if ( aAddressOfFirstByte > data.Count ) + { + throw new ETMException( "ERROR - initial write pointer is out-of-bounds" ); + } + else if ( aAddressOfFirstByte != 0 ) + { + List newData = new List(); + // + int count = data.Count; + for ( int i = (int) aAddressOfFirstByte; i < count; i++ ) + { + byte b = data[ i ]; + newData.Add( b ); + } + for ( int i = 0; i < (int) aAddressOfFirstByte; i++ ) + { + byte b = data[ i ]; + newData.Add( b ); + } + // + base.Data = newData; + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/Config/ETBConfig.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/Config/ETBConfig.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,275 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; +using SymbianStructuresLib.Arm.Exceptions; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Registers.EmbeddedTrace; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Utilities; +using SymbianETMLib.Common.Exception; +using SymbianETMLib.Common.Config; +using SymbianETMLib.ETB.Buffer; + +namespace SymbianETMLib.ETB.Config +{ + public class ETBConfig : ETConfigBase + { + #region Constructors + public ETBConfig( ETBBuffer aBuffer ) + : base( aBuffer ) + { + } + + public ETBConfig( ETBBuffer aBuffer, string aETBXmlFile ) + : this( aBuffer ) + { + bool loaded = ExtractFromXml( aETBXmlFile ); + if ( !loaded ) + { + throw new ETMException( "ERROR: XML input data is corrupt or invalid" ); + } + } + #endregion + + #region API + #endregion + + #region Properties + public uint RegisterETBRamWritePointer + { + get { return iRegistersETB[ TArmRegisterType.EArmReg_ETB_RamWritePointer ].Value; } + set { iRegistersETB[ TArmRegisterType.EArmReg_ETB_RamWritePointer ].Value = value; } + } + #endregion + + #region Internal methods + protected new ETBBuffer Buffer + { + get { return base.Buffer as ETBBuffer; } + } + + private bool ExtractFromXml( string aFileName ) + { + bool success = false; + // + try + { + XmlReaderSettings settings = new XmlReaderSettings(); + settings.ConformanceLevel = ConformanceLevel.Auto; + settings.IgnoreComments = true; + settings.CheckCharacters = true; + settings.IgnoreWhitespace = true; + // + using ( XmlReader reader = XmlReader.Create( aFileName, settings ) ) + { + XmlDocument document = new XmlDocument(); + document.Load( reader ); + XmlElement root = document.DocumentElement; + if ( root == null || root.Name != "etb" ) + { + throw new ETMException( "ERROR - document root expected to be \'etb\'" ); + } + else + { + foreach ( XmlNode node in root ) + { + string nodeName = node.Name.Trim().ToUpper(); + if ( nodeName == "REGISTERS" ) + { + ExtractXmlRegisters( node ); + } + else if ( nodeName == "EXCEPTION_VECTORS" ) + { + ExtractXmlExceptionVectors( node ); + } + else if ( nodeName == "RAW_DATA" ) + { + ExtractXmlRawData( node ); + } + else if ( nodeName == "THREAD_TABLE" ) + { + ExtractXmlThreadTable( node ); + } + } + } + } + + // Primed okay? + success = true; + + // Re-order data based upon write pointer value + if ( RegisterETBRamWritePointer != 0 ) + { + Buffer.Reorder( RegisterETBRamWritePointer ); + } + } + catch ( System.Exception ) + { + } + // + return success; + } + + private void ExtractXmlRegisters( XmlNode aNode ) + { + foreach ( XmlNode node in aNode.ChildNodes ) + { + string nodeName = node.Name.Trim().ToUpper(); + if ( nodeName == "REGISTER" && node.Attributes.Count == 2 ) + { + XmlAttributeCollection attributes = node.Attributes; + // + XmlAttribute attribName = attributes[ "name" ]; + XmlAttribute attribValue = attributes[ "value" ]; + // + if ( attribName != null && !string.IsNullOrEmpty( attribName.Value.Trim() ) && + attribValue != null && !string.IsNullOrEmpty( attribValue.Value.Trim() ) + ) + { + string name = attribName.Value.Trim().ToUpper(); + uint value = uint.Parse( attribValue.Value, System.Globalization.NumberStyles.HexNumber ); + // + TArmRegisterType regType = ETMTextToEnumConverter.ToRegisterType( name ); + switch ( regType ) + { + default: + break; + case TArmRegisterType.EArmReg_ETM_Id: + base.RegisterETMId = value; + break; + case TArmRegisterType.EArmReg_ETM_Control: + base.RegisterETMControl = value; + break; + case TArmRegisterType.EArmReg_ETB_RamWritePointer: + RegisterETBRamWritePointer = value; + break; + } + } + } + } + } + + private void ExtractXmlExceptionVectors( XmlNode aNode ) + { + foreach ( XmlNode node in aNode.ChildNodes ) + { + string nodeName = node.Name.Trim().ToUpper(); + if ( nodeName == "REGISTER" && node.Attributes.Count == 2 ) + { + XmlAttributeCollection attributes = node.Attributes; + // + XmlAttribute attribName = attributes[ "name" ]; + XmlAttribute attribValue = attributes[ "value" ]; + // + if ( attribName != null && !string.IsNullOrEmpty( attribName.Value.Trim() ) && + attribValue != null && !string.IsNullOrEmpty( attribValue.Value.Trim() ) + ) + { + string name = attribName.Value.Trim().ToUpper(); + uint value = uint.Parse( attribValue.Value, System.Globalization.NumberStyles.HexNumber ); + // + TArmExceptionVector exceptionVectorType = ETMTextToEnumConverter.ToExceptionVector( name ); + SetExceptionVector( exceptionVectorType, value ); + } + } + } + } + + private void ExtractXmlThreadTable( XmlNode aNode ) + { + foreach ( XmlNode node in aNode.ChildNodes ) + { + string nodeName = node.Name.Trim().ToUpper(); + if ( nodeName == "THREAD" && node.Attributes.Count == 3 ) + { + XmlAttributeCollection attributes = node.Attributes; + // + XmlAttribute attribName = attributes[ "name" ]; + XmlAttribute attribAddress = attributes[ "address" ]; + XmlAttribute attribId = attributes[ "id" ]; + // + if ( attribName != null && !string.IsNullOrEmpty( attribName.Value.Trim() ) && + attribAddress != null && !string.IsNullOrEmpty( attribAddress.Value.Trim() ) + ) + { + string name = attribName.Value.Trim(); + uint value = uint.Parse( attribAddress.Value, System.Globalization.NumberStyles.HexNumber ); + + // Add the missing colon back in. + if ( name.Contains( ":" ) ) + { + name = name.Replace( ":", "::" ); + } + AddContextIdMapping( value, name ); + } + } + } + } + + private void ExtractXmlRawData( XmlNode aNode ) + { + List lines = new List(); + // + foreach ( XmlNode node in aNode.ChildNodes ) + { + string nodeName = node.Name.Trim().ToUpper(); + if ( nodeName == "DATA" ) + { + string line = node.InnerText; + lines.Add( line ); + } + else + { + break; + } + } + + // Convert strings to bytes + List data = new List(); + foreach ( string line in lines ) + { + int len = line.Length; + if ( len % 2 != 0 ) + { + throw new ETMException( "ERROR: Raw data is corrupt - invalid line length" ); + } + + for ( int i = 0; i < len; i += 2 ) + { + string byteString = line.Substring( i, 2 ); + byte b = System.Convert.ToByte( byteString, 16 ); + data.Add( b ); + } + } + + // Save entire data + base.Buffer.AddRange( data.ToArray() ); + } + #endregion + + #region From System.Object + #endregion + + #region Data members + private ArmETBRegisterCollection iRegistersETB = new ArmETBRegisterCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/Config/ETBEngineConfig.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/Config/ETBEngineConfig.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using DecompressETB.Buffer; +using DecompressETB.State; +using DecompressETB.Types; + +namespace DecompressETB.Config +{ + public class ETBEngineConfig + { + #region Constructors + public ETBEngineConfig() + { + SetExceptionVector( TETBExceptionVector.EReset, 0 ); + SetExceptionVector( TETBExceptionVector.EUndefinedInstruction, 0 ); + SetExceptionVector( TETBExceptionVector.ESWI, 0 ); + SetExceptionVector( TETBExceptionVector.EPrefetchAbort, 0 ); + SetExceptionVector( TETBExceptionVector.EDataAbort, 0 ); + SetExceptionVector( TETBExceptionVector.EIRQ, 0 ); + SetExceptionVector( TETBExceptionVector.EFIQ, 0 ); + } + #endregion + + #region API + // + // Use this to seed the context id to thread name mapping + // + public void SetRegisterContextID( uint aID, string aName ) + { + if ( !iContextIDs.ContainsKey( aID ) ) + { + iContextIDs.Add( aID, aName ); + } + } + + public void SetExceptionVector( TETBExceptionVector aVector, uint aInstruction ) + { + if ( !iExceptionVectors.ContainsKey( aVector ) ) + { + iExceptionVectors.Add( aVector, aInstruction ); + } + else + { + iExceptionVectors[ aVector ] = aInstruction; + } + } + + public string GetContextID( uint aID ) + { + string ret = "Unknown Thread"; + // + if ( iContextIDs.ContainsKey( aID ) ) + { + ret = iContextIDs[ aID ]; + } + // + return ret; + } + + internal uint GetExceptionVector( TETBExceptionVector aVector ) + { + uint ret = iExceptionVectors[ aVector ]; + return ret; + } + + internal TETBExceptionVector MapToExceptionVector( uint aAddress ) + { + System.Diagnostics.Debug.Assert( IsExceptionVector( aAddress ) ); + // + TETBExceptionVector ret = TETBExceptionVector.EUndefinedInstruction; + // + uint baseAddress = (uint) ExceptionVectorLocation; + uint delta = aAddress - baseAddress; + switch ( delta ) + { + case (uint) TETBExceptionVector.EReset: + case (uint) TETBExceptionVector.EUndefinedInstruction: + case (uint) TETBExceptionVector.ESWI: + case (uint) TETBExceptionVector.EPrefetchAbort: + case (uint) TETBExceptionVector.EDataAbort: + case (uint) TETBExceptionVector.EIRQ: + case (uint) TETBExceptionVector.EFIQ: + ret = (TETBExceptionVector) delta; + break; + default: + throw new NotSupportedException( "Specified address is an unsupported vector location" ); + break; + } + // + return ret; + } + + internal bool IsExceptionVector( uint aAddress ) + { + bool ret = false; + + // Get current vector setting and also the vector address range + TETBExceptionVectorLocation type = ExceptionVectorLocation; + uint min = (uint) type; + uint max = min + (uint) TETBExceptionVector.EFIQ; + // + ret = ( aAddress >= min && aAddress <= max ); + // + return ret; + } + #endregion + + #region Properties + public bool Verbose + { + get { return iVerbose; } + set { iVerbose = value; } + } + + public uint ETMControlRegister + { + get { return iETMControlRegister; } + set { iETMControlRegister = value; } + } + + public uint SystemControlRegister + { + get { return iSystemControlRegister; } + set { iSystemControlRegister = value; } + } + + public int ContextIDSize + { + get + { + // Bits [15:14] define the context id size. + uint ret = iETMControlRegister & 0xC000; // b11000000 00000000 + ret >>= 14; + if ( ret > 0 ) + { + ++ret; + } + return (int) ret; + } + } + + public TETBExceptionVectorLocation ExceptionVectorLocation + { + get + { + TETBExceptionVectorLocation ret = TETBExceptionVectorLocation.ENormal; + uint mask = (uint) ( 1 << 13 ); + if ( ( iSystemControlRegister & mask ) == mask ) + { + ret = TETBExceptionVectorLocation.EHigh; + } + return ret; + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + private bool iVerbose = false; + private uint iETMControlRegister = 0xC000; // 4 byte context id + private uint iSystemControlRegister = 1 << 13; + private Dictionary iExceptionVectors = new Dictionary(); + private Dictionary iContextIDs = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/Engine/ETMEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/Engine/ETMEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianETMLib.Common.Buffer; +using SymbianETMLib.Common.State; +using SymbianETMLib.Common.Config; +using SymbianETMLib.Common.Utilities; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Engine; +using SymbianETMLib.ETB.Config; +using SymbianETMLib.ETB.Buffer; + +namespace SymbianETMLib.ETB.Engine +{ + public class ETBEngine : ETEngineBase + { + #region Constructors + public ETBEngine( ETBBuffer aBuffer, ETConfigBase aConfig ) + : base( aBuffer, aConfig ) + { + } + #endregion + + #region API + #endregion + + #region Properties + public new ETBBuffer Buffer + { + get { return base.Buffer as ETBBuffer; } + } + + public new ETBConfig Config + { + get { return base.Config as ETBConfig; } + } + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/StackRecon/ETBStack.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/StackRecon/ETBStack.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,232 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianETMLib.Common.Engine; +using SymbianETMLib.Common.Config; +using SymbianETMLib.Common.Types; +using SymbianETMLib.Common.Utilities; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; + +namespace SymbianETMLib.ETB.StackRecon +{ + internal class ETBStack + { + #region Constructors + public ETBStack( ETEngineBase aEngine, uint aContextId ) + { + iEngine = aEngine; + iContextId = aContextId; + } + #endregion + + #region API + internal void HandleBranch( ETMBranch aBranch ) + { + TETBStackEntry last = LastEntry; + if ( last != null ) + { + TETBStackEntry entry = new TETBStackEntry( aBranch ); + // + if ( last.SymbolAddress == entry.SymbolAddress ) + { + if ( entry.SymbolOffset > last.SymbolOffset ) + { + // Internal branch? E.g. if statement, or loop? + } + else + { + PushBranch( entry ); + } + } + else if ( aBranch.SymbolAddressOffset == 0 && aBranch.Symbol != null ) + { + // Guess: calling a new function + PushBranch( entry ); + } + else + { + bool save = true; + + // Check if we have branched back to an earlier function without + // popping back through the call stack + int count = iEntries.Count; + for ( int i = count - 2; i >= 0; i-- ) + { + last = iEntries[ i ]; + if ( last.SymbolAddress == entry.SymbolAddress ) + { + if ( entry.SymbolOffset > last.SymbolOffset ) + { + // We appear to have jumped back to a calling function - so + // discard later items on stack. + int deleteCount = count - i - 1; + iEntries.RemoveRange( i + 1, deleteCount ); + save = false; + break; + } + } + } + + if ( save ) + { + PushBranch( entry ); + } + } + } + else + { + PushBranch( aBranch ); + } + } + #endregion + + #region Properties + public uint ContextId + { + get { return iContextId; } + } + + public string ContextName + { + get { return iEngine.Config.GetContextID( iContextId ); } + } + #endregion + + #region Internal class + private class TETBStackEntry + { + #region Constructors + public TETBStackEntry( ETMBranch aBranch ) + { + iBranch = aBranch; + } + + #endregion + + #region API + public void Print() + { + string text = iBranch.ToString( iDepth ); + System.Console.WriteLine( text ); + } + #endregion + + #region Properties + public uint SymbolAddress + { + get + { + uint ret = 0; + // + if ( iBranch.Symbol != null ) + { + ret = (uint) iBranch.Symbol.Address; + } + // + return ret; + } + } + + public uint SymbolOffset + { + get { return iBranch.SymbolAddressOffset; } + } + + public int Depth + { + get { return iDepth; } + set { iDepth = value; } + } + + public bool IsUnknown + { + get + { + return ( iBranch.Symbol == null ); + } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder t = new StringBuilder(); + t.AppendFormat( "0x{0} [+{1:x4}] {2}", iBranch.Address.AddressHex, iBranch.SymbolAddressOffset, iBranch.SymbolText ); + return t.ToString(); + } + #endregion + + #region Data members + private readonly ETMBranch iBranch; + private int iDepth = 0; + #endregion + } + #endregion + + #region Internal methods + private void PushBranch( TETBStackEntry aEntry ) + { + if ( aEntry.IsUnknown == false ) + { + int lastDepth = 0; + // + TETBStackEntry lastEntry = LastEntry; + if ( lastEntry != null ) + { + lastDepth = lastEntry.Depth + 1; + } + // + aEntry.Depth = lastDepth; + } + iEntries.Add( aEntry ); + aEntry.Print(); + } + + private void PushBranch( ETMBranch aBranch ) + { + TETBStackEntry entry = new TETBStackEntry( aBranch ); + PushBranch( entry ); + } + + private TETBStackEntry LastEntry + { + get + { + TETBStackEntry ret = null; + // + int count = iEntries.Count; + if ( count > 0 ) + { + ret = iEntries[ count - 1 ]; + } + // + return ret; + } + } + #endregion + + #region Data members + private readonly ETEngineBase iEngine; + private readonly uint iContextId; + private List iEntries = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/StackRecon/ETBStackReconManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/ETB/StackRecon/ETBStackReconManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianETMLib.Common.Engine; +using SymbianETMLib.Common.Types; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Exceptions; + +namespace SymbianETMLib.ETB.StackRecon +{ + public class ETBStackReconManager + { + #region Constructors + public ETBStackReconManager( ETEngineBase aEngine ) + { + iEngine = aEngine; + iEngine.Branch += new ETEngineBase.BranchHandler( ETB_Branch ); + iEngine.ContextSwitch += new ETEngineBase.ContextSwitchHandler( ETB_ContextSwitch ); + + // Make the initial "unknown" context id stack. + SwitchContext( 0 ); + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Event handlers + private void ETB_ContextSwitch( uint aContextId, string aThreadName ) + { + // Make sure we're using the new current stack + SwitchContext( aContextId ); + } + + private void ETB_Branch( ETMBranch aBranch ) + { + if ( iCurrentStack != null ) + { + iCurrentStack.HandleBranch( aBranch ); + } + } + #endregion + + #region Internal methods + private void SwitchContext( uint aId ) + { + if ( !iStacks.ContainsKey( aId ) ) + { + ETBStack stack = new ETBStack( iEngine, aId ); + iStacks.Add( aId, stack ); + } + // + iCurrentStack = iStacks[ aId ]; + } + #endregion + + #region Data members + private readonly ETEngineBase iEngine; + private ETBStack iCurrentStack = null; + private Dictionary iStacks = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "SymbianETMLib" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "SymbianETMLib" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "05e83282-1739-4491-93cf-aa0d8c3c0761" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/SymbianETMLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/SymbianETMLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,123 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {4F251D40-F9D0-4807-80AA-81A66A648D56} + Library + Properties + SymbianETMLib + SymbianETMLib + v2.0 + 512 + + + + + + + true + full + false + bin\Debug\ + TRACE;DEBUG + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {A041EDFE-A120-4100-A0A6-FB1984D80815} + SymbianCodeLib + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/SymbianETMLib.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/SymbianETMLib.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,6 @@ + + + C:\Tool Demo Files\2. Crash Data\ETB\Data5 + -x a1.xml -s devlon70_rnd_imaker.rom.symbol -d -i devlon70_rnd_imaker.fpsx + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Content/SIContent.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Content/SIContent.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,377 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.ComponentModel; +using System.Threading; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.PluginManager; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Header; +using SymbianImageLib.Common.Streams; +using SymbianImageLib.Common.Factory; + +namespace SymbianImageLib.Common.Content +{ + public abstract class SIContent : DisposableObject, ITracer + { + #region Enumerations + public enum TDecompressionEvent + { + EEventDecompressionStarting = 0, + EEventDecompressionProgress, + EEventDecompressionComplete + } + #endregion + + #region Delegates & events + public delegate void DecompressionEventHandler( TDecompressionEvent aEvent, SIContent aFile, object aData ); + public event DecompressionEventHandler DecompressionEvent; + #endregion + + #region Constructors + protected SIContent( SIImage aImage ) + { + iImage = aImage; + } + #endregion + + #region Framework API + public abstract TSymbianCompressionType CompressionType + { + get; + } + + public abstract string FileName + { + get; + } + + public abstract uint FileSize + { + get; + } + + public abstract uint ContentSize + { + get; + } + + public virtual bool IsRelocationSupported + { + get { return true; } + } + + public virtual TCheckedUid Uid + { + get { return new TCheckedUid(); } + } + + public virtual byte[] GetAllData() + { + return new byte[ 0 ]; + } + + public virtual uint ProvideDataUInt32( uint aAddress ) + { + uint ret = 0; + // + if ( IsContentPrepared == false ) + { + // Cannot provide data if we've not prepared it yet + } + else if ( iDecompressionException == false ) + { + WaitForAsyncOperationCompletion(); + uint resolvedAddress = FixupAddress( aAddress ); + ret = DoProvideDataUInt32( resolvedAddress ); + } + // + return ret; + } + + public virtual ushort ProvideDataUInt16( uint aAddress ) + { + ushort ret = 0; + // + if ( IsContentPrepared == false ) + { + // Cannot provide data if we've not prepared it yet + } + else if ( iDecompressionException == false ) + { + WaitForAsyncOperationCompletion(); + uint resolvedAddress = FixupAddress( aAddress ); + ret = DoProvideDataUInt16( resolvedAddress ); + } + // + return ret; + } + + public virtual bool IsCode + { + get { return true; } + } + + protected virtual void OnRelocationAddressChanged( uint aOld, uint aNew ) + { + } + + protected virtual void DoDecompress() + { + } + + protected virtual uint DoProvideDataUInt32( uint aTranslatedAddress ) + { + throw new NotImplementedException(); + } + + protected virtual ushort DoProvideDataUInt16( uint aTranslatedAddress ) + { + throw new NotImplementedException(); + } + + protected abstract bool GetIsContentPrepared(); + #endregion + + #region API + public void PrepareContent( TSynchronicity aSynchronicity ) + { + if ( CompressionType == TSymbianCompressionType.ENone ) + { + // No content preparation required, so just indicate completion + // immediately. + ReportDecompressionEvent( TDecompressionEvent.EEventDecompressionStarting ); + ReportDecompressionEvent( TDecompressionEvent.EEventDecompressionComplete ); + } + else + { + switch ( aSynchronicity ) + { + case TSynchronicity.ESynchronous: + RunDecompressor(); + break; + case TSynchronicity.EAsynchronous: + // Must take the lock to either create or destroy waiter + lock ( iWaiterSyncRoot ) + { + if ( iWaiter == null ) + { + iWaiter = new AutoResetEvent( false ); + ThreadPool.QueueUserWorkItem( new WaitCallback( RunDecompressionInBackgroundThread ), null ); + break; + } + else + { + // Wait is active, so we are presumably busy... + throw new Exception( "Content is already in preparation" ); + } + } + } + } + } + + public uint RelocationAddress + { + get { return iRelocationAddress; } + set + { + if ( value != iRelocationAddress ) + { + uint old = iRelocationAddress; + iRelocationAddress = value; + OnRelocationAddressChanged( old, iRelocationAddress ); + } + } + } + + public virtual bool IsContentPrepared + { + get + { + bool ret = true; + // + if ( CompressionType != TSymbianCompressionType.ENone ) + { + ret = GetIsContentPrepared(); + } + // + return ret; + } + } + #endregion + + #region Properties + public SIImage Image + { + get { return iImage; } + } + + public SIHeader ImageHeader + { + get { return iImage.Header; } + } + + internal SIStream ImageStream + { + get + { + return iImage.Stream; + } + set { iImage.Stream = value; } + } + #endregion + + #region Event handlers + private void RunDecompressionInBackgroundThread( object aNotUsed ) + { + System.Diagnostics.Debug.Assert( iWaiter != null ); + + // Call derived class to do decompression. Must not throw. + RunDecompressor(); + + // Must do this last so that anybody that is waiting for code to become + // ready is resumed. + // + // Also, we might have been disposed of as a result of the "completion" callback + // so in that case, we will have already set the auto-reset-event during the cleanup. + if ( iWaiter != null ) + { + iWaiter.Set(); + } + } + #endregion + + #region Internal methods + protected void ReportDecompressionEvent( TDecompressionEvent aEvent ) + { + ReportDecompressionEvent( aEvent, null ); + } + + protected void ReportDecompressionEvent( TDecompressionEvent aEvent, object aData ) + { + if ( DecompressionEvent != null ) + { + DecompressionEvent( aEvent, this, aData ); + } + } + + private void RunDecompressor() + { + Trace( "[SIImageContent] RunDecompressor() - START - this: " + FileName ); + ReportDecompressionEvent( TDecompressionEvent.EEventDecompressionStarting ); + // + try + { + DoDecompress(); + } + catch ( Exception e ) + { + Trace( "[SIImageContent] RunDecompressor() - Exception - this: {0}, message: {1}", this.FileName, e.Message ); + Trace( "[SIImageContent] RunDecompressor() - Exception - this: {0}, stack : {1}", this.FileName, e.StackTrace ); + iDecompressionException = true; + } + + // Doing this might cause the disposal of the object + ReportDecompressionEvent( TDecompressionEvent.EEventDecompressionComplete ); + Trace( "[SIImageContent] RunDecompressor() - END - this: " + FileName ); + } + + private void WaitForAsyncOperationCompletion() + { + // If the worker doesn't exist then we've already completed the operation + if ( iWaiter != null ) + { + // Just wait on the auto-reset event. If it's already been signalled, then + // we will continue immediately. + iWaiter.WaitOne(); + + // Must take the lock to either create or destroy waiter + lock ( iWaiterSyncRoot ) + { + iWaiter.Close(); + iWaiter = null; + } + } + } + + private uint FixupAddress( uint aAddress ) + { + uint ret = aAddress - iRelocationAddress; + return ret; + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + iImage.Trace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iImage.Trace( aFormat, aParams ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iImage.Remove( this ); + // + if ( iWaiter != null ) + { + iWaiter.Set(); + iWaiter.Close(); + iWaiter = null; + } + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return FileName; + } + + public override int GetHashCode() + { + return FileName.GetHashCode(); + } + #endregion + + #region Data members + private readonly SIImage iImage; + private uint iRelocationAddress = 0; + private bool iDecompressionException = false; + private AutoResetEvent iWaiter = null; + private object iWaiterSyncRoot = new object(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Content/SIContentList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Content/SIContentList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; + +namespace SymbianImageLib.Common.Content +{ + public class SIContentList : IEnumerable + { + #region Constructors + public SIContentList() + { + } + #endregion + + #region API + public bool TryToGetFile( string aFileName, out SIContent aFile ) + { + aFile = null; + bool ret = iList.Contains( aFileName ); + if ( ret ) + { + aFile = iList[ aFileName ]; + } + return ret; + } + + public bool Contains( SIContent aFile ) + { + return iList.Contains( aFile ); + } + + public void Add( SIContent aFile ) + { + if ( iList.Contains( aFile ) ) + { + throw new ArgumentException( "Specified file is already part of the list" ); + } + iList.Add( aFile ); + } + + public void Remove( SIContent aFile ) + { + if ( iList.Contains( aFile ) ) + { + iList.Remove( aFile ); + } + } + #endregion + + #region Properties + public int Count + { + get { return iList.Count; } + } + + public SIContent this[ int aIndex ] + { + get { return iList[ aIndex ]; } + } + + public SIContent this[ string aFileName ] + { + get + { + string key = aFileName.ToUpper(); + return iList[ key ]; + } + } + #endregion + + #region Internal class + private class FileList : KeyedCollection + { + #region Constructors + public FileList() + { + } + #endregion + + #region From KeyedCollection + protected override string GetKeyForItem( SIContent aItem ) + { + return aItem.FileName.ToUpper(); + } + #endregion + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( SIContent file in iList ) + { + yield return file; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( SIContent file in iList ) + { + yield return file; + } + } + #endregion + + #region Data members + private FileList iList = new FileList(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Factory/SIFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Factory/SIFactory.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Tracer; +using SymbianImageLib.Common.Image; + +namespace SymbianImageLib.Common.Factory +{ + public abstract class SIFactory + { + #region Constructors + protected SIFactory() + { + } + #endregion + + #region Framework API + public abstract SIImage CreateImage( ITracer aTracer, Stream aStream, string aName ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Header/SIHeader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Header/SIHeader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Tracer; +using SymbianImageLib.Common.Image; +using SymbianStructuresLib.Compression.Common; + +namespace SymbianImageLib.Common.Header +{ + public abstract class SIHeader : ITracer + { + #region Constructors + protected SIHeader( SIImage aImage ) + { + iImage = aImage; + } + #endregion + + #region Framework API + public abstract TSymbianCompressionType CompressionType + { + get; + } + + public abstract uint HeaderSize + { + get; + } + #endregion + + #region Properties + public SIImage Image + { + get { return iImage; } + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + iImage.Trace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iImage.Trace( aFormat, aParams ); + } + #endregion + + #region Data members + private readonly SIImage iImage; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Image/SIImage.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Image/SIImage.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,243 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.ComponentModel; +using System.Threading; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.PluginManager; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.Common.Content; +using SymbianImageLib.Common.Header; +using SymbianImageLib.Common.Streams; +using SymbianImageLib.Common.Factory; + +namespace SymbianImageLib.Common.Image +{ + public abstract class SIImage : DisposableObject, ITracer, IEnumerable + { + #region Factory + public static SIImage New( ITracer aTracer, string aFileName ) + { + return SIImage.New( aTracer, new FileInfo( aFileName ) ); + } + + public static SIImage New( ITracer aTracer, FileInfo aFileInfo ) + { + SIImage ret = null; + // + if ( aFileInfo.Exists ) + { + Stream fileStream = aFileInfo.OpenRead(); + try + { + // If creating the image succeeds then we transfer ownership + // of the file stream + ret = SIImage.New( aTracer, fileStream, aFileInfo.FullName ); + if ( ret == null ) + { + fileStream.Close(); + } + } + catch( Exception ) + { + fileStream.Close(); + } + } + // + return ret; + } + + public static SIImage New( ITracer aTracer, Stream aStream, string aName ) + { + SIImage ret = null; + // + PluginManager imageFactories = new PluginManager(); + imageFactories.LoadFromCallingAssembly(); + foreach ( SIFactory factory in imageFactories ) + { + ret = factory.CreateImage( aTracer, aStream, aName ); + if ( ret != null ) + { + break; + } + } + // + return ret; + } + #endregion + + #region Constructors + internal SIImage( ITracer aTracer, SIStream aStream, string aName ) + { + iName = aName; + iTracer = aTracer; + iStream = aStream; + } + #endregion + + #region Framework API + public abstract SIHeader Header + { + get; + } + #endregion + + #region API + public bool Contains( SIContent aContent ) + { + lock ( iContentList ) + { + bool ret = iContentList.Contains( aContent ); + return ret; + } + } + + internal void Remove( SIContent aContent ) + { + lock ( iContentList ) + { + iContentList.Remove( aContent ); + } + } + #endregion + + #region Properties + public int Count + { + get + { + lock ( iContentList ) + { + return iContentList.Count; + } + } + } + + public TSymbianCompressionType CompressionType + { + get { return Header.CompressionType; } + } + + public SIContent this[ int aIndex ] + { + get + { + lock ( iContentList ) + { + return iContentList[ aIndex ]; + } + } + } + + public SIContent this[ string aFileName ] + { + get + { + lock ( iContentList ) + { + return iContentList[ aFileName ]; + } + } + } + + internal SIStream Stream + { + get { return iStream; } + set + { + System.Diagnostics.Debug.Assert( iStream != value ); + // + if ( iStream != null ) + { + iStream.Close(); + } + iStream = value; + } + } + + public string Name + { + get { return iName; } + } + #endregion + + #region Internal methods + protected void RegisterFile( SIContent aFile ) + { + iContentList.Add( aFile ); + } + + private SIContentList FileList + { + get { return iContentList; } + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + iTracer.Trace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iTracer.Trace( aFormat, aParams ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iStream != null ) + { + iStream.Close(); + iStream = null; + } + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return iContentList.GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return iContentList.GetEnumerator(); + } + #endregion + + #region Data members + private readonly ITracer iTracer; + private readonly string iName; + private SIStream iStream = null; + private SIContentList iContentList = new SIContentList(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Streams/SIMemoryStream.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Streams/SIMemoryStream.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianImageLib.Common.Header; +using SymbianStructuresLib.Compression.Common; + +namespace SymbianImageLib.Common.Streams +{ + internal class SIMemoryStream : SIStream + { + #region Constructors + public SIMemoryStream( uint aSize ) + { + iData = new byte[ aSize ]; + base.SwitchStream( new MemoryStream( iData ), TOwnershipType.EOwned ); + } + #endregion + + #region From SymbianImageStream + #endregion + + #region API + #endregion + + #region Properties + public byte[] Data + { + get { return iData; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly byte[] iData; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Streams/SIStream.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Common/Streams/SIStream.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,171 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Streams; +using SymbianImageLib.Common.Header; +using SymbianStructuresLib.Compression.Common; + +namespace SymbianImageLib.Common.Streams +{ + internal class SIStream : DisposableObject + { + #region Enumerations + public enum TOwnershipType + { + EOwned = 0, + EOwnedExternally + } + #endregion + + #region Constructors + public SIStream() + : this( null, TOwnershipType.EOwned ) + { + } + + public SIStream( Stream aStream ) + : this( aStream, TOwnershipType.EOwned ) + { + } + + public SIStream( Stream aStream, TOwnershipType aType ) + { + SwitchStream( aStream, aType ); + } + #endregion + + #region Framework API + public virtual bool InRange( long aPosition ) + { + bool ret = ( aPosition >= 0 && aPosition < this.Length ); + return ret; + } + + public virtual void Seek( long aPosition, SeekOrigin aOrigin ) + { + iStream.Seek( aPosition, aOrigin ); + } + + public virtual int Read( byte[] aBuffer, int aOffset, int aCount ) + { + int ret = iStream.Read( aBuffer, aOffset, aCount ); + return ret; + } + + public virtual void Write( byte[] aBuffer ) + { + Write( aBuffer, 0, aBuffer.Length ); + } + + public virtual void Write( SIStream aFrom, int aCount ) + { + Write( (Stream) aFrom, aCount ); + } + + public virtual void Write( Stream aFrom, int aCount ) + { + byte[] temp = new byte[ aCount ]; + int ret = aFrom.Read( temp, 0, aCount ); + if ( ret != aCount ) + { + throw new Exception( "Unable to read required number of bytes from stream" ); + } + Write( temp, 0, aCount ); + } + + public virtual void Write( byte[] aBuffer, int aOffset, int aCount ) + { + iStream.Write( aBuffer, aOffset, aCount ); + } + #endregion + + #region API + public void SwitchStream( Stream aStream, TOwnershipType aType ) + { + if ( iStream != null ) + { + if ( iOwnership == TOwnershipType.EOwned ) + { + iStream.Dispose(); + iStream = null; + iLength = 0; + } + } + // + iStream = aStream; + iOwnership = aType; + // + if ( iStream != null ) + { + // Cache this because calling it is very expensive. + iLength = iStream.Length; + } + } + + public void Close() + { + base.Dispose(); + } + + public void Seek( long aPosition ) + { + Seek( aPosition, SeekOrigin.Begin ); + } + + public SymbianStreamReaderLE CreateReader() + { + return SymbianStreamReaderLE.New( iStream ); + } + + public SymbianStreamReaderLE CreateReader( SymbianStreamReaderLE.TCloseOperation aCloseOperation ) + { + return SymbianStreamReaderLE.New( iStream, aCloseOperation ); + } + #endregion + + #region Properties + public long Length + { + get { return iLength; } + } + #endregion + + #region Operators + public static explicit operator Stream( SIStream aStream ) + { + return aStream.InternalStream; + } + #endregion + + #region Internal methods + protected Stream InternalStream + { + get { return iStream; } + } + #endregion + + #region Data members + private Stream iStream = null; + private TOwnershipType iOwnership = TOwnershipType.EOwned; + private long iLength = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/E32Image/Content/SIContentE32Image.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/E32Image/Content/SIContentE32Image.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,326 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.Streams; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.Common.Content; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Streams; +using SymbianImageLib.E32Image.Image; +using SymbianImageLib.E32Image.Header; + +namespace SymbianImageLib.E32Image.Content +{ + public class SIContentE32Image : SIContent + { + #region Constructors + internal SIContentE32Image( SymbianImageE32 aImage, string aName, uint aSize, long aImageContentOffset ) + : base( aImage ) + { + iName = aName; + iFileSize = aSize; + iFileSize = aSize; + } + #endregion + + #region From SymbianImageContentFile + public override TSymbianCompressionType CompressionType + { + get { return base.ImageHeader.CompressionType; } + } + + public override string FileName + { + get { return iName; } + } + + public override uint FileSize + { + get { return iFileSize; } + } + + public override uint ContentSize + { + get + { + uint ret = 0; + // + lock ( iCodeSyncRoot ) + { + if ( iCode != null ) + { + ret = (uint) iCode.Length; + } + } + // + return ret; + } + } + + public override TCheckedUid Uid + { + get { return ImageHeader.Uid; } + } + + public override byte[] GetAllData() + { + lock ( iCodeSyncRoot ) + { + return iCode; + } + } + + protected override uint DoProvideDataUInt32( uint aTranslatedAddress ) + { + uint ret = 0; + // + if ( iStream != null ) + { + using ( SymbianStreamReaderLE reader = SymbianStreamReaderLE.New( iStream, SymbianStreamReaderLE.TCloseOperation.ENone ) ) + { + reader.Seek( aTranslatedAddress ); + ret = reader.ReadUInt32(); + } + } + // + return ret; + } + + protected override ushort DoProvideDataUInt16( uint aTranslatedAddress ) + { + ushort ret = 0; + // + if ( iStream != null ) + { + using ( SymbianStreamReaderLE reader = SymbianStreamReaderLE.New( iStream, SymbianStreamReaderLE.TCloseOperation.ENone ) ) + { + reader.Seek( aTranslatedAddress ); + ret = reader.ReadUInt16(); + } + } + // + return ret; + } + + protected override void DoDecompress() + { + lock ( iCodeSyncRoot ) + { + if ( iCode == null ) + { + TSymbianCompressionType type = this.CompressionType; + switch ( type ) + { + default: + case TSymbianCompressionType.ENone: + // NB: This has not yet been observed in reality + DecompressNone(); + break; + case TSymbianCompressionType.EDeflate: + case TSymbianCompressionType.EBytePair: + { + using ( SymbianDecompressor decompressor = SymbianDecompressor.NewByType( type ) ) + { + // + switch ( type ) + { + case TSymbianCompressionType.EBytePair: + DecompressBytePair( decompressor ); + break; + case TSymbianCompressionType.EDeflate: + DecompressDeflate( decompressor ); + break; + } + } + break; + } + } + + if ( iCode != null ) + { + if ( iStream != null ) + { + iStream.Dispose(); + iStream = null; + } + // + iStream = new MemoryStream( iCode ); + } + } + } + } + + protected override bool GetIsContentPrepared() + { + lock ( iCodeSyncRoot ) + { + return ( iCode != null ); + } + } + #endregion + + #region Properties + public new SIHeaderE32Image ImageHeader + { + get { return (SIHeaderE32Image) base.ImageHeader; } + } + + public new SymbianImageE32 Image + { + get { return (SymbianImageE32) base.Image; } + } + #endregion + + #region Internal methods + private byte[] DecompressCommon( SymbianDecompressor aDecompressor, int aSeekOffset, int aAmountToRead, int aMaximumOutputSize, out int aNumberOfInputBytesRead ) + { + System.Diagnostics.Debug.WriteLine( "[SIContentE32Image] DecompressCommon - START - " + base.Image.Name + " # " + System.Threading.Thread.CurrentThread.Name ); + // + uint imageContentSize = iFileSize; + uint orighdrsz = ImageHeader.TotalSize; + uint remainder = imageContentSize - orighdrsz; + // + using ( SymbianStreamReaderLE reader = base.ImageStream.CreateReader( SymbianStreamReaderLE.TCloseOperation.EResetPosition ) ) + { + long codePos = Image.ContentOffsetWithinDataStream + orighdrsz + aSeekOffset; + reader.Seek( codePos ); + // + byte[] input = reader.ReadBytes( aAmountToRead ); + byte[] output = new byte[ aMaximumOutputSize ]; + + // The decompressor tells us how many bytes of output it really created. + int numberOfBytesCreated = aDecompressor.DecompressImage( input, output, out aNumberOfInputBytesRead ); + + // We can then return that to the callee. + byte[] ret = new byte[ numberOfBytesCreated > 0 ? numberOfBytesCreated : 0 ]; + if ( numberOfBytesCreated > 0 ) + { + Array.Copy( output, ret, numberOfBytesCreated ); + } + // + System.Diagnostics.Debug.WriteLine( "[SIContentE32Image] DecompressCommon - END - " + base.Image.Name + " # " + System.Threading.Thread.CurrentThread.Name ); + // + return ret; + } + } + + private void DecompressNone() + { + uint imageContentSize = iFileSize; + uint orighdrsz = ImageHeader.TotalSize; + uint uncompressedSize = ImageHeader.UncompressedSize; + + using ( SymbianStreamReaderLE reader = base.ImageStream.CreateReader( SymbianStreamReaderLE.TCloseOperation.EResetPosition ) ) + { + long codePos = Image.ContentOffsetWithinDataStream + orighdrsz; + reader.Seek( codePos ); + // + lock ( iCodeSyncRoot ) + { + iCode = reader.ReadBytes( (int) uncompressedSize ); + } + } + } + + private void DecompressBytePair( SymbianDecompressor aDecompressor ) + { + int inputBytesRead = 0; + // + uint imageContentSize = iFileSize; + uint orighdrsz = ImageHeader.TotalSize; + uint uncompressedSize = ImageHeader.UncompressedSize; + + // First decompress the code + byte[] code = DecompressCommon( aDecompressor, 0, (int) ( imageContentSize - orighdrsz ), (int) uncompressedSize, out inputBytesRead ); + if ( code.Length < ImageHeader.CodeSize ) + { + throw new Exception( "E32Image bytepair decompression did not provide enough code" ); + } + + // Now get the data + int remainder = (int) ( uncompressedSize - inputBytesRead ); + byte[] data = DecompressCommon( aDecompressor, inputBytesRead, remainder, (int) uncompressedSize, out inputBytesRead ); + + // We should have read all the decompressed data + int totalAmountOfDecompressedDataSupplied = data.Length + code.Length; + if ( totalAmountOfDecompressedDataSupplied != uncompressedSize ) + { + throw new Exception( "E32Image bytepair decompression did not supply enough decompressed output" ); + } + + lock ( iCodeSyncRoot ) + { + iCode = new byte[ uncompressedSize ]; + Array.Copy( code, iCode, code.Length ); + Array.Copy( data, 0, iCode, code.Length, data.Length ); + } + } + + private void DecompressDeflate( SymbianDecompressor aDecompressor ) + { + int inputBytesRead = 0; + // + uint imageContentSize = iFileSize; + uint orighdrsz = ImageHeader.TotalSize; + uint uncompressedSize = ImageHeader.UncompressedSize; + + byte[] combinedDataAndCode = DecompressCommon( aDecompressor, 0, (int) ( imageContentSize - orighdrsz ), (int) uncompressedSize, out inputBytesRead ); + if ( combinedDataAndCode.Length != uncompressedSize ) + { + throw new Exception( "E32Image inflate decompression did not supply enough decompressed output" ); + } + + lock ( iCodeSyncRoot ) + { + iCode = combinedDataAndCode; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iStream != null ) + { + iStream.Dispose(); + iStream = null; + } + } + } + #endregion + + #region Data members + private readonly string iName; + private readonly uint iFileSize; + private byte[] iCode = null; + private object iCodeSyncRoot = new object(); + private MemoryStream iStream = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/E32Image/Exceptions/SIExceptionsE32Image.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/E32Image/Exceptions/SIExceptionsE32Image.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianImageLib.E32Image.Exceptions +{ + public class E32ImageNotSupportedException : NotSupportedException + { + #region Constructors + public E32ImageNotSupportedException( string aMessage ) + : base( aMessage ) + { + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/E32Image/Factory/SIFactoryE32Image.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/E32Image/Factory/SIFactoryE32Image.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Tracer; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Factory; +using SymbianImageLib.Common.Streams; +using SymbianImageLib.E32Image.Image; + +namespace SymbianImageLib.E32Image.Factory +{ + internal class SIFactoryE32Image : SIFactory + { + #region Constructors + public SIFactoryE32Image() + { + } + #endregion + + #region From SymbianImageFactory + public override SIImage CreateImage( ITracer aTracer, Stream aStream, string aName ) + { + SIImage ret = null; + // + bool isSupported = SymbianImageE32.IsImageFile( aStream ); + if ( isSupported ) + { + ret = new SymbianImageE32( aName, (uint) aStream.Length, aStream.Position, new SIStream( aStream ), aTracer ); + } + // + return ret; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/E32Image/Header/SIHeaderE32Image.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/E32Image/Header/SIHeaderE32Image.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,244 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Tracer; +using SymbianUtils.Streams; +using SymbianUtils.Strings; +using SymbianStructuresLib.Version; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Security; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.Common.Header; +using SymbianImageLib.Common.Image; +using SymbianImageLib.E32Image.Exceptions; + +namespace SymbianImageLib.E32Image.Header +{ + public class SIHeaderE32Image : SIHeader + { + #region Constructors + internal SIHeaderE32Image( SIImage aImage, SymbianStreamReaderLE aReader ) + : base( aImage ) + { + long startPos = aReader.Position; + // + iUids = new TCheckedUid( aReader ); + iSignature = aReader.ReadUInt32(); + // + if ( iSignature != KExpectedSignatureUInt32 ) // 'EPOC' + { + throw new E32ImageNotSupportedException( "Invalid signature" ); + } + // + iHeaderCrc = aReader.ReadUInt32(); + iModuleVersion = aReader.ReadUInt32(); + iCompressionType = SIHeaderE32Image.ReadCompressionType( aReader ); + iToolsVersion = new TVersion( aReader ); + iTimeLo = aReader.ReadUInt32(); + iTimeHi = aReader.ReadUInt32(); + iFlags = aReader.ReadUInt32(); + // + iCodeSize = aReader.ReadInt32(); + iDataSize = aReader.ReadInt32(); + iHeapSizeMin = aReader.ReadInt32(); + iHeapSizeMax = aReader.ReadInt32(); + iStackSize = aReader.ReadInt32(); + iBssSize = aReader.ReadInt32(); + // + iEntryPoint = aReader.ReadUInt32(); + iCodeBase = aReader.ReadUInt32(); + iDataBase = aReader.ReadUInt32(); + // + iDllRefTableCount = aReader.ReadInt32(); + iExportDirOffset = aReader.ReadUInt32(); + iExportDirCount = aReader.ReadInt32(); + // + iTextSize = aReader.ReadInt32(); + iCodeOffset = aReader.ReadUInt32(); + iDataOffset = aReader.ReadUInt32(); + iImportOffset = aReader.ReadUInt32(); + iCodeRelocOffset = aReader.ReadUInt32(); + iDataRelocOffset = aReader.ReadUInt32(); + // + iProcessPriority = aReader.ReadInt16(); + // + iCpuIdentifier = aReader.ReadUInt16(); + // + iUncompressedSize = aReader.ReadUInt32(); + // + iS = new SSecurityInfo( aReader ); + iExceptionDescriptor = aReader.ReadUInt32(); + iSpare2 = aReader.ReadUInt16(); + iExportDescSize = aReader.ReadUInt16(); + iExportDescType = aReader.ReadUInt8(); + // + iHeaderSize = (uint) ( aReader.Position - startPos ); + } + #endregion + + #region Constants + public const int KMinimumSize = 16 + 4; // Enough to read UIDs + signature + #endregion + + #region API + public static bool IsSymbianImageHeader( byte[] aHeader ) + { + // We expect to see 16 bytes (3 x UID, 1 x UID checksum) and then + // the magic word EPOC + bool ret = false; + // + if ( aHeader.Length >= KMinimumSize ) + { + // We expect 16 bytes are the UID + checksum. Next should be the signature. + string sig = StringParsingUtils.BytesToString( aHeader, 16, 20 ); + ret = ( sig == KExpectedSignature ); + } + // + return ret; + } + #endregion + + #region Constants + public const uint KExpectedSignatureUInt32 = 0x434f5045; + public const string KExpectedSignature = "EPOC"; + #endregion + + #region Properties + public TCheckedUid Uid + { + get + { + return iUids; + } + } + + public int CodeSize + { + get { return iCodeSize; } + } + + public int DataSize + { + get { return iDataSize; } + } + + public uint CodeOffset + { + get { return iCodeOffset; } + } + + public uint UncompressedSize + { + get { return iUncompressedSize; } + } + + public uint TotalSize + { + // Just like in E32ImageHeader + get { return CodeOffset; } + } + #endregion + + #region From SymbianImageHeader + public override uint HeaderSize + { + get { return iHeaderSize; } + } + + public override TSymbianCompressionType CompressionType + { + get { return iCompressionType; } + } + #endregion + + #region Internal methods + private static TSymbianCompressionType ReadCompressionType( SymbianStreamReaderLE aReader ) + { + TSymbianCompressionType ret = TSymbianCompressionType.ENone; + // + uint type = aReader.ReadUInt32(); + if ( type == (uint) TSymbianCompressionType.EBytePair ) + { + ret = TSymbianCompressionType.EBytePair; + } + else if ( type == (uint) TSymbianCompressionType.EDeflate ) + { + ret = TSymbianCompressionType.EDeflate; + } + else + { + throw new E32ImageNotSupportedException( "Unsupported compression type" ); + } + // + return ret; + } + #endregion + + #region Data members + private readonly TCheckedUid iUids; + // + private readonly uint iSignature; // Contains 'EPOC'. + private readonly uint iHeaderCrc; // CRC-32 of entire header. @see #KImageCrcInitialiser. + private readonly uint iModuleVersion; // Version number for this executable (used in link resolution). + private readonly TSymbianCompressionType iCompressionType; // Type of compression used for file contents located after the header. (UID or 0 for none). + // + private readonly TVersion iToolsVersion; // Version number of tools which generated this file. + // + private readonly uint iTimeLo; // Least significant 32 bits of the time of image creation, in milliseconds since since midnight Jan 1st, 2000. + private readonly uint iTimeHi; // Most significant 32 bits of the time of image creation, in milliseconds since since midnight Jan 1st, 2000. + private readonly uint iFlags; // Contains various bit-fields of attributes for the image. + // + private readonly int iCodeSize; // Size of executables code. Includes import address table, constant data and export directory. + private readonly int iDataSize; // Size of executables initialised data. + private readonly int iHeapSizeMin; // Minimum size for an EXEs runtime heap memory. + private readonly int iHeapSizeMax; // Maximum size for an EXEs runtime heap memory. + private readonly int iStackSize; // Size for stack required by an EXEs initial thread. + private readonly int iBssSize; // Size of executables uninitialised data. + // + private readonly uint iEntryPoint; // Offset into code of the entry point. + private readonly uint iCodeBase; // Virtual address that the executables code is linked for. + private readonly uint iDataBase; // Virtual address that the executables data is linked for. + // + private readonly int iDllRefTableCount; // Number of executable against which this executable is linked. The number of files mention in the import section at iImportOffset. + private readonly uint iExportDirOffset; // Byte offset into file of the export directory. + private readonly int iExportDirCount; // Number of entries in the export directory. + // + private readonly int iTextSize; // Size of just the text section, also doubles as the offset for the Import Address Table w.r.t. the code section. + private readonly uint iCodeOffset; // Offset into file of the code section. Also doubles the as header size. + private readonly uint iDataOffset; // Offset into file of the data section. + private readonly uint iImportOffset; // Offset into file of the import section (E32ImportSection). + private readonly uint iCodeRelocOffset; // Offset into file of the code relocation section (E32RelocSection). + private readonly uint iDataRelocOffset; // Offset into file of the data relocation section (E32RelocSection). + private readonly short iProcessPriority; // Initial runtime process priorty for an EXE. (Value from enum TProcessPriority.) + private readonly ushort iCpuIdentifier; // Value from enum TCpu which indicates the CPU architecture for which the image was created + // + private readonly uint iUncompressedSize; // Uncompressed size of file data after the header, or zero if file not compressed. + // + private readonly SSecurityInfo iS; // Platform Security information of executable. + private readonly uint iExceptionDescriptor; // Offset in bytes from start of code section to Exception Descriptor, bit 0 set if valid. + private readonly ushort iSpare2; // Reserved for future use. Set to zero. + private readonly ushort iExportDescSize; // Size of export description stored in iExportDesc. + private readonly byte iExportDescType; // Type of description of holes in export table + + // Not part of header + private readonly uint iHeaderSize; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/E32Image/Image/SymbianE32Image.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/E32Image/Image/SymbianE32Image.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Tracer; +using SymbianUtils.Streams; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.Common.Header; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Streams; +using SymbianImageLib.E32Image.Content; +using SymbianImageLib.E32Image.Header; +using SymbianImageLib.E32Image.Exceptions; + +namespace SymbianImageLib.E32Image.Image +{ + public class SymbianImageE32 : SIImage + { + #region Constructors + public SymbianImageE32( FileInfo aFileInfo, ITracer aTracer ) + : this( aFileInfo.FullName, (uint) aFileInfo.Length, 0, new SIStream( aFileInfo.OpenRead() ), aTracer ) + { + } + + internal SymbianImageE32( string aImageName, uint aImageContentSize, long aImageContentOffset, SIStream aStream, ITracer aTracer ) + : base( aTracer, aStream, aImageName ) + { + iContentOffsetWithinDataStream = aImageContentOffset; + // + using ( SymbianStreamReaderLE reader = base.Stream.CreateReader() ) + { + reader.Seek( iContentOffsetWithinDataStream ); + iHeader = new SIHeaderE32Image( this, reader ); + } + + // Since we are a single e32 image, we have a single e32 Image file descriptor + SIContentE32Image file = new SIContentE32Image( this, aImageName, aImageContentSize, aImageContentOffset ); + base.RegisterFile( file ); + } + #endregion + + #region From SIImage + public override SIHeader Header + { + get { return iHeader; } + } + #endregion + + #region API + public static bool IsImageFile( Stream aStream ) + { + return IsImageFile( aStream, aStream.Position ); + } + + public static bool IsImageFile( Stream aStream, long aPosition ) + { + bool ret = false; + // + try + { + using ( SymbianStreamReaderLE reader = SymbianStreamReaderLE.New( aStream, SymbianStreamReaderLE.TCloseOperation.EResetPosition ) ) + { + aStream.Seek( aPosition, SeekOrigin.Begin ); + // + byte[] bytes = reader.ReadBytes( SIHeaderE32Image.KMinimumSize ); + ret = SIHeaderE32Image.IsSymbianImageHeader( bytes ); + } + } + catch ( Exception ) + { + } + return ret; + } + #endregion + + #region Properties + internal TCheckedUid Uid + { + get + { + return iHeader.Uid; + } + } + + internal long ContentOffsetWithinDataStream + { + get { return iContentOffsetWithinDataStream; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly SIHeaderE32Image iHeader; + private readonly long iContentOffsetWithinDataStream; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Internal/ROFSTest/Program.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Internal/ROFSTest/Program.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianImageLib.E32Image; +using SymbianImageLib.ROFS.Image; +using SymbianImageLib.ROFS.File; + +namespace ROFSTest +{ + class Program : ITracer + { + static void Main( string[] args ) + { + Program p = new Program(); + } + + #region Constructor + public Program() + { + SymbianE32Image memSpyDeflated = new SymbianE32Image( new FileInfo( @"C:\Tool Demo Files\2. Crash Data\IvaloImage\MemSpyDriverClient.epoc32_include.dll" ), this ); + memSpyDeflated.Decompress( TSynchronicity.ESynchronous ); + byte[] deflateCode = memSpyDeflated.GetAllData(); + + using ( FileStream stream = new FileStream( @"C:\Tool Demo Files\2. Crash Data\IvaloImage\ivalo\CoreImage\sp_rnd_image.rofs1.img", FileMode.Open ) ) + { + SymbianImageROFS rofsImage = new SymbianImageROFS( this, stream ); + + ISymbianFileROFS trkRofsFile = rofsImage[ @"\Trk.ini" ]; + System.Diagnostics.Debug.Assert( trkRofsFile != null ); + byte[] trkData = trkRofsFile.GetAllData(); + string trkIniText = SymbianUtils.Strings.StringParsingUtils.BytesToString( trkData ); + + ISymbianFileROFS memSpyRofsFile = rofsImage[ @"\Sys\Bin\MemSpyDriverClient.dll" ]; + System.Diagnostics.Debug.Assert( memSpyRofsFile != null ); + memSpyRofsFile.PrepareContent( TSynchronicity.ESynchronous ); + + byte[] bytePairCode = memSpyRofsFile.GetAllData(); + + System.Diagnostics.Debug.Assert( bytePairCode.Length == deflateCode.Length ); + for ( int i = 0; i < bytePairCode.Length; i++ ) + { + System.Diagnostics.Debug.Assert( bytePairCode[ i ] == deflateCode[ i ] ); + } + } + } + #endregion + + #region ITracer Members + public void Trace( string aMessage ) + { + System.Diagnostics.Debug.WriteLine( aMessage ); + System.Console.WriteLine( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + string text = string.Format( aFormat, aParams ); + Trace( text ); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Internal/ROFSTest/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Internal/ROFSTest/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "ROFSTest" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia" )] +[assembly: AssemblyProduct( "ROFSTest" )] +[assembly: AssemblyCopyright( "Copyright © Nokia 2009" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "3f903267-fab7-457b-b561-1f422e4c5a83" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Internal/ROFSTest/ROFSTest.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Internal/ROFSTest/ROFSTest.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,64 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {BC0A3A44-61EF-468D-9639-1260375BB403} + Exe + Properties + ROFSTest + ROFSTest + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB} + SymbianImageLib + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Internal/ROFSTest/ROFSTest.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Internal/ROFSTest/ROFSTest.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,5 @@ + + + true + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Internal/ROFSTest/ROFSTest.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Internal/ROFSTest/ROFSTest.sln Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,78 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ROFSTest", "ROFSTest.csproj", "{BC0A3A44-61EF-468D-9639-1260375BB403}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianImageLib", "..\..\SymbianImageLib.csproj", "{A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStructuresLib", "..\..\..\SymbianStructuresLib\SymbianStructuresLib.csproj", "{D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianUtils", "..\..\..\SymbianUtils\SymbianUtils.csproj", "{F6F4CE69-E73A-4917-97ED-B114DE90C92E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SymbianNativeTools", "..\..\..\SymbianNativeTools\SymbianNativeTools.vcproj", "{34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BC0A3A44-61EF-468D-9639-1260375BB403}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC0A3A44-61EF-468D-9639-1260375BB403}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC0A3A44-61EF-468D-9639-1260375BB403}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BC0A3A44-61EF-468D-9639-1260375BB403}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BC0A3A44-61EF-468D-9639-1260375BB403}.Debug|Win32.ActiveCfg = Debug|Any CPU + {BC0A3A44-61EF-468D-9639-1260375BB403}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC0A3A44-61EF-468D-9639-1260375BB403}.Release|Any CPU.Build.0 = Release|Any CPU + {BC0A3A44-61EF-468D-9639-1260375BB403}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BC0A3A44-61EF-468D-9639-1260375BB403}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BC0A3A44-61EF-468D-9639-1260375BB403}.Release|Win32.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Any CPU.Build.0 = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Win32.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Win32.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.Build.0 = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Win32.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.Build.0 = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Win32.ActiveCfg = Release|Any CPU + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Win32.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Win32.Build.0 = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Any CPU.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Mixed Platforms.Build.0 = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Win32.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "SymbianImageLib" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia" )] +[assembly: AssemblyProduct( "SymbianImageLib" )] +[assembly: AssemblyCopyright( "Copyright © Nokia 2009" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "6e79f544-e89b-40c2-9d43-f3b5802ddc91" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Content/SIContentFactoryROFS.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Content/SIContentFactoryROFS.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ + +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Tracer; +using SymbianUtils.Streams; +using SymbianStructuresLib.Uids; +using SymbianImageLib.E32Image.Image; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Streams; +using SymbianImageLib.Common.Content; +using SymbianImageLib.ROFS.Image; + +namespace SymbianImageLib.ROFS.Content +{ + internal static class SIContentFactoryROFS + { + public static SIContent New( SIROFS aImage, string aName, uint aSize, long aPosition, TCheckedUid aUids ) + { + SIContent ret = null; + // + bool isImage = SymbianImageE32.IsImageFile( (Stream) aImage.Stream, aPosition ); + if ( !isImage ) + { + // We create either a code file (binary) or data file depending on the type of file at the specified location. + ret = new SIContentROFSData( aImage, aName, aSize, aPosition, aUids ); + } + else + { + ret = new SIContentROFSCode( aImage, aName, aSize, aPosition ); + } + // + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Content/Types/SIContentROFSCode.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Content/Types/SIContentROFSCode.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.Streams; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.Common.Content; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Streams; +using SymbianImageLib.E32Image.Image; +using SymbianImageLib.E32Image.Content; +using SymbianImageLib.E32Image.Header; +using SymbianImageLib.ROFS.Image; + +namespace SymbianImageLib.ROFS.Content +{ + public class SIContentROFSCode : SIContent + { + #region Constructors + internal SIContentROFSCode( SIROFS aImage, string aName, uint aSize, long aPosition ) + : base( aImage ) + { + // We need to give the E32Image access to the underlying ROFS image stream, but we don't + // want to transfer ownership - ownership remains entirely with the SymbianImageROFS object. + SIStream e32ImageStream = new SIStream( (Stream) ImageStream, SIStream.TOwnershipType.EOwnedExternally ); + try + { + iE32Image = new SymbianImageE32( aName, aSize, aPosition, e32ImageStream, aImage ); + if ( iE32Image.Count == 0 ) + { + throw new Exception( "Invalid E32Image file" ); + } + } + catch ( Exception e ) + { + e32ImageStream.Close(); + throw e; + } + } + #endregion + + #region From SymbianImageContentFile + public override TSymbianCompressionType CompressionType + { + get { return iE32Image.CompressionType; } + } + + public override uint ProvideDataUInt32( uint aAddress ) + { + uint ret = E32ImageContent.ProvideDataUInt32( aAddress ); + return ret; + } + + public override ushort ProvideDataUInt16( uint aAddress ) + { + ushort ret = E32ImageContent.ProvideDataUInt16( aAddress ); + return ret; + } + + public override string FileName + { + get { return E32ImageContent.FileName; } + } + + public override uint FileSize + { + get { return E32ImageContent.FileSize; } + } + + public override uint ContentSize + { + get + { + uint ret = E32ImageContent.ContentSize; + return ret; + } + } + + public override TCheckedUid Uid + { + get { return E32ImageContent.Uid; } + } + + public override byte[] GetAllData() + { + return E32ImageContent.GetAllData(); + } + + protected override void DoDecompress() + { + // We can prepare the content synchronously because we're either running + // in a separate thread (async) or supposed to be performing the operation + // synchronously in any case. + SIContentE32Image content = E32ImageContent; + content.PrepareContent( TSynchronicity.ESynchronous ); + } + + protected override void OnRelocationAddressChanged( uint aOld, uint aNew ) + { + // Cascade the relocation change to the E32Image + E32ImageContent.RelocationAddress = aNew; + } + + protected override bool GetIsContentPrepared() + { + return E32ImageContent.IsContentPrepared; + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iE32Image.Dispose(); + } + } + #endregion + + #region Properties + internal SIContentE32Image E32ImageContent + { + get { return iE32Image[ 0 ] as SIContentE32Image; } + } + #endregion + + #region Data members + private readonly SymbianImageE32 iE32Image; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Content/Types/SIContentROFSData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Content/Types/SIContentROFSData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.Streams; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.Common.Content; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Streams; +using SymbianImageLib.ROFS.Image; + +namespace SymbianImageLib.ROFS.Content +{ + public class SIContentROFSData : SIContent + { + #region Constructors + internal SIContentROFSData( SIROFS aImage, string aName, uint aSize, long aPosition, TCheckedUid aUids ) + : base( aImage ) + { + iFileName = aName; + iUids = aUids; + iFileSize = aSize; + iPosition = aPosition; + } + #endregion + + #region From SymbianImageContentFile + public override TSymbianCompressionType CompressionType + { + get + { + return TSymbianCompressionType.ENone; + } + } + + public override string FileName + { + get { return iFileName; } + } + + public override uint FileSize + { + get { return iFileSize; } + } + + public override uint ContentSize + { + get { return FileSize; } + } + + public override TCheckedUid Uid + { + get { return iUids; } + } + + public override byte[] GetAllData() + { + byte[] ret = null; + // + using ( SymbianStreamReaderLE reader = SymbianStreamReaderLE.New( (Stream) base.ImageStream, SymbianStreamReaderLE.TCloseOperation.EResetPosition ) ) + { + reader.Position = iPosition; + ret = reader.ReadBytes( (int) iFileSize ); + } + // + return ret; + } + + public override bool IsCode + { + get { return false; } + } + + protected override uint DoProvideDataUInt32( uint aTranslatedAddress ) + { + using ( SymbianStreamReaderLE reader = Image.Stream.CreateReader( SymbianStreamReaderLE.TCloseOperation.ENone ) ) + { + reader.Seek( aTranslatedAddress ); + uint ret = reader.ReadUInt32(); + return ret; + } + } + + protected override ushort DoProvideDataUInt16( uint aTranslatedAddress ) + { + using ( SymbianStreamReaderLE reader = Image.Stream.CreateReader( SymbianStreamReaderLE.TCloseOperation.ENone ) ) + { + reader.Seek( aTranslatedAddress ); + ushort ret = reader.ReadUInt16(); + return ret; + } + } + + protected override bool GetIsContentPrepared() + { + // We just read straight from the file + return true; + } + #endregion + + #region Properties + public long Position + { + get { return iPosition; } + } + #endregion + + #region Data members + private readonly string iFileName; + private readonly uint iFileSize; + private readonly long iPosition; + private readonly TCheckedUid iUids; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Factory/SIFactoryROFS.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Factory/SIFactoryROFS.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Tracer; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Factory; +using SymbianImageLib.ROFS.Image; + +namespace SymbianImageLib.ROFS.Factory +{ + internal class SIFactoryROFS : SIFactory + { + #region Constructors + public SIFactoryROFS() + { + } + #endregion + + #region From SymbianImageFactory + public override SIImage CreateImage( ITracer aTracer, Stream aStream, string aName ) + { + SIImage ret = null; + // + bool isSupported = SIROFS.IsROFS( aStream ); + if ( isSupported ) + { + ret = new SIROFS( aTracer, aStream, aName ); + } + // + return ret; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Header/SIHeaderROF.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Header/SIHeaderROF.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Strings; +using SymbianUtils.Streams; +using SymbianImageLib.Common.Header; +using SymbianImageLib.Common.Image; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.ROFS.Structures; +using SymbianImageLib.ROFS.Header.Types; + +namespace SymbianImageLib.ROFS.Header +{ + internal abstract class SIHeaderROF : SIHeader + { + #region Static constructor + public static SIHeaderROF New( SIImage aImage, Stream aStream ) + { + byte[] signature = new byte[ 4 ]; + int readResult = aStream.Read( signature, 0, signature.Length ); + if ( readResult != 4 ) + { + throw new Exception( "Unable to read ROF signature" ); + } + + // Put us back where we were + aStream.Seek( -signature.Length, SeekOrigin.Current ); + + // Convert signature to string and compare against known types. + string headerText = StringParsingUtils.BytesToString( signature ); + aImage.Trace( "[SymbianImageHeaderROF] New() - headerText: {0}", headerText ); + // + SIHeaderROF ret = null; + switch ( headerText ) + { + case "ROFX": + ret = new SIHeaderROFS( aImage, aStream ); + break; + case "ROFS": + ret = new SIHeaderROFX( aImage, aStream ); + break; + default: + throw new NotSupportedException( "Unsupported ROF type" ); + } + // + return ret; + } + #endregion + + #region Constructors + protected SIHeaderROF( SIImage aImage, Stream aStream ) + : base( aImage ) + { + // Skip over identifier + aStream.Seek( 4, SeekOrigin.Begin ); + + // Read header size and then put us back at the start of the stream + // ready to read the entire header. + int headerSize = aStream.ReadByte(); + aStream.Seek( 0, SeekOrigin.Begin ); + // + iHeaderData = new byte[ headerSize ]; + aStream.Read( iHeaderData, 0, iHeaderData.Length ); + // + ReadHeaderData( iHeaderData ); + } + #endregion + + #region API + public static bool IsROFS( Stream aStream ) + { + using ( SymbianStreamReaderLE reader = SymbianStreamReaderLE.New( aStream, SymbianStreamReaderLE.TCloseOperation.EResetPosition ) ) + { + string signature = reader.ReadString( 4 ); + bool ret = ( signature == KImageROFS || signature == KImageROFX ); + return ret; + } + } + #endregion + + #region Constants + public const string KImageROFS = "ROFS"; + public const string KImageROFX = "ROFX"; + #endregion + + #region From SymbianImageHeader + public override TSymbianCompressionType CompressionType + { + get + { + // ROFS image itself is not compressed - however, the individual ROFS entries + // themselves are likely compressed. + return TSymbianCompressionType.ENone; + } + } + + public override uint HeaderSize + { + get { return iRofsHdr.Size; } + } + #endregion + + #region API + #endregion + + #region Properties + internal TRofsHeader InternalHeader + { + get { return iRofsHdr; } + } + #endregion + + #region Internal methods + private void ReadHeaderData( byte[] aBuffer ) + { + using ( MemoryStream stream = new MemoryStream( aBuffer ) ) + { + using ( BinaryReader reader = new BinaryReader( stream ) ) + { + iRofsHdr.Read( reader ); + } + } + } + #endregion + + #region Data members + private TRofsHeader iRofsHdr = new TRofsHeader(); + private readonly byte[] iHeaderData; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Header/Types/SIHeaderROFS.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Header/Types/SIHeaderROFS.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Strings; +using SymbianImageLib.Common.Header; +using SymbianImageLib.Common.Image; + +namespace SymbianImageLib.ROFS.Header.Types +{ + internal class SIHeaderROFS : SIHeaderROF + { + #region Constructors + public SIHeaderROFS( SIImage aImage, Stream aStream ) + : base( aImage, aStream ) + { + } + #endregion + + #region Constants + #endregion + + #region From SymbianImageHeader + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Header/Types/SIHeaderROFX.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Header/Types/SIHeaderROFX.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Strings; +using SymbianImageLib.Common.Header; +using SymbianImageLib.Common.Image; + +namespace SymbianImageLib.ROFS.Header.Types +{ + internal class SIHeaderROFX : SIHeaderROF + { + #region Constructors + public SIHeaderROFX( SIImage aImage, Stream aStream ) + : base( aImage, aStream ) + { + } + #endregion + + #region Constants + #endregion + + #region From SymbianImageHeader + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Image/SIROFS.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Image/SIROFS.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Streams; +using SymbianUtils.Tracer; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.Common.Content; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Header; +using SymbianImageLib.Common.Streams; +using SymbianImageLib.ROFS.Content; +using SymbianImageLib.ROFS.Header; +using SymbianImageLib.ROFS.Structures; + +namespace SymbianImageLib.ROFS.Image +{ + public class SIROFS : SIImage + { + #region Constructors + public SIROFS( ITracer aTracer, Stream aStream, string aName ) + : base( aTracer, new SIStream( aStream ), aName ) + { + base.Trace( "[SymbianImageROFS] Ctor() - START" ); + iHeader = SIHeaderROF.New( this, aStream ); + + ReadFiles(); + base.Trace( "[SymbianImageROFS] Ctor() - END" ); + } + #endregion + + #region From SIImage + public override SIHeader Header + { + get { return iHeader; } + } + #endregion + + #region API + public static bool IsROFS( Stream aStream ) + { + bool ret = false; + // + try + { + ret = SIHeaderROF.IsROFS( aStream ); + } + catch ( Exception ) + { + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void ReadFiles() + { + base.Trace( "[SymbianImageROFS] ReadFiles() - reading directory tree..." ); + using ( SymbianStreamReaderLE reader = SymbianStreamReaderLE.New( (Stream) base.Stream ) ) + { + reader.Seek( iHeader.InternalHeader.DirTreeOffset, SeekOrigin.Begin ); + TRofsDir rootDirectory = new TRofsDir( string.Empty, (uint) reader.Position, reader, this ); + + base.Trace( "[SymbianImageROFS] ReadFiles() - converting directory tree to full full paths..." ); + MakeFilesForDirectory( rootDirectory, string.Empty ); + } + } + + private void MakeFilesForDirectory( TRofsDir aDirectory, string aParentDirectoryName ) + { + string name = aParentDirectoryName + @"\"; + + // Create files + StringBuilder fullName = new StringBuilder(); + foreach ( TRofsEntry entry in aDirectory ) + { + fullName.Length = 0; + fullName.Append( name ); + fullName.Append( entry.Name ); + // + SIContent file = SIContentFactoryROFS.New( this, fullName.ToString(), entry.FileSize, entry.FileAddress, entry.Uids ); + base.RegisterFile( file ); + } + + // Create files in any subdirs + foreach ( TRofsDir subdir in aDirectory.SubDirectories ) + { + MakeFilesForDirectory( subdir, name + subdir.Name ); + } + } + #endregion + + #region Data members + private readonly SIHeaderROF iHeader; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Structures/TRofsDir.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Structures/TRofsDir.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,181 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Tracer; +using SymbianUtils.Streams; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Version; + +namespace SymbianImageLib.ROFS.Structures +{ + internal class TRofsDir : IEnumerable + { + #region Constructors + public TRofsDir( string aName, uint aFileAddress, SymbianStreamReaderLE aReader, ITracer aTracer ) + { + //aTracer.Trace( "[Dir ] @ 0x{0:x8} {1}", aFileAddress, aName ); + // + iName = aName; + // + aReader.Seek( aFileAddress, SeekOrigin.Begin ); + // + iStructSize = aReader.ReadUInt16(); + iPadding = aReader.ReadUInt8(); + iFirstEntryOffset = aReader.ReadUInt8(); + iFileBlockAddress = aReader.ReadUInt32(); + iFileBlockSize = aReader.ReadUInt32(); + // + if ( iFileBlockAddress != 0 ) + { + // Directory has files in it + AddFiles( aReader, aTracer, iFileBlockAddress, iFileBlockSize ); + } + if ( iStructSize > KMinimumDirectoryEntrySize ) + { + // Directory has subdirectories + AddSubDirs( aReader, aTracer, aFileAddress + iStructSize ); + } + } + #endregion + + #region API + #endregion + + #region Constants + // The minimum standard entry size, irrespective of whether the directory + // contains subdirs or files. + public const uint KMinimumDirectoryEntrySize = 2 + 1 + 1 + 4 + 4; + #endregion + + #region Properties + public uint Size + { + get { return iStructSize; } + } + + public string Name + { + get { return iName; } + } + + public uint FirstEntryOffset + { + get { return iFirstEntryOffset; } + } + + public uint FileBlockAddress + { + get { return iFileBlockAddress; } + } + + public uint FileBlockSize + { + get { return iFileBlockSize; } + } + + public TRofsDir[] SubDirectories + { + get + { + return iSubdirectories.ToArray(); + } + } + #endregion + + #region Internal methods + private void AddFiles( SymbianStreamReaderLE aReader, ITracer aTracer, long aStartPosition, uint aSize ) + { + long originalPosition = aReader.Position; + long endPos = aStartPosition + aSize; + // + long filePosition = aStartPosition; + while ( filePosition < endPos ) + { + // Seek to start of file and read it + aReader.Seek( filePosition, SeekOrigin.Begin ); + TRofsEntry entry = new TRofsEntry( aReader, aTracer ); + iFiles.Add( entry ); + //aTracer.Trace( "[File] @ 0x{0:x8} {1:d8} {2}", filePosition, entry.FileSize, entry.Name ); + + // Move to next file + filePosition += entry.Size; + } + + // Restore original position + aReader.Seek( originalPosition, SeekOrigin.Begin ); + } + + private void AddSubDirs( SymbianStreamReaderLE aReader, ITracer aTracer, long aEndDirPos ) + { + long originalPosition = aReader.Position; + // + long filePosition = aReader.BaseStream.Position; + while ( filePosition < aEndDirPos ) + { + // Seek to start of subdir and read basic properties + aReader.Seek( filePosition, SeekOrigin.Begin ); + TRofsEntry entry = new TRofsEntry( aReader, aTracer ); + + // Create a new subdirectory that we'll process recursively. + TRofsDir subdir = new TRofsDir( entry.Name, entry.FileAddress, aReader, aTracer ); + iSubdirectories.Add( subdir ); + + // Move to next subdir, rounding to 4 bytes + long nextSubDirOffset = entry.Size; + nextSubDirOffset += ( ( 4 - nextSubDirOffset ) & 0x3 ); + filePosition += nextSubDirOffset; + } + + // Restore original position + aReader.Seek( originalPosition, SeekOrigin.Begin ); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( TRofsEntry entry in iFiles ) + { + yield return entry; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( TRofsEntry entry in iFiles ) + { + yield return entry; + } + } + #endregion + + #region Data members + private readonly string iName; + private ushort iStructSize; // Total size of this directory block including padding + private byte iPadding; + private byte iFirstEntryOffset; // offset to first entry + private uint iFileBlockAddress; // address of associated file block + private uint iFileBlockSize; // size of associated file block + + private List iFiles = new List(); + private List iSubdirectories = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Structures/TRofsEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Structures/TRofsEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Tracer; +using SymbianUtils.Streams; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Version; + +namespace SymbianImageLib.ROFS.Structures +{ + internal class TRofsEntry + { + #region Constructors + public TRofsEntry( SymbianStreamReaderLE aReader, ITracer aTracer ) + { + long startPos = aReader.BaseStream.Position; + + iStructSize = aReader.ReadUInt16(); + iUids = new TCheckedUid( aReader ); + + // Skip name offset - not useful + aReader.ReadUInt8(); + // + iAtt = aReader.ReadUInt8(); + iFileSize = aReader.ReadUInt32(); + iFileAddress = aReader.ReadUInt32(); + iAttExtra = aReader.ReadUInt8(); + + // Read name - the length is in unicode characters. + byte nameLength = aReader.ReadUInt8(); + iName = aReader.ReadStringUTF16( nameLength ); + } + #endregion + + #region API + #endregion + + #region Properties + public uint Size + { + get { return iStructSize; } + } + + public TCheckedUid Uids + { + get + { + return iUids; + } + } + + public uint Att + { + get { return iAtt; } + } + + public uint FileSize + { + get { return iFileSize; } + } + + public uint FileAddress + { + get { return iFileAddress; } + } + + public uint AttExtra + { + get { return iAttExtra; } + } + + public string Name + { + get { return iName; } + } + #endregion + + #region From System.Object + public override string ToString() + { + return iName; + } + + public override int GetHashCode() + { + return iName.GetHashCode(); + } + #endregion + + #region Data members + private readonly ushort iStructSize; // Total size of entry, header + name + any padding + private readonly TCheckedUid iUids; // A copy of all the UID info + private readonly byte iAtt; // standard file attributes + private readonly uint iFileSize; // real size of file in bytes (may be different from size in image) + // for subdirectories this is the total size of the directory + // block entry excluding padding + private readonly uint iFileAddress; // address in image of file start + private readonly byte iAttExtra; // extra ROFS attributes (these are inverted so 0 = enabled) + private readonly string iName; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Structures/TRofsHeader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROFS/Structures/TRofsHeader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianStructuresLib.Version; + +namespace SymbianImageLib.ROFS.Structures +{ + internal class TRofsHeader + { + #region Constructors + #endregion + + #region API + public void Read( BinaryReader aReader ) + { + iIdentifier = SymbianUtils.Strings.StringParsingUtils.BytesToString( aReader.ReadBytes( 4 ) ); + iHeaderSize = aReader.ReadByte(); + iReserved = aReader.ReadByte(); + iRofsFormatVersion = aReader.ReadUInt16(); + iDirTreeOffset = aReader.ReadUInt32(); + iDirTreeSize = aReader.ReadUInt32(); + iDirFileEntriesOffset = aReader.ReadUInt32(); + iDirFileEntriesSize = aReader.ReadUInt32(); + iTime = aReader.ReadInt64(); + iImageVersion.Read( aReader ); + iImageSize = aReader.ReadUInt32(); + iCheckSum = aReader.ReadUInt32(); + iMaxImageSize = aReader.ReadUInt32(); + } + #endregion + + #region Properties + public string Identifier + { + get { return iIdentifier; } + } + + public uint Size + { + get + { + return iHeaderSize; + } + } + + public uint RofsFormatVersion + { + get { return iRofsFormatVersion; } + } + + public uint DirTreeOffset + { + get { return iDirTreeOffset; } + } + + public uint DirTreeSize + { + get { return iDirTreeSize; } + } + + public uint DirFileEntriesOffset + { + get { return iDirFileEntriesOffset; } + } + + public uint DirFileEntriesSize + { + get { return iDirFileEntriesSize; } + } + + public uint CheckSum + { + get { return iCheckSum; } + } + #endregion + + #region Data members + private string iIdentifier = string.Empty; + private byte iHeaderSize; + private byte iReserved; + private ushort iRofsFormatVersion; + private uint iDirTreeOffset; // offset to start of directory structure + private uint iDirTreeSize; // size in bytes of directory + private uint iDirFileEntriesOffset; // offset to start of file entries + private uint iDirFileEntriesSize; // size in bytes of file entry block + private long iTime; + private TVersion iImageVersion = new TVersion(); // licensee image version + private uint iImageSize; + private uint iCheckSum; + private uint iMaxImageSize; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Content/SIContentROM.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Content/SIContentROM.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,248 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.Streams; +using SymbianStructuresLib.Uids; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.Common.Content; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Header; +using SymbianImageLib.Common.Streams; +using SymbianImageLib.Common.Factory; +using SymbianImageLib.ROM.Image; +using SymbianImageLib.ROM.Header; +using SymbianImageLib.ROM.Structures; + +namespace SymbianImageLib.ROM.Content +{ + internal class SIContentROM : SIContent + { + #region Constructors + public SIContentROM( SIROM aImage ) + : base( aImage ) + { + SIHeaderROM header = (SIHeaderROM) aImage.Header; + base.RelocationAddress = header.RomBaseAddress; + } + #endregion + + #region From SymbianImageContentFile + public override TSymbianCompressionType CompressionType + { + get + { + // Compression type comes from overall image header + TSymbianCompressionType ret = base.ImageHeader.CompressionType; + return ret; + } + } + + public override bool IsRelocationSupported + { + get { return false; } + } + + public override string FileName + { + get { return Image.Name; } + } + + public override uint FileSize + { + get { return (uint) base.Image.Stream.Length; } + } + + public override uint ContentSize + { + get + { + // This is not 100% accurate, but hopefully good enough... + uint size = (uint) base.ImageStream.Length; + return size; + } + } + + public override byte[] GetAllData() + { + // The image ownes a memory stream (if the image has been decompressed) + byte[] ret = new byte[ 0 ]; + // + if ( base.ImageStream is SIMemoryStream ) + { + SIMemoryStream memStream = (SIMemoryStream) base.ImageStream; + ret = memStream.Data; + } + // + return ret; + } + + protected override uint DoProvideDataUInt32( uint aTranslatedAddress ) + { + using ( SymbianStreamReaderLE reader = Image.Stream.CreateReader( SymbianStreamReaderLE.TCloseOperation.ENone ) ) + { + reader.Seek( aTranslatedAddress ); + uint ret = reader.ReadUInt32(); + return ret; + } + } + + protected override ushort DoProvideDataUInt16( uint aTranslatedAddress ) + { + using ( SymbianStreamReaderLE reader = Image.Stream.CreateReader( SymbianStreamReaderLE.TCloseOperation.ENone ) ) + { + reader.Seek( aTranslatedAddress ); + ushort ret = reader.ReadUInt16(); + return ret; + } + } + + protected override void DoDecompress() + { + base.Trace( "[SymbianImageContentFileROM] DoDecompress() - START - compression type: {0}", CompressionType ); + // + switch ( CompressionType ) + { + case TSymbianCompressionType.ENone: + base.Trace( "[SymbianImageContentFileROM] DoDecompress() - not compressed" ); + break; + case TSymbianCompressionType.EBytePair: + base.Trace( "[SymbianImageContentFileROM] DoDecompress() - byte pair" ); + DoDecompressBytePair(); + break; + default: + case TSymbianCompressionType.EDeflate: + base.Trace( "[SymbianImageContentFileROM] DoDecompress() - unsuporrted compression type" ); + throw new NotSupportedException(); + } + // + base.Trace( "[SymbianImageROM] DoDecompress() - END" ); + } + + protected override bool GetIsContentPrepared() + { + return iContentIsPrepared; + } + #endregion + + #region Properties + public new SIHeaderROM ImageHeader + { + get + { + SIHeaderROM header = (SIHeaderROM) base.ImageHeader; + return header; + } + } + #endregion + + #region Internal methods + private void DoDecompressBytePair() + { + if ( iContentIsPrepared == false ) + { + SIHeaderROM imageHeader = ImageHeader; + base.Trace( "[SymbianImageROM] DoDecompressBytePair() - START - header uncompressed rom size: {0}", imageHeader.UncompressedRomSize ); + + // Create new buffer and copy over rom image header + SIMemoryStream resultantDataStream = new SIMemoryStream( imageHeader.UncompressedRomSize ); + + int numPages = imageHeader.NumberOfPages; + uint pageTableOffset = imageHeader.RomPageIndexOffset; + uint romDataOffset = imageHeader.HeaderSizeLoader; + base.Trace( "[SymbianImageROM] DoDecompressBytePair() - numPages: {0}, pageTableOffset: {1}, romDataOffset: {2}", numPages, pageTableOffset, romDataOffset ); + // + SymbianDecompressor decompressor = SymbianDecompressor.NewByType( TSymbianCompressionType.EBytePair ); + // + List pages = new List( numPages + 1 ); + for ( int i = 0; i < numPages; i++ ) + { + // Read a page table entry + long pageOffsetWithinFile = pageTableOffset + ( i * SRomPageInfo.Size ); + + //base.Trace( "[SymbianImageROM] DoDecompressBytePair() - page[{0:d5}] - pageOffsetWithinFile: {1}", i, pageOffsetWithinFile ); + base.ImageStream.Seek( pageOffsetWithinFile, SeekOrigin.Begin ); + SRomPageInfo pageInfo = SRomPageInfo.New( (Stream) base.ImageStream, romDataOffset ); + + // Process the entry based upon the compression type + //base.Trace( "[SymbianImageROM] DoDecompressBytePair() - page[{0:d5}] - pageInfo.DataSize: {1}, pageInfo.DataStart: {2}, pageInfo.CompressionType: {3}", i, pageInfo.DataSize, pageInfo.DataStart, pageInfo.CompressionType ); + base.ImageStream.Seek( pageInfo.DataStart, SeekOrigin.Begin ); + + if ( pageInfo.CompressionType == SRomPageInfo.TSymbianCompressionType.ENoCompression ) + { + // Read data - no decompression needed + //base.Trace( "[SymbianImageROM] DoDecompressBytePair() - page[{0:d5}] - PAGE NOT COMPRESSED", i ); + resultantDataStream.Write( base.ImageStream, (int) pageInfo.DataSize ); + } + else if ( pageInfo.CompressionType == SRomPageInfo.TSymbianCompressionType.EBytePair ) + { + //base.Trace( "[SymbianImageROM] DoDecompressBytePair() - page[{0:d5}] - BYTE PAIR PAGE", i ); + + // Read data - need to decompress it + byte[] compressedData = new byte[ pageInfo.DataSize ]; + base.ImageStream.Read( compressedData, 0, compressedData.Length ); + + // Make destination buffer - which is a page big + byte[] uncompressedData = new byte[ SRomPageInfo.KPageSize ]; + + // Decompress to buffer - we're handling the page management, so we want raw decompression + int error = decompressor.DecompressRaw( compressedData, uncompressedData ); + + // Save it + if ( error < 0 ) + { + base.Trace( "[SymbianImageROM] DoDecompressBytePair() - page[{0:d5}] - Exception - bytepair decompression error", i ); + throw new Exception( "BytePair decompression error: " + error.ToString() ); + } + else if ( error != SRomPageInfo.KPageSize ) + { + base.Trace( "[SymbianImageROM] DoDecompressBytePair() - page[{0:d5}] - Exception - bytepair underflow error", i ); + throw new Exception( "Decompressor underflow - only created " + error.ToString() + " bytes" ); + } + else + { + resultantDataStream.Write( uncompressedData ); + } + } + else + { + base.Trace( "[SymbianImageROM] DoDecompressBytePair() - page[{0:d5}] - UNSUPPORTED COMPRESSION TYPE - Exception!", i ); + throw new NotSupportedException( "Unsupported page compression type" ); + } + + // Report progress + base.ReportDecompressionEvent( TDecompressionEvent.EEventDecompressionProgress, ( (float) i / (float) numPages ) * 100 ); + } + + // Now we can replace the base class stream (which is just the raw compressed file data) with the new uncompressed version + base.ImageStream = resultantDataStream; + iContentIsPrepared = true; + + base.Trace( "[SymbianImageROM] DoDecompressBytePair() - END" ); + } + } + #endregion + + #region Data members + private bool iContentIsPrepared = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Factory/SIFactoryROM.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Factory/SIFactoryROM.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.Tracer; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Factory; +using SymbianImageLib.ROM.Image; + +namespace SymbianImageLib.ROM.Factory +{ + internal class SIFactoryROM : SIFactory + { + #region Constructors + public SIFactoryROM() + { + } + #endregion + + #region From SymbianImageFactory + public override SIImage CreateImage( ITracer aTracer, Stream aStream, string aName ) + { + SIImage ret = null; + // + bool isSupported = SIROM.IsROM( aStream ); + if ( isSupported ) + { + ret = new SIROM( aTracer, aStream, aName ); + } + // + return ret; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Header/SIHeaderROM.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Header/SIHeaderROM.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,192 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; +using SymbianUtils.Strings; +using SymbianUtils.Streams; +using SymbianImageLib.Common.Header; +using SymbianImageLib.Common.Image; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.ROM.Structures; + +namespace SymbianImageLib.ROM.Header +{ + internal class SIHeaderROM : SIHeader + { + #region Constructors + public SIHeaderROM( SIImage aImage, Stream aStream ) + : base( aImage ) + { + aStream.Seek( 0, SeekOrigin.Begin ); + // + iHeaderData = new byte[ KMaximumRomHeaderSize ]; + int amountRead = aStream.Read( iHeaderData, 0, KMaximumRomHeaderSize ); + // + string headerText = StringParsingUtils.BytesToString( iHeaderData, KEpocHeaderLength ); + base.Trace( "[SymbianImageHeaderROM] Ctor() - headerText: {0}, amountRead: {1}", headerText, amountRead ); + // + if ( IsEpocHeader( headerText ) == false ) + { + throw new NotSupportedException( string.Format( "ROM Image header is unsupported: {0}", headerText ) ); + } + // + ReadHeaderData( iHeaderData ); + } + #endregion + + #region Constants + public const int KMaximumRomHeaderSize = 0x400; + public const int KPageSize = 0x1000; + #endregion + + #region From SymbianImageHeader + public override TSymbianCompressionType CompressionType + { + get + { + TSymbianCompressionType ret = TSymbianCompressionType.ENone; + // + if ( iRomHdr.CompressionType == (uint) TSymbianCompressionType.EBytePair ) + { + ret = TSymbianCompressionType.EBytePair; + } + else if ( iRomHdr.CompressionType == (uint) TSymbianCompressionType.EDeflate ) + { + ret = TSymbianCompressionType.EDeflate; + } + else + { + // Check for byte pair... + if ( iRomHdr.RomPageIndex != 0 ) + { + ret = TSymbianCompressionType.EBytePair; + } + } + // + return ret; + } + } + + public override uint HeaderSize + { + get + { + uint ret = 0; + // + ret += HeaderSizeLoader; + ret += iRomHdr.Size; + // + return ret; + } + } + #endregion + + #region API + public static bool IsROM( Stream aStream ) + { + using ( SymbianStreamReaderLE reader = SymbianStreamReaderLE.New( aStream, SymbianStreamReaderLE.TCloseOperation.EResetPosition ) ) + { + string signature = reader.ReadString( KEpocHeaderLength ); + bool ret = IsEpocHeader( signature ); + return ret; + } + } + #endregion + + #region Properties + public uint UncompressedRomSize + { + get { return iRomHdr.UncompressedSize; } + } + + public uint HeaderSizeLoader + { + get { return iLoaderHdr.Size; } + } + + public uint RomBaseAddress + { + get { return iRomHdr.RomBaseAddress; } + } + + public int NumberOfPages + { + get + { + int pageAreaStart = iRomHdr.PageableRomStart; + int pageRomSize = iRomHdr.PageableRomSize; + int numPages = ( pageAreaStart + pageRomSize + KPageSize - 1 ) / KPageSize; + // + return numPages; + } + } + + public uint RomPageIndexOffset + { + get + { + uint ret = iLoaderHdr.Size; + ret += iRomHdr.RomPageIndex; + return ret; + } + } + #endregion + + #region Internal constants + // The signature for Core ROM images used to be EPOCARM4ROM, but now EPOCARM5ROM has + // also been observed. + private const int KEpocHeaderLength = 11; + private static readonly Regex KEpocHeaderTextRegEx = new Regex( + "EPOCARM\\dROM", + RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + #endregion + + #region Internal methods + private static bool IsEpocHeader( string aText ) + { + Match m = KEpocHeaderTextRegEx.Match( aText ); + bool ret = m.Success; + return ret; + } + + private void ReadHeaderData( byte[] aBuffer ) + { + using ( MemoryStream stream = new MemoryStream( aBuffer ) ) + { + using ( BinaryReader reader = new BinaryReader( stream ) ) + { + iLoaderHdr.Read( reader ); + iRomHdr.Read( reader ); + } + } + } + #endregion + + #region Data members + private TRomLoaderHeader iLoaderHdr = new TRomLoaderHeader(); + private TRomHeader iRomHdr = new TRomHeader(); + private readonly byte[] iHeaderData; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Image/SIROM.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Image/SIROM.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.Streams; +using SymbianStructuresLib.Compression.Common; +using SymbianImageLib.Common.Image; +using SymbianImageLib.Common.Header; +using SymbianImageLib.Common.Streams; +using SymbianImageLib.ROM.Content; +using SymbianImageLib.ROM.Header; +using SymbianImageLib.ROM.Structures; + +namespace SymbianImageLib.ROM.Image +{ + public class SIROM : SIImage + { + #region Constructors + public SIROM( ITracer aTracer, Stream aStream, string aName ) + : base( aTracer, new SIStream( aStream ), aName ) + { + base.Trace( "[SymbianImageROM] Ctor() - START" ); + + // Read the header and set base class relocation address + iHeader = new SIHeaderROM( this, aStream ); + + // We treat ourselves as one giant blob + SIContentROM file = new SIContentROM( this ); + base.RegisterFile( file ); + + base.Trace( "[SymbianImageROM] Ctor() - END" ); + } + #endregion + + #region API + public static bool IsROM( Stream aStream ) + { + bool ret = false; + // + try + { + ret = SIHeaderROM.IsROM( aStream ); + } + catch ( Exception ) + { + } + // + return ret; + } + #endregion + + #region From SIImage + public override SIHeader Header + { + get { return iHeader; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly SIHeaderROM iHeader; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/SDemandPagingConfig.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/SDemandPagingConfig.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianStructuresLib.Version; + +namespace SymbianImageLib.ROM.Structures +{ + internal class SDemandPagingConfig + { + #region Constructors + #endregion + + #region API + public void Read( BinaryReader aReader ) + { + iMinPages = aReader.ReadUInt16(); + iMaxPages = aReader.ReadUInt16(); + iYoungOldRatio = aReader.ReadUInt16(); + } + #endregion + + #region Properties + public uint Size + { + get + { + int ret = 6 + ( iSpare.Length * 2 ); + return (uint) ret; + } + } + + public ushort MinPages + { + get { return iMinPages; } + } + + public ushort MaxPages + { + get { return iMaxPages; } + } + + public ushort YoungOldRatio + { + get { return iYoungOldRatio; } + } + #endregion + + #region Internal constants + #endregion + + #region Data members + private ushort iMinPages; + private ushort iMaxPages; + private ushort iYoungOldRatio; + private ushort[] iSpare = new ushort[3]; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/SRomPageInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/SRomPageInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianStructuresLib.Version; + +namespace SymbianImageLib.ROM.Structures +{ + internal class SRomPageInfo + { + #region Enumerations + public enum TSymbianCompressionType + { + ENoCompression = 0, + EBytePair, + } + #endregion + + #region Static constructors + public static SRomPageInfo New( Stream aStream, uint aOffsetToStartOfRomData ) + { + byte[] data = new byte[ Size ]; + aStream.Read( data, 0, data.Length ); + return new SRomPageInfo( data, aOffsetToStartOfRomData ); + } + #endregion + + #region Constructors + private SRomPageInfo( byte[] aArray, uint aOffsetToStartOfRomData ) + { + uint delta = 0; + // + iDataStart = aOffsetToStartOfRomData + ReadUint( aArray, ref delta ); + iDataSize = ReadUshort( aArray, ref delta ); + iCompressionType = (TSymbianCompressionType) aArray[ delta++ ]; + iPagingAttributes = (TAttributes) aArray[ delta++ ]; + } + #endregion + + #region Constants + public const int KPageSize = 0x1000; + #endregion + + #region Properties + public static uint Size + { + get { return 8; } + } + + public bool IsPageable + { + get { return ( iPagingAttributes & TAttributes.EPageable ) == TAttributes.EPageable; } + } + + public TSymbianCompressionType CompressionType + { + get + { + // Rather frustratingly, even unpageable areas of the ROM still report their + // compression type as "byte pair". We must zero this out, since they are + // definitely not compressed. + if ( !IsPageable ) + { + return TSymbianCompressionType.ENoCompression; + } + // + return iCompressionType; + } + } + + public uint DataStart + { + get { return iDataStart; } + } + + public uint DataSize + { + get { return iDataSize; } + } + #endregion + + #region Internal enumerations + [Flags] + private enum TAttributes + { + EPageable = 1 << 0 + } + #endregion + + #region Internal methods + private static uint ReadUint( byte[] aArray, ref uint aOffset ) + { + uint ret = 0; + // + ret += (uint) ( aArray[ aOffset + 0 ] << 00 ); + ret += (uint) ( aArray[ aOffset + 1 ] << 08 ); + ret += (uint) ( aArray[ aOffset + 2 ] << 16 ); + ret += (uint) ( aArray[ aOffset + 3 ] << 24 ); + // + aOffset += 4; + // + return ret; + } + + private static ushort ReadUshort( byte[] aArray, ref uint aOffset ) + { + ushort ret = 0; + // + ret += (ushort) ( aArray[ aOffset + 0 ] << 00 ); + ret += (ushort) ( aArray[ aOffset + 1 ] << 08 ); + // + aOffset += 2; + // + return ret; + } + #endregion + + #region Data members + private uint iDataStart; + private ushort iDataSize; + private TSymbianCompressionType iCompressionType; + private TAttributes iPagingAttributes; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/TExtensionRomHeader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/TExtensionRomHeader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Runtime.InteropServices; +using SymbianStructuresLib.Version; + +namespace SymbianImageLib.ROM.Structures +{ + internal class TExtensionRomHeader + { + #region Constructors + #endregion + + #region API + public void Read( BinaryReader aReader ) + { + iVersion.Read( aReader ); + iRomBase = aReader.ReadUInt32(); + iRomSize = aReader.ReadUInt32(); + iRomRootDirectoryList = aReader.ReadUInt32(); + iTime = aReader.ReadInt64(); + iCheckSum = aReader.ReadUInt32(); + iKernelVersion.Read( aReader ); + iKernelTime = aReader.ReadInt64(); + iKernelCheckSum = aReader.ReadUInt32(); + iCompressionType = aReader.ReadUInt32(); + iCompressedSize = aReader.ReadUInt32(); + iUncompressedSize = aReader.ReadUInt32(); + iRomExceptionSearchTable = aReader.ReadUInt32(); + // + int size = Marshal.SizeOf( iPad ); + byte[] pad = aReader.ReadBytes( size ); + } + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region Data members + private TVersion iVersion = new TVersion(); + private uint iRomBase; + private uint iRomSize; + private uint iRomRootDirectoryList; + private long iTime; + private uint iCheckSum; + private TVersion iKernelVersion = new TVersion(); + private long iKernelTime; + private uint iKernelCheckSum; + private uint iCompressionType; // compression type used + private uint iCompressedSize; // Size after compression + private uint iUncompressedSize; // Size before compression + private uint iRomExceptionSearchTable; + private uint[] iPad = new uint[ 32 - 15 ]; // sizeof(TExtensionRomHeader)=128 + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/TRomHeader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/TRomHeader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,206 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianStructuresLib.Version; + +namespace SymbianImageLib.ROM.Structures +{ + internal class TRomHeader + { + #region Constructors + #endregion + + #region API + public void Read( BinaryReader aReader ) + { + aReader.BaseStream.Read( iJump, 0, iJump.Length ); + iRestartVector = aReader.ReadUInt32(); + iTime = aReader.ReadInt64(); + iTimeHi = aReader.ReadUInt32(); + iRomBase = aReader.ReadUInt32(); + iRomSize = aReader.ReadUInt32(); + + iRomRootDirectoryList = aReader.ReadUInt32(); + iKernDataAddress = aReader.ReadUInt32(); + iKernelLimit = aReader.ReadUInt32(); + iPrimaryFile = aReader.ReadUInt32(); + iSecondaryFile = aReader.ReadUInt32(); + iCheckSum = aReader.ReadUInt32(); + + // Print the checksum to aid debugging + System.Diagnostics.Debug.WriteLine( string.Format( "[SIHeaderROM] checksum: 0x{0:x8}", iCheckSum ) ); + + iHardware = aReader.ReadUInt32(); + + iLanguage = aReader.ReadInt64(); + + iKernelConfigFlags = aReader.ReadUInt32(); + iRomExceptionSearchTable = aReader.ReadUInt32(); + iRomHeaderSize = aReader.ReadUInt32(); + iRomSectionHeader = aReader.ReadUInt32(); + + iTotalSvDataSize = aReader.ReadInt32(); + + iVariantFile = aReader.ReadUInt32(); + iExtensionFile = aReader.ReadUInt32(); + iRelocInfo = aReader.ReadUInt32(); + iOldTraceMask = aReader.ReadUInt32(); + iUserDataAddress = aReader.ReadUInt32(); + iTotalUserDataSize = aReader.ReadUInt32(); + iDebugPort = aReader.ReadUInt32(); + + iVersion.Read( aReader ); + + iCompressionType = aReader.ReadUInt32(); + iCompressedSize = aReader.ReadUInt32(); + iUncompressedSize = aReader.ReadUInt32(); + + ReadUintArray( aReader, iDisabledCapabilities ); + ReadUintArray( aReader, iTraceMask ); + ReadUintArray( aReader, iInitialBTraceFilter ); + + iInitialBTraceBuffer = aReader.ReadInt32(); + iInitialBTraceMode = aReader.ReadInt32(); + iPageableRomStart = aReader.ReadInt32(); + iPageableRomSize = aReader.ReadInt32(); + iRomPageIndex = aReader.ReadInt32(); + + iDemandPagingConfig.Read( aReader ); + + ReadUintArray( aReader, iSpare ); + } + #endregion + + #region Properties + public uint Size + { + get + { + return iRomHeaderSize; + } + } + + public uint RomBaseAddress + { + get { return iRomBase; } + } + + public uint CompressedSize + { + get { return iCompressedSize; } + } + + public uint UncompressedSize + { + get { return iUncompressedSize; } + } + + public uint CompressionType + { + get { return iCompressionType; } + } + + public int PageableRomStart + { + get { return iPageableRomStart; } + } + + public int PageableRomSize + { + get { return iPageableRomSize; } + } + + public uint RomPageIndex + { + get + { + return (uint) iRomPageIndex; + } + } + #endregion + + #region Internal constants + private const int KNumTraceMask = 8; + #endregion + + #region Internal methods + private void ReadUintArray( BinaryReader aReader, uint[] aArray ) + { + for ( int i = 0; i < aArray.Length; i++ ) + { + byte[] b = aReader.ReadBytes( 4 ); + uint val = 0; + // + val += (uint) ( b[ 0 ] ); + val += (uint) ( b[ 1 ] << 08 ); + val += (uint) ( b[ 2 ] << 16 ); + val += (uint) ( b[ 3 ] << 24 ); + // + aArray[ i ] = val; + } + } + #endregion + + #region Data members + private byte[] iJump = new byte[ 124 ]; + private uint iRestartVector; + private long iTime; + private uint iTimeHi; + + // Default to the old moving memory model base address. + private uint iRomBase = 0xf8000000; + private uint iRomSize; + private uint iRomRootDirectoryList; + private uint iKernDataAddress; + private uint iKernelLimit; + private uint iPrimaryFile; + private uint iSecondaryFile; + private uint iCheckSum; + private uint iHardware; + private long iLanguage; + private uint iKernelConfigFlags; + private uint iRomExceptionSearchTable; + private uint iRomHeaderSize; + private uint iRomSectionHeader; + private int iTotalSvDataSize; + private uint iVariantFile; + private uint iExtensionFile; + private uint iRelocInfo; + private uint iOldTraceMask; + private uint iUserDataAddress; + private uint iTotalUserDataSize; + private uint iDebugPort; + private TVersion iVersion = new TVersion(); + private uint iCompressionType; + private uint iCompressedSize; + private uint iUncompressedSize; + private uint[] iDisabledCapabilities = new uint[ 2 ]; + private uint[] iTraceMask = new uint[ KNumTraceMask ]; + private uint[] iInitialBTraceFilter = new uint[ 8 ]; + private int iInitialBTraceBuffer; + private int iInitialBTraceMode; + private int iPageableRomStart; + private int iPageableRomSize; + private int iRomPageIndex; + private SDemandPagingConfig iDemandPagingConfig = new SDemandPagingConfig(); + private uint[] iSpare = new uint[ 40 ]; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/TRomLoad.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/TRomLoad.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace SymbianImageLib.ROM.Structures +{ + internal class TRomLoad + { + #region Constructors + #endregion + + #region API + public void Read( BinaryReader aReader ) + { + ReadBytesAsChars( aReader, iName ); + ReadBytesAsChars( aReader, iVersionStr ); + ReadBytesAsChars( aReader, iBuildNumStr ); + iRomSize = aReader.ReadUInt32(); + iWrapSize = aReader.ReadUInt32(); + } + #endregion + + #region Properties + public static uint Size + { + get + { + uint ret = 0; + // + ret += KRomNameSize; + ret += 4; // iVersionStr + ret += 4; // iBuildNumStr + ret += 4; // iRomSize + ret += 4; // iWrapSize + // + return ret; + } + } + + public string Name + { + get + { + + StringBuilder ret = new StringBuilder(); + ret.Append( iName ); + return ret.ToString(); + } + } + + public string Version + { + get + { + StringBuilder ret = new StringBuilder(); + ret.Append( iVersionStr ); + return ret.ToString(); + } + } + + public string BuildNumber + { + get + { + StringBuilder ret = new StringBuilder(); + ret.Append( iBuildNumStr ); + return ret.ToString(); + } + } + #endregion + + #region Internal constants + private const int KRomNameSize = 16; + #endregion + + #region Internal methods + private void ReadBytesAsChars( BinaryReader aReader, char[] aDest ) + { + byte[] bytes = aReader.ReadBytes( aDest.Length ); + // + int pos = 0; + foreach ( byte b in bytes ) + { + aDest[ pos++ ] = System.Convert.ToChar( b ); + } + } + #endregion + + #region Data members + private char[] iName = new char[ KRomNameSize ]; + private char[] iVersionStr = new char[ 4 ]; + private char[] iBuildNumStr = new char[ 4 ]; + private uint iRomSize; + private uint iWrapSize; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/TRomLoaderHeader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/ROM/Structures/TRomLoaderHeader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace SymbianImageLib.ROM.Structures +{ + internal class TRomLoaderHeader + { + #region Constructors + public TRomLoaderHeader() + { + uint sizeOfRomLoad = TRomLoad.Size; + iPadding = new byte[ KRomWrapperSize - sizeOfRomLoad ]; + } + #endregion + + #region API + public void Read( BinaryReader aReader ) + { + iRomLoad.Read( aReader ); + aReader.BaseStream.Read( iPadding, 0, iPadding.Length ); + } + #endregion + + #region Properties + public uint Size + { + get + { + uint ret = TRomLoad.Size; + ret += (uint) iPadding.Length; + return ret; + } + } + #endregion + + #region Internal constants + private const int KRomWrapperSize = 0x100; + private const int KRomLoadSize = 0xc8; + #endregion + + #region Data members + private TRomLoad iRomLoad = new TRomLoad(); + private byte[] iPadding = new byte[ 0 ]; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/SymbianImageLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianImageLib/SymbianImageLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,92 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB} + Library + Properties + SymbianImageLib + SymbianImageLib + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/ArchitecturallyUndefined/Arm_ArchitecturallyUndefined.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/ArchitecturallyUndefined/Arm_ArchitecturallyUndefined.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.ArchitecturallyUndefined +{ + public class Arm_ArchitecturallyUndefined : ArmInstruction + { + #region Constructors + public Arm_ArchitecturallyUndefined() + { + base.SetMask( "####" + "011" + "11111" + "############" + "1111" + "####" ); + base.AIGroup = SymbianStructuresLib.Arm.Instructions.TArmInstructionGroup.EGroupUndefined; + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From System.Object + #endregion + + #region From IArmInstruction + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/ArmInstruction.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/ArmInstruction.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm +{ + public abstract class ArmInstruction : ArmBaseInstruction + { + #region Constructors + protected ArmInstruction() + : base( TArmInstructionSet.EARM ) + { + } + #endregion + + #region API + public SymBit IBit + { + get { return this[ ArmInstruction.KBitIndexI ]; } + } + + public SymBit PBit + { + get { return this[ ArmInstruction.KBitIndexP ]; } + } + + public SymBit UBit + { + get { return this[ ArmInstruction.KBitIndexU ]; } + } + + public SymBit SBit + { + get { return this[ ArmInstruction.KBitIndexS ]; } + } + + public SymBit WBit + { + get { return this[ ArmInstruction.KBitIndexW ]; } + } + + public SymBit LBit + { + get { return this[ ArmInstruction.KBitIndexL ]; } + } + #endregion + + #region From ArmBaseInstruction + protected override void OnRawValueAssigned() + { + base.OnRawValueAssigned(); + base.AIConditionCode = (TArmInstructionCondition) KMask_Condition.Apply( base.AIRawValue ); + } + #endregion + + #region Constants + // Type-specific + public const int KBitIndexI = 25; + + // Common + public const int KBitIndexP = 24; + public const int KBitIndexU = 23; + public const int KBitIndexS = 22; + public const int KBitIndexW = 21; + public const int KBitIndexL = 20; + + // VFP specific + public const int KVFPBitIndexD = 22; + #endregion + + #region Internal constants + private static readonly SymMask KMask_Condition = new SymMask( 15u << 28, SymMask.TShiftDirection.ERight, 28 ); + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Arm_Unknown.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Arm_Unknown.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianInstructionLib.Arm.Instructions.Arm +{ + public class Arm_Unknown : ArmInstruction + { + #region Constructors + public Arm_Unknown() + { + } + #endregion + + #region API + public override bool Matches( uint aOpCode ) + { + // Matches everything + return true; + } + #endregion + + #region Properties + #endregion + + #region From System.Object + #endregion + + #region From IArmInstruction + public new bool AIIsUnknown + { + get { return true; } + } + #endregion + + #region From ArmBaseInstruction + internal override int SortOrder + { + get { return int.MinValue; } + } + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_B.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_B.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.Branching +{ + [ArmRefAttribute( "", "" )] + public class Arm_B : Arm_Branch_Immediate + { + #region Constructors + public Arm_B() + { + // cond 101 L signed_immed_24 + // 1110 101 0 00001000 00100111 00100101 => 0x00209cc8 + base.SetMask( "#### 101 0 ########", "######## ########" ); + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_BL.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_BL.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.Branching +{ + [ArmRefAttribute( "", "" )] + public class Arm_BL : Arm_Branch_Immediate + { + #region Constructors + public Arm_BL() + { + // cond 101 L signed_immed_24 + // 1110 101 1 00001000 00100111 00100101 => 0x00209cc8 + base.SetMask( "#### 101 1 ########", "######## ########" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + bool ret = false; + // + bool linkSaved = base[ 24 ] == SymbianUtils.BasicTypes.SymBit.ESet; + if ( linkSaved ) + { + ret = ( aRegister == TArmRegisterType.EArmReg_LR ); + } + // + return ret; + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_BLX_Immediate.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_BLX_Immediate.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.Branching +{ + [ArmRefAttribute( "A4.1.8 BLX (1)", "BLX " )] + public class Arm_BLX_Immediate : Arm_Branch_Immediate + { + #region Constructors + public Arm_BLX_Immediate() + { + // 101 H signed_immed_24 + // 1111 101 0 00001000 00100111 00100101 + base.SetMask( "1111 101 # ########", "######## ########" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + return ( aRegister == TArmRegisterType.EArmReg_LR ); + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_BLX_Register.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_BLX_Register.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.Branching +{ + [ArmRefAttribute( "A4.1.9 BLX (2)", "BLX{} " )] + public class Arm_BLX_Register : Arm_Branch_Register + { + #region Constructors + public Arm_BLX_Register() + { + // cond SBO SBO SBO Rm + // 1110 00010010 1111 1111 1111 0011 0001 + base.SetMask( "####" + "00010010" + "1111" + "1111" + "1111" + "0011" + "####" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + return ( aRegister == TArmRegisterType.EArmReg_LR ); + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_BX.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_BX.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.Branching +{ + [ArmRefAttribute( "A4.1.10 BX", "BX{} " )] + public class Arm_BX : Arm_Branch_Register + { + #region Constructors + public Arm_BX() + { + // cond SBO SBO SBO Rm + // 1110 00010010 1111 1111 1111 0001 0001 + base.SetMask( "####" + "00010010" + "1111" + "1111" + "1111" + "0001" + "####" ); + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_BXJ.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Arm_BXJ.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.Branching +{ + [ArmRefAttribute( "A4.1.11 BXJ", "BXJ{} " )] + public class Arm_BXJ : Arm_Branch_Register + { + #region Constructors + public Arm_BXJ() + { + // cond SBO SBO SBO Rm + // 1110 00010010 1111 1111 1111 0010 0001 + base.SetMask( "####" + "00010010" + "1111" + "1111" + "1111" + "0010" + "####" ); + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Bases/Arm_Branch.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Bases/Arm_Branch.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.Branching +{ + public abstract class Arm_Branch : ArmInstruction + { + #region Constructors + protected Arm_Branch() + { + base.AIGroup = SymbianStructuresLib.Arm.Instructions.TArmInstructionGroup.EGroupBranch; + } + #endregion + + #region Framework API + public abstract int BranchOffset + { + get; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Bases/Arm_Branch_Immediate.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Bases/Arm_Branch_Immediate.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.Branching +{ + public abstract class Arm_Branch_Immediate : Arm_Branch + { + #region Constructors + protected Arm_Branch_Immediate() + { + } + #endregion + + #region From Arm_Branch + public override int BranchOffset + { + get + { + int offset = ArmInstructionUtils.SignExtend24BitTo32Bit( base.AIRawValue & 0x00FFFFFF ); + return offset; + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Bases/Arm_Branch_Register.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/Branching/Bases/Arm_Branch_Register.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.Branching +{ + public abstract class Arm_Branch_Register : Arm_Branch + { + #region Constructors + protected Arm_Branch_Register() + { + } + #endregion + + #region From Arm_Branch + public override int BranchOffset + { + get + { + int offset = ArmInstructionUtils.SignExtend24BitTo32Bit( base.AIRawValue & 0x00FFFFFF ); + return offset; + } + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + TArmRegisterType branchReg = this.RegisterContainingBranchAddress; + return ( aRegister == branchReg ); + } + #endregion + + #region Properties + public TArmRegisterType RegisterContainingBranchAddress + { + get + { + TArmRegisterType ret = (TArmRegisterType) base.AIRawValue[ 3, 0 ].ToUInt(); + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataProcessing/Arm_DataProcessing_32BitImmediate.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataProcessing/Arm_DataProcessing_32BitImmediate.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataProcessing +{ + public class Arm_DataProcessing_32BitImmediate : Arm_DataProcessing + { + #region Constructors + public Arm_DataProcessing_32BitImmediate() + : base( TEncoding.EEncoding32BitImmediate ) + { + // Cond Op. S Rn Rd rotate_imm imm_8 + base.SetMask( "####" + "001" + "####" + "#" + "####" + "####" + "####" + "########" ); + } + #endregion + + #region From Arm_DataProcessing + public override uint Immediate + { + get + { + byte rotate = this.RotateImm; + SymUInt8 immediate = this.Immediate8; + // + int rotateAmount = (int) ( rotate * 2 ); + SymUInt32 ret = immediate.RotateRight( rotateAmount ); + return ret; + } + } + + public override bool SuppliesImmediate + { + get { return true; } + } + #endregion + + #region Properties + public byte RotateImm + { + get + { + byte rotate_imm = (byte) KMaskRotate.Apply( base.AIRawValue ); + return rotate_imm; + } + } + + public byte Immediate8 + { + get + { + byte immediate_8 = (byte) ( base.AIRawValue & 0xFF ); + return immediate_8; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private static readonly SymMask KMaskRotate = new SymMask( 0xF00, SymMask.TShiftDirection.ERight, 8 ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataProcessing/Arm_DataProcessing_Shift_Immediate.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataProcessing/Arm_DataProcessing_Shift_Immediate.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataProcessing +{ + public class Arm_DataProcessing_Shift_Immediate : Arm_DataProcessing_Shift + { + #region Constructors + public Arm_DataProcessing_Shift_Immediate() + : base( TEncoding.EEncodingShiftsImmediate ) + { + // Cond Op. S Rn Rd shift_imm shift Rm + base.SetMask( "####" + "000" + "####" + "#" + "####" + "####" + "#####" + "##" + "0" + "####" ); + } + #endregion + + #region From Arm_DataProcessing + public override bool SuppliesImmediate + { + get { return true; } + } + + public override uint Immediate + { + get + { + byte ret = base.AIRawValue[ 11, 7 ]; + + TShiftType type = base.ShiftType; + + // Some of the shift types use a value of 0 to mean 32 bits. + if ( type == TShiftType.EShiftLogicalRight && ret == 0 ) + { + ret = 32; + } + else if ( type == TShiftType.EShiftArithmeticRight && ret == 0 ) + { + ret = 32; + } + + return ret; + } + } + #endregion + + #region Properties + public override TShiftType ShiftType + { + get + { + TShiftType type = base.ShiftType; + + // Some of the immediate values can actually alter the shift types. + uint immediate = Immediate; + if ( immediate == 0 && type == TShiftType.EShiftRotateRight ) + { + // Rotate right by 32 bits is the same as an RRX. + type = TShiftType.EShiftRotateRightWithExtend; + } + else if ( immediate == 0 && type == TShiftType.EShiftLogicalLeft ) + { + // LSL of 0 is actually not a shift. + type = TShiftType.EShiftNone; + } + + return type; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataProcessing/Arm_DataProcessing_Shift_Register.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataProcessing/Arm_DataProcessing_Shift_Register.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataProcessing +{ + public class Arm_DataProcessing_Shift_Register : Arm_DataProcessing_Shift + { + #region Constructors + public Arm_DataProcessing_Shift_Register() + : base( TEncoding.EEncodingShiftsRegister ) + { + // Cond Op. S Rn Rd Rs shift Rm + base.SetMask( "####" + "000" + "####" + "#" + "####" + "####" + "####" + "0" + "##" + "1" + "####" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + bool ret = base.DoQueryInvolvementAsSource( aRegister ); + // + if ( ret == false ) + { + TArmRegisterType reg3 = this.Rs; + ret = ( reg3 == aRegister ); + } + // + return ret; + } + #endregion + + #region API + #endregion + + #region Properties + public TArmRegisterType Rs + { + get + { + TArmRegisterType ret = (TArmRegisterType) base.AIRawValue[ 11, 8 ].ToUInt(); + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataProcessing/Bases/Arm_DataProcessing.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataProcessing/Bases/Arm_DataProcessing.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataProcessing +{ + public abstract class Arm_DataProcessing : ArmInstruction + { + #region Enumerations + public enum TEncoding + { + EEncodingNotSupported = -1, + EEncoding32BitImmediate = 0, + EEncodingShiftsImmediate, + EEncodingShiftsRegister + } + #endregion + + #region Constructors + protected Arm_DataProcessing( TEncoding aEncoding ) + { + iEncoding = aEncoding; + base.AIGroup = SymbianStructuresLib.Arm.Instructions.TArmInstructionGroup.EGroupDataProcessing; + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + TArmRegisterType reg1 = Rn; + return ( aRegister == reg1 ); + } + + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + TArmRegisterType reg = Rd; + return ( aRegister == reg ); + } + #endregion + + #region Framework API + public virtual uint Immediate + { + get { return 0; } + } + + public virtual bool SuppliesImmediate + { + get { return false; } + } + #endregion + + #region Properties + public TEncoding Encoding + { + get { return iEncoding; } + } + + public TArmDataProcessingType OperationType + { + get + { + TArmDataProcessingType ret = (TArmDataProcessingType) base.AIRawValue[ 24, 21 ].ToUInt(); + return ret; + } + } + + public TArmRegisterType Rn + { + get + { + TArmRegisterType ret = (TArmRegisterType) base.AIRawValue[ 19, 16 ].ToUInt(); + return ret; + } + } + + public TArmRegisterType Rd + { + get + { + TArmRegisterType ret = (TArmRegisterType) base.AIRawValue[ 15, 12 ].ToUInt(); + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly TEncoding iEncoding; + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataProcessing/Bases/Arm_DataProcessing_Shift.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataProcessing/Bases/Arm_DataProcessing_Shift.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataProcessing +{ + public abstract class Arm_DataProcessing_Shift : Arm_DataProcessing + { + #region Enumerations + public enum TShiftType + { + EShiftNone = -1, + EShiftLogicalLeft = 0, + EShiftLogicalRight, + EShiftArithmeticRight, + EShiftRotateRight, + EShiftRotateRightWithExtend + } + #endregion + + #region Constructors + protected Arm_DataProcessing_Shift( TEncoding aEncoding ) + : base( aEncoding ) + { + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + TArmRegisterType reg1 = base.Rn; + TArmRegisterType reg2 = this.Rm; + return ( aRegister == reg1 || aRegister == reg2 ); + } + #endregion + + #region From ArmInstruction + public override bool Matches( uint aOpCode ) + { + // If the following values hold true then it is not a data processing instruction at all. + // + // bit[25] == 0 + // bit[ 4] == 1 + // bit[ 7] == 1 + // + bool match = base.Matches( aOpCode ); + if ( match ) + { + SymUInt32 raw = aOpCode; + if ( raw[ 25 ] == SymBit.EClear && raw[ 4 ] == SymBit.ESet && raw[ 7 ] == SymBit.ESet ) + { + match = false; + } + } + // + return match; + } + #endregion + + #region API + #endregion + + #region Properties + public virtual TShiftType ShiftType + { + get + { + TShiftType ret = (TShiftType) base.AIRawValue[ 6, 5 ].ToUInt(); + return ret; + } + } + + public TArmRegisterType Rm + { + get + { + TArmRegisterType ret = (TArmRegisterType) base.AIRawValue[ 3, 0 ].ToUInt(); + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Arm_FSTMD.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Arm_FSTMD.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Registers.VFP; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataTransfer +{ + [ArmRefAttribute( "C4.1.56 FSTMD", "FSTMD{} {!}, " )] + public class Arm_FSTMD : Arm_LoadOrStoreMultiple_VFP + { + #region Constructors + public Arm_FSTMD() + { + // Same as FSTMDBD (non-stacking) + // + // 1110 => Condition = "Always" + // 110 => FSTMD (1) instruction signature + // 1 => P = addressing mode + // 0 => U = addressing mode + // 0 => ? + // 1 => W = write a modified value back to its base register Rn + // 0 => ? + // 1101 => Rn = Specifies the base register used by . => SP + // + // Cond PU SWL Rn Dd offset + base.SetMask( "####" + "110" + "##" + "0#0" + "####" + "####" + "1011" + "########" ); + } + #endregion + + #region From Arm_LoadOrStore + public override TArmDataTransferType DataTransferType + { + get { return TArmDataTransferType.EStore; } + } + #endregion + + #region API + #endregion + + #region Properties + public override TArmRegisterTypeVFP FirstRegister + { + get + { + uint firstReg = Arm_LoadOrStoreMultiple_VFP.KMaskFirstReg.Apply( base.AIRawValue ); + TArmRegisterTypeVFP ret = (TArmRegisterTypeVFP) firstReg; + return ret; + } + } + + public override TArmRegisterTypeVFP[] Registers + { + get + { + uint offset = base.Offset; + uint firstReg = (uint) this.FirstRegister; + uint regCount = (uint) ( offset / 2 ); + + List regs = new List(); + for ( uint i = firstReg; i < regCount + firstReg; i++ ) + { + regs.Add( (TArmRegisterTypeVFP) i ); + } + // + return regs.ToArray(); + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Arm_FSTMS.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Arm_FSTMS.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Registers.VFP; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataTransfer +{ + [ArmRefAttribute( "C4.1.57 FSTMS", "FSTMS{} {!}, " )] + public class Arm_FSTMS : Arm_LoadOrStoreMultiple_VFP + { + #region Constructors + public Arm_FSTMS() + { + // Same as FSTMDBS (non-stacking) + // + // 1110 => Condition = "Always" + // 110 => FSTMD (1) instruction signature + // 1 => P = addressing mode + // 0 => U = addressing mode + // 0 => ? + // 1 => W = write a modified value back to its base register Rn + // 0 => ? + // 1101 => Rn = Specifies the base register used by . => SP + // + // Cond PU D WL Rn Fd offset + base.SetMask( "####" + "110" + "##" + "#" + "#0" + "####" + "####" + "1010" + "########" ); + } + #endregion + + #region From Arm_LoadOrStore + public override TArmDataTransferType DataTransferType + { + get { return TArmDataTransferType.EStore; } + } + #endregion + + #region API + #endregion + + #region Properties + public override TArmRegisterTypeVFP FirstRegister + { + get + { + // Get bits 15-12 inclusive + uint firstReg = Arm_LoadOrStoreMultiple_VFP.KMaskFirstReg.Apply( base.AIRawValue ); + + // Shift one to the left to make room for 'D' + firstReg <<= 1; + + // Now add D + firstReg |= (uint) base.AIRawValue[ 22 ]; + + // We must rebase these in alignment with the first single precision register + // value. + TArmRegisterTypeVFP ret = (TArmRegisterTypeVFP) ( firstReg + (uint) TArmRegisterTypeVFP.S00 ); + + return ret; + } + } + + public override TArmRegisterTypeVFP[] Registers + { + get + { + uint regCount = base.Offset; + uint firstReg = (uint) this.FirstRegister; + + List regs = new List(); + for ( uint i = firstReg; i < regCount + firstReg; i++ ) + { + regs.Add( (TArmRegisterTypeVFP) i ); + } + // + return regs.ToArray(); + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Arm_LDM.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Arm_LDM.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataTransfer +{ + [ArmRefAttribute( "A4.1.20 LDM(1) + A5.4.1 Encoding", "LDM{} {!}, " )] + public class Arm_LDM : Arm_LoadOrStoreMultiple_GP + { + #region Enumerations + public enum TType + { + ETypeNotSupported = -1, + ETypeNonEmptyGP = 0, + ETypeUserModeWhenInPrivilaged, + ETypeGPAndPCAndUpdateCPSR + } + #endregion + + #region Constructors + public Arm_LDM() + { + // 4 3 4 16 bits + // --------------------------------------------------- + // cond 100 P U S W L Rn register list + // 1110 100 0 1 0 1 1 1101 1000111111110000 + // + // P = indicates that the word addressed by Rn is included in the range of memory + // locations accessed, lying at the top (U==0) or bottom (U==1) of that range. + // + // U = Indicates that the transfer is made upwards (U==1) or downwards (U==0) from + // the base register. + // + // S = For LDMs that load the PC, the S bit indicates that the CPSR is loaded + // from the SPSR. + // + // W = Indicates that the base register is updated after the transfer. The base + // register is incremented (U==1) or decremented (U==0) by four times the + // number of registers in the register list. + // + // L = Distinguishes between Load (L==1) and Store (L==0) instructions. + // + // Rn = Specifies the base register used by . Using R15 as + // the base register gives an UNPREDICTABLE result. + // + // This mask translates to "LDM's that load PC from SP" + // 1110 100 01011 1101 1000111111110000 + base.SetMask( "####" + "100" + "##" + "##1" + "####" + "######## ########" ); + } + #endregion + + #region From ArmInstruction + public override bool Matches( uint aOpCode ) + { + bool match = base.Matches( aOpCode ); + if ( match ) + { + TType type = StaticInternalType( aOpCode ); + match = ( type != TType.ETypeNotSupported ); + } + return match; + } + #endregion + + #region From Arm_LoadOrStore + public override TArmDataTransferType DataTransferType + { + get { return TArmDataTransferType.ELoad; } + } + #endregion + + #region Properties + public TType Type + { + get { return iType; } + } + #endregion + + #region From ArmBaseInstruction + protected override void OnRawValueAssigned() + { + base.OnRawValueAssigned(); + iType = InternalType; + } + #endregion + + #region Internal methods + private new SymBit SBit // Hide + { + get { return SymBit.EClear; } + } + + private TType InternalType + { + get + { + uint raw = base.AIRawValue; + TType ret = StaticInternalType( raw ); + return ret; + } + } + + private static TType StaticInternalType( uint aRaw ) + { + TType ret = TType.ETypeNotSupported; + // + if ( KLDM1.IsMatch( aRaw ) ) + { + ret = TType.ETypeNonEmptyGP; + } + else if ( KLDM2.IsMatch( aRaw ) ) + { + ret = TType.ETypeUserModeWhenInPrivilaged; + } + else if ( KLDM3.IsMatch( aRaw ) ) + { + ret = TType.ETypeGPAndPCAndUpdateCPSR; + } + // + return ret; + } + #endregion + + #region Data members + private TType iType = TType.ETypeNotSupported; + private static readonly SymMask KLDM1 = new SymMask( "####" + "100" + "##" + "0#1" + "####" + "######## ########" ); + private static readonly SymMask KLDM2 = new SymMask( "####" + "100" + "##" + "101" + "####" + "0####### ########" ); + private static readonly SymMask KLDM3 = new SymMask( "####" + "100" + "##" + "1#1" + "####" + "1####### ########" ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Arm_STM.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Arm_STM.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataTransfer +{ + [ArmRefAttribute( "A4.1.98 STM (1)", "STM{} {!}, " )] + public class Arm_STM : Arm_LoadOrStoreMultiple_GP + { + #region Enumerations + public enum TType + { + ETypeNotSupported = -1, + ETypeNonEmptyGP = 0, + ETypeNonEmptyUserMode + } + #endregion + + #region Constructors + public Arm_STM() + { + // STM (1) (Store Multiple) stores a non-empty subset (or possibly all) of the general-purpose registers to + // sequential memory locations. + // + // 4 3 4 16 bits + // --------------------------------------------------- + // cond 100 P U S W L Rn register list + // 1110 100 1 0 0 1 0 1101 0100000000010000 + // + // 1110 => Condition = "Always" + // 100 => STM (1) instruction signature + // 1 => P = addressing mode + // 0 => U = addressing mode + // 0 => S = indicates that when the processor is in a privileged mode + // 1 => W = write a modified value back to its base register Rn + // 0 => L = distinguishes between a Load (L==1) and a Store (L==0) instruction. + // 1101 => Rn = Specifies the base register used by . => SP + // + base.SetMask( "####" + "100" + "##" + "##0" + "####" + "######## ########" ); + } + #endregion + + #region From Arm_LoadOrStore + public override TArmDataTransferType DataTransferType + { + get { return TArmDataTransferType.EStore; } + } + #endregion + + #region From ArmInstruction + public override bool Matches( uint aOpCode ) + { + bool match = base.Matches( aOpCode ); + if ( match ) + { + TType type = StaticInternalType( aOpCode ); + match = ( type != TType.ETypeNotSupported ); + } + return match; + } + #endregion + + #region Properties + public TType Type + { + get { return iType; } + } + #endregion + + #region Internal methods + private new SymBit SBit // Hide + { + get { return SymBit.EClear; } + } + + private TType InternalType + { + get + { + uint raw = base.AIRawValue; + TType ret = StaticInternalType( raw ); + return ret; + } + } + + private static TType StaticInternalType( uint aRaw ) + { + TType ret = TType.ETypeNotSupported; + // + if ( KSTM1.IsMatch( aRaw ) ) + { + ret = TType.ETypeNonEmptyGP; + } + else if ( KSTM2.IsMatch( aRaw ) ) + { + ret = TType.ETypeNonEmptyUserMode; + } + // + return ret; + } + #endregion + + #region Data members + private TType iType = TType.ETypeNotSupported; + private static readonly SymMask KSTM1 = new SymMask( "####" + "100" + "##" + "0#0" + "####" + "######## ########" ); + private static readonly SymMask KSTM2 = new SymMask( "####" + "100" + "##" + "101" + "####" + "0####### ########" ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Bases/Arm_LoadOrStore.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Bases/Arm_LoadOrStore.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataTransfer +{ + public abstract class Arm_LoadOrStore : ArmInstruction + { + #region Constructors + protected Arm_LoadOrStore() + { + base.AIGroup = SymbianStructuresLib.Arm.Instructions.TArmInstructionGroup.EGroupDataTransfer; + } + #endregion + + #region API + #endregion + + #region Properties + public abstract TArmDataTransferType DataTransferType + { + get; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Bases/Arm_LoadOrStoreMultiple.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Bases/Arm_LoadOrStoreMultiple.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataTransfer +{ + public abstract class Arm_LoadOrStoreMultiple : Arm_LoadOrStore + { + #region Constructors + protected Arm_LoadOrStoreMultiple() + { + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + bool ret = false; + // + TArmDataTransferType type = this.DataTransferType; + if ( type == TArmDataTransferType.EStore ) + { + // STMFD R13!, {R0 - R12, LR} + // r13 = dest, r0->r12, r14 are source registers + // + // Cannot test here, requires derived class to implement this check + } + else if ( type == TArmDataTransferType.ELoad ) + { + // LDMFD R13!, {R0 - R12, PC} + // r13 = source, r0->r12, r15 are destination registers + TArmRegisterType baseReg = this.BaseRegister; + ret = ( aRegister == baseReg ); + } + // + return ret; + } + + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + bool ret = false; + // + TArmDataTransferType type = this.DataTransferType; + if ( type == TArmDataTransferType.EStore ) + { + // STMFD R13!, {R0 - R12, LR} + // r13 = dest, r0->r12, r14 are source registers + TArmRegisterType baseReg = this.BaseRegister; + ret = ( aRegister == baseReg ); + } + else if ( type == TArmDataTransferType.ELoad ) + { + // LDMFD R13!, {R0 - R12, PC} + // r13 = source, r0->r12, r15 are destination registers + // + // Cannot test here, requires derived class to implement this check + } + // + return ret; + } + #endregion + + #region API + #endregion + + #region Properties + public abstract TArmRegisterType BaseRegister + { + get; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Bases/Arm_LoadOrStoreMultiple_GP.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Bases/Arm_LoadOrStoreMultiple_GP.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataTransfer +{ + public abstract class Arm_LoadOrStoreMultiple_GP : Arm_LoadOrStoreMultiple + { + #region Constructors + protected Arm_LoadOrStoreMultiple_GP() + { + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + TArmDataTransferType type = this.DataTransferType; + // + bool ret = base.DoQueryInvolvementAsSource( aRegister ); + if ( ret == false && type == TArmDataTransferType.EStore ) + { + // STMFD R13!, {R0 - R12, LR} + // r13 = dest, r0->r12, r14 are source registers + List regs = this.RegistersAsList; + ret = regs.Contains( aRegister ); + } + // + return ret; + } + + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + TArmDataTransferType type = this.DataTransferType; + // + bool ret = base.DoQueryInvolvementAsDestination( aRegister ); + if ( ret == false && type == TArmDataTransferType.ELoad ) + { + // LDMFD R13!, {R0 - R12, PC} + // r13 = source, r0->r12, r15 are destination registers + List regs = this.RegistersAsList; + ret = regs.Contains( aRegister ); + } + // + return ret; + } + #endregion + + #region API + #endregion + + #region Properties + public bool AffectsPC + { + get + { + SymBit pcBit = SymBitUtils.GetBit( base.AIRawValue, 15 ); + return ( pcBit == SymBit.ESet ); + } + } + + public override TArmRegisterType BaseRegister + { + get + { + SymMask mask = new SymMask( 0xF << 16, SymMask.TShiftDirection.ERight, 16 ); + TArmRegisterType ret = (TArmRegisterType) mask.Apply( base.AIRawValue ); + return ret; + } + } + + public TArmRegisterType[] Registers + { + get + { + TArmRegisterType[] list = RegistersAsList.ToArray(); + return list; + } + } + + public TArmInstructionAddressingMode AddressingMode + { + get + { + SymMask mask = new SymMask( 3u << 23, SymMask.TShiftDirection.ERight, 23 ); + TArmInstructionAddressingMode mode = (TArmInstructionAddressingMode) mask.Apply( base.AIRawValue ); + return mode; + } + } + #endregion + + #region Internal methods + private List RegistersAsList + { + get + { + List list = ArmInstructionUtils.ExtractGPRegisterList( base.AIRawValue & 0x0000FFFF ); + return list; + } + } + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Bases/Arm_LoadOrStoreMultiple_VFP.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/DataTransfer/Bases/Arm_LoadOrStoreMultiple_VFP.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Registers.VFP; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.DataTransfer +{ + public abstract class Arm_LoadOrStoreMultiple_VFP : Arm_LoadOrStoreMultiple + { + #region Constructors + protected Arm_LoadOrStoreMultiple_VFP() + { + base.AITarget = TArmInstructionTarget.EVectorFloatingPoint; + } + #endregion + + #region Frin Arm_LoadOrStoreMultiple + public override TArmRegisterType BaseRegister + { + get + { + SymMask mask = new SymMask( 0xF << 16, SymMask.TShiftDirection.ERight, 16 ); + TArmRegisterType ret = (TArmRegisterType) mask.Apply( base.AIRawValue ); + return ret; + } + } + #endregion + + #region Framework API + public abstract TArmRegisterTypeVFP FirstRegister + { + get; + } + + public abstract TArmRegisterTypeVFP[] Registers + { + get; + } + #endregion + + #region Properties + public TArmInstructionAddressingModeVFP AddressingMode + { + get + { + // The address mode is a combination of P U and W bits. + TArmInstructionAddressingModeVFP ret = TArmInstructionAddressingModeVFP.EUndefined; + + // First extract P and U bits. NB: We shift this only 22 to the right because + // we are about to inject the 'W' bit at bit zero. + SymMask maskPU = new SymMask( 3u << 23, SymMask.TShiftDirection.ERight, 22 ); + uint bits = maskPU.Apply( base.AIRawValue ); + + // Extract W bit + SymBit wBit = base.AIRawValue[ ArmInstruction.KBitIndexW ]; + bits |= (uint) wBit; + + switch ( bits ) + { + case 0: + case 1: + case 7: + default: + break; + // P U W + case 2: // 0 1 0 + ret = TArmInstructionAddressingModeVFP.EUnindexed; + break; + case 3: // 0 1 0 + ret = TArmInstructionAddressingModeVFP.EIncrement; + break; + case 4: // 1 0 0 + ret = TArmInstructionAddressingModeVFP.EOffsetNegative; + break; + case 5: // 1 0 1 + ret = TArmInstructionAddressingModeVFP.EDecrement; + break; + case 6: // 1 1 0 + ret = TArmInstructionAddressingModeVFP.EOffsetPositive; + break; + } + // + return ret; + } + } + + public uint Offset + { + get + { + uint offset = base.AIRawValue & 0xFF; + return offset; + } + } + #endregion + + #region Internal constants + protected readonly static SymMask KMaskFirstReg = new SymMask( 0xF000, SymMask.TShiftDirection.ERight, 12 ); + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/SWI/Arm_SWI.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Arm/SWI/Arm_SWI.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianInstructionLib.Arm.Instructions.Arm.SWI +{ + public class Arm_SWI : ArmInstruction + { + #region Constructors + public Arm_SWI() + { + base.SetMask( "####" + "1111" + "########################" ); + base.AIGroup = SymbianStructuresLib.Arm.Instructions.TArmInstructionGroup.EGroupExceptionGenerating; + } + #endregion + + #region API + #endregion + + #region Properties + public int OpCode + { + get + { + int val = base.AIRawValue & 0xFFFFFF; + return val; + } + } + #endregion + + #region From System.Object + #endregion + + #region From IArmInstruction + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Common/ArmBaseInstruction.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Common/ArmBaseInstruction.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,315 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Arm; +using SymbianInstructionLib.Arm.Instructions.Thumb; + +namespace SymbianInstructionLib.Arm.Instructions.Common +{ + public abstract class ArmBaseInstruction : IArmInstruction + { + #region Constructors + protected ArmBaseInstruction( TArmInstructionSet aInstructionSet ) + { + iInstructionSet = aInstructionSet; + } + #endregion + + #region API + public virtual bool Matches( uint aOpCode ) + { + uint masked = (uint) ( aOpCode & BitMask ); + if ( masked == BitValue ) + { + return true; + } + + return false; + } + + protected void SetMask( string aMostSignificantByte, string aLeastSignificantByte ) + { + SetMask( aMostSignificantByte + aLeastSignificantByte ); + } + + protected void SetMask( string aSignificantBitValues ) + { + int bit = 0; + uint mask = 0; + uint value = 0; + + // Loop through all characters in the mask, starting from the RHS, working + // towards the left hand side. + int count = aSignificantBitValues.Length; + for ( int charIndex = count - 1; charIndex >= 0; charIndex-- ) + { + // Get a character from the string + char c = aSignificantBitValues[ charIndex ]; + // + if ( c == KBitIsSet ) + { + mask |= (uint) ( 1 << bit ); + value |= (uint) ( 1 << bit ); + } + else if ( c == KBitIsClear ) + { + mask |= (uint) ( 1 << bit ); + } + else if ( c == KBitIsNotApplicable ) + { + } + // + if ( c != ' ' ) + { + ++bit; + } + } + // + iBitMask = mask; + iBitValue = value; + } + #endregion + + #region Properties + protected uint BitMask + { + get { return iBitMask; } + } + + protected uint BitValue + { + get { return iBitValue; } + } + + internal virtual int SortOrder + { + get { return 0; } + } + #endregion + + #region From IArmInstruction + public TArmInstructionSet AIType + { + get { return iInstructionSet; } + } + + public TArmInstructionGroup AIGroup + { + get { return iGroup; } + internal set + { + iGroup = value; + } + } + + public TArmInstructionTarget AITarget + { + get { return iTarget; } + internal set { iTarget = value; } + } + + public TArmInstructionCondition AIConditionCode + { + get { return iConditionCode; } + internal set { iConditionCode = value; } + } + + public SymUInt32 AIRawValue + { + get { return iRawValue; } + internal set + { + if ( iRawValue != value ) + { + iRawValue = value; + OnRawValueAssigned(); + } + } + } + + public string AIBinaryString + { + get + { + return iRawValue.Binary; + } + } + + public string AIHexString + { + get + { + uint size = this.AISize * 2; + string format = "x" + size; + string ret = this.AIRawValue.ToString( format ); + return ret; + } + } + + public string AIDisassembly + { + get { return iDisassembly; } + internal set { iDisassembly = value; } + } + + public uint AIAddress + { + get { return iAddress; } + internal set { iAddress = value; } + } + + public uint AISize + { + get + { + TArmInstructionSet instSet = this.AIType; + uint ret = (uint) instSet; + return ret; + } + } + + public bool AIIsUnknown + { + get { return ( this is Arm_Unknown ) || ( this is Thumb_Unknown ); } + } + + public SymBit this[ int aIndex ] + { + get + { + SymBit ret = SymBitUtils.GetBit( AIRawValue, aIndex ); + return ret; + } + } + + public bool QueryInvolvement( TArmRegisterType aRegister ) + { + bool source = QueryInvolvementAsSource( aRegister ); + bool destination = QueryInvolvementAsDestination( aRegister ); + return ( source || destination ); + } + + public bool QueryInvolvementAsSource( TArmRegisterType aRegister ) + { + bool ret = DoQueryInvolvementAsSource( aRegister ); + return ret; + } + + public bool QueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + bool ret = DoQueryInvolvementAsDestination( aRegister ); + return ret; + } + #endregion + + #region Framework API + protected virtual void OnRawValueAssigned() + { + } + + protected virtual bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + return false; + } + + protected virtual bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + return false; + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder t = new StringBuilder(); + // + if ( this.AIRawValue == 0u ) + { + t.Append( GetType().Name ); + } + else + { + const int padAmount = 60; + // + string type = "A"; + if ( this.AIType == TArmInstructionSet.ETHUMB ) + { + type = "T"; + } + // + bool isRecognised = this.AIIsUnknown == false; + t.AppendFormat( "[{0:x8}] [{1}] 0x{2:x8} {3} {4} ", + this.AIAddress, + type, + this.AIRawValue, + this.AIBinaryString, + isRecognised ? "Y" : "?" ); + // + string disassembly = this.AIDisassembly; + string typeName = isRecognised ? this.GetType().Name : string.Empty; + // + if ( !isRecognised ) + { + t.AppendFormat( " {0} ", typeName.PadRight( padAmount, ' ' ) ); + t.Append( disassembly ); + } + else + { + if ( disassembly.Contains( "r13" ) || disassembly.Contains( "SP" ) ) + { + t.AppendFormat( "* {0} ", disassembly.PadRight( padAmount, ' ' ) ); + t.Append( typeName ); + } + else + { + t.AppendFormat( " {0} ", disassembly.PadRight( padAmount, ' ' ) ); + t.Append( typeName ); + } + } + } + // + return t.ToString(); + } + #endregion + + #region Internal constants + private const char KBitIsSet = '1'; + private const char KBitIsClear = '0'; + private const char KBitIsNotApplicable = '#'; + #endregion + + #region Data members + private readonly TArmInstructionSet iInstructionSet; + private SymUInt32 iRawValue = new SymUInt32( 0 ); + private TArmInstructionGroup iGroup = TArmInstructionGroup.EGroupUndefined; + private TArmInstructionTarget iTarget = TArmInstructionTarget.EDefault; + private TArmInstructionCondition iConditionCode = TArmInstructionCondition.ENotApplicable; + private uint iAddress = 0; + private string iDisassembly = string.Empty; + private uint iBitMask = 0; + private uint iBitValue = 0; + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Common/ArmInstructionUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Common/ArmInstructionUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; +using SymbianStructuresLib.Arm.Registers; + +namespace SymbianInstructionLib.Arm.Instructions.Common +{ + internal static class ArmInstructionUtils + { + public static int SignExtend24BitTo32Bit( uint aImmediate ) + { + int offset; + // + unchecked + { + if ( ( aImmediate & 0x00800000 ) == 0x00800000 ) + { + offset = (int) ( 0xff000000 | aImmediate ); + } + else + { + offset = (int) aImmediate; + } + } + // + offset <<= 2; + offset += 8; // pipeline + return offset; + } + + public static List ExtractGPRegisterList( uint aEncodedList ) + { + List ret = new List(); + // + for ( int i = 15; i >= 0; i-- ) + { + uint mask = (uint) ( 1 << i ); + if ( ( aEncodedList & mask ) == mask ) + { + ret.Add( (TArmRegisterType) i ); + } + } + // + return ret; + } + } + + internal static class ThumbInstructionUtils + { + public static int SignExtend11BitTo32Bit( uint aImmediate ) + { + int offset = SignExtend11BitTo32Bit( aImmediate, 1 ); + offset += 4; // pipeline + return offset; + } + + public static int SignExtend11BitTo32Bit( uint aImmediate, int aLeftShiftCount ) + { + int offset; + // + unchecked + { + // 10 9 8 7 6 5 4 3 2 1 0 + // ---------------------------------- + // 1 0 0 0 0 0 0 0 0 0 0 + if ( ( aImmediate & 0x00000400 ) == 0x00000400 ) + { + // 11111111111111111111100000000000 + // 10000000000 + offset = (int) ( 0xFFFFF800 | aImmediate ); + } + else + { + offset = (int) aImmediate; + } + } + // + offset <<= aLeftShiftCount; + return offset; + } + + public static int SignExtend8BitTo32Bit( uint aImmediate ) + { + int offset; + // + unchecked + { + // 7 6 5 4 3 2 1 0 + // ------------------------ + // 1 0 0 0 0 0 0 0 + if ( ( aImmediate & 0x00000080 ) == 0x00000080 ) + { + // 11111111111111111111111100000000 + // 10000000 + offset = (int) ( 0xFFFFFF00 | aImmediate ); + } + else + { + offset = (int) aImmediate; + } + } + // + offset <<= 1; + offset += 4; // pipeline + return offset; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Common/ArmRefAttribute.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Common/ArmRefAttribute.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; + +namespace SymbianInstructionLib.Arm.Instructions.Common +{ + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] + internal class ArmRefAttribute : Attribute + { + #region Constructors + public ArmRefAttribute( string aPageRef, string aDescription ) + { + iPageRef = aPageRef; + iDescription = aDescription; + } + #endregion + + #region API + #endregion + + #region Properties + public string PageRef + { + get { return iPageRef; } + set { iPageRef = value; } + } + + public string Description + { + get { return iDescription; } + set { iDescription = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + protected string iPageRef = string.Empty; + protected string iDescription = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Branching/Bases/Thumb_Branch.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Branching/Bases/Thumb_Branch.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.Branching +{ + public abstract class Thumb_Branch : ThumbInstruction + { + #region Constructors + protected Thumb_Branch() + { + base.AIGroup = SymbianStructuresLib.Arm.Instructions.TArmInstructionGroup.EGroupBranch; + } + #endregion + + #region Framework API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Branching/Bases/Thumb_Branch_Immediate.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Branching/Bases/Thumb_Branch_Immediate.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.Branching +{ + public abstract class Thumb_Branch_Immediate : Thumb_Branch + { + #region Constructors + protected Thumb_Branch_Immediate() + { + } + #endregion + + #region Framework API + public abstract int BranchOffset + { + get; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Branching/Thumb_Branch_Conditional.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Branching/Thumb_Branch_Conditional.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.Branching +{ + [ArmRef( "A7.1.13 B (1)", "B " )] + public class Thumb_Branch_Conditional : Thumb_Branch_Immediate + { + #region Constructors + public Thumb_Branch_Conditional() + { + base.SetMask( "1101" + "####" + "########" ); + } + #endregion + + #region API + #endregion + + #region Properties + public override int BranchOffset + { + get + { + int ret = ThumbInstructionUtils.SignExtend8BitTo32Bit( base.AIRawValue & 0xFF ); + return ret; + } + } + #endregion + + #region From ArmBaseInstruction + protected override void OnRawValueAssigned() + { + base.OnRawValueAssigned(); + base.AIConditionCode = (TArmInstructionCondition) (TArmInstructionCondition) base.AIRawValue[ 11, 8 ].ToUInt(); + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Branching/Thumb_Branch_Unconditional.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Branching/Thumb_Branch_Unconditional.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.Branching +{ + public class Thumb_Branch_Unconditional : Thumb_Branch_Immediate + { + #region Enumerations + public enum TType + { + ETypeMultipartFirstPartOfBranch = -1, + ETypeB = 0, + ETypeBL, + ETypeBLX + } + #endregion + + #region Constructors + public Thumb_Branch_Unconditional() + { + // H offset_11 + base.SetMask( "111" + "##" + "###########" ); + } + #endregion + + #region API + #endregion + + #region Properties + public override int BranchOffset + { + get + { + int ret = ThumbInstructionUtils.SignExtend11BitTo32Bit( base.AIRawValue & 0x7FF ); + return ret; + } + } + + public TType Type + { + get + { + TType ret = TType.ETypeB; + // + byte val = base.AIRawValue[ 12, 11 ]; + if ( val == 1 ) + { + ret = TType.ETypeBLX; + } + else if ( val == 3 ) + { + ret = TType.ETypeBL; + } + else if ( val == 2 ) + { + ret = TType.ETypeMultipartFirstPartOfBranch; + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Branching/Thumb_Branch_WithExchange.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Branching/Thumb_Branch_WithExchange.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.Branching +{ + public class Thumb_Branch_WithExchange : Thumb_Branch + { + #region Enumerations + public enum TType + { + ETypeBX = 0, + ETypeBLX + } + #endregion + + #region Constructors + public Thumb_Branch_WithExchange() + { + // L H2 Rm SBZ + base.SetMask( "01000111" + "#" + "#" + "###" + "000" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + TArmRegisterType branchReg = this.Register; + return ( aRegister == branchReg ); + } + #endregion + + #region API + #endregion + + #region Properties + public TType Type + { + get + { + TType ret = (TType) base.AIRawValue[ 7 ]; + return ret; + } + } + + public TArmRegisterType Register + { + get + { + // 10001111 0 011 000 0x4798 BLX r3 + // 10001110 1 110 000 0x4770 BX lr + // + TArmRegisterType ret = (TArmRegisterType) base.AIRawValue[ 6, 3 ].ToUInt(); + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Bases/Thumb_AddOrSubtract.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Bases/Thumb_AddOrSubtract.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing +{ + public abstract class Thumb_AddOrSubtract : ThumbInstruction + { + #region Enumerations + #endregion + + #region Constructors + protected Thumb_AddOrSubtract() + { + base.AIGroup = SymbianStructuresLib.Arm.Instructions.TArmInstructionGroup.EGroupDataProcessing; + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + TArmRegisterType reg = this.Rd; + return ( aRegister == reg ); + } + #endregion + + #region Framework API + public abstract TArmRegisterType Rd + { + get; + } + + public virtual TArmDataProcessingType OperationType + { + get { return TArmDataProcessingType.EUndefined; } + } + + public virtual uint Immediate + { + get { return 0; } + } + + public virtual bool SuppliesImmediate + { + get { return false; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Bases/Thumb_AddOrSubtract_2Regs.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Bases/Thumb_AddOrSubtract_2Regs.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing +{ + public abstract class Thumb_AddOrSubtract_2Regs : Thumb_AddOrSubtract + { + #region Constructors + protected Thumb_AddOrSubtract_2Regs() + { + } + #endregion + + #region From Thumb_AddOrSubtract + public override TArmDataProcessingType OperationType + { + get + { + TArmDataProcessingType ret = TArmDataProcessingType.ADD; + // + if ( base.AIRawValue[ 9 ] == SymBit.ESet ) + { + ret = TArmDataProcessingType.SUB; + } + // + return ret; + } + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + TArmRegisterType reg = this.Rn; + return ( aRegister == reg ); + } + #endregion + + #region Properties + public TArmRegisterType Rn + { + get + { + TArmRegisterType ret = (TArmRegisterType) RnByte; + return ret; + } + } + + public override TArmRegisterType Rd + { + get + { + TArmRegisterType ret = (TArmRegisterType) RdByte; + return ret; + } + } + #endregion + + #region Internal methods + protected byte RnByte + { + get + { + byte ret = (byte) KMaskRn.Apply( base.AIRawValue ); + return ret; + } + } + + protected byte RdByte + { + get + { + byte ret = (byte) KMaskRd.Apply( base.AIRawValue ); + return ret; + } + } + #endregion + + #region Data members + private static readonly SymMask KMaskRn = new SymMask( 0x38, SymMask.TShiftDirection.ERight, 3 ); + private static readonly SymMask KMaskRd = new SymMask( 0x7 ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_AddOrSubtract_Immediate.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_AddOrSubtract_Immediate.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing +{ + [ArmRef( "A7.1.3 ADD (1)", "ADD , , #" )] + [ArmRef( "A7.1.65 SUB (1)", "SUB , , #" )] + public class Thumb_AddOrSubtract_Immediate : Thumb_AddOrSubtract_2Regs + { + #region Constructors + public Thumb_AddOrSubtract_Immediate() + { + // Type imed_3 Rn Rd + base.SetMask( "000111" + "#" + "###" + "###" + "###" ); + } + #endregion + + #region Properties + public override uint Immediate + { + get + { + uint ret = KMaskImm.Apply( base.AIRawValue ); + return ret; + } + } + + public override bool SuppliesImmediate + { + get { return true; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private static readonly SymMask KMaskImm = new SymMask( 0x1C0, SymMask.TShiftDirection.ERight, 6 ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_AddOrSubtract_Large.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_AddOrSubtract_Large.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing +{ + [ArmRef( "A7.1.4 ADD (2)", "ADD , #" )] + [ArmRef( "A7.1.66 SUB (2)", "SUB , #" )] + public class Thumb_AddOrSubtract_Large : Thumb_AddOrSubtract + { + #region Constructors + public Thumb_AddOrSubtract_Large() + { + // Type Rd immed_8 + base.SetMask( "0011" + "#" + "###" + "########" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + // Rd acts as source and destination + TArmRegisterType reg = this.Rd; + return ( aRegister == reg ); + } + #endregion + + #region From Thumb_AddOrSubtract + public override TArmDataProcessingType OperationType + { + get + { + TArmDataProcessingType ret = TArmDataProcessingType.ADD; + // + if ( base.AIRawValue[ 11 ] == SymBit.ESet ) + { + ret = TArmDataProcessingType.SUB; + } + // + return ret; + } + } + + public override TArmRegisterType Rd + { + get + { + TArmRegisterType ret = (TArmRegisterType) KMaskRd.Apply( base.AIRawValue ); + return ret; + } + } + + public override uint Immediate + { + get + { + uint ret = ( base.AIRawValue & 0xFF ); + return ret; + } + } + + public override bool SuppliesImmediate + { + get { return true; } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + private static readonly SymMask KMaskRd = new SymMask( 0x700, SymMask.TShiftDirection.ERight, 8 ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_AddOrSubtract_Register.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_AddOrSubtract_Register.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,66 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing +{ + [ArmRef( "A7.1.5 ADD (3)", "ADD , , " )] + [ArmRef( "A7.1.67 SUB (3)", "SUB , , " )] + public class Thumb_AddOrSubtract_Register : Thumb_AddOrSubtract_2Regs + { + #region Constructors + public Thumb_AddOrSubtract_Register() + { + // Type Rm Rn Rd + base.SetMask( "000110" + "#" + "###" + "###" + "###" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + TArmRegisterType reg1 = this.Rm; + TArmRegisterType reg2 = this.Rn; + return ( aRegister == reg1 || aRegister == reg2 ); + } + #endregion + + #region Properties + public TArmRegisterType Rm + { + get + { + TArmRegisterType ret = (TArmRegisterType) KMaskRm.Apply( base.AIRawValue ); + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private static readonly SymMask KMaskRm = new SymMask( 0x1C0, SymMask.TShiftDirection.ERight, 6 ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_AddOrSubtract_SP.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_AddOrSubtract_SP.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing +{ + [ArmRef( "A7.1.9 ADD (7)", "ADD SP, # * 4" )] + [ArmRef( "A7.1.68 SUB (4)", "SUB SP, # * 4" )] + public class Thumb_AddOrSubtract_SP : Thumb_AddOrSubtract + { + #region Constructors + public Thumb_AddOrSubtract_SP() + { + // Type immed_7 + base.SetMask( "10110000" + "#" + "#######" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + // SP acts as source & destination + return ( aRegister == TArmRegisterType.EArmReg_SP ); + } + #endregion + + #region From Thumb_AddOrSubtract + public override TArmDataProcessingType OperationType + { + get + { + TArmDataProcessingType ret = TArmDataProcessingType.ADD; + // + if ( base.AIRawValue[ 7 ] == SymBit.ESet ) + { + ret = TArmDataProcessingType.SUB; + } + // + return ret; + } + } + #endregion + + #region Properties + public override uint Immediate + { + get + { + uint rawValue = ( base.AIRawValue & 0x7F ); + uint ret = rawValue * 4; + return ret; + } + } + + public override bool SuppliesImmediate + { + get { return true; } + } + + public override TArmRegisterType Rd + { + get { return TArmRegisterType.EArmReg_SP; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private static readonly SymMask KMaskRn = new SymMask( 0x38, SymMask.TShiftDirection.ERight, 3 ); + private static readonly SymMask KMaskRd = new SymMask( 0x7 ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_Add_2Regs_High.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_Add_2Regs_High.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing +{ + [ArmRef( "A7.1.6 ADD (4)", "ADD , " )] + public class Thumb_Add_2Regs_High : Thumb_AddOrSubtract_2Regs + { + #region Constructors + public Thumb_Add_2Regs_High() + { + // H1 H2 Rm Rd + base.SetMask( "01000100" + "#" + "#" + "###" + "###" ); + } + #endregion + + #region From Thumb_AddOrSubtract + public override TArmRegisterType Rd + { + get + { + byte reg = base.RdByte; + byte h1 = (byte) base.AIRawValue[ 7 ]; + h1 <<= 3; + reg |= h1; + return (TArmRegisterType) reg; + } + } + + public override TArmDataProcessingType OperationType + { + get { return TArmDataProcessingType.ADD; } + } + #endregion + + #region Properties + public TArmRegisterType Rm + { + get + { + byte reg = base.RdByte; + byte h2 = (byte) base.AIRawValue[ 6 ]; + h2 <<= 3; + reg |= h2; + return (TArmRegisterType) reg; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_Add_SPOrPC.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataProcessing/Thumb_Add_SPOrPC.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing +{ + [ArmRef( "A7.1.7 ADD (5)", "ADD , PC, # * 4" )] + [ArmRef( "A7.1.8 ADD (6)", "ADD , SP, # * 4" )] + public class Thumb_Add_SPOrPC : Thumb_AddOrSubtract + { + #region Constructors + public Thumb_Add_SPOrPC() + { + // Type Rd immed_8 + base.SetMask( "1010" + "#" + "###" + "########" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + // SP or PC acts as source + TArmRegisterType reg = this.RelativeRegister; + return ( aRegister == reg ); + } + #endregion + + #region From Thumb_AddOrSubtract + public override TArmRegisterType Rd + { + get + { + TArmRegisterType ret = (TArmRegisterType) KMaskRd.Apply( base.AIRawValue ); + return ret; + } + } + + public TArmRegisterType RelativeRegister + { + get + { + SymBit bit11 = base.AIRawValue[ 11 ]; + TArmRegisterType ret = TArmRegisterType.EArmReg_PC; + if ( bit11 == SymBit.ESet ) + { + ret = TArmRegisterType.EArmReg_SP; + } + return ret; + } + } + + public override TArmDataProcessingType OperationType + { + get { return TArmDataProcessingType.ADD; } + } + + public override uint Immediate + { + get + { + uint rawValue = ( base.AIRawValue & 0xFF ); + uint ret = rawValue * 4; + return ret; + } + } + + public override bool SuppliesImmediate + { + get { return true; } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + private static readonly SymMask KMaskRd = new SymMask( 0x700, SymMask.TShiftDirection.ERight, 8 ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Bases/Thumb_LoadOrStore.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Bases/Thumb_LoadOrStore.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataTransfer +{ + public abstract class Thumb_LoadOrStore : ThumbInstruction + { + #region Constructors + protected Thumb_LoadOrStore() + { + base.AIGroup = SymbianStructuresLib.Arm.Instructions.TArmInstructionGroup.EGroupDataTransfer; + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + bool ret = false; + // + TArmDataTransferType type = this.DataTransferType; + if ( type == TArmDataTransferType.EStore ) + { + // STR , [, # * 4] + // Rd = dest, Rn is source + // + // Cannot test here, requires derived class to implement this check + } + else if ( type == TArmDataTransferType.ELoad ) + { + // LDR , [, # * 4] + // LDR , [, ] + // LDR , [PC, # * 4] + // LDR , [SP, # * 4] + TArmRegisterType reg = this.Rd; + ret = ( reg == aRegister ); + } + // + return ret; + } + + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + bool ret = false; + // + TArmDataTransferType type = this.DataTransferType; + if ( type == TArmDataTransferType.EStore ) + { + // STR , [, # * 4] + // Rd = dest, Rn is source + TArmRegisterType reg = this.Rd; + ret = ( reg == aRegister ); + } + else if ( type == TArmDataTransferType.ELoad ) + { + // LDR , [, # * 4] + // LDR , [, ] + // LDR , [PC, # * 4] + // LDR , [SP, # * 4] + // + // Cannot test here, requires derived class to implement this check + } + // + return ret; + } + #endregion + + #region Framework API + public abstract TArmDataTransferType DataTransferType + { + get; + } + + public abstract TArmRegisterType Rd + { + get; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + protected static readonly SymMask KBits2To0 = new SymMask( 0x7 ); + protected static readonly SymMask KBits5To3 = new SymMask( 0x38 ); + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Bases/Thumb_LoadOrStoreMultiple.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Bases/Thumb_LoadOrStoreMultiple.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataTransfer +{ + public abstract class Thumb_LoadOrStoreMultiple : Thumb_LoadOrStore + { + #region Constructors + protected Thumb_LoadOrStoreMultiple() + { + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + TArmDataTransferType type = this.DataTransferType; + // + bool ret = base.DoQueryInvolvementAsSource( aRegister ); + if ( ret == false && type == TArmDataTransferType.EStore ) + { + // PUSH {r4, r5, r14} + // r13 = dest, r4, r5, r14 are source registers + List regs = this.RegistersAsList; + ret = regs.Contains( aRegister ); + } + // + return ret; + } + + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + TArmDataTransferType type = this.DataTransferType; + // + bool ret = base.DoQueryInvolvementAsDestination( aRegister ); + if ( ret == false && type == TArmDataTransferType.ELoad ) + { + // POP {r4, r5, r15} + // r13 = source, r4, r5, r14 are destination registers + List regs = this.RegistersAsList; + ret = regs.Contains( aRegister ); + } + // + return ret; + } + #endregion + + #region Framework API + protected abstract List RegistersAsList + { + get; + } + #endregion + + #region Properties + public TArmRegisterType[] Registers + { + get { return RegistersAsList.ToArray(); } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Bases/Thumb_LoadOrStore_Immediate8.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Bases/Thumb_LoadOrStore_Immediate8.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataTransfer +{ + public abstract class Thumb_LoadOrStore_Immediate8 : Thumb_LoadOrStore + { + #region Constructors + protected Thumb_LoadOrStore_Immediate8() + { + } + #endregion + + #region Framework API + public override TArmRegisterType Rd + { + get + { + TArmRegisterType ret = (TArmRegisterType) KMaskRd.Apply( base.AIRawValue ); + return ret; + } + } + #endregion + + #region Properties + public uint Immediate + { + get + { + uint ret = base.AIRawValue & 0xFF; + ret *= 4; + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private static readonly SymMask KMaskRd = new SymMask( 0x700, SymMask.TShiftDirection.ERight, 8 ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_LDR_RelativeToPC.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_LDR_RelativeToPC.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataTransfer +{ + [ArmRef( "A7.1.30 LDR (3)", "LDR , [PC, # * 4]" )] + public class Thumb_LDR_RelativeToPC : Thumb_LoadOrStore_Immediate8 + { + #region Constructors + public Thumb_LDR_RelativeToPC() + { + // Rd immed_8 + base.SetMask( "01001" + "###" + "########" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + // PC acts as source + return ( aRegister == TArmRegisterType.EArmReg_PC ); + } + + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + // Rd acts as destination + TArmRegisterType reg = this.Rd; + return ( aRegister == reg ); + } + #endregion + + #region From Thumb_LoadOrStore + public override TArmDataTransferType DataTransferType + { + get { return TArmDataTransferType.ELoad; } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_LDR_RelativeToSP.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_LDR_RelativeToSP.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataTransfer +{ + [ArmRef( "A7.1.31 LDR (4)", "LDR , [SP, # * 4]" )] + public class Thumb_LDR_RelativeToSP : Thumb_LoadOrStore_Immediate8 + { + #region Constructors + public Thumb_LDR_RelativeToSP() + { + // Rd immed_8 + base.SetMask( "10011" + "###" + "########" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + // SP acts as source + return ( aRegister == TArmRegisterType.EArmReg_SP ); + } + + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + // Rd acts as destination + TArmRegisterType reg = this.Rd; + return ( aRegister == reg ); + } + #endregion + + #region From Thumb_LoadOrStore + public override TArmDataTransferType DataTransferType + { + get { return TArmDataTransferType.ELoad; } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_LoadOrStore_Immediate5.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_LoadOrStore_Immediate5.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataTransfer +{ + [ArmRef( "A7.1.28 LDR (1)", "LDR , [, # * 4]" )] + [ArmRef( "A7.1.58 STR (1)", "STR , [, # * 4]" )] + public class Thumb_LoadOrStore_Immediate5 : Thumb_LoadOrStore + { + #region Constructors + public Thumb_LoadOrStore_Immediate5() + { + // Type immed_5 Rn Rd + base.SetMask( "0110" + "#" + "#####" + "###" + "###" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + bool ret = false; + // + TArmDataTransferType type = this.DataTransferType; + if ( type == TArmDataTransferType.EStore ) + { + // STR , [, # * 4] + // Rd = dest, Rn is source register + TArmRegisterType regN = this.Rn; + ret = ( aRegister == regN ); + } + else if ( type == TArmDataTransferType.ELoad ) + { + // LDR , [, # * 4] + // Rd = source, Rn is destination register + TArmRegisterType regD = this.Rd; + ret = ( aRegister == regD ); + } + // + return ret; + } + + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + bool ret = false; + // + TArmDataTransferType type = this.DataTransferType; + if ( type == TArmDataTransferType.EStore ) + { + // STR , [, # * 4] + // Rd = dest, Rn is source register + TArmRegisterType regD = this.Rd; + ret = ( aRegister == regD ); + } + else if ( type == TArmDataTransferType.ELoad ) + { + // LDR , [, # * 4] + // Rd = source, Rn is destination register + TArmRegisterType regN = this.Rn; + ret = ( aRegister == regN ); + } + // + return ret; + } + #endregion + + #region Framework API + public override TArmDataTransferType DataTransferType + { + get + { + TArmDataTransferType ret = (TArmDataTransferType) base.AIRawValue[ 11 ]; + return ret; + } + } + + public override TArmRegisterType Rd + { + get + { + TArmRegisterType ret = (TArmRegisterType) Thumb_LoadOrStore.KBits2To0.Apply( base.AIRawValue ); + return ret; + } + } + + public TArmRegisterType Rn + { + get + { + TArmRegisterType ret = (TArmRegisterType) Thumb_LoadOrStore.KBits5To3.Apply( base.AIRawValue ); + return ret; + } + } + #endregion + + #region Properties + public uint Immediate + { + get + { + uint ret = KMaskImmediate5.Apply( base.AIRawValue ); + ret *= 4; + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private static readonly SymMask KMaskImmediate5 = new SymMask( 0x7C0, SymMask.TShiftDirection.ERight, 6 ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_LoadOrStore_Register.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_LoadOrStore_Register.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataTransfer +{ + [ArmRef( "A7.1.29 LDR (2)", "LDR , [, ]" )] + [ArmRef( "A7.1.59 STR (2)", "STR , [, ]" )] + public class Thumb_LoadOrStore_Register : Thumb_LoadOrStore + { + #region Constructors + public Thumb_LoadOrStore_Register() + { + // Type Rm Rn Rd + base.SetMask( "0101" + "#" + "00" + "###" + "###" + "###" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + bool ret = false; + // + TArmDataTransferType type = this.DataTransferType; + if ( type == TArmDataTransferType.EStore ) + { + // STR , [, ] + // Rd = dest, Rn, Rm are source registers + TArmRegisterType regN = this.Rn; + TArmRegisterType regM = this.Rm; + ret = ( aRegister == regN || aRegister == regM ); + } + else if ( type == TArmDataTransferType.ELoad ) + { + // LDR , [, ] + // Rd = source, Rn, Rm are destination registers + TArmRegisterType regD = this.Rd; + ret = ( aRegister == regD ); + } + // + return ret; + } + + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + bool ret = false; + // + TArmDataTransferType type = this.DataTransferType; + if ( type == TArmDataTransferType.EStore ) + { + // STR , [, ] + // Rd = dest, Rn, Rm are source registers + TArmRegisterType regD = this.Rd; + ret = ( aRegister == regD ); + } + else if ( type == TArmDataTransferType.ELoad ) + { + // LDR , [, ] + // Rd = source, Rn, Rm are destination registers + TArmRegisterType regN = this.Rn; + TArmRegisterType regM = this.Rm; + ret = ( aRegister == regN || aRegister == regM ); + } + // + return ret; + } + #endregion + + #region Framework API + public override TArmDataTransferType DataTransferType + { + get + { + TArmDataTransferType ret = (TArmDataTransferType) base.AIRawValue[ 11 ]; + return ret; + } + } + + public override TArmRegisterType Rd + { + get + { + TArmRegisterType ret = (TArmRegisterType) Thumb_LoadOrStore.KBits2To0.Apply( base.AIRawValue ); + return ret; + } + } + + public TArmRegisterType Rn + { + get + { + TArmRegisterType ret = (TArmRegisterType) Thumb_LoadOrStore.KBits5To3.Apply( base.AIRawValue ); + return ret; + } + } + + public TArmRegisterType Rm + { + get + { + TArmRegisterType ret = (TArmRegisterType) KMaskRm.Apply( base.AIRawValue ); + return ret; + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + private static readonly SymMask KMaskRm = new SymMask( 0x1C0, SymMask.TShiftDirection.ERight, 6 ); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_PushOrPop.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_PushOrPop.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataTransfer +{ + [ArmRef( "A7.1.50 PUSH", "PUSH " )] + [ArmRef( "A7.1.49 POP", "POP " )] + public class Thumb_PushOrPop : Thumb_LoadOrStoreMultiple + { + #region Constructors + public Thumb_PushOrPop() + { + // Type R register_list + base.SetMask( "1011" + "#" + "10" + "#" + "########" ); + base.AIGroup = SymbianStructuresLib.Arm.Instructions.TArmInstructionGroup.EGroupDataTransfer; + } + #endregion + + #region From Thumb_LoadOrStore + public override TArmRegisterType Rd + { + get { return TArmRegisterType.EArmReg_SP; } + } + #endregion + + #region Properties + public override TArmDataTransferType DataTransferType + { + get + { + TArmDataTransferType ret = (TArmDataTransferType) base.AIRawValue[ 11 ]; + return ret; + } + } + + protected override List RegistersAsList + { + get + { + List regs = new List(); + + // Bit 8 represents LR or PC, depending on whether it's a PUSH or POP. + // + // PUSH = R bit is set if LR is to be included + // POP = R bit is set if PC is to be included + SymBit rBit = base.AIRawValue[ 8 ]; + if ( rBit == SymBit.ESet ) + { + if ( DataTransferType == TArmDataTransferType.ELoad ) + { + regs.Add( TArmRegisterType.EArmReg_PC ); + } + else if ( DataTransferType == TArmDataTransferType.EStore ) + { + regs.Add( TArmRegisterType.EArmReg_LR ); + } + } + + // Bits 7-0 represent R7 -> R0. + uint value = base.AIRawValue & 0xFF; + for ( int i = 7; i >= 0; i-- ) + { + uint mask = (uint) ( 1 << i ); + if ( ( mask & value ) == mask ) + { + TArmRegisterType reg = (TArmRegisterType) i; + regs.Add( reg ); + } + } + // + return regs; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_STR_RelativeToSP.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/DataTransfer/Thumb_STR_RelativeToSP.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb.DataTransfer +{ + [ArmRef( "A7.1.60 STR (3)", "STR , [SP, # * 4]" )] + public class Thumb_STR_RelativeToSP : Thumb_LoadOrStore_Immediate8 + { + #region Constructors + public Thumb_STR_RelativeToSP() + { + // Rd immed_8 + base.SetMask( "10010" + "###" + "########" ); + } + #endregion + + #region From ArmBaseInstruction + protected override bool DoQueryInvolvementAsSource( TArmRegisterType aRegister ) + { + // Rd acts as source + TArmRegisterType reg = this.Rd; + return ( aRegister == reg ); + } + + protected override bool DoQueryInvolvementAsDestination( TArmRegisterType aRegister ) + { + // SP acts as destination + return ( aRegister == TArmRegisterType.EArmReg_SP ); + } + #endregion + + #region From Thumb_LoadOrStore + public override TArmDataTransferType DataTransferType + { + get { return TArmDataTransferType.EStore; } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/ThumbInstruction.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/ThumbInstruction.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianStructuresLib.Arm; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb +{ + public abstract class ThumbInstruction : ArmBaseInstruction + { + #region Constructors + protected ThumbInstruction() + : base( TArmInstructionSet.ETHUMB ) + { + // Very few thumb instructions are conditional + base.AIConditionCode = SymbianStructuresLib.Arm.Instructions.TArmInstructionCondition.AL; + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Thumb_Unknown.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Instructions/Thumb/Thumb_Unknown.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; + +namespace SymbianInstructionLib.Arm.Instructions.Thumb +{ + public class Thumb_Unknown : ThumbInstruction + { + #region Constructors + public Thumb_Unknown() + { + } + #endregion + + #region API + public override bool Matches( uint aOpCode ) + { + // Matches everything + return true; + } + #endregion + + #region Properties + #endregion + + #region From System.Object + #endregion + + #region From IArmInstruction + public new bool AIIsUnknown + { + get { return true; } + } + #endregion + + #region From ArmBaseInstruction + internal override int SortOrder + { + get { return int.MinValue; } + } + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Library/ArmLibrary.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Arm/Library/ArmLibrary.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Tracer; +using SymbianUtils.PluginManager; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Disassembler; +using SymbianStructuresLib.Arm.Instructions; +using SymbianInstructionLib.Arm.Instructions.Arm; +using SymbianInstructionLib.Arm.Instructions.Thumb; +using SymbianInstructionLib.Arm.Instructions.Common; +using System.Reflection; + +namespace SymbianInstructionLib.Arm.Library +{ + public class ArmLibrary + { + #region Constructors + public ArmLibrary() + { + } + + static ArmLibrary() + { + // Load all the ARM instructions + Comparison armInstructionComparer = delegate( ArmInstruction aLeft, ArmInstruction aRight ) + { + // We sort in reverse order, hence right compared to left + return aRight.SortOrder.CompareTo( aLeft.SortOrder ); + }; + iArmInstructions = new PluginManager(); + iArmInstructions.LoadFromCallingAssembly(); + iArmInstructions.Sort( armInstructionComparer ); + + // Load all the THUMB instructions + Comparison thumbInstructionComparer = delegate( ThumbInstruction aLeft, ThumbInstruction aRight ) + { + // We sort in reverse order, hence right compared to left + return aRight.SortOrder.CompareTo( aLeft.SortOrder ); + }; + iThumbInstructions = new PluginManager(); + iThumbInstructions.LoadFromCallingAssembly(); + iThumbInstructions.Sort( thumbInstructionComparer ); + + // Load disassembler if present + iDisassembler = new PluginManager(); + iDisassembler.Load( null ); + } + #endregion + + #region API + public IArmInstruction[] ConvertToInstructions( TArmInstructionSet aInstructionSet, uint[] aRawInstructions, uint aStartingAddress ) + { + IArmInstruction[] ret = null; + // + switch ( aInstructionSet ) + { + case TArmInstructionSet.EARM: + ret = ConvertToArm( aRawInstructions, aStartingAddress ); + break; + case TArmInstructionSet.ETHUMB: + ret = ConvertToThumb( aRawInstructions, aStartingAddress ); + break; + default: + throw new NotSupportedException(); + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void Disassemble( ArmBaseInstruction aInstruction ) + { + if ( iDisassembler.Count > 0 ) + { + IArmDisassembler disassembler = iDisassembler[ 0 ]; + string disassembly = disassembler.Disassemble( aInstruction ); + aInstruction.AIDisassembly = disassembly; + } + } + + private IArmInstruction[] ConvertToArm( uint[] aRawInstructions, uint aStartingAddress ) + { + // TODO: optimise this + List ret = new List(); + // + uint address = aStartingAddress; + for ( int i = 0; i < aRawInstructions.Length; i++, address += 4 ) + { + uint raw = aRawInstructions[ i ]; + foreach ( ArmInstruction inst in iArmInstructions ) + { + if ( inst.Matches( raw ) ) + { + Type type = inst.GetType(); + ConstructorInfo ctor = type.GetConstructor( new Type[] { } ); + ArmInstruction copy = (ArmInstruction) ctor.Invoke( new object[] { } ); + copy.AIAddress = address; + copy.AIRawValue = raw; + ret.Add( copy ); + Disassemble( copy ); + break; + } + } + } + // + return ret.ToArray(); + } + + private IArmInstruction[] ConvertToThumb( uint[] aRawInstructions, uint aStartingAddress ) + { + // TODO: optimise this + List ret = new List(); + // + uint address = aStartingAddress; + for ( int i = 0; i < aRawInstructions.Length; i++, address += 2 ) + { + uint raw = aRawInstructions[ i ]; + foreach ( ThumbInstruction inst in iThumbInstructions ) + { + if ( inst.Matches( raw ) ) + { + Type type = inst.GetType(); + ConstructorInfo ctor = type.GetConstructor( new Type[] { } ); + ThumbInstruction copy = (ThumbInstruction) ctor.Invoke( new object[] { } ); + copy.AIAddress = address; + copy.AIRawValue = raw; + ret.Add( copy ); + Disassemble( copy ); + break; + } + } + } + // + return ret.ToArray(); + } + #endregion + + #region Data members + private static readonly PluginManager iArmInstructions; + private static readonly PluginManager iThumbInstructions; + private static readonly PluginManager iDisassembler; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "SymbianInstructionLib" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia" )] +[assembly: AssemblyProduct( "SymbianInstructionLib" )] +[assembly: AssemblyCopyright( "Copyright © Nokia 2009" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "3d40f318-dbd9-46aa-b1cf-bfa93c8a1ade" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/SymbianInstructionLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianInstructionLib/SymbianInstructionLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,116 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {EB93FD74-17C6-44B2-8384-4D58DC210F77} + Library + Properties + SymbianInstructionLib + SymbianInstructionLib + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/PagedCompress.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/PagedCompress.h Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,26 @@ +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef PAGEDCOMPRESS_H +#define PAGEDCOMPRESS_H + +// System includes +#include +#include + +// Returns the number of output bytes created, and the number of input bytes read via aInputBytesRead +TInt UnpackBytePairE32Image( TUint8* aSource, TInt aSourceSize, TUint8* aDest, TInt aDestSize, TInt& aInputBytesRead ); + +#endif diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/SymbianBytePair.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/SymbianBytePair.h Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef SYMBIANBYTEPAIR_H +#define SYMBIANBYTEPAIR_H + +// User includes +#include "SymbianNativeToolsApi.h" + +// Function definitions +extern "C" SYMBIANNATIVETOOL_API TInt SymbianBytePairUnpackRaw( TUint8* aDest, TInt aDestSize, TUint8* aSource, TInt aSourceSize ); +extern "C" SYMBIANNATIVETOOL_API TInt SymbianBytePairUnpackImage( TUint8* aDest, TInt aDestSize, TUint8* aSource, TInt aSourceSize, TInt* aAmountOfInputRead ); + + +#endif \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/SymbianInflate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/SymbianInflate.h Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,27 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef SYMBIANINFLATE_H +#define SYMBIANINFLATE_H + +// User includes +#include "SymbianNativeToolsApi.h" + +// Function definitions +extern "C" SYMBIANNATIVETOOL_API TInt SymbianInflateImage( TUint8* aDest, TInt aDestSize, TUint8* aSource, TInt aSourceSize ); + + +#endif \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/SymbianNativeToolsApi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/SymbianNativeToolsApi.h Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef SYMBIANNATIVETOOLSAPI_H +#define SYMBIANNATIVETOOLSAPI_H + +// from a DLL simpler. All files within this DLL are compiled with the SYMBIAN_NATIVE_TOOLS_EXPORTS +// symbol defined on the command line. this symbol should not be defined on any project +// that uses this DLL. This way any other project whose source files include this file see +// SYMBIANBYTEPAIRLIB_API functions as being imported from a DLL, whereas this DLL sees symbols +// defined with this macro as being exported. +#ifdef SYMBIAN_NATIVE_TOOL_EXPORTS +#define SYMBIANNATIVETOOL_API __declspec(dllexport) +#else +#define SYMBIANNATIVETOOL_API __declspec(dllimport) +#endif + +// User includes +#include "e32defwrap.h" + +#endif \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/byte_pair.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/byte_pair.h Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,24 @@ +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef BYTE_PAIR_H +#define BYTE_PAIR_H + +// System includes +#include + +TInt UnpackBytePair(TUint8* dst, TInt dstSize, TUint8* src, TInt srcSize, TUint8*& srcNext); + +#endif diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/e32defwrap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/e32defwrap.h Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef SYMBIAN_E32DEF_H +#define SYMBIAN_E32DEF_H + +typedef void TAny; +typedef signed char TInt8; +typedef unsigned char TUint8; +typedef short int TInt16; +typedef unsigned short int TUint16; +typedef long int TInt32; +typedef unsigned long int TUint32; +typedef signed int TInt; +typedef unsigned int TUint; +typedef float TReal32; +typedef double TReal64; +typedef double TReal; +typedef unsigned char TText8; +typedef unsigned short int TText16; +typedef int TBool; +typedef TUint32 TLinAddr; + +#endif diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/e32errwrap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/e32errwrap.h Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef SYMBIAN_E32ERR_H +#define SYMBIAN_E32ERR_H + +// User includes +#include "e32defwrap.h" + +// Constants +const TInt KErrNone = 0; +const TInt KErrNoMemory = -4; +const TInt KErrCorrupt = -20; + +#endif diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/farray.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/farray.h Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef __FARRAY_H__ +#define __FARRAY_H__ +#include +#include "h_utl.h" + +template +class TFixedArray +// Range checking wrapper+ class for C++ arrays +// Can be embedded in C-objects, or used on the stack: use Reset() to zero it + { + typedef TFixedArray ThisClass; +public: + inline TFixedArray(); + inline TFixedArray(const T* aList, TInt aLength); + // + inline void Copy(const T* aList, TInt aLength); + inline void Reset(); // zero fill + inline void DeleteAll(); + // + inline TInt Count() const; + inline TInt Length() const; + // Accessors - debug range checking + inline T& operator[](TInt aIndex); + inline const T& operator[] (TInt aIndex) const; + // Accessors - always range checking + inline T& At(TInt aIndex); + inline const T& At(TInt aIndex) const; + // Provides pointers to the beginning and end of the array + inline T* Begin(); + inline T* End(); + inline const T* Begin() const; + inline const T* End() const; + // +protected: + inline static TBool InRange(TInt aIndex); +protected: + T iRep[S]; + }; + + +template +inline TFixedArray::TFixedArray() + {} +template +inline void TFixedArray::Copy(const T* aList,TInt aLength) + {assert(TUint(aLength)<=TUint(S));HMem::Copy(iRep,aList,aLength*sizeof(T));} +template +inline TFixedArray::TFixedArray(const T* aList,TInt aLength) + {Copy(aList,aLength);} +template +inline void TFixedArray::Reset() + {HMem::FillZ(iRep,sizeof(iRep));} +template +inline TInt TFixedArray::Count() const + {return S;} +template +inline TInt TFixedArray::Length() const + {return sizeof(T);} +template +inline TBool TFixedArray::InRange(TInt aIndex) + {return TUint(aIndex) +inline T& TFixedArray::operator[](TInt aIndex) + {assert(InRange(aIndex));return iRep[aIndex];} +template +inline const T& TFixedArray::operator[](TInt aIndex) const + {return const_cast(*this)[aIndex];} +template +inline T& TFixedArray::At(TInt aIndex) + {verify(InRange(aIndex));return iRep[aIndex];} +template +inline const T& TFixedArray::At(TInt aIndex) const + {return const_cast(*this).At(aIndex);} +template +inline T* TFixedArray::Begin() + {return &iRep[0];} +template +inline T* TFixedArray::End() + {return &iRep[S];} +template +inline const T* TFixedArray::Begin() const + {return &iRep[0];} +template +inline const T* TFixedArray::End() const + {return &iRep[S];} +#endif diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/h_utl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Include/h_utl.h Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,115 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef H_UTL_H +#define H_UTL_H +// +#include + +#ifdef __VC32__ + #ifdef __MSVCDOTNET__ + #include + #include + #include + using namespace std; + #else //!__MSVCDOTNET__ + #include + #include + #include + #endif //__MSVCDOTNET__ +#else //!__VC32__ + #include + #include + #include +#endif // __VC32__ + +#ifdef __LINUX__ +#include +#include +#include +#include + +#define _close close +#define _filelength filelength +#define _lseek lseek +#define _read read +#define _snprintf snprintf +#define _vsnprintf vsnprintf + +// linux case insensitive stromg comparisons have different names +#define stricmp strcasecmp +#define _stricmp strcasecmp +#define strnicmp strncasecmp + +// to fix the linux problem: memcpy does not work with overlapped areas. +#define memcpy memmove + +// hand-rolled strupr function for converting a string to all uppercase +char* strupr(char *a); + +// return the length of a file +off_t filelength (int filedes); + +#endif //__LINUX__ + +#include + +#define ALIGN4K(a) ((a+0xfff)&0xfffff000) +#define ALIGN4(a) ((a+0x3)&0xfffffffc) + + +#ifdef HEAPCHK +#define NOIMAGE +#define WIN32_LEAN_AND_MEAN +#include +void HeapCheck(); +#endif +#define Print H.PrintString +// +const TInt KMaxStringLength=0x400; +// + +class HMem + { +public: + static TAny* Alloc(TAny * const aBaseAddress,const TUint32 aImageSize); + static TAny* AllocZ( const TUint32 aImageSize ); + static void Free(TAny * const aMem); + static void Copy(TAny * const aDestAddr,const TAny * const aSourceAddr,const TUint32 aLength); + static void Move(TAny * const aDestAddr,const TAny * const aSourceAddr,const TUint32 aLength); + static void Set(TAny * const aDestAddr, const TUint8 aFillChar, const TUint32 aLength); + static void FillZ(TAny * const aDestAddr, const TUint32 aLength); + + static TUint CheckSum(TUint *aPtr, TInt aSize); + static TUint CheckSum8(TUint8 *aPtr, TInt aSize); + static TUint CheckSumOdd8(TUint8 *aPtr, TInt aSize); + static TUint CheckSumEven8(TUint8 *aPtr, TInt aSize); + + static void Crc32(TUint32& aCrc, const TAny* aPtr, TInt aLength); + }; + + +template +inline T* PtrAdd(T* aPtr,S aVal) + {return((T*)(((TUint8*)aPtr)+aVal));} + +template +inline T Min(T aLeft,T aRight) + {return(aLeft + + + +/** +Base class for E32Image Compression Errors. +@internalComponent +@released +*/ +class E32ImageCompressionError +{ + public: + enum + { + HUFFMANBUFFEROVERFLOWERROR = -1, + HUFFMANBUFFERUNDERFLOWERROR = -2, + HUFFMANTOOMANYCODESERROR = -3, + HUFFMANINVALIDCODINGERROR = -4, + }; + public: + E32ImageCompressionError(int aError) + { + iError = aError; + } + + public: + int iError; +}; + + + +/** +Class for Bit input stream. +Good for reading bit streams for packed, compressed or huffman data algorithms. +@since 8.0 +@library euser.lib +@internalComponent +@released +*/ +class TBitInput +{ + public: + TBitInput(); + TBitInput(const TUint8* aPtr, TInt aLength, TInt aOffset=0); + void Set(const TUint8* aPtr, TInt aLength, TInt aOffset=0); + TUint ReadL(); + TUint ReadL(TInt aSize); + TUint HuffmanL(const TUint32* aTree); + private: + virtual void UnderflowL(); + private: + TInt iCount; + TUint iBits; + TInt iRemain; + const TUint32* iPtr; +}; + +/** +Class derived from TBitInput +@internalComponent +@released +*/ +class TFileInput : public TBitInput +{ + public: + TFileInput(unsigned char* source,int size); + ~TFileInput(); + private: + void UnderflowL(); + private: + TUint8* iReadBuf; + TInt iSize; +}; +/* +Class for Huffman code toolkit. + +This class builds a huffman encoding from a frequency table and builds a decoding tree from a +code-lengths table. + +The encoding generated is based on the rule that given two symbols s1 and s2, with code +length l1 and l2, and huffman codes h1 and h2: + if l1step); + + if(src>=srcEnd) + goto error; + numTokens = *src++; + if(numTokens) + { + if(src>=srcEnd) + goto error; + marker = *src++; + LUT0[marker] = (TUint8)~marker; + + if(numTokens<32) + { + TUint8* tokenEnd = src+3*numTokens; + if(tokenEnd>srcEnd) + goto error; + do + { + TInt b = *src++; + TInt p1 = *src++; + TInt p2 = *src++; + LUT0[b] = (TUint8)p1; + LUT1[b] = (TUint8)p2; + } + while(srcsrcEnd) + goto error; + TInt b=0; + do + { + TUint8 mask = bitMask[b>>3]; + if(mask&(1<<(b&7))) + { + if(src>srcEnd) + goto error; + TInt p1 = *src++; + if(src>srcEnd) + goto error; + TInt p2 = *src++; + LUT0[b] = (TUint8)p1; + LUT1[b] = (TUint8)p2; + --numTokens; + } + ++b; + } + while(b<0x100); + if(numTokens) + goto error; + } + } + + if(src>=srcEnd) + goto error; + b = *src++; + if(dst>=dstEnd) + goto error; + p1 = LUT0[b]; + if(p1!=b) + goto not_single; +next: + if(src>=srcEnd) + goto done_s; + b = *src++; + *dst++ = (TUint8)p1; + if(dst>=dstEnd) + goto done_d; + p1 = LUT0[b]; + if(p1==b) + goto next; + +not_single: + if(b==marker) + goto do_marker; + +do_pair: + p2 = LUT1[b]; + b = p1; + p1 = LUT0[b]; + if(sp<=stack) + goto error; + *--sp = (TUint8)p2; + +recurse: + if(b!=p1) + goto do_pair; + + if(sp==stackStart) + goto next; + b = *sp++; + if(dst>=dstEnd) + goto error; + *dst++ = (TUint8)p1; + p1 = LUT0[b]; + goto recurse; + +do_marker: + if(src>=srcEnd) + goto error; + p1 = *src++; + goto next; + +error: + srcNext = 0; + return KErrCorrupt; + +done_s: + *dst++ = (TUint8)p1; + srcNext = src; + return dst-dstStart; + +done_d: + if(dst>=dstEnd) + --src; + srcNext = src; + return dst-dstStart; + } + + + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/dllmain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/dllmain.cpp Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +// System includes +#include + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/h_mem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/h_mem.cpp Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,187 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include + +#include "h_utl.h" + +TAny* HMem::Alloc(TAny * const aBaseAddress,const TUint32 aImageSize) + { + if (aBaseAddress != 0) + { + return 0; + } + + TAny *address = malloc(aImageSize); + return (address); + } + +TAny* HMem::AllocZ( const TUint32 aImageSize ) + { + TAny* address = calloc( 1, aImageSize ); + return address; + } + +void HMem::Free(TAny * const aMem) + { + free(aMem); + } + +void HMem::Copy(TAny * const aDestAddr,const TAny * const aSourceAddr,const TUint32 aLength) + { + memcpy(aDestAddr,aSourceAddr,(size_t)aLength); + } + +void HMem::Move(TAny * const aDestAddr,const TAny * const aSourceAddr,const TUint32 aLength) + { + memmove(aDestAddr,aSourceAddr,(size_t)aLength); + } + +void HMem::Set(TAny * const aDestAddr, const TUint8 aFillChar, const TUint32 aLength) + { + memset(aDestAddr, aFillChar, aLength); + } + +void HMem::FillZ(TAny * const aDestAddr, const TUint32 aLength) + { + memset(aDestAddr, 0, aLength); + } + +TUint HMem::CheckSum(TUint *aPtr, TInt aSize) + { + TUint sum=0; + aSize/=4; + while (aSize-->0) + sum+=*aPtr++; + return sum; + } + +TUint HMem::CheckSum8(TUint8 *aPtr, TInt aSize) + { + TUint sum=0; + while (aSize-->0) + sum+=*aPtr++; + return sum; + } + +TUint HMem::CheckSumOdd8(TUint8 *aPtr, TInt aSize) + { + return CheckSumEven8(aPtr+2, aSize-2); + } + +TUint HMem::CheckSumEven8(TUint8 *aPtr, TInt aSize) + { + TUint sum=0; + while (aSize>0) + { + sum+=(TUint)aPtr[0]+aPtr[1]; + aPtr+=4; + aSize-=4; + } + return sum; + } + +static const TUint32 CrcTab32[256] = + { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d + }; + +/** +Performs a CCITT CRC-32 checksum on the specified data. + +On return from this function, the referenced 32 bit integer contains the CRC +value. + +@param aCrc A reference to a 32 bit integer to contain the CRC value. +@param aPtr A pointer to the start of the data to be checksummed. +@param aLength The length of the data to be checksummed. +*/ +void HMem::Crc32(TUint32& aCrc, const TAny* aPtr, TInt aLength) + { + const TUint8* p = (const TUint8*)aPtr; + const TUint8* q = p + aLength; + TUint32 crc = aCrc; + while (p < q) + crc = (crc >> 8) ^ CrcTab32[(crc ^ *p++) & 0xff]; + aCrc = crc; + } diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/h_utl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/h_utl.cpp Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,17 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/huffman.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/huffman.cpp Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,683 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifdef _MSC_VER + #pragma warning(disable: 4710) // function not inlined +#endif + +#include +#include "huffman.h" +//#include "errorhandler.h" +#include "farray.h" + + + +/** +Recursive function to calculate the code lengths from the node tree +@internalComponent +@released +*/ +void HuffmanLengthsL(TUint32* aLengths,const TNode* aNodes,TInt aNode,TInt aLen) +{ + if (++aLen>Huffman::KMaxCodeLength) + throw E32ImageCompressionError(E32ImageCompressionError::HUFFMANBUFFEROVERFLOWERROR); + + const TNode& node=aNodes[aNode]; + TUint x=node.iLeft; + if (x&KLeaf) + aLengths[x&~KLeaf]=aLen; + else + HuffmanLengthsL(aLengths,aNodes,x,aLen); + x=node.iRight; + if (x&KLeaf) + aLengths[x&~KLeaf]=aLen; + else + HuffmanLengthsL(aLengths,aNodes,x,aLen); +} + +/** +Function to Insert the {aCount,aValue} pair into the already sorted array of nodes +@internalComponent +@released +*/ +void InsertInOrder(TNode* aNodes, TInt aSize, TUint aCount, TInt aVal) +{ + // Uses Insertion sort following a binary search... + TInt l=0, r=aSize; + while (l < r) + { + TInt m = (l+r) >> 1; + if (aNodes[m].iCountTUint(KMaxCodes)) + throw E32ImageCompressionError(E32ImageCompressionError::HUFFMANTOOMANYCODESERROR); + + // Sort the values into decreasing order of frequency + TNode* nodes = new TNode[aNumCodes]; + + TInt lCount=0; + + for (TInt ii=0;ii0. No code has a length + } + else if (lCount==1) + { + // special case for a single value (always encode as "0") + aHuffman[nodes[0].iRight&~KLeaf]=1; + } + else + { + // Huffman algorithm: pair off least frequent nodes and reorder + do + { + --lCount; + TUint c=nodes[lCount].iCount + nodes[lCount-1].iCount; + nodes[lCount].iLeft=nodes[lCount-1].iRight; + // re-order the leaves now to reflect new combined frequency 'c' + InsertInOrder(nodes,lCount-1,c,lCount); + } while (lCount>1); + // generate code lengths in aHuffman[] + HuffmanLengthsL(aHuffman,nodes,1,0); + } + + delete [] nodes; + + if(!IsValid(aHuffman,aNumCodes)) + throw E32ImageCompressionError(E32ImageCompressionError::HUFFMANINVALIDCODINGERROR); +} + +/** +Validate a Huffman encoding + +This verifies that a Huffman coding described by the code lengths is valid. In particular, +it ensures that no code exceeds the maximum length and that it is possible to generate a +canonical coding for the specified lengths. + +@param "const TUint32 aHuffman[]" The table of code lengths as generated by Huffman::HuffmanL() +@param "TInt aNumCodes" The number of codes in the table + +@return True if the code is valid, otherwise false +*/ +TBool Huffman::IsValid(const TUint32 aHuffman[],TInt aNumCodes) +{ + // The code is valid if one of the following holds: + // (a) the code exactly fills the 'code space' + // (b) there is only a single symbol with code length 1 + // (c) there are no encoded symbols + // + TUint remain=1<aHuffman;) + { + TInt len=*--p; + if (len>0) + { + totlen+=len; + if (len>KMaxCodeLength) + return 0; + + TUint c=1<<(KMaxCodeLength-len); + if (c>remain) + return 0; + + remain-=c; + } + } + + return remain==0 || totlen<=1; +} + +/** +Create a canonical Huffman encoding table + +This generates the huffman codes used by TBitOutput::HuffmanL() to write huffman encoded data. +The input is table of code lengths, as generated by Huffman::HuffmanL() and must represent a +valid huffman code. + +@param "const TUint32 aHuffman[]" The table of code lengths as generated by Huffman::HuffmanL() +@param "TInt aNumCodes" The number of codes in the table +@param "TUint32 aEncodeTable[]" The table for the output huffman codes. This must be the same +size as the code-length table, and can safely be the same table. + +@panic "USER ???" If the provided code is not a valid Huffman coding + +@see IsValid() +@see HuffmanL() +*/ +void Huffman::Encoding(const TUint32 aHuffman[],TInt aNumCodes,TUint32 aEncodeTable[]) +{ + if (!IsValid(aHuffman,aNumCodes)) + throw E32ImageCompressionError(E32ImageCompressionError::HUFFMANINVALIDCODINGERROR); + + TFixedArray lenCount; + lenCount.Reset(); + + TInt ii; + for (ii=0;ii=0) + ++lenCount[len]; + } + + TFixedArray nextCode; + TUint code=0; + for (ii=0;iiaValue) + { + TUint32* sub0=HuffmanSubTree(aPtr,aValue,aLevel); // 0-tree first + aPtr=HuffmanSubTree(sub0,aValue-(aPtr-sub0)-1,aLevel); // 1-tree + TInt branch0=(TUint8*)sub0-(TUint8*)(aPtr-1); + *--aPtr=KBranch1|branch0; + } + else if (l==aValue) + { + TUint term0=*aValue--; // 0-term + aPtr=HuffmanSubTree(aPtr,aValue,aLevel); // 1-tree + *--aPtr=KBranch1|(term0>>16); + } + else // l>16<<16)|(term0>>16); + } + return aPtr; +} + +/** +Create a canonical Huffman decoding tree + +This generates the huffman decoding tree used by TBitInput::HuffmanL() to read huffman +encoded data. The input is table of code lengths, as generated by Huffman::HuffmanL() +and must represent a valid huffman code. + +@param "const TUint32 aHuffman[]" The table of code lengths as generated by Huffman::HuffmanL() +@param "TInt aNumCodes" The number of codes in the table +@param "TUint32 aDecodeTree[]" The space for the decoding tree. This must be the same +size as the code-length table, and can safely be the same memory +@param "TInt aSymbolBase" the base value for the output 'symbols' from the decoding tree, by default +this is zero. + +@panic "USER ???" If the provided code is not a valid Huffman coding + +@see IsValid() +@see HuffmanL() +*/ +void Huffman::Decoding(const TUint32 aHuffman[],TInt aNumCodes,TUint32 aDecodeTree[],TInt aSymbolBase) +{ + if(!IsValid(aHuffman,aNumCodes)) + throw E32ImageCompressionError(E32ImageCompressionError::HUFFMANINVALIDCODINGERROR); + + TFixedArray counts; + counts.Reset(); + TInt codes=0; + TInt ii; + for (ii=0;ii=0) + { + ++counts[len]; + ++codes; + } + } + + TFixedArray level; + TUint32* lit=aDecodeTree+codes; + for (ii=0;ii>16; + aDecodeTree[0]=term|(term<<16); // 0- and 1-terminate at root + } + else if (codes>1) + HuffmanSubTree(aDecodeTree+codes-1,aDecodeTree+codes-1,&level[0]); +} + +/** +The decoding tree for the externalised code +*/ +const TUint32 HuffmanDecoding[]= +{ + 0x0004006c, + 0x00040064, + 0x0004005c, + 0x00040050, + 0x00040044, + 0x0004003c, + 0x00040034, + 0x00040021, + 0x00040023, + 0x00040025, + 0x00040027, + 0x00040029, + 0x00040014, + 0x0004000c, + 0x00040035, + 0x00390037, + 0x00330031, + 0x0004002b, + 0x002f002d, + 0x001f001d, + 0x001b0019, + 0x00040013, + 0x00170015, + 0x0004000d, + 0x0011000f, + 0x000b0009, + 0x00070003, + 0x00050001 +}; + + +/** +Restore a canonical huffman encoding from a bit stream + +The encoding must have been stored using Huffman::ExternalizeL(). The resulting +code-length table can be used to create an encoding table using Huffman::Encoding() +or a decoding tree using Huffman::Decoding(). + +@param "TBitInput& aInput" The input stream with the encoding +@param "TUint32 aHuffman[]" The internalized code-length table is placed here +@param "TInt aNumCodes" The number of huffman codes in the table + +@leave "TBitInput::HuffmanL()" + +@see ExternalizeL() +See ExternalizeL for a description of the format +*/ +void Huffman::InternalizeL(TBitInput& aInput,TUint32 aHuffman[],TInt aNumCodes) +{ + // initialise move-to-front list + TFixedArray list; + for (TInt i=0;i0) + { + if (p>end) + { + throw E32ImageCompressionError(E32ImageCompressionError::HUFFMANINVALIDCODINGERROR); + } + *p++=last; + --rl; + } + --c; + list[0]=TUint8(last); + last=list[c]; + + memmove((void * const)&list[1],(const void * const)&list[0],(size_t)c); + if (p>end) + { + throw E32ImageCompressionError(E32ImageCompressionError::HUFFMANINVALIDCODINGERROR); + } + *p++=last; + } + } + while (rl>0) + { + if (p>end) + { + throw E32ImageCompressionError(E32ImageCompressionError::HUFFMANINVALIDCODINGERROR); + } + *p++=last; + --rl; + } +} + +/** +bit-stream input class +Reverse the byte-order of a 32 bit value +This generates optimal ARM code (4 instructions) +*/ +inline TUint reverse(TUint aVal) +{ + TUint v=(aVal<<16)|(aVal>>16); + v^=aVal; + v&=0xff00ffff; + aVal=(aVal>>8)|(aVal<<24); + return aVal^(v>>8); +} + +/** +Construct a bit stream input object + +Following construction the bit stream is ready for reading bits, but will +immediately call UnderflowL() as the input buffer is empty. +*/ +TBitInput::TBitInput():iCount(0),iRemain(0) +{ + +} + +/** +Construct a bit stream input object over a buffer + +Following construction the bit stream is ready for reading bits from the specified buffer. + +@param "const TUint8* aPtr" The address of the buffer containing the bit stream +@param "TInt aLength" The length of the bitstream in bits +@param "TInt aOffset" The bit offset from the start of the buffer to the bit stream (defaults to zero) +*/ +TBitInput::TBitInput(const TUint8* aPtr, TInt aLength, TInt aOffset) +{ + Set(aPtr,aLength,aOffset); +} + +/** +Set the memory buffer to use for input. + +Bits will be read from this buffer until it is empty, at which point UnderflowL() will be called. + +@param "const TUint8* aPtr" The address of the buffer containing the bit stream +@param "TInt aLength" The length of the bitstream in bits +@param "TInt aOffset" The bit offset from the start of the buffer to the bit stream (defaults to zero) +*/ +void TBitInput::Set(const TUint8* aPtr, TInt aLength, TInt aOffset) +{ + TUint p=(TUint)aPtr; + p+=aOffset>>3; // nearest byte to the specified bit offset + aOffset&=7; // bit offset within the byte + const TUint32* ptr=(const TUint32*)(p&~3); // word containing this byte + aOffset+=(p&3)<<3; // bit offset within the word + if (aLength==0) + iCount=0; + else + { + // read the first few bits of the stream + iBits=reverse(*ptr++)<>31; +} + +/** +Read a multi-bit value from the input + +Return the next few bits as an unsigned integer. The last bit read is the least significant +bit of the returned value, and the value is zero extended to return a 32-bit result. + +A read of zero bits will always reaturn zero. + +This will call UnderflowL() if there are not enough bits available. + +@param "TInt aSize" The number of bits to read + +@return The bits read from the stream + +@leave "UnderflowL()" It the bit stream is exhausted more UnderflowL is called to get more +data +*/ +TUint TBitInput::ReadL(TInt aSize) +{ + if (!aSize) + return 0; + TUint val=0; + TUint bits=iBits; + iCount-=aSize; + while (iCount<0) + { + // need more bits +#ifdef __CPU_X86 + // X86 does not allow shift-by-32 + if (iCount+aSize!=0) + val|=bits>>(32-(iCount+aSize))<<(-iCount); // scrub low order bits +#else + val|=bits>>(32-(iCount+aSize))<<(-iCount); // scrub low order bits +#endif + aSize=-iCount; // bits still required + if (iRemain>0) + { + bits=reverse(*iPtr++); + iCount+=32; + iRemain-=32; + if (iRemain<0) + iCount+=iRemain; + } + else + { + UnderflowL(); + bits=iBits; + iCount-=aSize; + } + } + +#ifdef __CPU_X86 + // X86 does not allow shift-by-32 + iBits=aSize==32?0:bits<>(32-aSize)); +} + +/** +Read and decode a Huffman Code + +Interpret the next bits in the input as a Huffman code in the specified decoding. +The decoding tree should be the output from Huffman::Decoding(). + +@param "const TUint32* aTree" The huffman decoding tree + +@return The symbol that was decoded + +@leave "UnderflowL()" It the bit stream is exhausted more UnderflowL is called to get more +data +*/ +TUint TBitInput::HuffmanL(const TUint32* aTree) +{ + TUint huff=0; + do + { + aTree=(const TUint32*)(((TUint8*)aTree)+(huff>>16)); + huff=*aTree; + if (ReadL()==0) + huff<<=16; + } while ((huff&0x10000u)==0); + + return huff>>17; +} + +#endif + +/** +Handle an empty input buffer + +This virtual function is called when the input buffer is empty and more bits are required. +It should reset the input buffer with more data using Set(). + +A derived class can replace this to read the data from a file (for example) before reseting +the input buffer. + +@leave "KErrUnderflow" The default implementation leaves +*/ +void TBitInput::UnderflowL() +{ + throw E32ImageCompressionError(E32ImageCompressionError::HUFFMANBUFFEROVERFLOWERROR); +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/inflate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/inflate.cpp Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,260 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "huffman.h" +#include "inflate.h" +#include "farray.h" + +/* +Inline constructor for CInflater +@param aInput +@internalComponent +@released +*/ +inline CInflater::CInflater(TBitInput& aInput):iBits(&aInput),iEncoding(0),iOut(0) +{ +} + +/* +Function for the 2nd phase construction. +@param +@internalComponent +@released +*/ +void CInflater::ConstructL() +{ + iEncoding=new TEncoding; + InitL(); + iLen=0; + iOut=new TUint8[KDeflateMaxDistance]; + iAvail=iLimit=iOut; +} + +/* +Function NewLC +@Leave OutOfMemory +@param aInput +@return pointer to self +@internalComponent +@released +*/ +CInflater* CInflater::NewLC(TBitInput& aInput) +{ + CInflater* self=new CInflater(aInput); + self->ConstructL(); + + return self; +} + +/* +Destructor for CInflater +@internalComponent +@released +*/ +CInflater::~CInflater() +{ + delete iEncoding; + delete [] iOut; +} + +/* +Function ReadL +@Leave +@param aBuffer +@param aLength +@internalComponent +@released +*/ +TInt CInflater::ReadL(TUint8* aBuffer,TInt aLength) +{ + TInt tfr=0; + for (;;) + { + TInt len; + if(aLength > (iLimit-iAvail)) + len=iLimit-iAvail; + else + len=aLength; + + if (len && aBuffer) + { + memcpy((void * const)aBuffer,(const void * const)iAvail,(size_t)len); + aBuffer+=len; + } + aLength-=len; + iAvail+=len; + tfr+=len; + if (aLength==0) + return tfr; + len=InflateL(); + if (len==0) + return tfr; + iAvail=iOut; + iLimit=iAvail+len; + } +} + +/* +Function InitL +@Leave +@internalComponent +@released +*/ +void CInflater::InitL() +{ + // read the encoding + Huffman::InternalizeL(*iBits,iEncoding->iLitLen,KDeflationCodes); + // validate the encoding + if (!Huffman::IsValid(iEncoding->iLitLen,TEncoding::ELitLens) || + !Huffman::IsValid(iEncoding->iDistance,TEncoding::EDistances)) + { + throw E32ImageCompressionError(E32ImageCompressionError::HUFFMANINVALIDCODINGERROR); + } + + // convert the length tables into huffman decoding trees + Huffman::Decoding(iEncoding->iLitLen,TEncoding::ELitLens,iEncoding->iLitLen); + Huffman::Decoding(iEncoding->iDistance,TEncoding::EDistances,iEncoding->iDistance,KDeflateDistCodeBase); +} + +/* +Consume all data lag in the history buffer, then decode to fill up the output buffer +Return the number of available bytes in the output buffer. This is only ever less than the +buffer size if the end of stream marker has been read. +@internalComponent +@released +*/ +TInt CInflater::InflateL() +{ + // empty the history buffer into the output + TUint8* out=iOut; + TUint8* const end=out+KDeflateMaxDistance; + const TUint32* tree=iEncoding->iLitLen; + if (iLen<0) // EOF + return 0; + if (iLen>0) + goto useHistory; + + while (outHuffmanL(tree)-TEncoding::ELiterals; + if (val<0) + { + *out++=TUint8(val); + continue; // another literal/length combo + } + if (val==TEncoding::EEos-TEncoding::ELiterals) + { // eos marker. we're done + iLen=-1; + break; + } + + // get the extra bits for the code + TInt code=val&0xff; + if (code>=8) + { // xtra bits + TInt xtra=(code>>2)-1; + code-=xtra<<2; + code<<=xtra; + code|=iBits->ReadL(xtra); + } + if (valiDistance; + continue; // read the huffman code + } + // distance code + iRptr=out-(code+1); + if (iRptr+KDeflateMaxDistance (end-out)) + tfr=end-out; + else + tfr=iLen; + + iLen-=tfr; + const TUint8* from=iRptr; + do + { + *out++=*from++; + if (from==end) + from-=KDeflateMaxDistance; + }while (--tfr!=0); + iRptr=from; + tree=iEncoding->iLitLen; + }; + + return out-iOut; +} + +/* +TFileInput Constructor +@param source +@param size +@internalComponent +@released +*/ +TFileInput::TFileInput(unsigned char* source,int size):iReadBuf(source),iSize(size) +{ + Set(source,iSize*8); +} + +/* +TFileInput Destructor +@internalComponent +@released +*/ +TFileInput::~TFileInput() +{ + +} + +/* +Function UnderFlowL +@Leave E32ImageCompressionError +@internalComponent +@released +*/ +void TFileInput::UnderflowL() +{ + throw E32ImageCompressionError(E32ImageCompressionError::HUFFMANBUFFERUNDERFLOWERROR); +} + +/* +Function InflateUncompress +@param source +@param sourcesize +@param dest +@param destsize +@internalComponent +@released +*/ +TInt InflateUnCompress(unsigned char* source, int sourcesize,unsigned char* dest, int destsize) +{ + TFileInput* input = new TFileInput(source, sourcesize); + CInflater* inflater=CInflater::NewLC(*input); + const TInt ret = inflater->ReadL(dest,destsize); + delete input; + delete inflater; + return ret; +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/pagedcompress.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/pagedcompress.cpp Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,232 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "pagedcompress.h" + +// User includes +#include "h_utl.h" +#include "byte_pair.h" +#include "e32defwrap.h" +#include "e32errwrap.h" + +// Constants and defines +const TInt MaxBlockSize = 0x1000; +#define PAGE_SIZE 4096 + + +typedef struct IndexTableItemTag +{ + TUint16 iSizeOfCompressedPageData; // pointer to an array TUint16[NumberOfPages] + TUint8 *iCompressedPageData; // pointer to an array TUint8*. Each elemet of + // this array point a compressed Page data +}IndexTableItem; + + +typedef struct IndexTableHeaderTag +{ + TInt iSizeOfData; // Includes the index and compressed pages + TInt iDecompressedSize; + TUint16 iNumberOfPages; +} IndexTableHeader; + + +class CBytePairCompressedImage +{ + public: + static CBytePairCompressedImage* NewLC(TUint16 aNumberOfPages, TInt aSize); + + ~CBytePairCompressedImage(); + + int GetPage(TUint16 aPageNum, TUint8 * aPageData); + int ReadInTable(std::istream &is, TUint & aNumberOfPages); + + private: + TInt ConstructL( TUint16 aNumberOfPages, TInt aSize); + CBytePairCompressedImage(); + + private: + IndexTableHeader iHeader; + IndexTableItem* iPages; + TUint8* iOutBuffer; + +}; + + +CBytePairCompressedImage::CBytePairCompressedImage() +{ + +} + + +CBytePairCompressedImage* CBytePairCompressedImage::NewLC(TUint16 aNumberOfPages, TInt aSize) +{ + CBytePairCompressedImage* self = new CBytePairCompressedImage; + if( NULL == self) + { + return self; + } + + if( KErrNone == self->ConstructL(aNumberOfPages, aSize)) + { + return self; + } + return NULL; +} + + +TInt CBytePairCompressedImage::ConstructL(TUint16 aNumberOfPages, TInt aSize) +{ + //Print(EWarning,"Start ofCBytePairCompressedImage::ConstructL(%d, %d)\n", aNumberOfPages, aSize ); + iHeader.iNumberOfPages = aNumberOfPages; + iHeader.iDecompressedSize = aSize; + + if( 0 != aNumberOfPages) + { + iPages = (IndexTableItem *) calloc(aNumberOfPages, sizeof(IndexTableItem)); + + if( NULL == iPages ) + { + return KErrNoMemory; + } + } + + iHeader.iSizeOfData = sizeof(iHeader.iSizeOfData) + + sizeof(iHeader.iDecompressedSize) + + sizeof(iHeader.iNumberOfPages) + + aNumberOfPages * sizeof(TUint16); + + iOutBuffer = (TUint8 *) calloc(4 * PAGE_SIZE, sizeof(TUint8) ); + + if ( NULL == iOutBuffer) + { + return KErrNoMemory; + } + return KErrNone; +} // End of ConstructL() + +CBytePairCompressedImage::~CBytePairCompressedImage() +{ + + for( int i = 0; i < iHeader.iNumberOfPages; i++) + { + free(iPages[i].iCompressedPageData); + iPages[i].iCompressedPageData = NULL; + } + + free( iPages ); + iPages = NULL; + + free( iOutBuffer ); + iOutBuffer = NULL; +} + + +int CBytePairCompressedImage::ReadInTable(std::istream &is, TUint & aNumberOfPages) +{ + // Read page index table header + int count = (sizeof(iHeader.iSizeOfData)+sizeof(iHeader.iDecompressedSize)+sizeof(iHeader.iNumberOfPages)); + is.read((char *)&iHeader, count); + + // Allocatin place to Page index table entries + iPages = (IndexTableItem *) calloc(iHeader.iNumberOfPages, sizeof(IndexTableItem)); + + if( NULL == iPages ) + { + return KErrNoMemory; + } + + // Read whole Page index table + for(TInt i = 0; i < iHeader.iNumberOfPages; i++) + { + is.read((char *) &(iPages[i].iSizeOfCompressedPageData), sizeof(TUint16)); + } + + // Read compressed data pages page by page, decompress and store them + for(TInt i = 0; i < iHeader.iNumberOfPages; i++) + { + + iPages[i].iCompressedPageData = (TUint8 *) calloc(iPages[i].iSizeOfCompressedPageData, sizeof(TUint8) ); + + if( NULL == iPages[i].iCompressedPageData ) + { + return KErrNoMemory; + } + + is.read((char *)iPages[i].iCompressedPageData, iPages[i].iSizeOfCompressedPageData); + } + + aNumberOfPages = iHeader.iNumberOfPages; + + return KErrNone; +} + +int CBytePairCompressedImage::GetPage(TUint16 aPageNum, TUint8 * aPageData) +{ + TUint8* pakEnd; + + + TUint16 uncompressedSize = (TUint16) UnpackBytePair( aPageData, + MaxBlockSize, + iPages[aPageNum].iCompressedPageData, + iPages[aPageNum].iSizeOfCompressedPageData, + pakEnd ); + + return uncompressedSize; + + +} + + + +int DecompressPages(TUint8 * bytes, std::istream& is) +{ + TUint decompressedSize = 0; + CBytePairCompressedImage *comprImage = CBytePairCompressedImage::NewLC(0, 0); + if( NULL == comprImage) + { + return KErrNoMemory; + } + + TUint numberOfPages = 0; + comprImage->ReadInTable(is, numberOfPages); + + + TUint8* iPageStart; + TUint16 iPage = 0; + + while(iPage < numberOfPages ) + { + iPageStart = &bytes[iPage * PAGE_SIZE]; + + decompressedSize += comprImage->GetPage(iPage, iPageStart); + + ++iPage; + } + + delete comprImage; + return decompressedSize; + +} + +TInt UnpackBytePairE32Image( TUint8* aSource, TInt aSourceSize, TUint8* aDest, TInt aDestSize, TInt& aInputBytesRead ) +{ + istrstream stream( (const char*) aSource, aSourceSize ); + const streampos startPos = stream.tellg(); + const TInt ret = DecompressPages( aDest, stream ); + const streampos endPos = stream.tellg(); + aInputBytesRead = endPos - startPos; + return ret; +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/sinflate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/Source/sinflate.cpp Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +/* +extern void InflateUnCompress(unsigned char* source, int sourcesize,unsigned char* dest, int destsize); + + void JNICALL Java_rofssym_SymbianInflater_InflateUncompress + (JNIEnv *env, jobject, jbyteArray aSource, jbyteArray aDest) + { + jboolean isCopy; // ignored + + jsize srcsize = env->GetArrayLength(aSource); + jsize dstsize = env->GetArrayLength(aDest); + + unsigned char * src = (unsigned char *) env->GetByteArrayElements(aSource, &isCopy); + unsigned char * dst = (unsigned char *) env->GetByteArrayElements(aDest, &isCopy); + + InflateUnCompress(src, srcsize, dst, dstsize); + + env->ReleaseByteArrayElements(aSource, (jbyte *) src, 0); + env->ReleaseByteArrayElements(aDest, (jbyte *) dst, 0); + } + + catch(ErrorHandler& error) + { + error.Report(); + } + + +*/ \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/SymbianNativeTools.vcproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianNativeTools/SymbianNativeTools.vcproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/BaseStructures/ParserElementBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/BaseStructures/ParserElementBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,270 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianParserLib.BaseStructures +{ + public abstract class ParserElementBase + { + #region Internal enumerations + [Flags] + internal enum TElementBaseFlags + { + EElementBaseFlagsNone = 0, + EElementBaseFlagsIsDisabled = 1, + EElementBaseFlagsIsNeverEnding = 2, + EElementBaseFlagsIsComplete = 4, + EElementBaseFlagsSetDisabledWhenComplete = 8, + } + #endregion + + #region Delegates and events + public delegate void ElementCompleteHandler( ParserElementBase aElement ); + public event ElementCompleteHandler ElementComplete; + #endregion + + #region Constructors + protected ParserElementBase() + : this( string.Empty ) + { + } + + protected ParserElementBase( string aName ) + : this( aName, null ) + { + } + + protected ParserElementBase( string aName, object aTag ) + : this( aName, null, aTag ) + { + } + + protected ParserElementBase( ParserElementBase aParent ) + : this( string.Empty, aParent, null ) + { + } + + protected ParserElementBase( string aName, ParserElementBase aParent, object aTag ) + { + iName = aName; + iParent = aParent; + iTag = aTag; + + // Default behaviour is to disable the item when it is complete + DisableWhenComplete = true; + } + #endregion + + #region Abstract API + internal abstract ParserResponse Offer( ref string aLine ); + + internal virtual string CurrentLine + { + get { return string.Empty; } + } + + internal virtual void OnDisableWhenComplete() + { + } + + internal virtual void OnNeverEnding() + { + } + #endregion + + #region API + public string GetCurrentLine() + { + string line = string.Empty; + // + ParserElementBase element = this; + while ( line == string.Empty && element != null ) + { + line = element.CurrentLine; + element = element.Parent; + } + // + return line; + } + + public void SetRepetitions( int aValue ) + { + iRepetitions = aValue; + IsComplete = ( aValue == 0 ) && !IsNeverEnding; + IsDisabled = ( IsComplete && DisableWhenComplete ); + } + #endregion + + #region Properties + public bool DisableWhenComplete + { + get { return ( iElementFlags & TElementBaseFlags.EElementBaseFlagsSetDisabledWhenComplete ) == TElementBaseFlags.EElementBaseFlagsSetDisabledWhenComplete; } + set + { + if ( value ) + { + iElementFlags |= TElementBaseFlags.EElementBaseFlagsSetDisabledWhenComplete; + } + else + { + iElementFlags &= ~TElementBaseFlags.EElementBaseFlagsSetDisabledWhenComplete; + } + + OnDisableWhenComplete(); + } + } + + public string Name + { + get { return iName; } + set { iName = value; } + } + + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + + public int Repetitions + { + get { return iRepetitions; } + } + + public bool IsDisabled + { + get { return ( iElementFlags & TElementBaseFlags.EElementBaseFlagsIsDisabled ) == TElementBaseFlags.EElementBaseFlagsIsDisabled; } + set + { + if ( value ) + { + iElementFlags |= TElementBaseFlags.EElementBaseFlagsIsDisabled; + } + else + { + iElementFlags &= ~TElementBaseFlags.EElementBaseFlagsIsDisabled; + } + } + } + + public bool IsNeverEnding + { + get { return ( iElementFlags & TElementBaseFlags.EElementBaseFlagsIsNeverEnding ) == TElementBaseFlags.EElementBaseFlagsIsNeverEnding; } + set + { + if ( value ) + { + iElementFlags |= TElementBaseFlags.EElementBaseFlagsIsNeverEnding; + } + else + { + iElementFlags &= ~TElementBaseFlags.EElementBaseFlagsIsNeverEnding; + } + + OnNeverEnding(); + } + } + + public bool IsComplete + { + get { return ( iElementFlags & TElementBaseFlags.EElementBaseFlagsIsComplete ) == TElementBaseFlags.EElementBaseFlagsIsComplete; } + set + { + bool isComplete = false; + + // Decrement the number of repetitions and if the final value is zero + // then the line is 'really' complete. + if ( value == true ) + { + if ( !IsNeverEnding ) + { + --iRepetitions; + } + + isComplete = ( iRepetitions <= 0 ) || IsNeverEnding; + } + else + { + isComplete = value; + } + + // Final value update + if ( isComplete ) + { + iElementFlags |= TElementBaseFlags.EElementBaseFlagsIsComplete; + } + else + { + iElementFlags &= ~TElementBaseFlags.EElementBaseFlagsIsComplete; + } + + if ( isComplete ) + { + if ( DisableWhenComplete ) + { + IsDisabled = true; + } + + OnElementComplete(); + } + + // If we're never ending, then the item is never really complete + if ( IsNeverEnding ) + { + iElementFlags &= ~TElementBaseFlags.EElementBaseFlagsIsComplete; + } + } + } + + public ParserElementBase Parent + { + get { return iParent; } + set { iParent = value; } + } + #endregion + + #region Internal methods + protected void OnElementComplete() + { + if ( ElementComplete != null ) + { + ElementComplete( this ); + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region Data members + private string iName; + private object iTag = null; + private TElementBaseFlags iElementFlags = TElementBaseFlags.EElementBaseFlagsNone; + private int iRepetitions = 1; + private ParserElementBase iParent = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/BaseStructures/ParserElementBaseWithValueStore.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/BaseStructures/ParserElementBaseWithValueStore.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,259 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.ComponentModel; +using SymbianParserLib.Enums; +using SymbianParserLib.ValueStores; +using SymbianParserLib.Elements.SubFields; + +namespace SymbianParserLib.BaseStructures +{ + public abstract class ParserElementBaseWithValueStore : ParserElementBase + { + #region Constructors + protected ParserElementBaseWithValueStore() + : this( string.Empty ) + { + } + + protected ParserElementBaseWithValueStore( string aName ) + : base( aName ) + { + } + #endregion + + #region Abstract API + internal abstract void SetTargetProperty( object aPropertyObject, string aPropertyName, int aIndex ); + + internal virtual void SetValue( ParserFieldFormatSpecifier aFormat, ParserFieldFormatValue aValue ) + { + ValueStore vs = GetValueStore( this ); + if ( vs == null ) + { + // Make a new "store internally" value store + iValueStore = new ValueStore(); + vs = iValueStore; + } + // + vs.SetValue( aFormat, aValue ); + } + #endregion + + #region API + public virtual void SetTargetObject() + { + iValueStore = new ValueStore(); + } + + public virtual void SetTargetProperty( object aPropertyObject, string aPropertyName ) + { + SetTargetProperty( aPropertyObject, aPropertyName, KGloballyApplicable ); + } + + public virtual void SetTargetProperties( object aPropertyObjects, params string[] aPropertyNames ) + { + if ( aPropertyObjects == null ) + { + throw new ArgumentException( "Property object cannot be null" ); + } + + int count = aPropertyNames.Length; + if ( count == 0 ) + { + throw new ArgumentException( "Property name array must not be empty" ); + } + + for ( int i = 0; i < count; i++ ) + { + string propName = aPropertyNames[ i ]; + if ( propName.Length == 0 ) + { + throw new ArgumentException( "Property name is invalid" ); + } + + SetTargetProperty( aPropertyObjects, propName, i ); + } + } + + public virtual void SetTargetProperties( object[] aPropertyObjects, params string[] aPropertyNames ) + { + if ( aPropertyObjects.Length == 0 || aPropertyNames.Length == 0 || aPropertyObjects.Length != aPropertyNames.Length ) + { + throw new ArgumentException( "Property object/names are invalid" ); + } + // + int count = aPropertyNames.Length; + for ( int i = 0; i < count; i++ ) + { + object obj = aPropertyObjects[ i ]; + if ( obj == null ) + { + throw new ArgumentException( "Property object cannot be null" ); + } + + string propName = aPropertyNames[ i ]; + if ( propName.Length == 0 ) + { + throw new ArgumentException( "Property name is invalid" ); + } + + SetTargetProperty( obj, propName, i ); + } + } + + public virtual void SetTargetMethod( object aMethodObject, string aMethodName ) + { + SetTargetMethod( aMethodObject, aMethodName, TValueStoreMethodArguments.EValueStoreMethodArgumentCalculateAtRuntime ); + } + + public virtual void SetTargetMethod( object aMethodObject, string aMethodName, params TValueStoreMethodArguments[] aMethodArgs ) + { + // Check that the args are okay. + foreach ( TValueStoreMethodArguments argType in aMethodArgs ) + { + if ( argType == TValueStoreMethodArguments.EValueStoreMethodArgumentCalculateAtRuntime ) + { + if ( aMethodArgs.Length != 1 ) + { + throw new ArgumentException( "Method arguments must contain only a single entry when using \'calculate at runtime\' approach" ); + } + } + } + + iValueStore = new ValueStore(); + iValueStore.SetTargetMethod( aMethodObject, aMethodName, aMethodArgs ); + } + #endregion + + #region Properties + public bool IsInt + { + get + { + bool ret = ( iValueStore != null ) && iValueStore.IsInt; + return ret; + } + } + + public bool IsUint + { + get + { + bool ret = ( iValueStore != null ) && iValueStore.IsUint; + return ret; + } + } + + public bool IsString + { + get + { + bool ret = ( iValueStore != null ) && iValueStore.IsString; + return ret; + } + } + + public int AsInt + { + get + { + int ret = 0; + // + if ( IsInt ) + { + ret = iValueStore.AsInt; + } + // + return ret; + } + } + + public uint AsUint + { + get + { + uint ret = 0; + // + if ( IsUint ) + { + ret = iValueStore.AsUint; + } + // + return ret; + } + } + + public string AsString + { + get + { + string ret = string.Empty; + // + if ( IsString ) + { + ret = iValueStore.AsString; + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal static methods + private static ValueStore GetValueStore( ParserElementBase aElement ) + { + ValueStore ret = null; + // + if ( aElement is ParserElementBaseWithValueStore ) + { + ParserElementBaseWithValueStore element = (ParserElementBaseWithValueStore) aElement; + if ( element.iValueStore != null ) + { + ret = element.iValueStore; + } + else if ( element.Parent != null ) + { + ret = GetValueStore( element.Parent ); + } + } + // + return ret; + } + #endregion + + #region Internal constant + protected const int KGloballyApplicable = -1; + #endregion + + #region From System.Object + public override string ToString() + { + return base.Name; + } + #endregion + + #region Data members + protected ValueStore iValueStore = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/BaseStructures/ParserFieldName.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/BaseStructures/ParserFieldName.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianParserLib.BaseStructures +{ + public class ParserFieldName + { + #region Constructors + public ParserFieldName() + { + } + + public ParserFieldName( string aName ) + { + iName = aName; + } + + internal ParserFieldName( ParserFieldName aCopy ) + { + iName = aCopy.Name; + } + #endregion + + #region API + public static implicit operator string( ParserFieldName aFieldName ) + { + return aFieldName.Name; + } + #endregion + + #region Properties + public string Name + { + get { return iName; } + set { iName = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region Data members + private string iName = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/BaseStructures/ParserResponse.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/BaseStructures/ParserResponse.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianParserLib.BaseStructures +{ + internal class ParserResponse + { + #region Enumerations + public enum TResponseType + { + EResponseTypeUnhandled = 0, + EResponseTypeHandled, + EResponseTypeHandledByRequiresReProcessing + } + #endregion + + #region Constructors + public ParserResponse() + : this( TResponseType.EResponseTypeUnhandled ) + { + } + + public ParserResponse( TResponseType aType ) + { + iType = aType; + } + #endregion + + #region API + #endregion + + #region Properties + public TResponseType Type + { + get { return iType; } + } + + public bool WasHandled + { + get { return Type != TResponseType.EResponseTypeUnhandled; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private readonly TResponseType iType; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Elements/ParserElementField.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Elements/ParserElementField.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using SymbianParserLib.Enums; +using SymbianParserLib.BaseStructures; +using SymbianParserLib.Elements.SubFields; +using SymbianParserLib.ValueStores; + +namespace SymbianParserLib.Elements +{ + public class ParserField : ParserElementBaseWithValueStore + { + #region Constructors + public ParserField() + : this( string.Empty ) + { + } + + public ParserField( string aName ) + : base( aName ) + { + iFormatSpecifier = new ParserFieldFormatSpecifier( this ); + iFormatValue = new ParserFieldFormatValue( this ); + } + + internal ParserField( ParserField aField ) + : this( aField.Name ) + { + iFormatSpecifier = new ParserFieldFormatSpecifier( this, aField.FormatSpecifier ); + iFormatValue = new ParserFieldFormatValue( this, aField.FormatValue ); + } + #endregion + + #region API + internal void ExtractValue( Group aGroup ) + { + string fieldValue = aGroup.Value; + TParserValueType fieldValueType = FormatSpecifier.ExpectedType; + // + switch ( fieldValueType ) + { + case TParserValueType.EValueTypeString: + { + iFormatValue.SetValueString( fieldValue ); + break; + } + case TParserValueType.EValueTypeInt32: + { + int valInt32 = System.Convert.ToInt32( fieldValue ); + iFormatValue.SetValueInt( valInt32 ); + break; + } + case TParserValueType.EValueTypeUint32: + { + int numberBase = FormatSpecifier.NumberBase; + uint valUint32 = System.Convert.ToUInt32( fieldValue, numberBase ); + iFormatValue.SetValueUint( valUint32 ); + } + break; + case TParserValueType.EValueTypeUint64: + { + int numberBase = FormatSpecifier.NumberBase; + ulong valUint64 = System.Convert.ToUInt32( fieldValue, numberBase ); + iFormatValue.SetValueUint64( valUint64 ); + } + break; + } + // + SetValue( iFormatSpecifier, iFormatValue ); + IsComplete = true; + } + #endregion + + #region Properties + public ParserLine Line + { + get + { + ParserLine ret = null; + // + if ( Parent != null && Parent is ParserLine ) + { + ret = Parent as ParserLine; + } + // + return ret; + } + } + + internal ParserFieldFormatSpecifier FormatSpecifier + { + get { return iFormatSpecifier; } + } + + internal ParserFieldFormatValue FormatValue + { + get { return iFormatValue; } + } + #endregion + + #region From ParserElementBase + internal override ParserResponse Offer( ref string aLine ) + { + throw new NotSupportedException(); + } + #endregion + + #region From ParserElementBaseWithValueStore + internal override void SetTargetProperty( object aPropertyObject, string aPropertyName, int aIndex ) + { + iValueStore = new ValueStore(); + iValueStore.SetTargetProperty( aPropertyObject, aPropertyName ); + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private readonly ParserFieldFormatSpecifier iFormatSpecifier; + private readonly ParserFieldFormatValue iFormatValue; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Elements/ParserElementLine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Elements/ParserElementLine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,398 @@ +//#define SHOW_EACH_LINE +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using SymbianParserLib.Utilities; +using SymbianParserLib.RegExTranslators; +using SymbianParserLib.BaseStructures; +using SymbianParserLib.ValueStores; + +namespace SymbianParserLib.Elements +{ + public class ParserLine : ParserElementBaseWithValueStore, IEnumerable + { + #region Enumerations + public enum TLineType + { + ELineTypeSimpleStringMatch = 0, + ELineTypeSymbianFormatString, + ELineTypeRegEx + } + + [Flags] + internal enum TLineFlags + { + ELineFlagNone = 0, + ELineFlagDequeueIfComplete = 1, + ELineFlagNeverConsumesLine = 2 + } + #endregion + + #region Static constructors + public static ParserLine New( string aText ) + { + ParserLine self = new ParserLine( TLineType.ELineTypeSimpleStringMatch ); + self.OriginalValue = ParserUtils.RemoveLineEndings( aText ); + return self; + } + + public static ParserLine NewSymFormat( string aFormat ) + { + // First check with cache + ParserLine self = RegExTranslatorManager.PreCachedCompiledEntry( aFormat ); + if ( self == null ) + { + // Wasn't cached so we need to parse and create a new entry + self = new ParserLine( TLineType.ELineTypeSymbianFormatString ); + self.OriginalValue = aFormat; + // + RegExTranslatorManager.CompileToRegularExpression( self ); + } + // + return self; + } + + public static ParserLine NewRegEx( string aRegEx ) + { + throw new NotSupportedException(); + } + + internal static ParserLine NewCopy( ParserLine aLine ) + { + ParserLine ret = new ParserLine( aLine ); + return ret; + } + #endregion + + #region Constructors + private ParserLine( TLineType aLineType ) + { + iLineType = aLineType; + } + + private ParserLine( ParserLine aLine ) + { + iLineType = aLine.LineType; + iOriginalValue = aLine.OriginalValue; + iFinalValue = new StringBuilder( aLine.FinalValue ); + iFlags = aLine.iFlags; + + foreach ( ParserField templateField in aLine ) + { + ParserField copy = new ParserField( templateField ); + Add( copy ); + } + + CreateRegEx(); + } + #endregion + + #region API + public void Add( ParserField aField ) + { + aField.Parent = this; + aField.DisableWhenComplete = this.DisableWhenComplete; + iFields.Add( aField ); + } + + internal void Finalise() + { + if ( Count != 0 ) + { + FinalValue = OriginalValue; + + // Fixup the final string to be a new "dynamically" generated regular expression. Work + // backwards since we adjust the string by index and therefore we must not affect earlier + // indexes when forming the replacement. + for( int i=Count-1; i>=0; i-- ) + { + ParserField field = this[ i ]; + // + string regex = field.FormatSpecifier.RegularExpressionString; + int origPos = field.FormatSpecifier.OriginalLocation; + int origLen = field.FormatSpecifier.OriginalLength; + iFinalValue.Remove( origPos, origLen ); + iFinalValue.Insert( origPos, regex ); + } + + CreateRegEx(); + } + } + #endregion + + #region Properties + public int Count + { + get { return iFields.Count; } + } + + public ParserField this[ int aIndex ] + { + get { return iFields[ aIndex ]; } + } + + public ParserParagraph Paragraph + { + get + { + ParserParagraph ret = null; + // + if ( Parent != null && Parent is ParserParagraph ) + { + ret = Parent as ParserParagraph; + } + // + return ret; + } + } + + public bool DequeueIfComplete + { + get { return ( iFlags & TLineFlags.ELineFlagDequeueIfComplete ) == TLineFlags.ELineFlagDequeueIfComplete; } + set + { + if ( value ) + { + iFlags |= TLineFlags.ELineFlagDequeueIfComplete; + } + else + { + iFlags &= ~TLineFlags.ELineFlagDequeueIfComplete; + } + } + } + + public bool NeverConsumesLine + { + get { return ( iFlags & TLineFlags.ELineFlagNeverConsumesLine ) == TLineFlags.ELineFlagNeverConsumesLine; } + set + { + if ( value ) + { + iFlags |= TLineFlags.ELineFlagNeverConsumesLine; + } + else + { + iFlags &= ~TLineFlags.ELineFlagNeverConsumesLine; + } + } + } + + public string OriginalValue + { + get { return iOriginalValue; } + set { iOriginalValue = value; } + } + + public TLineType LineType + { + get { return iLineType; } + } + + internal string FinalValue + { + get { return FinalValueBuilder.ToString(); } + set { iFinalValue = new StringBuilder( value ); } + } + + internal StringBuilder FinalValueBuilder + { + get { return iFinalValue; } + set { iFinalValue = value; } + } + #endregion + + #region From ParserElementBase + internal override ParserResponse Offer( ref string aLine ) + { + ParserResponse ret = new ParserResponse(); + // + if ( iLineType == TLineType.ELineTypeSimpleStringMatch ) + { + bool match = ( aLine.Contains( OriginalValue ) ); + if ( match ) + { +#if SHOW_EACH_LINE + System.Diagnostics.Debug.WriteLine( aLine ); +#endif + ret = new ParserResponse( ParserResponse.TResponseType.EResponseTypeHandled ); + } + } + else if ( iLineType == TLineType.ELineTypeSymbianFormatString ) + { + if ( iFinalRegEx != null ) + { + Match m = iFinalRegEx.Match( aLine ); + bool match = m.Success; + if ( match ) + { +#if SHOW_EACH_LINE + System.Diagnostics.Debug.WriteLine( aLine ); +#endif + + GroupCollection groups = m.Groups; + ExtractValues( groups ); + + ret = new ParserResponse( ParserResponse.TResponseType.EResponseTypeHandled ); + } + } + } + + // Update completion - will trigger observers + IsComplete = ret.WasHandled; + + if ( IsComplete ) + { + // Dequeue the line from parent paragraph if it is + // complete and so adorned + if ( DequeueIfComplete ) + { + Paragraph.Remove( this ); + } + + // If this object never consumes the input string, then + // instead throw a nonconsuming exception, and the engine + // will re-offer it to all objects + if ( NeverConsumesLine ) + { + ret = new ParserResponse( ParserResponse.TResponseType.EResponseTypeHandledByRequiresReProcessing ); + } + } + + return ret; + } + + internal override void OnDisableWhenComplete() + { + base.OnDisableWhenComplete(); + // + foreach( ParserField f in iFields ) + { + f.DisableWhenComplete = this.DisableWhenComplete; + } + } + + internal override void OnNeverEnding() + { + base.OnNeverEnding(); + // + foreach ( ParserField f in iFields ) + { + f.IsNeverEnding = this.IsNeverEnding; + } + } + #endregion + + #region From ParserElementBaseWithValueStore + public override void SetTargetObject() + { + base.SetTargetObject(); + foreach ( ParserField field in this ) + { + field.SetTargetObject(); + } + } + + internal override void SetTargetProperty( object aPropertyObject, string aPropertyName, int aIndex ) + { + if ( aIndex == ParserElementBaseWithValueStore.KGloballyApplicable ) + { + // Applicable to all + iValueStore = new ValueStore(); + iValueStore.SetTargetProperty( aPropertyObject, aPropertyName ); + } + else + { + // Specific to a field + if ( aIndex < 0 || aIndex >= Count ) + { + throw new ArgumentOutOfRangeException( "aIndex" ); + } + + this[ aIndex ].SetTargetProperty( aPropertyObject, aPropertyName ); + } + } + #endregion + + #region Internal methods + private void CreateRegEx() + { + iFinalRegEx = new Regex( FinalValue, RegexOptions.Singleline ); + } + + private void ExtractValues( GroupCollection aGroups ) + { + for ( int i = 1; i < aGroups.Count; i++ ) + { + Group group = aGroups[ i ]; + if ( group.Success ) + { + int pos = group.Index; + string value = group.Value; + // + if ( i <= Count ) + { + ParserField field = this[ i - 1 ]; + field.ExtractValue( group ); + } + } + } + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( ParserField field in iFields ) + { + yield return field; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( ParserField field in iFields ) + { + yield return field; + } + } + #endregion + + #region Data members + private readonly TLineType iLineType; + private string iOriginalValue = string.Empty; + private StringBuilder iFinalValue = new StringBuilder(); + private Regex iFinalRegEx = null; + private TLineFlags iFlags = TLineFlags.ELineFlagNone; + private List iFields = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Elements/ParserElementParagraph.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Elements/ParserElementParagraph.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,215 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using SymbianParserLib.RegExTranslators; +using SymbianParserLib.BaseStructures; + +namespace SymbianParserLib.Elements +{ + public class ParserParagraph : ParserElementBaseWithValueStore, IEnumerable + { + #region Constructors + public ParserParagraph( string aName ) + : base( aName ) + { + } + #endregion + + #region API + public void Add( ParserLine aLine ) + { + aLine.Parent = this; + aLine.ElementComplete += new ElementCompleteHandler( Line_ElementComplete ); + iLines.Add( aLine ); + } + + public void Add( params ParserLine[] aLines ) + { + foreach ( ParserLine line in aLines ) + { + Add( line ); + } + } + + public void Remove( ParserLine aLine ) + { + aLine.ElementComplete -= new ElementCompleteHandler( Line_ElementComplete ); + iLines.Remove( aLine ); + } + #endregion + + #region Properties + public ParserLine this[ int aIndex ] + { + get { return iLines[ aIndex ]; } + } + + public int Count + { + get { return iLines.Count; } + } + #endregion + + #region From ParserElementBase + internal override ParserResponse Offer( ref string aLine ) + { + ParserResponse ret = new ParserResponse(); + // + foreach ( ParserLine line in this ) + { + if ( !line.IsDisabled ) + { + ret = line.Offer( ref aLine ); + if ( ret.Type != ParserResponse.TResponseType.EResponseTypeUnhandled ) + { + break; + } + } + } + // + return ret; + } + #endregion + + #region From ParserElementBaseWithValueStore + internal override void SetTargetProperty( object aPropertyObject, string aPropertyName, int aIndex ) + { + if ( aIndex == ParserElementBaseWithValueStore.KGloballyApplicable ) + { + } + else + { + int cumulativeFieldCount = 0; + int count = iLines.Count; + for ( int i = 0; i < count; i++ ) + { + ParserLine line = this[ i ]; + int fieldCountForLine = line.Count; + int lastFieldIndexWithinLine = cumulativeFieldCount + fieldCountForLine; + // + if ( aIndex < fieldCountForLine ) + { + int index = aIndex - cumulativeFieldCount; + line.SetTargetProperty( aPropertyObject, aPropertyName, index ); + break; + } + // + cumulativeFieldCount += fieldCountForLine; + } + } + } + #endregion + + #region Event handlers + void Line_ElementComplete( ParserElementBase aElement ) + { + int completeCount = 0; + foreach( ParserLine line in iLines ) + { + if ( line.IsComplete && !line.IsNeverEnding ) + { + ++completeCount; + } + } + // + IsComplete = ( completeCount == Count ); + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return new ParserParagraphEnumerator( this ); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return new ParserParagraphEnumerator( this ); + } + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private List iLines = new List(); + #endregion + } + + #region Enumerator + internal class ParserParagraphEnumerator : IEnumerator + { + #region Constructors + public ParserParagraphEnumerator( ParserParagraph aObject ) + { + iObject = aObject; + } + #endregion + + #region IEnumerator Members + public void Reset() + { + iCurrentIndex = -1; + } + + public object Current + { + get + { + return iObject[ iCurrentIndex ]; + } + } + + public bool MoveNext() + { + return ( ++iCurrentIndex < iObject.Count ); + } + #endregion + + #region From IEnumerator + ParserLine IEnumerator.Current + { + get { return iObject[ iCurrentIndex ]; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly ParserParagraph iObject; + private int iCurrentIndex = -1; + #endregion + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Elements/SubFields/ParserFieldFormatSpecifier.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Elements/SubFields/ParserFieldFormatSpecifier.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using SymbianParserLib.Enums; +using SymbianParserLib.BaseStructures; + +namespace SymbianParserLib.Elements.SubFields +{ + internal class ParserFieldFormatSpecifier + { + #region Constructors + public ParserFieldFormatSpecifier( ParserField aField ) + { + iField = aField; + iFieldName.Name = aField.Name; + } + + public ParserFieldFormatSpecifier( ParserField aField, ParserFieldFormatSpecifier aCopy ) + : this( aField ) + { + OriginalLocation = aCopy.OriginalLocation; + OriginalLength = aCopy.OriginalLength; + RegularExpressionString = aCopy.RegularExpressionString; + NumberBase = aCopy.NumberBase; + ExpectedType = aCopy.ExpectedType; + } + #endregion + + #region API + #endregion + + #region Properties + public ParserFieldName Name + { + get { return iFieldName; } + } + + public int OriginalLocation + { + get { return iOriginalLocation; } + set { iOriginalLocation = value; } + } + + public int OriginalLength + { + get { return iOriginalLength; } + set { iOriginalLength = value; } + } + + public string RegularExpressionString + { + get { return iRegexString; } + set { iRegexString = value; } + } + + public int NumberBase + { + get { return iNumberBase; } + set { iNumberBase = value; } + } + + public Regex RegularExpression + { + get { return new Regex( iRegexString ); } + } + + public TParserValueType ExpectedType + { + get { return iExpectedType; } + set { iExpectedType = value; } + } + + internal ParserField Field + { + get { return iField; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private readonly ParserField iField; + private ParserFieldName iFieldName = new ParserFieldName(); + private int iOriginalLocation = -1; + private int iOriginalLength = -1; + private string iRegexString = null; + private int iNumberBase = 10; + private TParserValueType iExpectedType = TParserValueType.EValueTypeByte; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Elements/SubFields/ParserFieldFormatValue.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Elements/SubFields/ParserFieldFormatValue.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using System.ComponentModel; +using SymbianParserLib.Enums; + +namespace SymbianParserLib.Elements.SubFields +{ + internal class ParserFieldFormatValue + { + #region Constructors + public ParserFieldFormatValue( ParserField aField ) + { + iField = aField; + } + + internal ParserFieldFormatValue( ParserField aField, ParserFieldFormatValue aCopy ) + : this( aField ) + { + } + #endregion + + #region API + public void SetValueString( string aValue ) + { + iValue = aValue; + } + + public void SetValueUint( uint aValue ) + { + iValue = aValue; + } + + public void SetValueUint64( ulong aValue ) + { + iValue = aValue; + } + + public void SetValueInt( int aValue ) + { + iValue = aValue; + } + #endregion + + #region Properties + public object Value + { + get { return iValue; } + } + + internal ParserField Field + { + get { return iField; } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private readonly ParserField iField; + private object iValue = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Engine/ParserEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Engine/ParserEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,228 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using SymbianParserLib.Enums; +using SymbianParserLib.Elements; +using SymbianParserLib.Exceptions; +using SymbianParserLib.BaseStructures; +using SymbianParserLib.RegExTranslators; + +namespace SymbianParserLib.Engine +{ + public class ParserEngine : BaseStructures.ParserElementBase, IEnumerable + { + #region Delegates and events + public event BaseStructures.ParserElementBase.ElementCompleteHandler ParagraphComplete; + #endregion + + #region Constructors + public ParserEngine() + { + } + #endregion + + #region API + public bool OfferLine( ref string aLine ) + { + iCurrentLine = aLine; + // + ParserResponse response = Offer( ref aLine ); + bool ret = response.WasHandled; + // + return ret; + } + + public void Reset() + { + iParagraphs.Clear(); + } + + public void Remove( ParserParagraph aParagraph ) + { + aParagraph.ElementComplete -= new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler( Paragraph_ElementComplete ); + iParagraphs.Remove( aParagraph ); + } + + public void RemoveRange( int aStartAt ) + { + int count = iParagraphs.Count - aStartAt; + iParagraphs.RemoveRange( aStartAt, count ); + } + + public void Add( params ParserParagraph[] aParagraphs ) + { + foreach ( ParserParagraph para in aParagraphs ) + { + Add( para ); + } + } + + public void Add( ParserParagraph aParagraph ) + { + aParagraph.Parent = this; + aParagraph.ElementComplete += new SymbianParserLib.BaseStructures.ParserElementBase.ElementCompleteHandler( Paragraph_ElementComplete ); + iParagraphs.Add( aParagraph ); + } + #endregion + + #region Properties + public int Count + { + get { return iParagraphs.Count; } + } + + public ParserParagraph this[ int aIndex ] + { + get { return iParagraphs[ aIndex ]; } + } + #endregion + + #region From ParserElementBase + internal override string CurrentLine + { + get { return iCurrentLine; } + } + + internal override ParserResponse Offer( ref string aLine ) + { + ++iLineNumber; + // + ParserResponse ret = new ParserResponse(); + // + do + { + ret = TryToConsumeLine( ref aLine ); + } + while ( ret.Type == ParserResponse.TResponseType.EResponseTypeHandledByRequiresReProcessing ); + // + return ret; + } + #endregion + + #region Internal methods + private ParserResponse TryToConsumeLine( ref string aLine ) + { + ParserResponse ret = new ParserResponse(); + // + foreach ( ParserParagraph paragraph in iParagraphs ) + { + if ( !paragraph.IsDisabled ) + { + ret = paragraph.Offer( ref aLine ); + if ( ret.Type != ParserResponse.TResponseType.EResponseTypeUnhandled ) + { + break; + } + } + } + // + return ret; + } + #endregion + + #region Internal constants + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return new ParserEngineEnumerator( this ); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return new ParserEngineEnumerator( this ); + } + #endregion + + #region Internal event handlers + void Paragraph_ElementComplete( SymbianParserLib.BaseStructures.ParserElementBase aElement ) + { + if ( ParagraphComplete != null ) + { + ParagraphComplete( aElement ); + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private long iLineNumber = 0; + private string iCurrentLine = string.Empty; + private List iParagraphs = new List(); + #endregion + } + + #region Enumerator + internal class ParserEngineEnumerator : IEnumerator + { + #region Constructors + public ParserEngineEnumerator( ParserEngine aObject ) + { + iObject = aObject; + } + #endregion + + #region IEnumerator Members + public void Reset() + { + iCurrentIndex = -1; + } + + public object Current + { + get + { + return iObject[ iCurrentIndex ]; + } + } + + public bool MoveNext() + { + return ( ++iCurrentIndex < iObject.Count ); + } + #endregion + + #region From IEnumerator + ParserParagraph IEnumerator.Current + { + get { return iObject[ iCurrentIndex ]; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly ParserEngine iObject; + private int iCurrentIndex = -1; + #endregion + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Enums/ParserValueType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Enums/ParserValueType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; + +namespace SymbianParserLib.Enums +{ + public enum TParserValueType + { + EValueTypeUnknown = 0, + EValueTypeString, + EValueTypeInt32, + EValueTypeInt16, + EValueTypeInt8, + EValueTypeByte, + EValueTypeUint32, + EValueTypeLong, + EValueTypeUint64, + } + +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Enums/ValueStoreMethodArguments.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Enums/ValueStoreMethodArguments.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianParserLib.Enums +{ + public enum TValueStoreMethodArguments + { + /// + /// Special value which means that no argument specification is + /// supplied at compile time. The parser library runtime will guess + /// which arguments it should supply (in the correct order) based + /// upon the method signature + /// + EValueStoreMethodArgumentCalculateAtRuntime = -1, + + /// + /// Supply field name as string + /// + EValueStoreMethodArgumentNameAsString = 0, + + /// + /// Supply field name as object + /// + EValueStoreMethodArgumentNameAsObject, + + /// + /// Supply field value + /// + EValueStoreMethodArgumentValue, + + /// + /// Supply paragraph for associated field + /// + EValueStoreMethodArgumentParagraph, + + /// + /// Supply line for associated field + /// + EValueStoreMethodArgumentLine, + + /// + /// Supply field + /// + EValueStoreMethodArgumentField, + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Exceptions/ParserExceptions.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Exceptions/ParserExceptions.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianParserLib.Exceptions +{ + internal class NotUsedException : Exception + { + #region Constructors + public NotUsedException() + { + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "c5d07fb7-01e8-4e86-9537-eb9f495635fb" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Base/RegExTranslatorBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Base/RegExTranslatorBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using SymbianParserLib.Enums; +using SymbianParserLib.Elements; +using SymbianParserLib.Elements.SubFields; + +namespace SymbianParserLib.RegExTranslators +{ + internal abstract class RegExTranslatorBase + { + #region Constructors + public RegExTranslatorBase() + { + } + #endregion + + #region API + public abstract ParserField Process( Capture aCapture, int aStartAt, ParserLine aLine ); + #endregion + + #region Properties + #endregion + + #region Internal methods + protected ParserField CreateField( string aRegEx, string aFieldName, TParserValueType aValueType, int aCapturePos, int aCaptureLength ) + { + ParserField ret = CreateField( aRegEx, aFieldName, aValueType, aCapturePos, aCaptureLength, true ); + return ret; + } + + protected ParserField CreateField( string aRegEx, string aFieldName, TParserValueType aValueType, int aCapturePos, int aCaptureLength, bool aRequiresNumberedCaptureGroup ) + { + string fieldName = CompressName( aFieldName ); + ParserField ret = new ParserField( fieldName ); + + // Update format specifier + ParserFieldFormatSpecifier formatSpecifier = ret.FormatSpecifier; + formatSpecifier.OriginalLocation = aCapturePos; + formatSpecifier.OriginalLength = aCaptureLength; + + // Surround in numbered group if needed... + StringBuilder finalRegEx = new StringBuilder( aRegEx ); + if ( aRequiresNumberedCaptureGroup ) + { + finalRegEx.Insert( 0, "(" ); + finalRegEx.Append( ")" ); + } + + formatSpecifier.RegularExpressionString = finalRegEx.ToString(); + formatSpecifier.ExpectedType = aValueType; + + return ret; + } + + private static string CompressName( string aUncompressedFieldName ) + { + Regex spaces = new Regex(@"\s+"); + string[] fields = spaces.Split( aUncompressedFieldName ); + // + StringBuilder ret = new StringBuilder(); + foreach ( string field in fields ) + { + ret.Append( field ); + } + // + return ret.ToString(); + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Cache/RegExTranslatorCache.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Cache/RegExTranslatorCache.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using SymbianParserLib.Enums; +using SymbianParserLib.Elements; +using SymbianParserLib.Elements.SubFields; + +namespace SymbianParserLib.RegExTranslators.Cache +{ + internal class RegExTranslatorCache + { + #region Constructors + public RegExTranslatorCache() + { + } + #endregion + + #region API + public ParserLine CreateClone( string aKey ) + { + ParserLine ret = null; + // + lock ( iEntries ) + { + if ( Exists( aKey ) ) + { + RegExTranslatorCacheEntry entry = iEntries[ aKey ]; + ret = entry.Clone(); + } + } + // + return ret; + } + + public void Add( string aKey, ParserLine aLine ) + { + System.Diagnostics.Debug.Assert( !string.IsNullOrEmpty( aKey ) ); + System.Diagnostics.Debug.Assert( aLine != null ); + System.Diagnostics.Debug.Assert( !string.IsNullOrEmpty( aLine.OriginalValue ) ); + System.Diagnostics.Debug.Assert( !string.IsNullOrEmpty( aLine.FinalValue ) ); + System.Diagnostics.Debug.Assert( iEntries != null ); + + try + { + lock ( iEntries ) + { + if ( Exists( aKey ) == false ) + { + RegExTranslatorCacheEntry entry = new RegExTranslatorCacheEntry( aLine ); + iEntries.Add( aKey, entry ); + } + } + } + catch ( Exception ) + { + SymbianUtils.SymDebug.SymDebugger.Break(); + } + } + + public bool Exists( string aKey ) + { + lock ( iEntries ) + { + bool ret = iEntries.ContainsKey( aKey ); + return ret; + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + private Dictionary iEntries = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Cache/RegExTranslatorCacheEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Cache/RegExTranslatorCacheEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using SymbianParserLib.Enums; +using SymbianParserLib.Elements; +using SymbianParserLib.Elements.SubFields; + +namespace SymbianParserLib.RegExTranslators.Cache +{ + internal class RegExTranslatorCacheEntry + { + #region Constructors + public RegExTranslatorCacheEntry( ParserLine aLine ) + { + iLine = aLine; + } + #endregion + + #region API + public ParserLine Clone() + { + ParserLine ret = ParserLine.NewCopy( iLine ); + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + #endregion + + #region Data members + private readonly ParserLine iLine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Info/RegExTranslatorExtractionInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Info/RegExTranslatorExtractionInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,372 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using SymbianParserLib.Enums; + +namespace SymbianParserLib.RegExTranslators +{ + internal class RegExTranslatorExtractionInfo + { + #region Constructors + public RegExTranslatorExtractionInfo( string aLine, int aStartPos ) + { + iMatch = KRegEx.Match( aLine, aStartPos ); + } + #endregion + + #region API + #endregion + + #region Constants + public const int KNoWidthSpecified = -1; + #endregion + + #region Properties + public bool Success + { + get { return Match.Success; } + } + + public Match Match + { + get { return iMatch; } + } + + public char ValueTypeChar + { + get + { + char ret = '\0'; + // + if ( iMatch.Success ) + { + Group gpType = iMatch.Groups[ KGroupTypeChar ]; + if ( gpType.Success ) + { + string type = gpType.Value.ToUpper(); + ret = type[ 0 ]; + } + } + // + return ret; + } + } + + public TParserValueType ValueType + { + get + { + TParserValueType ret = TParserValueType.EValueTypeUnknown; + // + if ( iMatch.Success ) + { + char typeChar = ValueTypeChar; + switch ( typeChar ) + { + case 'U': + ret = TParserValueType.EValueTypeUint32; + break; + case 'S': + ret = TParserValueType.EValueTypeString; + break; + case 'D': + ret = TParserValueType.EValueTypeInt32; + break; + case 'X': + if ( IsLong ) + { + ret = TParserValueType.EValueTypeUint64; + } + else + { + ret = TParserValueType.EValueTypeUint32; + } + break; + default: + break; + } + } + // + return ret; + } + } + + public string ValuePrefix + { + get + { + string ret = string.Empty; + // + if ( iMatch.Success ) + { + Group gpValuePrefix = iMatch.Groups[ KGroupValuePrefix ]; + if ( gpValuePrefix.Success ) + { + ret = gpValuePrefix.Value; + } + } + // + return ret; + } + } + + public bool IsValuePrefixHex + { + get + { + string prefix = ValuePrefix; + bool ret = ( prefix == KValuePrefixHex1 || prefix == KValuePrefixHex2 ); + return ret; + } + } + + public int NumberBase + { + get + { + int ret = 0; + // + if ( iMatch.Success ) + { + if ( ValueType != TParserValueType.EValueTypeString ) + { + char typeChar = ValueTypeChar; + switch ( typeChar ) + { + case 'U': + case 'D': + ret = KNumberBaseDecimal; + break; + case 'X': + ret = KNumberBaseHexadecimal; + break; + default: + break; + } + } + } + // + return ret; + } + } + + public bool IsLong + { + get + { + // The 'long' (L) specifier gets shoehorned into the width group + bool ret = false; + // + if ( iMatch.Success ) + { + Group gpWidth = iMatch.Groups[ KGroupWidth ]; + if ( gpWidth.Success ) + { + string val = gpWidth.Value.Trim().ToUpper(); + ret = ( val == "L" ); + } + } + // + return ret; + } + } + + public int Width + { + get + { + int ret = KNoWidthSpecified; + // + if ( iMatch.Success ) + { + Group gpWidth = iMatch.Groups[ KGroupWidth ]; + if ( gpWidth.Success ) + { + string val = gpWidth.Value.Trim(); + if ( val.Length != 0 ) + { + Match m = KNumericNumberRegex.Match( val ); + if ( m.Success ) + { + ret = System.Convert.ToInt32( m.Value ); + } + } + } + } + // + return ret; + } + } + + public int CapturePos + { + get + { + Group gpPercent = Match.Groups[ KGroupPercent ]; + int pos = gpPercent.Index; + return pos; + } + } + + public int CaptureLength + { + get + { + // [StartPos] ..... [% Pos] .... [EndPos] + // <-------------------> = what we return + + int startPos = Match.Index; + int length = Match.Length; + int endPos = startPos + length; + int percentPos = CapturePos; + int ret = ( endPos - percentPos ); + return ret; + } + } + + public string Name + { + get + { + string ret = string.Empty; + // + if ( Success ) + { + Group propertyName = Match.Groups[ KGroupPropertyName ]; + ret = propertyName.Value.Trim(); + } + // + return ret; + } + } + + public string PadChar + { + get + { + string ret = string.Empty; + // + if ( Success ) + { + Group pad = Match.Groups[ KGroupPadChar ]; + ret = pad.Value.Trim(); + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + private const string KGroupValuePrefix = "ValuePrefix"; + private const string KGroupPropertyName = "PropertyName"; + private const string KGroupPadChar = "PadChar"; + private const string KGroupWidth = "Width"; + private const string KGroupTypeChar = "TypeChar"; + private const string KGroupPercent = "Percent"; + private const string KValuePrefixHex1 = "0x"; + private const string KValuePrefixHex2 = "x"; + private const int KNumberBaseDecimal = 10; + private const int KNumberBaseHexadecimal = 16; + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + /// + /// Regular expression built for C# on: Tue, May 20, 2008, 12:54:34 PM + /// Using Expresso Version: 3.0.2766, http://www.ultrapico.com + /// + /// A description of the regular expression: + /// + /// [PropertyName]: A named capture group. [(?:\w+\s*)+?], zero or one repetitions + /// Match expression but don't capture it. [\w+\s*], one or more repetitions, as few as possible + /// \w+\s* + /// Alphanumeric, one or more repetitions + /// Whitespace, any number of repetitions + /// Comment: Property name, essentially captures words separated by whitespace + /// Match expression but don't capture it. [\s*] + /// Whitespace, any number of repetitions + /// Comment: More whitespace + /// Match expression but don't capture it. [-], zero or one repetitions + /// - + /// Comment: Ignore any leading minus char + /// Match expression but don't capture it. [\s*] + /// Whitespace, any number of repetitions + /// Comment: More whitespace + /// Comment: Next parse and discard any optional assignment prefix - such a ";" or "=" + /// Match expression but don't capture it. [\s*] + /// Whitespace, any number of repetitions + /// Match expression but don't capture it. [=|\x3A], zero or one repetitions + /// Select from 2 alternatives + /// = + /// Hex 3A + /// Match expression but don't capture it. [\s*] + /// Whitespace, any number of repetitions + /// [ValuePrefix]: A named capture group. [0x|x], zero or one repetitions + /// Select from 2 alternatives + /// 0x + /// 0x + /// x + /// Match expression but don't capture it. [%{1}] + /// %, exactly 1 repetitions + /// [PadChar]: A named capture group. [(?:0| )?] + /// Match expression but don't capture it. [0| ], zero or one repetitions + /// Select from 2 alternatives + /// 0 + /// NULL + /// [Width]: A named capture group. [(?:[0-9]?|l)] + /// Match expression but don't capture it. [[0-9]?|l] + /// Select from 2 alternatives + /// Any character in this class: [0-9], zero or one repetitions + /// l + /// [TypeChar]: A named capture group. [d|D|x|X|u|U|s|S] + /// Select from 8 alternatives + /// dDxXuUsS + /// + /// + /// + private static readonly Regex KRegEx = new Regex( + "(?(?:\\w+\\s*)+?)? # Property name, essentiall" + + "y captures words separated by whitespace\r\n(?:\\s*) # More wh" + + "itespace\r\n(?:-)? # Ignore any leading minus char\r\n(?:\\s*) #" + + " More whitespace\r\n\r\n# Next parse and discard any optional as" + + "signment prefix - such a \";\" or \"=\"\r\n(?:\\s*)(?:=|\\x3A)" + + "?(?:\\s*) \r\n\r\n(?0x|x)?(?%{1})\r\n\r\n(?(?" + + ":0| )?)(?(?:[0-9]?|l))(?d|D|x|X|u|U|s|S|i|I)", + RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + + private static readonly Regex KNumericNumberRegex = new Regex( @"[0-9]", RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled ); + private readonly Match iMatch; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/RegExTranslatorManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/RegExTranslatorManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using SymbianParserLib.Utilities; +using SymbianParserLib.Elements; +using SymbianParserLib.RegExTranslators.Types; + +namespace SymbianParserLib.RegExTranslators +{ + public static class TheTickCounter + { + public static long TickCount; + } + + internal class RegExTranslatorManager + { + #region Constructors + public RegExTranslatorManager() + { + iTranslators.AddRange( KDefaultList ); + } + #endregion + + #region API + public static ParserLine PreCachedCompiledEntry( string aKey ) + { + ParserLine ret = TheTranslator.iCache.CreateClone( aKey ); + return ret; + } + + public static void CompileToRegularExpression( ParserLine aLine ) + { + TheTranslator.DoCompileToRegularExpression( aLine ); + } + #endregion + + #region Properties + public static RegExTranslatorManager TheTranslator + { + get { return iTheTranslator; } + } + #endregion + + #region Internal methods + private static string FixupOriginalValue( string aLine ) + { + StringBuilder ret = new StringBuilder( ParserUtils.RemoveLineEndings( aLine ) ); + + // Escape double percents + ret = ret.Replace( KEscapedPercent, KReplacementPercent ); + + // Escape [ and ] + ret = EscapeCharacter( ".", ret ); + ret = EscapeCharacter( "$", ret ); + ret = EscapeCharacter( "+", ret ); + ret = EscapeCharacter( "?", ret ); + ret = EscapeCharacter( "^", ret ); + ret = EscapeCharacter( "*", ret ); + ret = EscapeCharacter( "\\", ret ); + ret = EscapeCharacter( "[", ret ); + ret = EscapeCharacter( "]", ret ); + ret = EscapeCharacter( "(", ret ); + ret = EscapeCharacter( ")", ret ); + ret = EscapeCharacter( "{", ret ); + ret = EscapeCharacter( "}", ret ); + + return ret.ToString(); + } + + private static StringBuilder EscapeCharacter( string aCharacter, StringBuilder aObject ) + { + string replaceWith = "\\" + aCharacter; + return aObject.Replace( aCharacter, replaceWith ); + } + + private void DoCompileToRegularExpression( ParserLine aLine ) + { + System.DateTime starTime = DateTime.Now; + string input = aLine.OriginalValue; + + // First phase is to replace all excaped percents with a single percent + aLine.OriginalValue = FixupOriginalValue( aLine.OriginalValue ); + + // Next phase is to identify all format specifiers + MatchCollection matches = KRegExFormatSpecifier.Matches( aLine.OriginalValue ); + if ( matches.Count != 0 ) + { + // Get combined list of all captures spanning all matches. There must be a better way to do this? + List captureList = new List(); + foreach ( Match m in matches ) + { + if ( m.Success ) + { + foreach ( Capture cap in m.Captures ) + { + captureList.Add( cap ); + } + } + } + + // Convert captures into format specifiers + FixupFormatSpecifiers( captureList, aLine ); + + // Cache entry + iCache.Add( input, aLine ); + } + else + { + } + + System.DateTime endTime = DateTime.Now; + long tickDuration = ( ( endTime.Ticks - starTime.Ticks ) / 100 ); + TheTickCounter.TickCount += tickDuration; + } + + private void FixupFormatSpecifiers( List aCaptures, ParserLine aLine ) + { + int lastCapturePos = 0; + + // Pull out all the format specifiers and build regular expressions + int count = aCaptures.Count; + for ( int i = 0; i < count; i++ ) + { + Capture capture = aCaptures[ i ]; + + // Process the capture, starting at the last capture pos + lastCapturePos = TryToProcessCapture( capture, lastCapturePos, aLine ); + } + + aLine.Finalise(); + } + + private int TryToProcessCapture( Capture aCapture, int aStartAt, ParserLine aLine ) + { + // Return the end position of the current capture. + int ret = -1; + // + foreach ( RegExTranslatorBase translator in iTranslators ) + { + ParserField field = translator.Process( aCapture, aStartAt, aLine ); + if ( field != null ) + { + aLine.Add( field ); + ret = field.FormatSpecifier.OriginalLocation + field.FormatSpecifier.OriginalLength; + break; + } + } + // + return ret; + } + #endregion + + #region Internal constants + private static readonly RegExTranslatorBase[] KDefaultList = new RegExTranslatorBase[] + { + new RegExTranslatorDecimal(), + new RegExTranslatorHex(), + new RegExTranslatorString() + }; + + private static readonly Regex KRegExFormatSpecifier = new Regex( + "%{1}", + RegexOptions.IgnoreCase + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + + private const string KEscapedPercent = "%%"; + private const string KReplacementPercent = "%"; + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + private static RegExTranslatorManager iTheTranslator = new RegExTranslatorManager(); + private List iTranslators = new List(); + private Cache.RegExTranslatorCache iCache = new SymbianParserLib.RegExTranslators.Cache.RegExTranslatorCache(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Types/RegExTranslatorDecimal.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Types/RegExTranslatorDecimal.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace SymbianParserLib.RegExTranslators.Types +{ + internal class RegExTranslatorDecimal : RegExTranslatorBase + { + #region Constructors + public RegExTranslatorDecimal() + { + } + #endregion + + #region API + public override ParserField Process( Capture aCapture, int aStartAt, ParserLine aLine ) + { + ParserField ret = null; + // + RegExTranslatorExtractionInfo m = new RegExTranslatorExtractionInfo( aLine.OriginalValue, aStartAt ); + // + if ( m.Success && ( m.ValueTypeChar == 'D' || m.ValueTypeChar == 'I' || m.ValueTypeChar == 'U' ) ) + { + bool requiresNumberedCaptureGroup = true; + + // Build the regular expression + StringBuilder regex = new StringBuilder( "[0-9]" ); + if ( m.Width != RegExTranslatorExtractionInfo.KNoWidthSpecified ) + { + // (?(\b[ 0-9+-]{4}\b:)(?:[ ]{0,3}([+-]?[0-9]{1,4}):)) + int width = m.Width; + string padChar = m.PadChar; + + // This becomes very complex now. We must match the pad character + regex = new StringBuilder(); + + // Start a conditional group + regex.Append( "(?" ); + + // Start the if-statement match. The idea here is to perform a first pass + // that matches any numbers, signs (-/+) and pad characters without any + // care about the ordering. The length, however, is critical. + regex.AppendFormat( "([{0}0-9+-]{{1}})", padChar, width ); + + // If the match above is true, then we'll execute this 'yes' case. The + // idea now is to pull out the specific value, ignoring the padding. + + // We start a non-capturing group. This is the beginning of the value we + // need, but we don't want to capture the padding (although we validate it + // exists). + regex.AppendFormat( "(?:" ); + if ( padChar != string.Empty ) + { + // We must allow for width-1 pad characters. + regex.AppendFormat( "[{0}]", padChar ); + regex.Append( "{0," ); + regex.Append( width ); + regex.Append( "}" ); + } + + // We must now allow for a plus/minus sign. We do this within + // a numbered group, since this is the bit we're eventually interested in. + regex.Append( "(" ); + regex.Append( "[+-]?[0-9]" ); + regex.Append( "{1," + width + "}" ); + regex.Append( ")" ); + + // End non-capturing group + regex.Append( ")" ); + + // End conditional group + regex.Append( ")" ); + + // We explicitly managed this ourselves + requiresNumberedCaptureGroup = false; + } + else + { + // Add "one or more" suffix + regex.Append( "+" ); + } + + ret = CreateField( regex.ToString(), m.Name, m.ValueType, m.CapturePos, m.CaptureLength, requiresNumberedCaptureGroup ); + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Types/RegExTranslatorHex.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Types/RegExTranslatorHex.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,112 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace SymbianParserLib.RegExTranslators.Types +{ + internal class RegExTranslatorHex : RegExTranslatorBase + { + #region Constructors + public RegExTranslatorHex() + { + } + #endregion + + #region API + public override ParserField Process( Capture aCapture, int aStartAt, ParserLine aLine ) + { + ParserField ret = null; + // + RegExTranslatorExtractionInfo m = new RegExTranslatorExtractionInfo( aLine.OriginalValue, aStartAt ); + // + if ( m.Success && m.ValueTypeChar == 'X' ) + { + // Build the regular expression + StringBuilder regex = new StringBuilder( "[A-Fa-f0-9]" ); + if ( m.Width != RegExTranslatorExtractionInfo.KNoWidthSpecified ) + { + // Add specific length suffix + regex.Append( "{" ); + regex.Append( m.Width.ToString() ); + regex.Append( "}" ); + } + else + { + // Add "one or more" suffix + regex.Append( "+" ); + } + + ret = CreateField( regex.ToString(), m.Name, m.ValueType, m.CapturePos, m.CaptureLength, true ); + ret.FormatSpecifier.NumberBase = m.NumberBase; + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + /// + /// Regular expression built for C# on: Thu, May 15, 2008, 11:33:33 AM + /// Using Expresso Version: 3.0.2766, http://www.ultrapico.com + /// + /// A description of the regular expression: + /// + /// % + /// [PadChar]: A named capture group. [(?:0| )?] + /// Match expression but don't capture it. [0| ], zero or one repetitions + /// Select from 2 alternatives + /// 0 + /// Space + /// [Width]: A named capture group. [[0-9]?] + /// Any character in this class: [0-9], zero or one repetitions + /// Match expression but don't capture it. [x|X] + /// Select from 2 alternatives + /// xX + /// + /// + /// + private static Regex KRegEx = new Regex( + "%(?(?:0| )?)(?[0-9]?)(?:x|X)", + RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.Compiled + ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Types/RegExTranslatorString.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/RegExTranslators/Types/RegExTranslatorString.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using SymbianParserLib.Elements; +using SymbianParserLib.Enums; + +namespace SymbianParserLib.RegExTranslators.Types +{ + internal class RegExTranslatorString : RegExTranslatorBase + { + #region Constructors + public RegExTranslatorString() + { + } + #endregion + + #region API + public override ParserField Process( Capture aCapture, int aStartAt, ParserLine aLine ) + { + ParserField ret = null; + // + RegExTranslatorExtractionInfo m = new RegExTranslatorExtractionInfo( aLine.OriginalValue, aStartAt ); + // + if ( m.Success && m.ValueType == TParserValueType.EValueTypeString ) + { + ret = CreateField( ".+", m.Name, m.ValueType, m.CapturePos, m.CaptureLength ); + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + /// + /// Regular expression built for C# on: Thu, May 15, 2008, 01:10:03 PM + /// Using Expresso Version: 3.0.2766, http://www.ultrapico.com + /// + /// A description of the regular expression: + /// + /// % + /// [1]: A numbered capture group. [s|S] + /// Select from 2 alternatives + /// sS + /// + /// + /// + private static Regex KRegEx = new Regex( + "%(s|S)", + RegexOptions.IgnoreCase + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/SymbianParserLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/SymbianParserLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,81 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1} + Library + Properties + SymbianParserLib + SymbianParserLib + + + 2.0 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/TypeConverters/EnumTypeConverter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/TypeConverters/EnumTypeConverter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Reflection; +using System.ComponentModel; + +namespace SymbianParserLib.TypeConverters +{ + public class SymbianEnumConverter : EnumConverter + { + #region Constructors + public SymbianEnumConverter( Type aType ) + : base( aType ) + { + } + #endregion + + #region From EnumConverter + public override bool CanConvertFrom( ITypeDescriptorContext aContext, Type aSourceType ) + { + bool ret = base.CanConvertFrom( aContext, aSourceType ); + // + if ( aSourceType == typeof( uint ) ) + { + ret = true; + } + else if ( aSourceType == typeof( int ) ) + { + ret = true; + } + else if ( aSourceType == typeof( ulong ) ) + { + ret = true; + } + // + return ret; + } + + public override object ConvertFrom( ITypeDescriptorContext aContext, System.Globalization.CultureInfo aCulture, object aValue ) + { + object ret = null; + // + if ( ( aValue is uint ) || ( aValue is int ) || ( aValue is ulong ) ) + { + ret = Enum.ToObject( base.EnumType, aValue ); + } + else + { + ret = base.ConvertFrom( aContext, aCulture, aValue ); + } + // + return ret; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Utilities/ParserUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/Utilities/ParserUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,41 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianParserLib.Utilities +{ + public static class ParserUtils + { + #region API + public static string RemoveLineEndings( string aText ) + { + StringBuilder ret = new StringBuilder( aText ); + ret = ret.Replace( KCR, string.Empty ); + ret = ret.Replace( KLF, string.Empty ); + return ret.ToString(); + } + #endregion + + #region Internal constants + private const string KCR = "\r"; + private const string KLF = "\n"; + #endregion + + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/ValueStores/ValueStore.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianParserLib/ValueStores/ValueStore.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,492 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Reflection; +using System.ComponentModel; +using SymbianParserLib.Enums; +using SymbianParserLib.BaseStructures; +using SymbianParserLib.Elements; +using SymbianParserLib.Elements.SubFields; + +namespace SymbianParserLib.ValueStores +{ + public class ValueStore + { + #region Enumerations + internal enum TValueStoreType + { + EValueStoreTypeProperty = 0, + EValueStoreTypeMethod, + EValueStoreTypeStoreInternally + } + #endregion + + #region Constructors + public ValueStore() + { + } + #endregion + + #region API + public void SetTargetProperty( object aPropertyObject, string aPropertyName ) + { + iValueStore = aPropertyObject; + iValueStoreType = TValueStoreType.EValueStoreTypeProperty; + iValueStoreMemberName = aPropertyName; + // + } + + public void SetTargetMethod( object aMethodObject, string aMethodName, params TValueStoreMethodArguments[] aArgs ) + { + iValueStore = aMethodObject; + iValueStoreType = TValueStoreType.EValueStoreTypeMethod; + iValueStoreMemberName = aMethodName; + // + iMethodArgumentSpecifier = aArgs; + } + #endregion + + #region Internal API + internal void SetValue( ParserFieldFormatSpecifier aFieldFormatSpecifier, ParserFieldFormatValue aFieldFormatValue ) + { + CheckForValidValueStore(); + // + if ( iValueStoreType == TValueStoreType.EValueStoreTypeProperty ) + { + // Store value to user-supplied property within object + Binder binder = null; + Type typeInfo = iValueStore.GetType(); + PropertyInfo propInfo = typeInfo.GetProperty( iValueStoreMemberName, PropertyBindingFlags ); + if ( propInfo == null ) + { + throw new MissingMemberException( "A property called: \"" + iValueStoreMemberName + "\" was not found within object: " + iValueStore.ToString() ); + } + // + Type propType = propInfo.PropertyType; + object[] args = PrepareMethodArgument( aFieldFormatValue.Value, propType ); + typeInfo.InvokeMember( iValueStoreMemberName, PropertyBindingFlags, binder, iValueStore, args ); + } + else if ( iValueStoreType == TValueStoreType.EValueStoreTypeMethod ) + { + object[] args = null; + // + try + { + // Store value to user-supplied method + Binder binder = null; + + // Build arguments + Type valueTypeInfo = aFieldFormatValue.Value.GetType(); + TValueStoreMethodArguments[] argumentSpecification = BuildMethodArgumentSpecification( valueTypeInfo, iValueStore, iValueStoreMemberName ); + args = BuildCustomFunctionArguments( argumentSpecification, aFieldFormatSpecifier, aFieldFormatValue ); + + // Sanity check number of arguments for method implementation actually agrees with our run-time generated + // object array of parameters. + Type valueStoreTypeInfo = iValueStore.GetType(); + MethodInfo methodInfo = valueStoreTypeInfo.GetMethod( iValueStoreMemberName, MethodBindingFlags ); + ParameterInfo[] methodParams = methodInfo.GetParameters(); + if ( args.Length != methodParams.Length ) + { + throw new MissingMethodException( "Argument specification doesn't align with method implementation" ); + } + else + { + valueStoreTypeInfo.InvokeMember( iValueStoreMemberName, MethodBindingFlags, binder, iValueStore, args ); + } + } + catch ( Exception exception ) + { + if ( exception is TargetInvocationException || + exception is MissingMethodException || + exception is MissingMemberException || + exception is AmbiguousMatchException ) + { + StringBuilder funcDetails = new StringBuilder(); + funcDetails.Append( iValueStoreMemberName + "( " ); + // + int count = ( args != null ) ? args.Length : 0; + for ( int i = 0; i < count; i++ ) + { + object arg = args[ i ]; + string argTypeName = ( arg != null ) ? arg.GetType().ToString() : "null"; + funcDetails.Append( argTypeName ); + // + if ( i < count - 1 ) + { + funcDetails.Append( ", " ); + } + } + // + funcDetails.Append( " )" ); + System.Diagnostics.Debug.WriteLine( "Failed to invoke method: " + funcDetails.ToString() ); + } + else + { + throw exception; + } + } + } + else if ( iValueStoreType == TValueStoreType.EValueStoreTypeStoreInternally ) + { + // Store it in the value store and the client can extract it via the public properties... + iValueStore = aFieldFormatValue.Value; + } + } + #endregion + + #region Properties + public bool IsInt + { + get + { + bool ret = IsDynamicAndOfType( typeof( int ) ); + return ret; + } + } + + public bool IsUint + { + get + { + bool ret = IsDynamicAndOfType( typeof( uint ) ); + return ret; + } + } + + public bool IsString + { + get + { + bool ret = IsDynamicAndOfType( typeof( string ) ); + return ret; + } + } + + public int AsInt + { + get + { + int ret = 0; + // + if ( IsInt ) + { + ret = (int) iValueStore; + } + // + return ret; + } + } + + public uint AsUint + { + get + { + uint ret = 0; + // + if ( IsUint ) + { + ret = (uint) iValueStore; + } + // + return ret; + } + } + + public string AsString + { + get + { + string ret = string.Empty; + // + if ( IsString ) + { + ret = (string) iValueStore; + } + // + return ret; + } + } + + internal TValueStoreType ValueStoreType + { + get + { + return iValueStoreType; + } + } + + internal BindingFlags MethodBindingFlags + { + get + { + BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod; + return bindingFlags; + } + } + + internal BindingFlags PropertyBindingFlags + { + get + { + BindingFlags bindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty; + return bindingFlags; + } + } + #endregion + + #region Internal methods + private bool IsDynamicAndOfType( Type aExpectedType ) + { + bool ret = false; + // + object vs = iValueStore; + TValueStoreType vsType = ValueStoreType; + if ( vs != null && vsType == TValueStoreType.EValueStoreTypeStoreInternally ) + { + Type typeInfo = vs.GetType(); + ret = ( typeInfo == aExpectedType ); + } + // + return ret; + } + + private void CheckForValidValueStore() + { + if ( iValueStoreType == TValueStoreType.EValueStoreTypeProperty || + iValueStoreType == TValueStoreType.EValueStoreTypeMethod ) + { + if ( iValueStore == null ) + { + throw new Exception( "Missing value store" ); + } + } + } + + private object[] PrepareMethodArgument( object aValue, Type aExpectedPropertyType ) + { + // If we're calling a property where the expected property type doesn't match the value + // we have been asked to use (for example, a property expects an enumerator, but we are given + // a uint or int) then we must convert from the value type to the expected property type. + object[] ret = { aValue }; + Type valueType = aValue.GetType(); + // + if ( aExpectedPropertyType != valueType ) + { + // Get a type converter to perform the operation. Note that some of the built-in type + // converters are very "dumb" in that they only convert from strings to numbers (and vice + // versa). This doesn't help us when we need to convert from e.g. a uint to a long. + TypeConverter conv = TypeDescriptor.GetConverter( aExpectedPropertyType ); + if ( conv == null ) + { + throw new NotSupportedException( "No type converter exists to convert between " + valueType.ToString() + " and " + aExpectedPropertyType.ToString() ); + } + else if ( conv.CanConvertFrom( valueType ) ) + { + object converted = conv.ConvertFrom( aValue ); + ret = new object[] { converted }; + } + else + { + // Might be one of the built-in type converters that only works + // with strings. Convert the value to a string and try once more + string asString = aValue.ToString(); + try + { + object converted = conv.ConvertFrom( asString ); + ret = new object[] { converted }; + } + catch ( NotSupportedException ) + { + throw new NotSupportedException( "No type converter exists to convert between " + valueType.ToString() + " and " + aExpectedPropertyType.ToString() ); + } + } + } + // + return ret; + } + + private TValueStoreMethodArguments[] BuildMethodArgumentSpecification( Type aValueTypeInfo, object aObject, string aMethodName ) + { + List args = new List(); + // + if ( iMethodArgumentSpecifier == null ) + { + iMethodArgumentSpecifier = new TValueStoreMethodArguments[] { TValueStoreMethodArguments.EValueStoreMethodArgumentCalculateAtRuntime }; + } + // + bool done = false; + int count = iMethodArgumentSpecifier.Length; + for( int i=0; i aArgs ) + { + Type typeInfo = aObject.GetType(); + MethodInfo methodInfo = typeInfo.GetMethod( aMethodName, MethodBindingFlags ); + if ( methodInfo == null ) + { + throw new MissingMemberException( "Method: " + aMethodName + " was not found within object: " + aObject.ToString() ); + } + ParameterInfo[] methodParams = methodInfo.GetParameters(); + + // Check if the parameters include an explicit request for a ParserFieldName object + // If so, we'll not send the "argument name as string" since the client has + // explicitly requested it as an object... + bool requestingArgNameAsObject = false; + foreach ( ParameterInfo info in methodParams ) + { + if ( info.ParameterType == typeof( ParserFieldName ) ) + { + requestingArgNameAsObject = true; + break; + } + } + + // Second pass to build real list... + foreach ( ParameterInfo info in methodParams ) + { + Type paramType = info.ParameterType; + // + if ( paramType == typeof( ParserFieldName ) ) + { + aArgs.Add( TValueStoreMethodArguments.EValueStoreMethodArgumentNameAsObject ); + } + else if ( paramType == typeof( ParserField ) ) + { + aArgs.Add( TValueStoreMethodArguments.EValueStoreMethodArgumentField ); + } + else if ( paramType == typeof( ParserLine ) ) + { + aArgs.Add( TValueStoreMethodArguments.EValueStoreMethodArgumentLine ); + } + else if ( paramType == typeof( ParserParagraph ) ) + { + aArgs.Add( TValueStoreMethodArguments.EValueStoreMethodArgumentParagraph ); + } + else if ( paramType == typeof( string ) && !requestingArgNameAsObject ) + { + // Best guess - if the first argument of the method is actually + // a string-based "value" argument (rather than field name argument) then we'll + // pass the parameter out of order - hence the "name as object" approach used + // above, which let's us accurately infer type... + aArgs.Add( TValueStoreMethodArguments.EValueStoreMethodArgumentNameAsString ); + } + else if ( paramType == aValueTypeInfo ) + { + aArgs.Add( TValueStoreMethodArguments.EValueStoreMethodArgumentValue ); + } + } + } + + private object[] BuildCustomFunctionArguments( TValueStoreMethodArguments[] aArgumentSpecification, ParserFieldFormatSpecifier aFieldFormatSpecifier, ParserFieldFormatValue aFieldFormatValue ) + { + + List args = new List(); + // + foreach ( TValueStoreMethodArguments argType in aArgumentSpecification ) + { + if ( argType == TValueStoreMethodArguments.EValueStoreMethodArgumentNameAsString ) + { + args.Add( aFieldFormatSpecifier.Name.ToString() ); + } + else if ( argType == TValueStoreMethodArguments.EValueStoreMethodArgumentNameAsObject ) + { + args.Add( aFieldFormatSpecifier.Name ); + } + else if ( argType == TValueStoreMethodArguments.EValueStoreMethodArgumentValue ) + { + args.Add( aFieldFormatValue.Value ); + } + else if ( argType == TValueStoreMethodArguments.EValueStoreMethodArgumentParagraph ) + { + ParserParagraph para = null; + // + if ( aFieldFormatSpecifier.Field.Parent != null && aFieldFormatSpecifier.Field.Parent is ParserLine ) + { + ParserLine line = (ParserLine) aFieldFormatSpecifier.Field.Parent; + if ( line.Parent != null && line.Parent is ParserParagraph ) + { + para = (ParserParagraph) line.Parent; + } + } + // + args.Add( para ); + } + else if ( argType == TValueStoreMethodArguments.EValueStoreMethodArgumentLine ) + { + ParserLine line = null; + // + if ( aFieldFormatSpecifier.Field.Parent != null && aFieldFormatSpecifier.Field.Parent is ParserLine ) + { + line = (ParserLine) aFieldFormatSpecifier.Field.Parent; + } + // + args.Add( line ); + } + else if ( argType == TValueStoreMethodArguments.EValueStoreMethodArgumentField ) + { + args.Add( aFieldFormatSpecifier.Field ); + } + else + { + System.Diagnostics.Debug.Assert( false, "Argument specification contains unresolved runtime reference" ); + } + } + // + return args.ToArray(); + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region Data members + // Common members + private object iValueStore = null; + private string iValueStoreMemberName = string.Empty; + private TValueStoreType iValueStoreType = TValueStoreType.EValueStoreTypeStoreInternally; + + // Method-specific members + private TValueStoreMethodArguments[] iMethodArgumentSpecifier = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/AddressInfo/StackAddressInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/AddressInfo/StackAddressInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; +using SymbianUtils.DataBuffer.Entry; +using SymbianUtils.Range; +using SymbianStackLib.Exceptions; + +namespace SymbianStackLib.AddressInfo +{ + /// + /// Stack flows from the base upwards: + /// + /// -------------- TOP ---------------- 0x402000 + /// | + /// | Unused Stack + /// | + /// |----------- CURRENT SP ----------- 0x4033b8 + /// | + /// | ^ + /// | | + /// | + /// | Used Stack [Stack + /// | Pointer + /// | | Range] + /// | | + /// | | + /// | + /// -------------- BASE --------------- 0x407000 + /// + public sealed class StackAddressInfo + { + #region Constructors + internal StackAddressInfo() + { + } + #endregion + + #region API + public void Set( uint aSP, uint aTop, uint aBase ) + { + Pointer = aSP; + Top = aTop; + Base = aBase; + } + + internal void Validate() + { + if ( Top != 0 && Base < Top ) + { + throw new StackAddressException( StackAddressException.TType.ETypeBaseAddressBeforeTopAddress ); + } + else if ( Base != 0 && Top > Base ) + { + throw new StackAddressException( StackAddressException.TType.ETypeTopAddressAfterBaseAddress ); + } + else if ( Pointer == 0 ) + { + throw new StackAddressException( StackAddressException.TType.ETypePointerIsNull ); + } + else if ( Pointer > Base ) + { + throw new StackAddressException( StackAddressException.TType.ETypePointerOutOfBounds ); + } + else if ( Pointer < Top ) + { + // Not an error as possibly a stack overflow... + } + } + + internal bool IsWithinStackDomain( DataBufferByte aEntry ) + { + bool ret = Range.Contains( aEntry.Address ); + return ret; + } + + internal bool IsWithinCurrentStackDomain( DataBufferByte aEntry ) + { + bool ret = StackPointerRange.Contains( aEntry.Address ); + return ret; + } + #endregion + + #region Properties + public uint Base + { + get { return iBase; } + set + { + iBase = value; + } + } + + public uint Top + { + get { return iTop; } + set + { + iTop = value; + } + } + + public uint Pointer + { + get { return iPointer; } + set + { + iPointer = value; + + // Don't record that we've set the stack pointer if somebody is just + // zeroing it out. + if ( value != 0 ) + { + HaveSetStackPointer = true; + } + } + } + + public AddressRange Range + { + get { return new AddressRange( Top, Base ); } + set + { + Top = value.Min; + Base = value.Max; + } + } + + public AddressRange StackPointerRange + { + get + { + AddressRange ret = new AddressRange( Pointer, Base ); + + // If we don't have a valid SP value, then use the entire stack + if ( Pointer == 0 ) + { + ret = Range; + } + // + return ret; + } + } + + public AddressRange StackPointerRangeWithExtensionArea + { + get + { + AddressRange ret; + // + uint pointer = Pointer; + uint pointerMinusExtension = pointer - KStackRangeExtension; + if ( pointer == 0 || pointerMinusExtension < 0 || pointerMinusExtension < Top ) + { + ret = Range; + } + else + { + ret = StackPointerRange; + ret.Min = pointerMinusExtension; + } + // + return ret; + } + } + #endregion + + #region Internal methods + internal bool HaveSetStackPointer + { + get { return iHaveSetSP; } + set { iHaveSetSP = value; } + } + #endregion + + #region Internal constants + private const int KStackRangeExtension = 12 * 4; + #endregion + + #region Data members + private uint iBase = 0; + private uint iTop = 0; + private uint iPointer = 0; + private bool iHaveSetSP = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Algorithms/StackAlgorithm.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Algorithms/StackAlgorithm.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using SymbianDebugLib.Engine; +using SymbianStackLib.Data.Output; +using SymbianStackLib.Data.Source; +using SymbianStackLib.Engine; +using SymbianStackLib.Interfaces; +using SymbianUtils; + +namespace SymbianStackLib.Algorithms +{ + public abstract class StackAlgorithm : AsyncReaderBase + { + #region Constructors + protected StackAlgorithm( IStackAlgorithmManager aManager, IStackAlgorithmObserver aObserver ) + : base( aManager ) + { + iManager = aManager; + iAlgorithmObserver = aObserver; + } + #endregion + + #region API + public abstract string Name { get; } + public abstract int Priority { get; } + + public virtual bool IsAvailable() + { + // We must have symbols + bool ret = DebugEngineView.Symbols.IsReady; + // + base.Trace( "[StackAlgorithm] IsAvailable() - ret: {0}", ret ); + return ret; + } + + public virtual void BuildStack( TSynchronicity aSynchronicity ) + { + base.StartRead( aSynchronicity ); + } + #endregion + + #region Properties + protected IStackAlgorithmManager Manager + { + get { return iManager; } + } + + protected IStackAlgorithmObserver StackObserver + { + get { return iAlgorithmObserver; } + } + + protected StackEngine Engine + { + get { return Manager.Engine; } + } + + protected DbgEngineView DebugEngineView + { + get { return iManager.DebugEngineView; } + } + + protected StackSourceData SourceData + { + get { return Engine.DataSource; } + } + + protected StackOutputData OutputData + { + get { return Engine.DataOutput; } + } + #endregion + + #region From AsyncReaderBase + protected override void HandleReadException( Exception aException ) + { + iAlgorithmObserver.StackBuildingException( this, aException ); + } + + protected override void NotifyEvent( AsyncReaderBase.TEvent aEvent ) + { + switch ( aEvent ) + { + case TEvent.EReadingStarted: + iAlgorithmObserver.StackBuildingStarted( this ); + break; + case TEvent.EReadingProgress: + { + int progress = base.Progress; + if ( progress != iLastProgress ) + { + iAlgorithmObserver.StackBuldingProgress( this, base.Progress ); + iLastProgress = progress; + } + break; + } + case TEvent.EReadingComplete: + iAlgorithmObserver.StackBuildingComplete( this ); + break; + } + // + base.NotifyEvent( aEvent ); + } + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region Data members + private readonly IStackAlgorithmManager iManager; + private readonly IStackAlgorithmObserver iAlgorithmObserver; + private int iLastProgress = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Algorithms/StackAlgorithmManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Algorithms/StackAlgorithmManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,419 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianDebugLib.Engine; +using SymbianStackLib.Data.Output.Entry; +using SymbianStackLib.Engine; +using SymbianStackLib.Interfaces; +using SymbianUtils; +using SymbianUtils.PluginManager; +using SymbianUtils.Range; + +namespace SymbianStackLib.Algorithms +{ + internal sealed class StackAlgorithmManager : DisposableObject, IStackAlgorithmObserver, IStackAlgorithmManager + { + #region Delegates & events + public enum TEvent + { + EAlgorithmStarted = 0, + EAlgorithmProgress, + EAlgorithmComplete + } + + public delegate void AlgorithmEventHandler( StackAlgorithmManager aAlgManager, TEvent aEvent ); + public event AlgorithmEventHandler EventHandler; + + public delegate void AlgorithmExceptionHandler( StackAlgorithmManager aAlgManager, Exception aException ); + public event AlgorithmExceptionHandler ExceptionHandler; + #endregion + + #region Constructors + public StackAlgorithmManager( StackEngine aEngine ) + { + iEngine = aEngine; + + // Make the view name based upon the stack address range + AddressRange range = aEngine.AddressInfo.Range; + StringBuilder viewName = new StringBuilder(); + viewName.AppendFormat( "StackReconstructor_{0}_{1}", range, DateTime.Now.Ticks ); + iView = iEngine.DebugEngine.CreateView( viewName.ToString(), iEngine.CodeSegments ); + } + #endregion + + #region API + public void Reconstruct( TSynchronicity aSynchronicity ) + { + iSynchronicity = aSynchronicity; + try + { + PrepareForExecution(); + ExecuteHeadAlgorithm(); + } + catch ( Exception e ) + { + // The only reason an exception should occur is if none of the algorithms indicate that + // they are ready to process stack data (probably because symbols were not provided). + // + // In this situation, we must report the exception to our event handler + if ( ExceptionHandler != null && EventHandler != null ) + { + // Make sure we sent the 'start' and 'end' events as well - we cannot send + // these events twice so it's okay to try to send them (will be ignored if + // already sent). + ReportEvent( TEvent.EAlgorithmStarted ); + + // Now report the exception + ExceptionHandler( this, e ); + + // Indicate completion since we're not going to be able to do anything anymore + ReportEvent( TEvent.EAlgorithmComplete ); + } + else + { + // No exception handler so just rethrow... + throw e; + } + } + } + #endregion + + #region Properties + public int Progress + { + get + { + // Scale the progress back to a fraction of the total + lock ( this ) + { + int totalProgressSoFar = iProgressValueCompleted + iProgressValueCurrent; + float prog = ( (float) totalProgressSoFar ) / ( (float) iProgressValueMax ); + prog *= 100.0f; + return (int) prog; + } + } + } + #endregion + + #region From IStackAlgorithmObserver + public void StackBuildingStarted( StackAlgorithm aAlg ) + { + Trace( "[SBAlgManager] StackBuildingStarted() - aAlg: {0}", aAlg ); + ReportEvent( TEvent.EAlgorithmStarted ); + } + + public void StackBuldingProgress( StackAlgorithm aAlg, int aPercent ) + { + Trace( "[SBAlgManager] StackBuldingProgress() - aAlg: {0}, aPercent: {1}", aAlg, aPercent ); + lock ( this ) + { + iProgressValueCurrent = aPercent; + } + // + ReportEvent( TEvent.EAlgorithmProgress ); + } + + public void StackBuildingComplete( StackAlgorithm aAlg ) + { + // If the algorithm is still queued then everything went okay. If not, then we + // had an exception and we should therefore ignore the completion as the algorithm + // terminated unexpectedly. + bool stillExists = iExecutionQueue.Contains( aAlg ); + Trace( "[SBAlgManager] StackBuildingComplete() - aAlg: {0}, stillExists: {1}", aAlg, stillExists ); + if ( stillExists ) + { + iExecutionQueue.Clear(); + ReportEvent( TEvent.EAlgorithmComplete ); + } + } + + public void StackBuildingElementConstructed( StackAlgorithm aAlg, StackOutputEntry aEntry ) + { + lock ( this ) + { + iEngine.DataOutput.InsertAsFirstEntry( aEntry ); + } + } + + public void StackBuildingException( StackAlgorithm aAlg, Exception aException ) + { + Trace( "[SBAlgManager] STACK ALG EXCEPTION: " + aException.Message ); + Trace( "[SBAlgManager] {0}", aException.StackTrace ); + + StackAlgorithm alg = CurrentAlgorithm; + + // If we're executing using the fallback entry, then we're in trouble. + // There is nothing we can do besides report the problem upwards. + if ( iExecutionQueue.Count == 1 ) + { + if ( ExceptionHandler != null ) + { + ExceptionHandler( this, aException ); + } + } + else + { + // Report event + string message = string.Format( LibResources.StackAlgorithmManager_FailedAlgorithmWarning + System.Environment.NewLine + "{1}", + alg.Name, aException.Message.ToString() + ); + iEngine.ReportMessage( StackEngine.TMessageType.ETypeWarning, message ); + + // The primary algorithm has failed, let's roll back to the secondary + // by dumping the primary algorithm and starting again. + iExecutionQueue.Dequeue(); + iEngine.DataOutput.Clear(); + + // Reset progress. + iProgressValueCompleted += 100; + iProgressValueCurrent = 0; + + // Start next algorithm... + ExecuteHeadAlgorithm(); + } + } + #endregion + + #region From IStackAlgorithmManager + public StackEngine Engine + { + get { return iEngine; } + } + + public DbgEngineView DebugEngineView + { + get { return iView; } + } + + public void Trace( string aMessage ) + { + iEngine.Trace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iEngine.Trace( aFormat, aParams ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iMasterAlgorithmTable != null ) + { + iMasterAlgorithmTable.Dispose(); + iMasterAlgorithmTable = null; + } + + if ( iView != null ) + { + iView.Dispose(); + iView = null; + } + } + } + #endregion + + #region Internal properties + private StackAlgorithm CurrentAlgorithm + { + get + { + if ( iExecutionQueue.Count == 0 ) + { + throw new Exception( "No stack algorithms available" ); + } + // + return iExecutionQueue.Peek(); + } + } + #endregion + + #region Internal methods + private void PrepareForExecution() + { + Trace( "[SBAlgManager] PrepareForExecution() - START" ); + + // Validate address info + iEngine.AddressInfo.Validate(); + + // Clear data output + iEngine.DataOutput.Clear(); + + // Reset master list + IStackAlgorithmManager manager = (IStackAlgorithmManager) this; + IStackAlgorithmObserver observer = (IStackAlgorithmObserver) this; + iMasterAlgorithmTable.Load( new object[] { manager, observer } ); + SortAlgorithms(); + + // Build list of algorithms we'll try to use + PrepareExecutionQueue(); + + // Work out maximum progress value for this operation + int numberOfPendingAlgs = iExecutionQueue.Count; + iProgressValueMax = numberOfPendingAlgs * 100; + + // Reset current progress + iProgressValueCurrent = 0; + iProgressValueCompleted = 0; + + Trace( "[SBAlgManager] PrepareForExecution() - END" ); + } + + private void PrepareExecutionQueue() + { + iExecutionQueue.Clear(); + + // Find most appropriate algorithm... + StackAlgorithm primary = FindPrimaryAlgorithm(); + if ( primary != null ) + { + iExecutionQueue.Enqueue( primary ); + + // Find backup algorithms + EnqueueBackupAlgorithms( primary ); + } + else + { + throw new Exception( "No valid stack algorithms available" ); + } + } + + private StackAlgorithm FindPrimaryAlgorithm() + { + StackAlgorithm ret = null; + // + foreach ( StackAlgorithm alg in iMasterAlgorithmTable ) + { + if ( alg.IsAvailable() ) + { + ret = alg; + break; + } + } + // + Trace( "[SBAlgManager] FindPrimaryAlgorithm() - ret: {0}", ret ); + return ret; + } + + private void EnqueueBackupAlgorithms( StackAlgorithm aExclude ) + { + foreach ( StackAlgorithm alg in iMasterAlgorithmTable ) + { + string name = alg.Name; + bool available = alg.IsAvailable(); + Trace( "[SBAlgManager] EnqueueBackupAlgorithms() - name: {0}, available: {1}", name, available ); + + if ( available && name != aExclude.Name ) + { + iExecutionQueue.Enqueue( alg ); + } + } + } + + private void ExecuteHeadAlgorithm() + { + Trace( "[SBAlgManager] ExecuteHeadAlgorithm() - iSynchronicity: {0}", iSynchronicity ); + StackAlgorithm alg = CurrentAlgorithm; + alg.BuildStack( iSynchronicity ); + } + + private void SortAlgorithms() + { + Comparison sorter = delegate( StackAlgorithm aLeft, StackAlgorithm aRight ) + { + int ret = 1; + // + if ( aLeft == null ) + { + ret = -1; + } + else if ( aRight == null ) + { + } + else + { + ret = aLeft.Priority.CompareTo( aRight.Priority ); + } + // + return ret; + }; + iMasterAlgorithmTable.Sort( sorter ); + } + + private void ReportEvent( TEvent aEvent ) + { + // Ensure we only report significant events once + if ( EventHandler != null ) + { + switch ( aEvent ) + { + case TEvent.EAlgorithmStarted: + if ( ( iFlags & TFlags.EFlagsReportedStarted ) != TFlags.EFlagsReportedStarted ) + { + iFlags |= TFlags.EFlagsReportedStarted; + EventHandler( this, aEvent ); + } + break; + case TEvent.EAlgorithmComplete: + if ( ( iFlags & TFlags.EFlagsReportedComplete ) != TFlags.EFlagsReportedComplete ) + { + iFlags |= TFlags.EFlagsReportedComplete; + EventHandler( this, aEvent ); + } + break; + default: + EventHandler( this, aEvent ); + break; + } + } + } + #endregion + + #region Internal enumerations + [Flags] + private enum TFlags + { + EFlagsNone = 0, + EFlagsReportedStarted = 1, + EFlagsReportedComplete = 2 + } + #endregion + + #region Data members + private readonly StackEngine iEngine; + private DbgEngineView iView; + private PluginManager iMasterAlgorithmTable = new PluginManager( 2 ); + + // Transient variables + private TSynchronicity iSynchronicity = TSynchronicity.EAsynchronous; + private Queue iExecutionQueue = new Queue(); + private int iProgressValueMax = 0; + private int iProgressValueCompleted = 0; + private int iProgressValueCurrent = 0; + private TFlags iFlags = TFlags.EFlagsNone; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Data/Output/Entry/StackOutputEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Data/Output/Entry/StackOutputEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,345 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Drawing; +using System.IO; +using System.Text; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Debug.Symbols.Constants; +using SymbianUtils.Range; +using SymbianUtils.Utilities; + +namespace SymbianStackLib.Data.Output.Entry +{ + public class StackOutputEntry + { + #region Constructors + public StackOutputEntry( uint aAddress, uint aData, DbgViewSymbol aSymbolView ) + : this( aAddress, aData ) + { + FindNearestSymbol( aSymbolView ); + } + + public StackOutputEntry( uint aAddress, uint aData ) + { + iAddress = aAddress; + iData = aData; + iDataAsString = RawByteUtility.CreateCharacterisedData( aData ); + } + + internal StackOutputEntry( StackOutputEntry aCopy ) + { + iAddress = aCopy.Address; + iData = aCopy.Data; + iDataAsString = aCopy.DataAsString; + iSymbol = aCopy.Symbol; + iFlags = aCopy.iFlags; + iAssociatedBinary = aCopy.AssociatedBinary; + iAssociatedRegister = aCopy.AssociatedRegister; + iTag = aCopy.Tag; + } + #endregion + + #region API + public void FindNearestSymbol( DbgViewSymbol aSymbolView ) + { + SymbolCollection collection = null; + iSymbol = aSymbolView.Lookup( this.Data, out collection ); + // + if ( collection != null ) + { + // FIXME: should this be device file name if available, and host file name if all else fails? + AssociatedBinary = Path.GetFileName( collection.FileName.FileNameInHost ); + } + } + + public string GetSuggestedToolTipText() + { + string ret = string.Empty; + // + if ( IsCurrentStackPointerEntry ) + { + ret = "Current stack pointer address"; + } + else if ( IsRegisterBasedEntry ) + { + ret = "Value obtained from register " + AssociatedRegisterName; + } + else if ( Symbol != null ) + { + ret = "From: " + Symbol.Object; + } + else if ( AssociatedBinary != string.Empty ) + { + ret = "From: " + AssociatedBinary; + } + // + return ret; + } + + public void GetSuggestedColours( out Color aFore, out Color aBack ) + { + aFore = Color.Black; + aBack = Color.Transparent; + // + if ( IsRegisterBasedEntry ) + { + aBack = Color.LightSteelBlue; + } + else if ( IsCurrentStackPointerEntry ) + { + aBack = Color.Pink; + } + else if ( IsOutsideCurrentStackRange ) + { + aFore = Color.DarkGray; + } + else if ( IsGhost ) + { + aFore = Color.DarkGray; + } + else if ( Symbol != null ) + { + aFore = Color.DarkBlue; + } + } + #endregion + + #region Properties + public uint Address + { + get { return iAddress; } + } + + public AddressRange AddressRange + { + get { return new AddressRange( Address, Address + 3 ); } + } + + public uint Data + { + get { return iData; } + } + + public string DataAsString + { + get { return iDataAsString; } + } + + public Symbol Symbol + { + get { return iSymbol; } + } + + public TArmRegisterType AssociatedRegister + { + get { return iAssociatedRegister; } + set { iAssociatedRegister = value; } + } + + public string AssociatedRegisterName + { + get { return ArmRegister.GetTypeName( iAssociatedRegister ); } + } + + public string AssociatedBinary + { + get { return iAssociatedBinary; } + set { iAssociatedBinary = value; } + } + + public string Object + { + get + { + string ret = AssociatedBinary; + // + if ( Symbol != null ) + { + ret = Symbol.Object; + } + // + return ret; + } + } + + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + + public uint FunctionOffset + { + get + { + uint ret = 0; + // + if ( iSymbol != null ) + { + ret = iSymbol.Offset( this.Data ); + } + // + return ret; + } + } + #endregion + + #region Flag query properties + public bool IsCurrentStackPointerEntry + { + get { return ( iFlags & TFlags.EFlagsIsCurrentStackPointerEntry ) == TFlags.EFlagsIsCurrentStackPointerEntry; } + set + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsCurrentStackPointerEntry; + } + else + { + iFlags &= ~TFlags.EFlagsIsCurrentStackPointerEntry; + } + } + } + + public bool IsOutsideCurrentStackRange + { + get { return ( iFlags & TFlags.EFlagsIsOutsideCurrentStackRange ) == TFlags.EFlagsIsOutsideCurrentStackRange; } + set + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsOutsideCurrentStackRange; + } + else + { + iFlags &= ~TFlags.EFlagsIsOutsideCurrentStackRange; + } + } + } + + public bool IsAccurate + { + get { return ( iFlags & TFlags.EFlagsIsAccurate ) == TFlags.EFlagsIsAccurate; } + set + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsAccurate; + } + else + { + iFlags &= ~TFlags.EFlagsIsAccurate; + } + } + } + + public bool IsRegisterBasedEntry + { + get { return ( iFlags & TFlags.EFlagsIsRegisterBasedEntry ) == TFlags.EFlagsIsRegisterBasedEntry; } + set + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsRegisterBasedEntry; + } + else + { + iFlags &= ~TFlags.EFlagsIsRegisterBasedEntry; + } + } + } + + public bool IsGhost + { + get { return ( iFlags & TFlags.EFlagsIsGhost ) == TFlags.EFlagsIsGhost; } + set + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsGhost; + } + else + { + iFlags &= ~TFlags.EFlagsIsGhost; + } + } + } + #endregion + + #region From System.Object + public override string ToString() + { + const int KNormalAddressWidth = 10; + + StringBuilder ret = new StringBuilder(); + if ( IsRegisterBasedEntry ) + { + string prefix = "[ " + AssociatedRegisterName; + prefix = prefix.PadRight( KNormalAddressWidth - 2 ); + prefix += " ]"; + ret.AppendFormat( "{0} = {1:x8} {2} ", prefix, Data, DataAsString ); + } + else + { + ret.AppendFormat( "[{0:x8}] = {1:x8} {2} ", Address, Data, DataAsString ); + } + // + if ( iSymbol != null && !iSymbol.IsDefault ) + { + string baseAddressOffset = Symbol.ToStringOffset( Data ); + ret.AppendFormat( "{0} {1}", baseAddressOffset, Symbol.Name ); + } + else if ( AssociatedBinary != string.Empty ) + { + ret.AppendFormat( "{0} {1}", SymbolConstants.KUnknownOffset, AssociatedBinary ); + } + // + return ret.ToString(); + } + #endregion + + #region Internal methods + #endregion + + #region Internal flags + [Flags] + private enum TFlags + { + EFlagsNone = 0, + EFlagsIsCurrentStackPointerEntry = 1, + EFlagsIsOutsideCurrentStackRange = 2, + EFlagsIsAccurate = 4, + EFlagsIsRegisterBasedEntry = 8, + EFlagsIsGhost = 16 + } + #endregion + + #region Data members + private readonly uint iAddress; + private readonly uint iData; + private readonly string iDataAsString; + private Symbol iSymbol = null; + private TFlags iFlags = TFlags.EFlagsNone; + private string iAssociatedBinary = string.Empty; + private TArmRegisterType iAssociatedRegister = TArmRegisterType.EArmReg_Other; + private object iTag = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Data/Output/StackOutputData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Data/Output/StackOutputData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianStackLib.Data.Output.Entry; + +namespace SymbianStackLib.Data.Output +{ + public class StackOutputData : IEnumerable + { + #region Delegates & events + public delegate void EntryCreatedHandler( StackOutputEntry aEntry ); + public event EntryCreatedHandler EntryCreated; + #endregion + + #region Constructors + public StackOutputData() + { + } + #endregion + + #region API + public void Clear() + { + iEntries.Clear(); + IsAccurate = false; + AlgorithmName = string.Empty; + } + + public string ToString( bool aHideNonSymbols, bool aHideGhosts ) + { + StringBuilder text = new StringBuilder(); + // + StackOutputEntry lastElement = null; + foreach ( StackOutputEntry element in this ) + { + bool includeEntry = IncludeEntry( element, aHideNonSymbols, aHideGhosts ); + if ( includeEntry ) + { + if ( lastElement != null && lastElement.IsOutsideCurrentStackRange && element.IsOutsideCurrentStackRange == false && !element.IsRegisterBasedEntry ) + { + text.Append( System.Environment.NewLine ); + text.Append( " >>>> Current Stack Pointer >>>> " + System.Environment.NewLine ); + text.Append( System.Environment.NewLine ); + } + + string line = element.ToString() + Environment.NewLine; + text.Append( line ); + // + lastElement = element; + } + } + // + return text.ToString(); + } + + internal void InsertAsFirstEntry( StackOutputEntry aEntry ) + { + iEntries.Insert( 0, aEntry ); + + if ( EntryCreated != null ) + { + EntryCreated( aEntry ); + } + } + + internal void Add( StackOutputEntry aEntry ) + { + iEntries.Add( aEntry ); + // + if ( EntryCreated != null ) + { + EntryCreated( aEntry ); + } + } + #endregion + + #region Properties + public int Count + { + get { return iEntries.Count; } + } + + public bool IsAccurate + { + get { return iIsAccurate; } + set { iIsAccurate = value; } + } + + public string AlgorithmName + { + get { return iAlgorithmName; } + set { iAlgorithmName = value; } + } + + public StackOutputEntry this[ int aIndex ] + { + get { return iEntries[ aIndex ]; } + } + #endregion + + #region Internal methods + private static bool IncludeEntry( StackOutputEntry aElement, bool aHideNonSymbols, bool aHideGhosts ) + { + bool passedGhostCheck = true; + bool passedNonSymbolCheck = true; + + // Check whether we should exclude ghosts + if ( aHideGhosts ) + { + if ( aElement.IsGhost ) + { + // We definitely hide these... + passedGhostCheck = false; + } + else if ( aElement.Symbol == null ) + { + // We also hide all of these + passedGhostCheck = false; + } + } + + // Check whether we should exclude symbols which are NULL + if ( aHideNonSymbols ) + { + if ( aElement.Symbol == null && aElement.AssociatedBinary == string.Empty ) + { + passedNonSymbolCheck = false; + } + } + + // Some entries override everything + bool ret = ( passedGhostCheck && passedNonSymbolCheck ); + if ( aElement.IsCurrentStackPointerEntry || aElement.IsRegisterBasedEntry ) + { + ret = true; + } + // + return ret; + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( StackOutputEntry entry in iEntries ) + { + yield return entry; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( StackOutputEntry entry in iEntries ) + { + yield return entry; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + foreach ( StackOutputEntry entry in this ) + { + ret.AppendLine( entry.ToString() ); + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private bool iIsAccurate = false; + private string iAlgorithmName = string.Empty; + private List iEntries = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Data/Source/Primer/StackEnginePrimer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Data/Source/Primer/StackEnginePrimer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; +using SymbianUtils.DataBuffer; +using SymbianUtils.DataBuffer.Entry; +using SymbianUtils.DataBuffer.Primer; +using SymbianStackLib.Engine; +using SymbianStackLib.Data.Source; + +namespace SymbianStackLib.Data.Source.Primer +{ + public sealed class StackEnginePrimer : DataBufferPrimer + { + #region Constructors + internal StackEnginePrimer( StackEngine aEngine ) + : base( aEngine.DataSource ) + { + iEngine = aEngine; + // + base.LineNotHandled += new DataBufferPrimerUnhandledLine( StackEnginePrimer_LineNotHandled ); + base.PrimerComplete += new DataBufferPrimerCompleteHandler( StackEnginePrimer_PrimerComplete ); + } + #endregion + + #region Event handlers + void StackEnginePrimer_PrimerComplete( DataBufferPrimer aPrimer, DataBuffer aBuffer, uint aFirstByteAddress, uint aLastByteAddress ) + { + SeedAddressRangeBasedUponData(); + } + + void StackEnginePrimer_LineNotHandled( DataBufferPrimer aPrimer, DataBuffer aBuffer, string aLine ) + { + iEngine.Prefixes.TryAgainstPrefixes( aLine ); + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void SeedAddressRangeBasedUponData() + { + uint top = iEngine.DataSource.First.Address; + if ( top != 0 && iEngine.AddressInfo.Top == 0 ) + { + iEngine.AddressInfo.Top = top; + } + // + uint baseAddr = iEngine.DataSource.Last.Address; + if ( baseAddr != 0 && iEngine.AddressInfo.Base == 0 ) + { + iEngine.AddressInfo.Base = baseAddr; + } + } + #endregion + + #region Data members + private readonly StackEngine iEngine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Data/Source/StackSourceData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Data/Source/StackSourceData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianUtils.DataBuffer; +using SymbianUtils.DataBuffer.Entry; +using SymbianUtils.Range; + +namespace SymbianStackLib.Data.Source +{ + public class StackSourceData : DataBuffer + { + #region Constructors + public StackSourceData() + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region From System.Object + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Engine/StackEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Engine/StackEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,267 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using SymbianDebugLib.Engine; +using SymbianStackLib.AddressInfo; +using SymbianStackLib.Algorithms; +using SymbianStackLib.Data.Output; +using SymbianStackLib.Data.Source; +using SymbianStackLib.Data.Source.Primer; +using SymbianStackLib.Prefixes; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.CodeSegments; +using SymbianUtils; +using SymbianUtils.Tracer; + +namespace SymbianStackLib.Engine +{ + public sealed class StackEngine : ITracer + { + #region Delegates & events + public enum TEvent + { + EStackBuildingStarted = 0, + EStackBuildingProgress, + EStackBuildingComplete + } + + public enum TMessageType + { + ETypeWarning = 0, + ETypeError + } + + public delegate void StackEngineEventHandler( TEvent aEvent, StackEngine aEngine ); + public event StackEngineEventHandler EventHandler; + + public delegate void StackEngineExceptionHandler( Exception aException, StackEngine aEngine ); + public event StackEngineExceptionHandler ExceptionHandler; + + public delegate void StackEngineMessageHandler( TMessageType aType, string aMessage, StackEngine aEngine ); + public event StackEngineMessageHandler MessageHandler; + #endregion + + #region Constructors + public StackEngine( DbgEngine aDebugEngine ) + { + // Construction order important - must make primer after data source + iPrefixes = new StackPrefixManager( this ); + iPrimer = new StackEnginePrimer( this ); + // + iDebugEngine = aDebugEngine; + } + #endregion + + #region API + public void Reconstruct( TSynchronicity aSynchronicity ) + { + StackAlgorithmManager algorithmManager = new StackAlgorithmManager( this ); + algorithmManager.EventHandler += new StackAlgorithmManager.AlgorithmEventHandler( AlgorithmManager_EventHandler ); + algorithmManager.ExceptionHandler += new StackAlgorithmManager.AlgorithmExceptionHandler( AlgorithmManager_ExceptionHandler ); + algorithmManager.Reconstruct( aSynchronicity ); + } + + public void ReconstructAsync() + { + Reconstruct( TSynchronicity.EAsynchronous ); + } + + public void ReconstructSync() + { + Reconstruct( TSynchronicity.ESynchronous ); + } + #endregion + + #region Properties + public int Progress + { + get { return iProgress; } + } + + public bool Verbose + { + get + { + bool ret = iVerbose; + if ( System.Diagnostics.Debugger.IsAttached ) + { + ret = true; + } + return ret; + } + set { iVerbose = value; } + } + + public DbgEngine DebugEngine + { + get { return iDebugEngine; } + } + + public StackEnginePrimer Primer + { + get { return iPrimer; } + } + + public StackPrefixManager Prefixes + { + get { return iPrefixes; } + } + + public StackAddressInfo AddressInfo + { + get { return iAddressInfo; } + } + + public StackSourceData DataSource + { + get { return iDataSource; } + set { iDataSource = value; } + } + + public StackOutputData DataOutput + { + get { return iDataOutput; } + } + + public ArmRegisterCollection Registers + { + get { return iRegisters; } + set + { + iRegisters = value; + + // Update SP in the address info area if not already set + if ( iAddressInfo.HaveSetStackPointer == false && iRegisters.Contains( TArmRegisterType.EArmReg_SP ) ) + { + iAddressInfo.Pointer = iRegisters[ TArmRegisterType.EArmReg_SP ].Value; + } + } + } + + public CodeSegDefinitionCollection CodeSegments + { + get { return iCodeSegments; } + set { iCodeSegments = value; } + } + #endregion + + #region Event handlers + private void AlgorithmManager_ExceptionHandler( StackAlgorithmManager aAlgManager, Exception aException ) + { + if ( ExceptionHandler != null ) + { + ExceptionHandler( aException, this ); + } + } + + private void AlgorithmManager_EventHandler( StackAlgorithmManager aAlgManager, StackAlgorithmManager.TEvent aEvent ) + { + if ( EventHandler != null ) + { + switch ( aEvent ) + { + case StackAlgorithmManager.TEvent.EAlgorithmStarted: + EventHandler( TEvent.EStackBuildingStarted, this ); + break; + case StackAlgorithmManager.TEvent.EAlgorithmProgress: + iProgress = aAlgManager.Progress; + EventHandler( TEvent.EStackBuildingProgress, this ); + break; + case StackAlgorithmManager.TEvent.EAlgorithmComplete: + // Stop listening to algorithm manager events now that the reconstruction + // process is complete. + aAlgManager.EventHandler -= new StackAlgorithmManager.AlgorithmEventHandler( AlgorithmManager_EventHandler ); + aAlgManager.ExceptionHandler -= new StackAlgorithmManager.AlgorithmExceptionHandler( AlgorithmManager_ExceptionHandler ); + + // Get rid of alg manager + aAlgManager.Dispose(); + + // Report that we're done! + EventHandler( TEvent.EStackBuildingComplete, this ); + break; + } + } + } + #endregion + + #region Internal properties + #endregion + + #region Internal methods + internal void ReportMessage( TMessageType aType, string aMessage ) + { + if ( MessageHandler != null ) + { + MessageHandler( aType, aMessage, this ); + } + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + iDebugEngine.Trace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iDebugEngine.Trace( aFormat, aParams ); + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + + // CodeSegs + foreach ( CodeSegDefinition entry in CodeSegments ) + { + ret.Append( Prefixes.CodeSegment ); + ret.Append( entry.ToString() ); + ret.Append( System.Environment.NewLine ); + } + + // Current SP + if ( AddressInfo.Pointer != 0 ) + { + ret.AppendLine( Prefixes.Pointer + "0x" + AddressInfo.Pointer.ToString("x8") ); + } + + // Stack data + ret.AppendLine( DataSource.ToString() ); + + // + return ret.ToString(); + } + #endregion + + #region Data members + private readonly StackEnginePrimer iPrimer; + private readonly StackPrefixManager iPrefixes; + private readonly DbgEngine iDebugEngine; + private bool iVerbose = false; + private int iProgress = 0; + private StackOutputData iDataOutput = new StackOutputData(); + private StackSourceData iDataSource = new StackSourceData(); + private StackAddressInfo iAddressInfo = new StackAddressInfo(); + private ArmRegisterCollection iRegisters = new ArmRegisterCollection(); + private CodeSegDefinitionCollection iCodeSegments = new CodeSegDefinitionCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Exceptions/StackAddressException.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Exceptions/StackAddressException.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianDebugLib.Engine; +using SymbianStackLib.Engine; + +namespace SymbianStackLib.Exceptions +{ + public class StackAddressException : Exception + { + #region Enumerations + public enum TType + { + ETypeBaseAddressBeforeTopAddress = 0, + ETypeTopAddressAfterBaseAddress, + ETypePointerIsNull, + ETypePointerOutOfBounds + } + #endregion + + #region Constructors + internal StackAddressException( TType aType ) + { + iType = aType; + } + #endregion + + #region Properties + public TType Type + { + get { return iType; } + } + #endregion + + #region Data members + private readonly TType iType; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Interfaces/IStackAlgorithmManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Interfaces/IStackAlgorithmManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianDebugLib.Engine; +using SymbianStackLib.Engine; + +namespace SymbianStackLib.Interfaces +{ + public interface IStackAlgorithmManager : ITracer + { + StackEngine Engine + { + get; + } + + DbgEngineView DebugEngineView + { + get; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Interfaces/IStackAlgorithmObserver.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Interfaces/IStackAlgorithmObserver.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianStackLib.Data.Output.Entry; +using SymbianStackLib.Algorithms; + +namespace SymbianStackLib.Interfaces +{ + public interface IStackAlgorithmObserver + { + void StackBuildingStarted( StackAlgorithm aAlg ); + void StackBuldingProgress( StackAlgorithm aAlg, int aPercent ); + void StackBuildingComplete( StackAlgorithm aAlg ); + void StackBuildingException( StackAlgorithm aAlg, Exception aException ); + void StackBuildingElementConstructed( StackAlgorithm aAlg, StackOutputEntry aEntry ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/LibResources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/LibResources.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SymbianStackLib { + using System; + + + // + // A strongly-typed resource class, for looking up localized strings, etc. + // + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class LibResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal LibResources() { + } + + // + // Returns the cached ResourceManager instance used by this class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SymbianStackLib.LibResources", typeof(LibResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + // + // Overrides the current thread's CurrentUICulture property for all + // resource lookups using this strongly typed resource class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + // + // Looks up a localized string similar to Unable to create call stack using \'{0}\' algorithm.. + // + internal static string StackAlgorithmManager_FailedAlgorithmWarning { + get { + return ResourceManager.GetString("StackAlgorithmManager_FailedAlgorithmWarning", resourceCulture); + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/LibResources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/LibResources.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Unable to create call stack using \'{0}\' algorithm. + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/ParsedDataItems.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/ParsedDataItems.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; + +namespace StackLib +{ + public class ParsedDataItem + { + #region Constructors & destructor + public ParsedDataItem( long aAddress, long aReversedData, long aOriginalData, string aCharacterisedData ) + { + iAddress = aAddress; + iData = aReversedData; + iOriginalData = aOriginalData; + iCharacterisedData = aCharacterisedData; + } + #endregion + + #region Properties + public long Address + { + get { return iAddress; } + set { iAddress = value; } + } + + public long Data + { + get { return iData; } + set { iData = value; } + } + + public long OriginalData + { + get { return iOriginalData; } + set { iOriginalData = value; } + } + + public string CharacterisedData + { + get { return iCharacterisedData; } + set { iCharacterisedData = value; } + } + + public string OriginalCharacterisedData + { + get + { + char[] reversedCharacterisedData = new char[iCharacterisedData.Length]; + for (int i = 0; i < iCharacterisedData.Length; i+=4) + { + string bytes = iCharacterisedData.Substring(i, 4); + reversedCharacterisedData[i] = bytes[3]; + reversedCharacterisedData[i+1] = bytes[2]; + reversedCharacterisedData[i+2] = bytes[1]; + reversedCharacterisedData[i+3] = bytes[0]; + } + // + string characterisedData = new string(reversedCharacterisedData); + return characterisedData; + } + } + + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + #endregion + + #region Data members + private object iTag; + private long iAddress; + private long iData; + private long iOriginalData; + private string iCharacterisedData; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Algorithm/AccurateAlgorithm.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Algorithm/AccurateAlgorithm.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,432 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using SymbianStackAlgorithmAccurate.Engine; +using SymbianStackAlgorithmAccurate.Interfaces; +using SymbianStackAlgorithmAccurate.Stack; +using SymbianStackLib.Algorithms; +using SymbianStackLib.Data.Output; +using SymbianStackLib.Data.Output.Entry; +using SymbianStackLib.Data.Source; +using SymbianStackLib.Interfaces; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Debug.Symbols.Constants; +using SymbianUtils.DataBuffer.Entry; +using SymbianUtils.Range; + +namespace SymbianStackAlgorithmAccurate.Algorithm +{ + internal class AccurateAlgorithm : StackAlgorithm, IArmStackInterface + { + #region Constructors + public AccurateAlgorithm( IStackAlgorithmManager aManager, IStackAlgorithmObserver aObserver ) + : base( aManager, aObserver ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StackAlgorithm + public override string Name + { + get { return "Accurate"; } + } + + public override int Priority + { + get { return 0; } + } + + public override bool IsAvailable() + { + bool ret = base.IsAvailable(); + // + if ( ret ) + { + // We need some registers + ret = !base.Engine.Registers.IsEmpty; + // + if ( ret ) + { + // This algorithm can only work if we have code available + // to work with... + ret = base.DebugEngineView.Code.IsReady; + // + if ( ret == false ) + { + base.Trace( "[AccurateAlgorithm] IsAvailable() - code not provided" ); + } + } + else + { + base.Trace( "[AccurateAlgorithm] IsAvailable() - registers not provided" ); + } + } + else + { + base.Trace( "[AccurateAlgorithm] IsAvailable() - symbols not provided" ); + } + // + base.Trace( "[AccurateAlgorithm] IsAvailable() - ret: {0}", ret ); + return ret; + } + #endregion + + #region From IArmStackInterface + uint IArmStackInterface.StackBase + { + get { return base.Engine.AddressInfo.Base; } + } + + uint IArmStackInterface.StackTop + { + get { return base.Engine.AddressInfo.Top; } + } + + uint IArmStackInterface.StackValueAtAddress( uint aAddress ) + { + DataBufferUint entry = base.SourceData[ aAddress ]; + return entry.Uint; + } + #endregion + + #region From AsyncReaderBase + protected override void HandleReadException( Exception aException ) + { + // If an exception occurred during frame building or + // stack reconstruction, then we are aborting the entire operation. + // + // However, HandleReadcompleted() is always called irrespective + // of whether or not an operation succeeded or failed. + // + // Therefore, to ensure we do not generate a nested exception in + // an abort scenario we toggle the 'accurate entry check required' + // status flag to false so that we will not complain if the + // algorithm did not locate any accurate frames. + iAccurateEntryCheckRequired = false; + base.Trace( "[AccurateAlgorithm] HandleReadException() - aException: {0}, stack: {1}", aException.Message, aException.StackTrace ); + + // Now we can propagate the exception onwards. + base.HandleReadException( aException ); + } + + protected override void HandleReadCompleted() + { + // If we didn't identify any accurate entries, then we bail out + // and let the heuristic algorithm run instead. + // + // NB: we don't do this unless we succeeded to reconstruct + // the entire stack. + base.Trace( "[AccurateAlgorithm] HandleReadCompleted() - iAccurateEntryCheckRequired: {0}, iAccurateEntryCount: {1}", iAccurateEntryCheckRequired, iAccurateEntryCount ); + if ( iAccurateEntryCheckRequired ) + { + if ( iAccurateEntryCount == 0 ) + { + throw new Exception( "Unable to locate any accurate entries" ); + } + } + + // We're an accurate algorithm + base.OutputData.IsAccurate = true; + + base.Trace( "[AccurateAlgorithm] HandleReadCompleted() - read ok!" ); + base.HandleReadCompleted(); + } + + protected override void HandleReadStarted() + { + try + { + base.Trace( "[AccurateAlgorithm] HandleReadStarted() - START" ); + + // Indicate that we will throw an exception if we do not + // find at least one accurate entry. This is the default behaviour + // to ensure we don't result in stack data containing just ghost entries. + // We toggle this to false if we abort stack walking due to an exception, + // thereby preventing nested exception throwing. + iAccurateEntryCheckRequired = true; + + // Create arm engine + iArmEngine = new AccurateEngine( base.DebugEngineView, this, base.Manager.Engine ); + + // Seed it with the registers + iArmEngine.CPU.Registers = base.Engine.Registers; + + // Dump the registers in verbose mode + base.Trace( "STACK ENGINE REGISTERS:" ); + foreach ( ArmRegister reg in base.Engine.Registers ) + { + string symbol = base.DebugEngineView.Symbols.PlainText[ reg.Value ]; + base.Trace( reg.ToString() + " " + symbol ); + } + // + base.Trace( System.Environment.NewLine ); + base.Trace( "[AccurateAlgorithm] HandleReadStarted() - setup complete." ); + } + finally + { + base.HandleReadStarted(); + } + + base.Trace( "[AccurateAlgorithm] HandleReadStarted() - END" ); + } + + protected override void PerformOperation() + { + System.Diagnostics.Debug.Assert( iArmEngine != null ); + + // First step is to read as many valid stack frames as possible + BuildStackFrames(); + + // Second step is to try to fill any gaps in the stack data + CreateStackOutput(); + } + + protected override long Size + { + get + { + int bytes = base.SourceData.Count; + int dWords = bytes / 4; + return dWords; + } + } + + protected override long Position + { + get + { + return iDWordIndex; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iArmEngine != null ) + { + iArmEngine.Dispose(); + iArmEngine = null; + } + } + } + #endregion + + #region Internal methods + private ArmStackFrame FrameByStackAddress( uint aAddress ) + { + ArmStackFrame ret = null; + // + ArmStackFrame[] frames = iArmEngine.StackFrames; + foreach ( ArmStackFrame frame in frames ) + { + if ( frame.Address == aAddress ) + { + ret = frame; + break; + } + } + // + return ret; + } + + private ArmStackFrame FrameByRegisterType( TArmRegisterType aRegister ) + { + ArmStackFrame ret = null; + // + ArmStackFrame[] frames = iArmEngine.StackFrames; + foreach ( ArmStackFrame frame in frames ) + { + if ( frame.IsRegisterBasedEntry && frame.AssociatedRegister == aRegister ) + { + ret = frame; + break; + } + } + // + return ret; + } + + private void BuildStackFrames() + { + bool success = iArmEngine.Process(); + while ( success ) + { + success = iArmEngine.Process(); + } + + base.Trace( string.Empty ); + base.Trace( string.Empty ); + } + + private void CreateStackOutput() + { + // Get the source data we need to reconstruct and signal we're about to start + StackSourceData sourceData = base.SourceData; + + // Get the output data sink + StackOutputData outputData = base.OutputData; + outputData.Clear(); + outputData.AlgorithmName = Name; + + // Get the address range of the stack pointer data + AddressRange pointerRange = base.Engine.AddressInfo.StackPointerRange; + AddressRange pointerRangeExtended = base.Engine.AddressInfo.StackPointerRangeWithExtensionArea; + + foreach ( DataBufferUint sourceEntry in sourceData.GetUintEnumerator() ) + { + // Check if it is within the stack domain, taking into account + // our extended range + if ( pointerRangeExtended.Contains( sourceEntry.Address ) ) + { + StackOutputEntry outputEntry = new StackOutputEntry( sourceEntry.Address, sourceEntry.Uint, base.DebugEngineView ); + + // Is it the element that corresponds to the current value of SP? + bool isCurrentSPEntry = ( outputEntry.AddressRange.Contains( base.Engine.AddressInfo.Pointer ) ); + + // Is it within the pure 'stack pointer' address range? + bool outsidePureStackPointerRange = !pointerRange.Contains( sourceEntry.Address ); + outputEntry.IsOutsideCurrentStackRange = outsidePureStackPointerRange; + + // Is it a ghost? + if ( outputEntry.Symbol != null ) + { + ArmStackFrame realStackFrame = FrameByStackAddress( sourceEntry.Address ); + outputEntry.IsAccurate = ( realStackFrame != null ); + outputEntry.IsGhost = ( realStackFrame == null ); + } + + // Save entry + EmitElement( outputEntry ); + + // If we're inside the stack address range, then poke in the PC and LR values + if ( isCurrentSPEntry ) + { + outputEntry.IsCurrentStackPointerEntry = true; + + // Working bottom up, so LR should go on the stack first + ArmStackFrame stackFrameLR = FrameByRegisterType( TArmRegisterType.EArmReg_LR ); + if ( stackFrameLR != null ) + { + StackOutputEntry entryLR = new StackOutputEntry( 0, stackFrameLR.Data, base.DebugEngineView ); + entryLR.IsRegisterBasedEntry = true; + entryLR.IsOutsideCurrentStackRange = true; + entryLR.AssociatedRegister = stackFrameLR.AssociatedRegister; + EmitElement( entryLR ); + } + + // Then the PC... + ArmStackFrame stackFramePC = FrameByRegisterType( TArmRegisterType.EArmReg_PC ); + if ( stackFramePC != null ) + { + StackOutputEntry entryPC = new StackOutputEntry( 0, stackFramePC.Data, base.DebugEngineView ); + entryPC.IsRegisterBasedEntry = true; + entryPC.IsOutsideCurrentStackRange = true; + entryPC.AssociatedRegister = stackFramePC.AssociatedRegister; + EmitElement( entryPC ); + } + } + } + else + { + // Nope, ignore it... + } + + NotifyEvent( TEvent.EReadingProgress ); + ++iDWordIndex; + } + } + + private void EmitElement( StackOutputEntry aEntry ) + { + // Debug support + if ( base.Engine.Verbose ) + { + StringBuilder line = new StringBuilder( "[AccurateAlgorithm] " ); + // + if ( aEntry.IsCurrentStackPointerEntry ) + { + line.Append( "[C] " ); + } + else if ( aEntry.IsRegisterBasedEntry ) + { + const int KNormalAddressWidth = 10; + string prefix = "[ " + aEntry.AssociatedRegisterName; + prefix = prefix.PadRight( KNormalAddressWidth - 2 ); + prefix += " ]"; + line.Append( prefix ); + } + else if ( aEntry.IsGhost ) + { + line.Append( "[G] " ); + } + else if ( aEntry.IsOutsideCurrentStackRange ) + { + line.Append( " " ); + } + else + { + line.AppendFormat( "[{0:x8}]", aEntry.Address ); + } + + line.AppendFormat( " {0:x8} {1}", aEntry.Data, aEntry.DataAsString ); + + if ( aEntry.Symbol != null ) + { + string baseAddressOffset = aEntry.Symbol.ToStringOffset( aEntry.Data ); + line.AppendFormat( "{0} {1}", baseAddressOffset, aEntry.Symbol.Name ); + } + else if ( aEntry.AssociatedBinary != string.Empty ) + { + line.AppendFormat( "{0} {1}", SymbolConstants.KUnknownOffset, aEntry.AssociatedBinary ); + } + + base.Trace( line.ToString() ); + } + + // Count the number of accurate entries + if ( aEntry.IsAccurate ) + { + ++iAccurateEntryCount; + } + + // Flush entry + base.StackObserver.StackBuildingElementConstructed( this, aEntry ); + } + #endregion + + #region Data members + private AccurateEngine iArmEngine = null; + private int iDWordIndex = 0; + private bool iAccurateEntryCheckRequired = true; + private int iAccurateEntryCount = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/CPU/ArmCpu.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/CPU/ArmCpu.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStackAlgorithmAccurate.Instructions; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm; + +namespace SymbianStackAlgorithmAccurate.CPU +{ + public class ArmCpu + { + #region Constructors + public ArmCpu() + { + } + #endregion + + #region API + #endregion + + #region Properties + public ArmRegisterCollection Registers + { + get { return iRegisters; } + set + { + // Copy the registers, don't take a reference to the supplied ones.. + // Otherwise we cannot invoke stack walking twice since we blatted + // the original (external) copy. + ArmRegisterCollection regs = new ArmRegisterCollection( value ); + iRegisters = regs; + } + } + + public ArmRegister SP + { + get + { + ArmRegister ret = Registers[ TArmRegisterType.EArmReg_SP ]; + return ret; + } + } + + public ArmRegister LR + { + get + { + ArmRegister ret = Registers[ TArmRegisterType.EArmReg_LR ]; + return ret; + } + } + + public ArmRegister PC + { + get + { + ArmRegister ret = Registers[ TArmRegisterType.EArmReg_PC ]; + return ret; + } + } + + public ArmRegister CPSR + { + get + { + ArmRegister ret = Registers[ TArmRegisterType.EArmReg_CPSR ]; + return ret; + } + } + + public TArmInstructionSet CurrentProcessorMode + { + get + { + TArmInstructionSet ret = TArmInstructionSet.EARM; + ArmRegister cpsr = CPSR; + // + if ( ( cpsr.Value & 0x20 ) != 0 ) + { + ret = TArmInstructionSet.ETHUMB; + } + // + return ret; + } + set + { + if ( value == TArmInstructionSet.EARM ) + { + // Clear CPSR Thumb bit + CPSR.Value &= 0xFFFFFFDF; + } + else if ( value == TArmInstructionSet.ETHUMB ) + { + // Set CPSR Thumb bit + CPSR.Value |= 0x00000020; + } + } + } + + public ArmRegister this[ TArmRegisterType aType ] + { + get { return iRegisters[ aType ]; } + } + #endregion + + #region Data members + private ArmRegisterCollection iRegisters = new ArmRegisterCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/CPU/ArmCpuUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/CPU/ArmCpuUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm; +using SymbianStackAlgorithmAccurate.Instructions; + +namespace SymbianStackAlgorithmAccurate.CPU +{ + internal static class ArmCpuUtils + { + #region API + public static uint InstructionSize( TArmInstructionSet aSet ) + { + uint ret = 2; + // + if ( aSet == TArmInstructionSet.EARM ) + { + ret = 4; + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Code/ArmCodeHelper.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Code/ArmCodeHelper.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Tracer; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Code; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStackAlgorithmAccurate.Engine; +using SymbianStackAlgorithmAccurate.Instructions; + +namespace SymbianStackAlgorithmAccurate.Code +{ + internal class ArmCodeHelper + { + #region Constructors + public ArmCodeHelper( DbgViewCode aDebugViewCode, ITracer aTracer ) + { + iCodeView = aDebugViewCode; + iTracer = aTracer; + } + #endregion + + #region API + public uint LoadData( uint aAddress ) + { + uint ret = iCodeView.GetDataUInt32( aAddress ); + return ret; + } + + public AccInstructionList LoadInstructions( uint aAddress, int aCount, TArmInstructionSet aType ) + { + AccInstructionList ret = new AccInstructionList(); + + // Get list of instructions from code engine + IArmInstruction[] basicInstructions = null; + bool available = iCodeView.GetInstructions( aAddress, aType, aCount, out basicInstructions ); + if ( available ) + { + // Convert the basic instructions into the different types + // we can handle + ret.AddRange( basicInstructions ); + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly ITracer iTracer; + private readonly DbgViewCode iCodeView; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Engine/AccurateEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Engine/AccurateEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,359 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianStackAlgorithmAccurate.Code; +using SymbianStackAlgorithmAccurate.CPU; +using SymbianStackAlgorithmAccurate.Interfaces; +using SymbianStackAlgorithmAccurate.Prologue; +using SymbianStackAlgorithmAccurate.Stack; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Registers; +using SymbianUtils; +using SymbianUtils.Tracer; + +namespace SymbianStackAlgorithmAccurate.Engine +{ + internal class AccurateEngine : DisposableObject, ITracer + { + #region Constructors + public AccurateEngine( DbgEngineView aDebugEngineView, IArmStackInterface aStackInterface, ITracer aTracer ) + { + iTracer = aTracer; + iDebugEngineView = aDebugEngineView; + iStackInterface = aStackInterface; + iCodeHelper = new ArmCodeHelper( aDebugEngineView, aTracer ); + } + #endregion + + #region API + public bool Process() + { + // We need SP, LR, PC, CPSR + CheckRequiredRegistersAvailable(); + + // Debug info + PrintInitialInfo(); + + // Make initial stack frames for seed registers + MakeInitialSeedStackFramesFromRegisterValues(); + + // Get sp + ArmRegister sp = CPU[ TArmRegisterType.EArmReg_SP ]; + uint initialSPValue = sp.Value; + + // Create Prologue object that will establish the instructions for the + // function and also identify operations that might affect SP and LR. + ArmPrologueHelper Prologue = new ArmPrologueHelper( this ); + Prologue.Build(); + + // Create a new stack frame for this function call + ArmStackFrame stackFrame = new ArmStackFrame( Prologue ); + + // We save the stack address which contained the popped link register + // during the previous cycle. If possible, use that value. If it + // hasn't been set, then assume we obtained the link register from the + // previous 4 bytes of stack (according to the current value of SP). + long stackAddressAssociatedWithCurrentFrame = iLastLinkRegisterStackAddress; + if ( stackAddressAssociatedWithCurrentFrame == KLinkRegisterWasNotPushedOnStack ) + { + // We're always four bytes behind the current SP + stackAddressAssociatedWithCurrentFrame = sp - 4; + } + stackFrame.Address = (uint) stackAddressAssociatedWithCurrentFrame; + stackFrame.Data = iStackInterface.StackValueAtAddress( stackFrame.Address ); + + Trace( "Creating Stack Frame [" + stackFrame.Address.ToString( "x8" ) + "] = 0x" + stackFrame.Data.ToString( "x8" ) + " = " + SymbolString ( stackFrame.Data ) ); + + // Can now adjust stack pointer based upon the number of stack-adjusting + // instructions during the Prologue phase. + uint stackAdjustment = (uint) ( Prologue.NumberOfWordsPushedOnStack * 4 ); + sp.Value += stackAdjustment; + Trace( "stack adjusted by: 0x" + stackAdjustment.ToString( "x8" ) ); + + // We're hoping that the link register was pushed on the stack somewhere + // during the function preamble. If that was the case, then as we processed + // each instruction, we'll have updated the register offsets so that we know + // the offset to the link register from the perspective of the starting stack + // address for the function. + uint lrOffsetInWords = Prologue.OffsetValues[ TArmRegisterType.EArmReg_LR ]; + Trace( string.Format( "LR offset on stack is: 0x{0:x8}", lrOffsetInWords * 4 ) ); + GetNewLRValue( lrOffsetInWords, Prologue ); + + // Update the PC to point to the new function address (which we obtain + // from LR) + uint oldPCValue = CPU.PC; + ChangePCToLRAddress(); + uint newPCValue = CPU.PC; + Trace( string.Format( "oldPCValue: 0x{0:x8}, newPCValue: 0x{1:x8}, fn: {2}", oldPCValue, newPCValue, SymbolViewText[ newPCValue ] ) ); + + // Decide if we are in thumb or ARM mode after switching functions + UpdateInstructionSet( newPCValue ); + + // Return true if we moved to a new function + bool gotNewFunction = ( oldPCValue != CPU.PC ); + Trace( "gotNewFunction: " + gotNewFunction ); + + // Save stack frame + SaveStackFrames( stackFrame ); + + // Increment iteration + ++iIterationNumber; + + // Do we have more to do? + bool moreToDo = gotNewFunction && ( CPU.PC > 0 ); + + // Done + Trace( "moreToDo: " + moreToDo ); + return moreToDo; + } + #endregion + + #region Properties + public ArmCpu CPU + { + get { return iCPU; } + } + + public ArmStackFrame[] StackFrames + { + get + { + return iStackFrames.ToArray(); + } + } + + internal ArmCodeHelper CodeHelper + { + get { return iCodeHelper; } + } + + internal DbgEngineView DebugEngineView + { + get { return iDebugEngineView; } + } + + internal DbgViewSymbol SymbolView + { + get { return DebugEngineView.Symbols; } + } + + internal DbgSymbolViewText SymbolViewText + { + get { return SymbolView.PlainText; } + } + #endregion + + #region Internal methods + private void PrintInitialInfo() + { + ArmRegister sp = CPU[ TArmRegisterType.EArmReg_SP ]; + // + ArmRegister lr = CPU[ TArmRegisterType.EArmReg_LR ]; + string lrSymbol = SymbolViewText[ lr ]; + // + ArmRegister pc = CPU[ TArmRegisterType.EArmReg_PC ]; + string pcSymbol = SymbolViewText[ pc ]; + // + ArmRegister cpsr = CPU[ TArmRegisterType.EArmReg_CPSR ]; + // + Trace( System.Environment.NewLine ); + Trace( string.Format( "[{5:d2}] SP: 0x{0:x8}, LR: 0x{1:x8} [{2}], PC: 0x{3:x8} [{4}], isThumb: {6}", sp.Value, lr.Value, lrSymbol, pc.Value, pcSymbol, iIterationNumber, CPU.CurrentProcessorMode == TArmInstructionSet.ETHUMB ) ); + } + + private void CheckRequiredRegistersAvailable() + { + ArmRegisterCollection regs = CPU.Registers; + + // We need SP, LR, PC, CPSR + bool sp = regs.Contains( TArmRegisterType.EArmReg_SP ); + bool lr = regs.Contains( TArmRegisterType.EArmReg_LR ); + bool pc = regs.Contains( TArmRegisterType.EArmReg_PC ); + bool cpsr = regs.Contains( TArmRegisterType.EArmReg_CPSR ); + // + bool available = ( sp && lr && pc && cpsr ); + if ( !available ) + { + SymbianUtils.SymDebug.SymDebugger.Break(); + throw new ArgumentException( "One or more registers is unavailable" ); + } + } + + private void MakeInitialSeedStackFramesFromRegisterValues() + { + if ( !iAlreadySavedInitialRegisterFrames ) + { + ArmRegisterCollection regs = CPU.Registers; + + // Make PC stack frame + ArmStackFrame framePC = new ArmStackFrame( TArmRegisterType.EArmReg_PC ); + framePC.Data = regs[ TArmRegisterType.EArmReg_PC ].Value; + + // Make LR stack frame + ArmStackFrame frameLR = new ArmStackFrame( TArmRegisterType.EArmReg_LR ); + frameLR.Data = regs[ TArmRegisterType.EArmReg_LR ].Value; + + // Save 'em + SaveStackFrames( framePC, frameLR ); + + // Don't do this again + iAlreadySavedInitialRegisterFrames = true; + } + } + + private void GetNewLRValue( uint aLinkRegOffsetInWords, ArmPrologueHelper aPrologue ) + { + uint sp = CPU[ TArmRegisterType.EArmReg_SP ]; + Trace( string.Format( "GetNewLRValue - stack DWORD offset to LR: 0x{0:x8}, sp: 0x{1:x8}", aLinkRegOffsetInWords, sp ) ); + + // If the link register was pushed onto the stack, then get the new value + // now... + if ( aLinkRegOffsetInWords != uint.MaxValue ) + { + ArmRegisterCollection regs = aPrologue.OffsetValues; + foreach ( ArmRegister reg in regs ) + { + Trace( "GetNewLRValue - reg offsets - " + reg.ToString() ); + } + + long offsetOnStackToLR = aLinkRegOffsetInWords * 4; + long stackBase = iStackInterface.StackBase; + long stackOffsetToLR = sp - 4 - stackBase - offsetOnStackToLR; + iLastLinkRegisterStackAddress = stackBase + stackOffsetToLR; + uint newLRValue = iStackInterface.StackValueAtAddress( (uint) iLastLinkRegisterStackAddress ); + Trace( string.Format( "GetNewLRValue - Fetching LR from stack address: 0x{0:x8} (0x{1:x8})", iLastLinkRegisterStackAddress, newLRValue ) ); + + uint temp; + string sym; + SymbolViewText.Lookup( newLRValue, out temp, out sym ); + Trace( "GetNewLRValue - LR changed to: 0x" + newLRValue.ToString( "x8" ) + " => [ " + sym + " ]" ); + + CPU[ TArmRegisterType.EArmReg_LR ].Value = newLRValue; + } + else + { + iLastLinkRegisterStackAddress = KLinkRegisterWasNotPushedOnStack; + Trace( "GetNewLRValue - LR not pushed on stack!" ); + } + } + + private void UpdateInstructionSet( uint aPC ) + { + uint isThumb = aPC & 0x1; + if ( isThumb != 0 ) + { + CPU.CurrentProcessorMode = TArmInstructionSet.ETHUMB; + } + else + { + CPU.CurrentProcessorMode = TArmInstructionSet.EARM; + } + + // Twiddle the first bit to clear any possible non-address value + CPU.PC.Value &= 0xFFFFFFFE; + } + + private void ChangePCToLRAddress() + { + CPU.PC.Value = CPU.LR.Value; + + // Zero out the LR value as it has just been promoted to PC + CPU.LR.Value = 0; + } + + private void SaveStackFrames( params ArmStackFrame[] aFrames ) + { + foreach ( ArmStackFrame frame in aFrames ) + { + iStackFrames.Add( frame ); + } + } + + private string SymbolString( uint aAddress ) + { + // Used for debugging + uint fnStartAddr = 0; + string symbolName = string.Empty; + SymbolViewText.Lookup( aAddress, out fnStartAddr, out symbolName ); + return symbolName; + } + #endregion + + #region Internal constants + private const long KLinkRegisterWasNotPushedOnStack = -1; + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + StringBuilder t = new StringBuilder(); + // + string pad = string.Empty; + // + if ( iTraceIndentLevel != 0 ) + { + pad = pad.PadLeft( iTraceIndentLevel * 4, ' ' ); + } + // + t.AppendFormat( "[AIE] {0}{1}", pad, aMessage ); + iTracer.Trace( t.ToString() ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + string t = string.Format( aFormat, aParams ); + Trace( t ); + } + + internal void SetIndent( int aIndentLevel ) + { + iTraceIndentLevel = aIndentLevel; + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iStackFrames.Clear(); + iStackFrames = null; + } + } + #endregion + + #region Data members + private readonly ITracer iTracer; + private readonly DbgEngineView iDebugEngineView; + private readonly ArmCodeHelper iCodeHelper; + private readonly IArmStackInterface iStackInterface; + private long iLastLinkRegisterStackAddress = KLinkRegisterWasNotPushedOnStack; + private int iTraceIndentLevel = 0; + private int iIterationNumber = 0; + private bool iAlreadySavedInitialRegisterFrames = false; + private ArmCpu iCPU = new ArmCpu(); + private List iStackFrames = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/AccInstruction.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/AccInstruction.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.BasicTypes; +using SymbianStackAlgorithmAccurate.CPU; +using SymbianStackAlgorithmAccurate.Prologue; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; + +namespace SymbianStackAlgorithmAccurate.Instructions +{ + internal abstract class AccInstruction + { + #region Constructors + protected AccInstruction( IArmInstruction aInstruction ) + { + iInstruction = aInstruction; + } + #endregion + + #region API + internal abstract void Process( ArmPrologueHelper aProlog ); + + internal virtual void Prefilter( AccInstructionList aInstructions, int aMyIndex, int aInstructionCountOffsetToPC ) + { + } + #endregion + + #region Properties + public IArmInstruction Instruction + { + get { return iInstruction; } + } + + public bool Ignored + { + get { return iIgnored; } + internal set { iIgnored = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + return iInstruction.ToString(); + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly IArmInstruction iInstruction; + private bool iIgnored = false; + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/AccInstructionList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/AccInstructionList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Tracer; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStackAlgorithmAccurate.CPU; +using SymbianStackAlgorithmAccurate.Interfaces; +using SymbianStackAlgorithmAccurate.Instructions.Types; + +namespace SymbianStackAlgorithmAccurate.Instructions +{ + internal class AccInstructionList : IEnumerable + { + #region Constructors + public AccInstructionList() + { + } + #endregion + + #region API + public void AddRange( IEnumerable aInstructions ) + { + foreach ( IArmInstruction bi in aInstructions ) + { + AccInstruction instruction = null; + // + switch ( bi.AIGroup ) + { + case TArmInstructionGroup.EGroupBranch: + instruction = new AccInstBranch( bi ); + break; + case TArmInstructionGroup.EGroupDataProcessing: + instruction = new AccInstDataProcessing( bi ); + break; + case TArmInstructionGroup.EGroupDataTransfer: + instruction = new AccInstDataTransfer( bi ); + break; + default: + instruction = new AccInstUnknown( bi ); + break; + } + // + iInstructions.Add( instruction ); + } + } + + public AccInstruction Deque() + { + if ( Count == 0 ) + { + throw new InvalidOperationException( "No instructions to deque" ); + } + + AccInstruction head = iInstructions[ 0 ]; + iInstructions.RemoveAt( 0 ); + return head; + } + + internal void Prefilter( int aInstructionCountOffsetToPC ) + { + int count = this.Count; + for ( int i = 0; i < count; i++ ) + { + AccInstruction instruction = iInstructions[ i ]; + // + if ( instruction.Ignored == false ) + { + instruction.Prefilter( this, i, aInstructionCountOffsetToPC ); + } + } + } + + internal void DebugPrint( ITracer aTracer ) + { + if ( aTracer != null ) + { + uint address = iInstructions.Count > 0 ? iInstructions[ 0 ].Instruction.AIAddress : uint.MaxValue; + // + aTracer.Trace( "" ); + aTracer.Trace( "INSTRUCTIONS @ 0x{0:x8}", address ); + aTracer.Trace( "=========================" ); + // + foreach ( AccInstruction instruction in this ) + { + string line = instruction.ToString(); + aTracer.Trace( line ); + } + // + aTracer.Trace( "" ); + } + } + #endregion + + #region Properties + public int Count + { + get { return iInstructions.Count; } + } + + public TArmInstructionSet InstructionSet + { + get + { + TArmInstructionSet ret = TArmInstructionSet.EARM; + // + if ( iInstructions.Count > 0 ) + { + ret = iInstructions[ 0 ].Instruction.AIType; + } + // + return ret; + } + } + + public AccInstruction this[ int aIndex ] + { + get { return iInstructions[ aIndex ]; } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( AccInstruction instruction in iInstructions ) + { + yield return instruction; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( AccInstruction instruction in iInstructions ) + { + yield return instruction; + } + } + #endregion + + #region Data members + private List iInstructions = new List(); + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/Types/AccInstBranch.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/Types/AccInstBranch.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,103 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; +using SymbianInstructionLib.Arm.Instructions.Arm; +using SymbianInstructionLib.Arm.Instructions.Arm.DataProcessing; +using SymbianInstructionLib.Arm.Instructions.Thumb; +using SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing; +using SymbianStackAlgorithmAccurate.CPU; +using SymbianStackAlgorithmAccurate.Prologue; + +namespace SymbianStackAlgorithmAccurate.Instructions.Types +{ + internal class AccInstBranch : AccInstruction + { + #region Constructors + public AccInstBranch( IArmInstruction aInstruction ) + : base( aInstruction ) + { + System.Diagnostics.Debug.Assert( base.Instruction.AIGroup == TArmInstructionGroup.EGroupBranch ); + } + #endregion + + #region API + internal override void Process( ArmPrologueHelper aProlog ) + { + } + + internal override void Prefilter( AccInstructionList aInstructions, int aMyIndex, int aInstructionCountOffsetToPC ) + { + if ( this.Ignored == false ) + { + int count = aInstructions.Count; + // + if ( base.Instruction.AIConditionCode == TArmInstructionCondition.AL ) + { + // As soon as we see any unconditional branch statement we can be sure that we are past the Prologue. + for ( int i = aMyIndex + 1; i < count; i++ ) + { + aInstructions[ i ].Ignored = true; + } + } + else + { + // Count the number of interesting instructions before the conditional branch + int interestingInstructionCount = 0; + for ( int i = 0; i < aMyIndex; i++ ) + { + AccInstruction accInstruction = aInstructions[ i ]; + IArmInstruction inst = accInstruction.Instruction; + // + bool involvesSP = inst.QueryInvolvement( TArmRegisterType.EArmReg_SP ); + if ( involvesSP ) + { + ++interestingInstructionCount; + } + } + + // If we have seen at least one interesting instruction then assume prologue is complete. + if ( interestingInstructionCount >= 1 ) + { + for ( int i = aMyIndex; i < count; i++ ) + { + aInstructions[ i ].Ignored = true; + } + } + } + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/Types/AccInstDataProcessing.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/Types/AccInstDataProcessing.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,185 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.BasicTypes; +using SymbianStackAlgorithmAccurate.CPU; +using SymbianStackAlgorithmAccurate.Prologue; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; +using SymbianInstructionLib.Arm.Instructions.Arm; +using SymbianInstructionLib.Arm.Instructions.Arm.DataProcessing; +using SymbianInstructionLib.Arm.Instructions.Thumb; +using SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing; + +namespace SymbianStackAlgorithmAccurate.Instructions.Types +{ + internal class AccInstDataProcessing : AccInstruction + { + #region Constructors + public AccInstDataProcessing( IArmInstruction aInstruction ) + : base( aInstruction ) + { + System.Diagnostics.Debug.Assert( base.Instruction.AIGroup == TArmInstructionGroup.EGroupDataProcessing ); + } + #endregion + + #region API + internal override void Process( ArmPrologueHelper aProlog ) + { + IArmInstruction instruction = base.Instruction; + + // Only unconditional instructions are handled + if ( instruction.AIConditionCode == TArmInstructionCondition.AL ) + { + // Two heuristically observed requirements: + // + // 1) It must be an immediate instruction + // 2) It must apply with source & destination registers both being SP + if ( instruction is ArmInstruction ) + { + // Aim is to detect modifications to SP (i.e. reservation of stack space) + Arm_DataProcessing armDpInst = instruction as Arm_DataProcessing; + + // 1) Must supply an immediate value + if ( armDpInst != null && armDpInst.SuppliesImmediate ) + { + // 2) Must apply to SP + if ( armDpInst.Rd == TArmRegisterType.EArmReg_SP && + armDpInst.Rn == TArmRegisterType.EArmReg_SP ) + { + uint immediate = armDpInst.Immediate; + HandleDPOperation( armDpInst.OperationType, immediate, aProlog ); + } + } + } + else if ( instruction is ThumbInstruction ) + { + Thumb_AddOrSubtract thumbDpInst = instruction as Thumb_AddOrSubtract; + + // 2) Must apply to SP + if ( thumbDpInst.Rd == TArmRegisterType.EArmReg_SP ) + { + // 1) Must supply an immediate value + if ( thumbDpInst != null && thumbDpInst.SuppliesImmediate ) + { + uint immediate = thumbDpInst.Immediate; + HandleDPOperation( thumbDpInst.OperationType, immediate, aProlog ); + } + else if ( thumbDpInst is Thumb_Add_2Regs_High ) + { + // Handle the case where one register supplies the number of + // words by which the stack pointer is incremented. Used when + // a large stack allocation is made. + } + } + } + else + { + throw new NotSupportedException( "Instruction type not supported" ); + } + } + } + #endregion + + #region Properties + public bool AppliesToSP + { + get + { + bool ret = false; + IArmInstruction instruction = base.Instruction; + + // Only unconditional instructions are handled + if ( instruction.AIConditionCode == TArmInstructionCondition.AL ) + { + // Two heuristically observed requirements: + // + // 1) It must be an immediate instruction + // 2) It must apply with source & destination registers both being SP + if ( instruction is ArmInstruction ) + { + // Aim is to detect modifications to SP (i.e. reservation of stack space) + Arm_DataProcessing armDpInst = instruction as Arm_DataProcessing; + + // 1) Must supply an immediate value + if ( armDpInst != null && armDpInst.SuppliesImmediate ) + { + // 2) Must apply to SP + if ( armDpInst.Rd == TArmRegisterType.EArmReg_SP && + armDpInst.Rn == TArmRegisterType.EArmReg_SP ) + { + ret = true; + } + } + } + else if ( instruction is ThumbInstruction ) + { + Thumb_AddOrSubtract thumbDpInst = instruction as Thumb_AddOrSubtract; + + // 2) Must apply to SP + if ( thumbDpInst.Rd == TArmRegisterType.EArmReg_SP ) + { + // 1) Must supply an immediate value + if ( thumbDpInst != null && thumbDpInst.SuppliesImmediate ) + { + ret = true; + } + else if ( thumbDpInst is Thumb_Add_2Regs_High ) + { + // Handle the case where one register supplies the number of + // words by which the stack pointer is incremented. Used when + // a large stack allocation is made. + } + } + } + } + + return ret; + } + } + #endregion + + #region Internal methods + private void HandleDPOperation( TArmDataProcessingType aType, uint aImmediate, ArmPrologueHelper aProlog ) + { + int wordsPushed = (int) aImmediate / 4; + // + switch( aType ) + { + case TArmDataProcessingType.ADD: + wordsPushed = -wordsPushed; + break; + case TArmDataProcessingType.SUB: + break; + default: + throw new NotSupportedException( "Data processing does not (yet) support instructions of type: " + aType ); + } + // + aProlog.AddToNumberOfWordsPushedOnStack( wordsPushed ); + } + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/Types/AccInstDataTransfer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/Types/AccInstDataTransfer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.BasicTypes; +using SymbianStackAlgorithmAccurate.CPU; +using SymbianStackAlgorithmAccurate.Prologue; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Registers.VFP; +using SymbianInstructionLib.Arm.Instructions.Common; +using SymbianInstructionLib.Arm.Instructions.Arm; +using SymbianInstructionLib.Arm.Instructions.Arm.DataTransfer; +using SymbianInstructionLib.Arm.Instructions.Thumb; +using SymbianInstructionLib.Arm.Instructions.Thumb.DataTransfer; + +namespace SymbianStackAlgorithmAccurate.Instructions.Types +{ + internal class AccInstDataTransfer : AccInstruction + { + #region Constructors + public AccInstDataTransfer( IArmInstruction aInstruction ) + : base( aInstruction ) + { + System.Diagnostics.Debug.Assert( base.Instruction.AIGroup == TArmInstructionGroup.EGroupDataTransfer ); + } + #endregion + + #region API + internal override void Process( ArmPrologueHelper aProlog ) + { + IArmInstruction instruction = base.Instruction; + + // Only unconditional instructions are handled + if ( instruction.AIConditionCode == TArmInstructionCondition.AL ) + { + if ( instruction is ArmInstruction ) + { + ArmInstruction armInst = (ArmInstruction) instruction; + // + if ( armInst is Arm_LoadOrStoreMultiple ) + { + Arm_LoadOrStoreMultiple lsmInstruction = (Arm_LoadOrStoreMultiple) instruction; + + // We're looking for store operations + if ( lsmInstruction.DataTransferType == TArmDataTransferType.EStore ) + { + // We're looking for LSM's that involve SP. + if ( lsmInstruction.BaseRegister == TArmRegisterType.EArmReg_SP ) + { + if ( lsmInstruction is Arm_LoadOrStoreMultiple_GP ) + { + Arm_LoadOrStoreMultiple_GP gpLsmInstruction = (Arm_LoadOrStoreMultiple_GP) lsmInstruction; + HandleDTOperation( aProlog, gpLsmInstruction.Registers ); + } + else if ( lsmInstruction is Arm_LoadOrStoreMultiple_VFP ) + { + Arm_LoadOrStoreMultiple_VFP vfpLsmInstruction = (Arm_LoadOrStoreMultiple_VFP) lsmInstruction; + HandleDTOperation( aProlog, vfpLsmInstruction.Registers ); + } + } + } + } + } + else if ( instruction is ThumbInstruction ) + { + ThumbInstruction thumbInst = (ThumbInstruction) instruction; + // + if ( thumbInst is Thumb_LoadOrStoreMultiple ) + { + // Special case that loads or stores multiple registers + Thumb_LoadOrStoreMultiple lsmThumb = (Thumb_LoadOrStoreMultiple) thumbInst; + if ( lsmThumb.DataTransferType == TArmDataTransferType.EStore && lsmThumb.Rd == TArmRegisterType.EArmReg_SP ) + { + HandleDTOperation( aProlog, lsmThumb.Registers ); + } + else + { + } + } + else if ( thumbInst is Thumb_LDR_RelativeToPC ) + { + // When the Prologue needs to establish a working stack slurry, then often + // the scratch registers are used to build up a large subtraction from SP. + HandleDTLoad( aProlog, thumbInst as Thumb_LDR_RelativeToPC ); + } + } + else + { + throw new NotSupportedException( "Instruction type not supported" ); + } + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private void HandleDTOperation( ArmPrologueHelper aProlog, TArmRegisterType[] aRegisterList ) + { + int count = aRegisterList.Length; + for ( int i = 0; i < count; i++ ) + { + TArmRegisterType register = aRegisterList[ i ]; + int push = aProlog.IncrementNumberOfWordsPushedOnStack( register ); + aProlog.OffsetValues[ register ].Value = (uint) push; + } + } + + private void HandleDTOperation( ArmPrologueHelper aProlog, TArmRegisterTypeVFP[] aRegisterList ) + { + int numberOfRegisters = aRegisterList.Length; + if ( numberOfRegisters > 0 ) + { + // The size of the register varies... but the list will be consistent. + TArmRegisterTypeVFP first = aRegisterList[ 0 ]; + // + int numberOfBitsPerRegister = ArmVectorFloatingPointUtils.RegisterSizeInBits( first ); + int numberOfBytesPerRegister = numberOfBitsPerRegister / 8; + int totalNumberOfBytes = numberOfBytesPerRegister * numberOfRegisters; + int numberOfWords = totalNumberOfBytes / 4; + // + aProlog.AddToNumberOfWordsPushedOnStack( numberOfWords ); + } + } + + private void HandleDTLoad( ArmPrologueHelper aProlog, Thumb_LoadOrStore_Immediate8 aInstruction ) + { + // E.g: + // + // LDR R0, [PC, #40] ; Load R0 from PC + 0x40 (= address of the LDR instruction + 8 + 0x40) + // + TArmRegisterType reg = aInstruction.Rd; + uint immed = aInstruction.Immediate * 4u; + + // PC = Is the program counter. Its value is used to calculate the memory + // address. Bit 1 of the PC value is forced to zero for the purpose of + // this calculation, so the address is always word-aligned. + uint pcAddress = aProlog.ProloguePC & 0xFFFFFFFC; + pcAddress = pcAddress + immed; + + // Read code value at specified address + uint value = aProlog.CodeHelper.LoadData( pcAddress ); + + // Set the register + aProlog.CPU[ reg ].Value = value; + } + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/Types/AccInstUnknown.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Instructions/Types/AccInstUnknown.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils.BasicTypes; +using SymbianStackAlgorithmAccurate.CPU; +using SymbianStackAlgorithmAccurate.Prologue; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.Arm.Registers; +using SymbianInstructionLib.Arm.Instructions.Common; +using SymbianInstructionLib.Arm.Instructions.Arm; +using SymbianInstructionLib.Arm.Instructions.Arm.DataProcessing; +using SymbianInstructionLib.Arm.Instructions.Thumb; +using SymbianInstructionLib.Arm.Instructions.Thumb.DataProcessing; + +namespace SymbianStackAlgorithmAccurate.Instructions.Types +{ + internal class AccInstUnknown : AccInstruction + { + #region Constructors + public AccInstUnknown( IArmInstruction aInstruction ) + : base( aInstruction ) + { + } + #endregion + + #region API + internal override void Process( ArmPrologueHelper aProlog ) + { + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Interfaces/IArmStackInterface.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Interfaces/IArmStackInterface.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianStackAlgorithmAccurate.Interfaces +{ + internal interface IArmStackInterface + { + uint StackBase { get; } + uint StackTop { get; } + uint StackValueAtAddress( uint aAddress ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Prologue/ArmPrologueExceptions.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Prologue/ArmPrologueExceptions.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianStackAlgorithmAccurate.Prologue +{ + internal class APESymbolNotFound : Exception + { + #region Constructors + public APESymbolNotFound( uint aAddress ) + : this( aAddress, string.Empty ) + { + } + + public APESymbolNotFound( uint aAddress, string aMessage ) + : base( aMessage ) + { + iAddress = aAddress; + } + #endregion + + #region Properties + public uint Address + { + get { return iAddress; } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "{0} [0x{1:x8}]", base.Message, iAddress ); + return ret.ToString(); + } + #endregion + + #region Data members + private readonly uint iAddress; + #endregion + } + + internal class APESymbolNotFoundCodeSegmentUnavailable : APESymbolNotFound + { + #region Constructors + public APESymbolNotFoundCodeSegmentUnavailable( uint aAddress ) + : base( aAddress ) + { + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "No code segment exists that describes the specified symbol address [0x{0:x8}]", base.Address ); + return ret.ToString(); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Prologue/ArmPrologueHelper.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Prologue/ArmPrologueHelper.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,341 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Tracer; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.Arm.Registers; +using SymbianStackAlgorithmAccurate.CPU; +using SymbianStackAlgorithmAccurate.Code; +using SymbianStackAlgorithmAccurate.Engine; +using SymbianStackAlgorithmAccurate.Interfaces; +using SymbianStackAlgorithmAccurate.Instructions; + +namespace SymbianStackAlgorithmAccurate.Prologue +{ + internal class ArmPrologueHelper + { + #region Constructors + public ArmPrologueHelper( AccurateEngine aEngine ) + { + iEngine = aEngine; + + // Make a new PC register, since we're going to manipulate it... + iPC = new ArmRegister( aEngine.CPU.PC ); + + // Create offsets + iOffsetValues.AddDefaults(); + iOffsetValues.SetAll( uint.MaxValue ); + } + #endregion + + #region API + public void Build() + { + // First, work out how many instructions we need to read from + // the code data in order to reach the current PC value. + // We currently cap this at 20 instructions. + CalculatePrologueInstructionCount(); + + // Get Prologue instructions + GetPrologueInstructions(); + + // Update iPC with Prologue starting address - needed for PC-relative + // instructions + PrepareInitialPCValue(); + + // Process the instructions until exhausted + ProcessPrologueInstructions(); + } + + public int IncrementNumberOfWordsPushedOnStack( TArmRegisterType aRegister ) + { + uint offset = (uint) iNumberOfWordsPushedOnStack * 4; + int ret = iNumberOfWordsPushedOnStack++; + iEngine.Trace( "[PLG] IncrementNumberOfWordsPushedOnStack - register: {0}, offset: 0x{1:x4}, DWORDs now on stack: {2:d2}", aRegister, offset, NumberOfWordsPushedOnStack ); + return ret; + } + + public int AddToNumberOfWordsPushedOnStack( int aExtraWords ) + { + iNumberOfWordsPushedOnStack += aExtraWords; + iEngine.Trace( "[PLG] AddToNumberOfWordsPushedOnStack - DWORDs added: {0}, prior SP adjustment: 0x{1:x8} ({2} x DWORDs), new SP adjustment: 0x{3:x8} ({4} x DWORDs)", + aExtraWords, + ( iNumberOfWordsPushedOnStack - aExtraWords ) * 4, + iNumberOfWordsPushedOnStack - aExtraWords, + iNumberOfWordsPushedOnStack * 4, + iNumberOfWordsPushedOnStack + ); + // + return iNumberOfWordsPushedOnStack; + } + #endregion + + #region Properties + public int PrologueInstructionCount + { + get + { + int ret = iPrologueInstructionCount; + // + if ( ret > KMaxPrologueInstructionCount ) + { + ret = KMaxPrologueInstructionCount; + iEngine.Trace( "[PLG] Capping the amount of Prologue instructions to read to: " + ret ); + } + // + return ret; + } + set + { + iPrologueInstructionCount = value; + } + } + + public string FunctionName + { + get { return iFunctionName; } + } + + public TArmInstructionSet FunctionInstructionSet + { + get + { + TArmInstructionSet ret = TArmInstructionSet.EARM; + // + if ( ( FunctionStartingAddress & 0x1 ) == 0x1 ) + { + ret = TArmInstructionSet.ETHUMB; + } + // + return ret; + } + } + + public uint FunctionStartingAddress + { + get { return iFunctionStartAddress; } + } + + public uint FunctionStartingAddressWithoutType + { + get { return iFunctionStartAddress & KInstructionSetMask; } + } + + public uint FunctionOffsetToPC + { + get + { + uint funcAddrWithoutInstructionSetType = FunctionStartingAddressWithoutType; + uint offset = iPC - funcAddrWithoutInstructionSetType; + return offset; + } + } + + public ArmRegister ProloguePC + { + get { return iPC; } + } + + public int NumberOfWordsPushedOnStack + { + get { return iNumberOfWordsPushedOnStack; } + set { iNumberOfWordsPushedOnStack = value; } + } + #endregion + + #region Internal methods + private void CalculatePrologueInstructionCount() + { + DbgViewSymbol symbolView = iEngine.DebugEngineView.Symbols; + + // Get the PC and try to match it to a function + SymbolCollection collection = null; + Symbol symbol = symbolView.Lookup( iPC, out collection ); + if ( symbol != null ) + { + iFunctionStartAddress = symbol.Address; + iFunctionName = symbol.Name; + // + uint offset = FunctionOffsetToPC; + uint instructionSize = SingleInstructionSize; + uint prologueInstructionCount = ( offset / instructionSize ); + // + iEngine.Trace( "[PLG] Prologue function: 0x{0:x8} = {1} [+{2:x4}], {3} instructions", iPC.Value, iFunctionName, offset, PrologueInstructionCount ); + PrologueInstructionCount = (int) prologueInstructionCount; + } + else + { + // We could not locate the symbol for the corresponding program counter address. + // In this situation, there's nothing we can do - if we cannot work out the offset + // within the function, then we cannot identify how many Prologue instructions to + // attempt to read. + // + // If the symbol was not found because no code segment claims ownership of this address + // then that might indicate premature dll unload or bad crash data (missing code segments) + if ( collection == null ) + { + throw new APESymbolNotFoundCodeSegmentUnavailable( iPC ); + } + else + { + throw new APESymbolNotFound( iPC, string.Format( "Code segment \'{0}\' should describe symbol, but none was found for requested program counter address", collection.FileName ) ); + } + } + } + + private void GetPrologueInstructions() + { + TArmInstructionSet instSet = CPU.CurrentProcessorMode; + uint address = FunctionStartingAddressWithoutType; + + // Let's get unadulterated instruction counts + int instCount = iPrologueInstructionCount; + if ( address > 0 && instCount > 0 ) + { + iInstructions = CodeHelper.LoadInstructions( address, instCount, instSet ); + } + else + { + iInstructions = new AccInstructionList(); + } + + // Verify that we have the expected number of instructions. + // If, for some reason, the code provider does not supply + // any Prologue instructions, then we should bail out. + int actual = iInstructions.Count; + if ( actual != instCount ) + { + throw new Exception( string.Format( "Prologue instructions unavailable or insufficient @ address: 0x{0:x8} - expected: {1}, received: {2}", FunctionStartingAddressWithoutType, instCount, actual ) ); + } + + // Since we fetch all the instructions from a function (leading up to the current address) + // we may have lots more instructions that we'd ideally normally expect to see form part + // of the function prologue. Normally, we cap the prologue instruction count at ~19 instructions, + // so therefore we should disable any instructions beyond this maximum. + for ( int i = KMaxPrologueInstructionCount - 1; i < iInstructions.Count; i++ ) + { + iInstructions[ i ].Ignored = true; + } + + // Run the instructions through the pre-filter. We tell the + // instruction list how many instructions through the current function + // we are because this helps to identify whether a branch has been + // executed as the last instruction, or whether we artificially limited + // the preamble, in which case the branch was "probably" not taken. + iInstructions.Prefilter( iPrologueInstructionCount ); + iInstructions.DebugPrint( iEngine as ITracer ); + } + + private void PrepareInitialPCValue() + { + // Update the program counter so that we skip past the start of + // the function. According to Tom G, this is two instructions past + // the function entry address + uint newPC = FunctionStartingAddress; + newPC += (uint) ( 2 * SingleInstructionSize ); + + // Zero the non-address bits for sanity + uint clearBitMask = (uint) ( SingleInstructionSize - 1 ); + newPC &= ~clearBitMask; + iPC.Value = newPC; + + string sym = iEngine.DebugEngineView.Symbols.PlainText[ iPC.Value ]; + iEngine.Trace( "[PLG] PrepareInitialPCValue - new PC value: 0x{0:x8} = {1}", iPC.Value, sym ); + } + + private void ProcessPrologueInstructions() + { + uint sp = iEngine.CPU[ TArmRegisterType.EArmReg_SP ]; + iEngine.Trace( "[PLG] ProcessPrologueInstructions - initial PC: 0x{0:x8}, SP: 0x{1:x8}", iPC.Value, sp ); + + // We've got the necessary instructions so continue as normal... + int actual = iInstructions.Count; + while ( actual > 0 ) + { + // Get instruction + AccInstruction inst = iInstructions.Deque(); + + // Don't process any ignored instructions + if ( inst.Ignored == false ) + { + iEngine.Trace( "[PLG] ProcessPrologueInstructions - PC: 0x{0:x8}, SP: 0x{1:x8}, I: {2}", iPC.Value, sp + ( iNumberOfWordsPushedOnStack * 4 ), inst.ToString() ); + iEngine.SetIndent( 1 ); + + // Process it to update offsets & register values + inst.Process( this ); + + // Update Prologue program counter value + iPC.Value += SingleInstructionSize; + + // Finished with indentation + iEngine.SetIndent( 0 ); + } + + // Update count + actual = iInstructions.Count; + } + } + #endregion + + #region Internal properties + internal ArmCpu CPU + { + get { return iEngine.CPU; } + } + + internal ArmCodeHelper CodeHelper + { + get { return iEngine.CodeHelper; } + } + + internal ArmRegisterCollection OffsetValues + { + get { return iOffsetValues; } + } + + private uint SingleInstructionSize + { + get + { + uint size = ArmCpuUtils.InstructionSize( CPU.CurrentProcessorMode ); + return size; + } + } + #endregion + + #region Internal constants + private const int KMaxPrologueInstructionCount = 19; + private const uint KInstructionSetMask = 0xFFFFFFFE; + #endregion + + #region Data members + private readonly AccurateEngine iEngine; + private readonly ArmRegister iPC; + private int iPrologueInstructionCount = 0; + private string iFunctionName = string.Empty; + private uint iFunctionStartAddress = 0; + private int iNumberOfWordsPushedOnStack = 0; + private AccInstructionList iInstructions = new AccInstructionList(); + private ArmRegisterCollection iOffsetValues = new ArmRegisterCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "7b309b78-fbcb-4537-bf15-22f043496fdc" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Stack/ArmStackFrame.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/Stack/ArmStackFrame.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStackAlgorithmAccurate.Prologue; +using SymbianStructuresLib.Arm.Registers; + +namespace SymbianStackAlgorithmAccurate.Stack +{ + internal class ArmStackFrame + { + #region Constructors + internal ArmStackFrame( TArmRegisterType aRegister ) + { + iAssociatedRegister = aRegister; + } + + internal ArmStackFrame( ArmPrologueHelper aPrologEntry ) + { + iPrologEntry = aPrologEntry; + } + #endregion + + #region API + #endregion + + #region Properties + public bool IsStackBasedEntry + { + get { return iAddress != 0; } + } + + public bool IsRegisterBasedEntry + { + get { return !IsStackBasedEntry; } + } + + public uint Address + { + get { return iAddress; } + set { iAddress = value; } + } + + public uint Data + { + get { return iData; } + set { iData = value; } + } + + public TArmRegisterType AssociatedRegister + { + get { return iAssociatedRegister; } + set { iAssociatedRegister = value; } + } + #endregion + + #region Internal properties + internal ArmPrologueHelper PrologEntry + { + get { return iPrologEntry; } + } + #endregion + + #region Data members + private ArmPrologueHelper iPrologEntry = null; + private uint iAddress = 0; + private uint iData = 0; + private TArmRegisterType iAssociatedRegister = TArmRegisterType.EArmReg_Other; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/SymbianStackAlgorithmAccurate.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/SymbianStackAlgorithmAccurate.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,133 @@ + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {EF406EC5-04F3-45CA-BD01-686ACBD91C49} + Library + Properties + SymbianStackAlgorithmAccurate + SymbianStackAlgorithmAccurate.plugin + + + 2.0 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + + + {A041EDFE-A120-4100-A0A6-FB1984D80815} + SymbianCodeLib + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {EB93FD74-17C6-44B2-8384-4D58DC210F77} + SymbianInstructionLib + + + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3} + SymbianStackLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/SymbianStackAlgorithmAccurate.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Accurate/SymbianStackAlgorithmAccurate.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + en-US + false + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Basic/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Basic/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion( "1.0.*" )] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign( false )] +[assembly: AssemblyKeyFile( "" )] +[assembly: AssemblyKeyName( "" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Basic/StackAlgBasic.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Basic/StackAlgBasic.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,212 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Threading; +using System.ComponentModel; +using System.Collections.Generic; +using System.IO; +using SymbianUtils.DataBuffer.Entry; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Utilities; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.Engine; +using SymbianStackLib.Data.Source; +using SymbianStackLib.Data.Output; +using SymbianStackLib.Data.Output.Entry; +using SymbianStackLib.Interfaces; +using SymbianStackLib.Algorithms; + +namespace SymbianStackAlgorithmBasic +{ + internal class StackAlgBasic : StackAlgorithm + { + #region Constructors + public StackAlgBasic( IStackAlgorithmManager aManager, IStackAlgorithmObserver aObserver ) + : base( aManager, aObserver ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StackAlgorithm + public override bool IsAvailable() + { + // This is always available + return true; + } + + public override string Name + { + get { return "Basic"; } + } + + public override int Priority + { + get { return 200; } + } + #endregion + + #region From AsyncReaderBase + protected override void PerformOperation() + { + // Get the source data we need to reconstruct and signal we're about to start + StackSourceData sourceData = base.SourceData; + + // Get the output data sink + StackOutputData outputData = base.OutputData; + outputData.Clear(); + outputData.AlgorithmName = Name; + + // Get the address range of the stack pointer data + AddressRange pointerRange = base.Engine.AddressInfo.StackPointerRange; + AddressRange pointerRangeExtended = base.Engine.AddressInfo.StackPointerRangeWithExtensionArea; + + // Indicates if we added LR and PC to the call stack + bool addedLRandPC = false; + + // Get registers + ArmRegisterCollection regs = base.Engine.Registers; + + foreach ( DataBufferUint sourceEntry in sourceData.GetUintEnumerator() ) + { + // Check if it is within the stack domain, taking into account + // our extended range + if ( pointerRangeExtended.Contains( sourceEntry.Address ) ) + { + StackOutputEntry outputEntry = new StackOutputEntry( sourceEntry.Address, sourceEntry.Uint ); + + // Is it the element tht corresponds to the current value of SP? + bool isCurrentSPEntry = ( outputEntry.AddressRange.Contains( base.Engine.AddressInfo.Pointer ) ); + outputEntry.IsCurrentStackPointerEntry = isCurrentSPEntry; + + // Is it within the pure 'stack pointer' address range? + bool outsidePureStackPointerRange = !pointerRange.Contains( sourceEntry.Address ); + outputEntry.IsOutsideCurrentStackRange = outsidePureStackPointerRange; + + // These are never accurate, but neither are they ghosts + outputEntry.IsAccurate = false; + outputEntry.IsGhost = false; + + // Save entry + EmitElement( outputEntry ); + + // If we're inside the stack address range, then poke in the PC and LR values + if ( isCurrentSPEntry ) + { + System.Diagnostics.Debug.Assert( !addedLRandPC ); + addedLRandPC = AddLRAndPC(); + } + } + else + { + // Nope, ignore it... + } + + NotifyEvent( TEvent.EReadingProgress ); + ++iDWordIndex; + } + + // If the stack overflowed, then SP might be outside of the stack range. Therefore + // LR and PC will not be added yet. + if ( !addedLRandPC ) + { + AddLRAndPC(); + } + } + + protected override long Size + { + get + { + int bytes = base.SourceData.Count; + int dWords = bytes / 4; + return dWords; + } + } + + protected override long Position + { + get + { + return iDWordIndex; + } + } + #endregion + + #region Internal methods + private bool AddLRAndPC() + { + bool addedLRandPC = false; + // + ArmRegisterCollection regs = base.Engine.Registers; + + // If we're inside the stack address range, then poke in the PC and LR values + if ( regs.Count > 0 ) + { + // Working bottom up, so LR should go on the stack first + if ( regs.Contains( TArmRegisterType.EArmReg_LR ) ) + { + ArmRegister regLR = regs[ TArmRegisterType.EArmReg_LR ]; + + StackOutputEntry entryLR = new StackOutputEntry( 0, regLR.Value ); + entryLR.IsRegisterBasedEntry = true; + entryLR.IsOutsideCurrentStackRange = true; + entryLR.AssociatedRegister = regLR.RegType; + EmitElement( entryLR ); + } + + // Then the PC... + if ( regs.Contains( TArmRegisterType.EArmReg_PC ) ) + { + ArmRegister regPC = regs[ TArmRegisterType.EArmReg_PC ]; + + StackOutputEntry entryPC = new StackOutputEntry( 0, regPC.Value ); + entryPC.IsRegisterBasedEntry = true; + entryPC.IsOutsideCurrentStackRange = true; + entryPC.AssociatedRegister = regPC.RegType; + EmitElement( entryPC ); + } + + // Even if they weren't added, we at least attempted to addd them + addedLRandPC = true; + } + + return addedLRandPC; + } + + private void EmitElement( StackOutputEntry aEntry ) + { + // Flush entry + base.StackObserver.StackBuildingElementConstructed( this, aEntry ); + } + #endregion + + #region Data members + private int iDWordIndex = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Basic/SymbianStackAlgorithmBasic.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Basic/SymbianStackAlgorithmBasic.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,76 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20} + Library + Properties + SymbianStackAlgorithmBasic + SymbianStackAlgorithmBasic.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3} + SymbianStackLib + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Heuristic/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Heuristic/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion( "1.0.*" )] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign( false )] +[assembly: AssemblyKeyFile( "" )] +[assembly: AssemblyKeyName( "" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Heuristic/StackAlgHeuristic.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Heuristic/StackAlgHeuristic.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,206 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Threading; +using System.ComponentModel; +using System.Collections.Generic; +using System.IO; +using SymbianUtils.DataBuffer.Entry; +using SymbianStructuresLib.Arm.Registers; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Utilities; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.Engine; +using SymbianStackLib.Data.Source; +using SymbianStackLib.Data.Output; +using SymbianStackLib.Data.Output.Entry; +using SymbianStackLib.Interfaces; +using SymbianStackLib.Algorithms; + +namespace SymbianStackAlgorithmHeuristic +{ + internal class StackAlgHeuristic : StackAlgorithm + { + #region Constructors + public StackAlgHeuristic( IStackAlgorithmManager aManager, IStackAlgorithmObserver aObserver ) + : base( aManager, aObserver ) + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From StackAlgorithm + public override string Name + { + get { return "Heuristic"; } + } + + public override int Priority + { + get { return 100; } + } + #endregion + + #region From AsyncReaderBase + protected override void PerformOperation() + { + // Get the source data we need to reconstruct and signal we're about to start + StackSourceData sourceData = base.SourceData; + + // Get the output data sink + StackOutputData outputData = base.OutputData; + outputData.Clear(); + outputData.AlgorithmName = Name; + + // Get the address range of the stack pointer data + AddressRange pointerRange = base.Engine.AddressInfo.StackPointerRange; + AddressRange pointerRangeExtended = base.Engine.AddressInfo.StackPointerRangeWithExtensionArea; + + // Indicates if we added LR and PC to the call stack + bool addedLRandPC = false; + + // Get registers + ArmRegisterCollection regs = base.Engine.Registers; + + foreach( DataBufferUint sourceEntry in sourceData.GetUintEnumerator() ) + { + // Check if it is within the stack domain, taking into account + // our extended range + if ( pointerRangeExtended.Contains( sourceEntry.Address ) ) + { + StackOutputEntry outputEntry = new StackOutputEntry( sourceEntry.Address, sourceEntry.Uint, base.DebugEngineView ); + + // Is it the element tht corresponds to the current value of SP? + bool isCurrentSPEntry = ( outputEntry.AddressRange.Contains( base.Engine.AddressInfo.Pointer ) ); + outputEntry.IsCurrentStackPointerEntry = isCurrentSPEntry; + + // Is it within the pure 'stack pointer' address range? + bool outsidePureStackPointerRange = !pointerRange.Contains( sourceEntry.Address ); + outputEntry.IsOutsideCurrentStackRange = outsidePureStackPointerRange; + + // These are never accurate, but neither are they ghosts + outputEntry.IsAccurate = false; + outputEntry.IsGhost = false; + + // Save entry + EmitElement( outputEntry ); + + // If we're inside the stack address range, then poke in the PC and LR values + if ( isCurrentSPEntry ) + { + System.Diagnostics.Debug.Assert( !addedLRandPC ); + addedLRandPC = AddLRAndPC(); + } + } + else + { + // Nope, ignore it... + } + + NotifyEvent( TEvent.EReadingProgress ); + ++iDWordIndex; + } + + // If the stack overflowed, then SP might be outside of the stack range. Therefore + // LR and PC will not be added yet. + if ( !addedLRandPC ) + { + AddLRAndPC(); + } + } + + protected override long Size + { + get + { + int bytes = base.SourceData.Count; + int dWords = bytes / 4; + return dWords; + } + } + + protected override long Position + { + get + { + return iDWordIndex; + } + } + #endregion + + #region Internal methods + private bool AddLRAndPC() + { + bool addedLRandPC = false; + // + ArmRegisterCollection regs = base.Engine.Registers; + + // If we're inside the stack address range, then poke in the PC and LR values + if ( regs.Count > 0 ) + { + // Working bottom up, so LR should go on the stack first + if ( regs.Contains( TArmRegisterType.EArmReg_LR ) ) + { + ArmRegister regLR = regs[ TArmRegisterType.EArmReg_LR ]; + + StackOutputEntry entryLR = new StackOutputEntry( 0, regLR.Value, base.DebugEngineView ); + entryLR.IsRegisterBasedEntry = true; + entryLR.IsOutsideCurrentStackRange = true; + entryLR.AssociatedRegister = regLR.RegType; + EmitElement( entryLR ); + } + + // Then the PC... + if ( regs.Contains( TArmRegisterType.EArmReg_PC ) ) + { + ArmRegister regPC = regs[ TArmRegisterType.EArmReg_PC ]; + + StackOutputEntry entryPC = new StackOutputEntry( 0, regPC.Value, base.DebugEngineView ); + entryPC.IsRegisterBasedEntry = true; + entryPC.IsOutsideCurrentStackRange = true; + entryPC.AssociatedRegister = regPC.RegType; + EmitElement( entryPC ); + } + + // Even if they weren't added, we at least attempted to addd them + addedLRandPC = true; + } + + return addedLRandPC; + } + + private void EmitElement( StackOutputEntry aEntry ) + { + // Flush entry + base.StackObserver.StackBuildingElementConstructed( this, aEntry ); + } + #endregion + + #region Data members + private int iDWordIndex = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Heuristic/SymbianStackAlgorithmHeuristic.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Plugins/Heuristic/SymbianStackAlgorithmHeuristic.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,76 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {19F87778-8320-42AC-BD00-FD23FC4D2828} + Library + Properties + SymbianStackAlgorithmHeuristic + SymbianStackAlgorithmHeuristic.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3} + SymbianStackLib + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Prefixes/StackPrefixManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Prefixes/StackPrefixManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,229 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using SymbianUtils; +using SymbianParserLib.Engine; +using SymbianParserLib.Elements; +using SymbianStructuresLib.CodeSegments; +using SymbianStackLib.Engine; + +namespace SymbianStackLib.Prefixes +{ + public class StackPrefixManager + { + #region Constructors + internal StackPrefixManager( StackEngine aEngine ) + { + iEngine = aEngine; + // + PreparePrefixes_CodeSegment(); + PreparePrefixes_Pointer(); + // + iParserEntries.Add( iPrefixEngine_Pointer ); + iParserEntries.Add( iPrefixEngine_CodeSegment ); + } + #endregion + + #region API + public void SetCustomPointer( string aPrefix ) + { + // Find any existing custom entry and remove it + int paraCount = iPrefixEngine_Pointer.Count; + System.Diagnostics.Debug.Assert( paraCount >= 1 ); + if ( paraCount > 1 ) + { + iPrefixEngine_Pointer.RemoveRange( 1 ); + } + + string prefixText = aPrefix.Trim(); + if ( prefixText != string.Empty ) + { + ParserParagraph para = new ParserParagraph( "Dynamic_Pointer" ); + // + prefixText += "%08x"; + // + ParserLine l1 = ParserLine.NewSymFormat( prefixText ); + l1.SetTargetProperty( iEngine.AddressInfo, "Pointer" ); + para.Add( l1 ); + iPrefixEngine_Pointer.Add( para ); + } + } + + public void SetCustomCodeSegment( string aPrefix ) + { + // Find any existing custom entry and remove it + int paraCount = iPrefixEngine_CodeSegment.Count; + System.Diagnostics.Debug.Assert( paraCount >= 1 ); + if ( paraCount > 1 ) + { + iPrefixEngine_CodeSegment.RemoveRange( 1 ); + } + + string prefixText = aPrefix.Trim(); + if ( prefixText != string.Empty ) + { + ParserParagraph para = new ParserParagraph( "Dynamic_CodeSegment" ); + // + prefixText += "%08x-%08x %S"; + // + ParserLine l1 = ParserLine.NewSymFormat( prefixText ); + l1.SetTargetMethod( this, "TryToParseCodeSegment" ); + l1.DisableWhenComplete = false; + para.Add( l1 ); + para.DisableWhenComplete = false; + iPrefixEngine_CodeSegment.Add( para ); + } + } + #endregion + + #region Properties + public string CodeSegment + { + get + { + string ret = string.Empty; + // + int count = iPrefixEngine_CodeSegment.Count; + if ( count > 0 ) + { + ParserParagraph para = iPrefixEngine_CodeSegment[ count - 1 ]; + count = para.Count; + if ( count > 0 ) + { + ParserLine line = para[ count - 1 ]; + // + if ( line.LineType == ParserLine.TLineType.ELineTypeSimpleStringMatch ) + { + ret = line.OriginalValue; + } + } + } + // + return ret; + } + } + + public string Pointer + { + get + { + string ret = "CurrentSP - "; + // + int count = iPrefixEngine_Pointer.Count; + if ( count > 0 ) + { + ParserParagraph para = iPrefixEngine_Pointer[ count - 1 ]; + count = para.Count; + if ( count > 0 ) + { + ParserLine line = para[ count - 1 ]; + // + if ( line.LineType == ParserLine.TLineType.ELineTypeSimpleStringMatch ) + { + ret = line.OriginalValue; + } + } + } + // + return ret; + } + } + #endregion + + #region Internal methods + internal void TryAgainstPrefixes( string aLine ) + { + string line = aLine; + foreach ( ParserEngine engine in iParserEntries ) + { + if ( engine.OfferLine( ref line ) ) + { + break; + } + } + } + + private void TryToParseCodeSegment( ParserLine aLine ) + { + string line = aLine.GetCurrentLine(); + CodeSegDefinition codeSegDef = CodeSegDefinitionParser.ParseDefinition( line ); + if ( codeSegDef != null ) + { + iEngine.CodeSegments.Add( codeSegDef ); + } + } + + private void PreparePrefixes_Pointer() + { + ParserParagraph para = new ParserParagraph( "Fixed_Pointer" ); + // + ParserLine l1 = ParserLine.NewSymFormat( "CurrentSP - 0x%08x" ); + l1.SetTargetProperty( iEngine.AddressInfo, "Pointer" ); + // + ParserLine l2 = ParserLine.NewSymFormat( "CurrentSP - %08x" ); + l2.SetTargetProperty( iEngine.AddressInfo, "Pointer" ); + // + ParserLine l3 = ParserLine.NewSymFormat( "CurrentSP: 0x%08x" ); + l3.SetTargetProperty( iEngine.AddressInfo, "Pointer" ); + // + ParserLine l4 = ParserLine.NewSymFormat( "CurrentSP: %08x" ); + l4.SetTargetProperty( iEngine.AddressInfo, "Pointer" ); + // + ParserLine l5 = ParserLine.NewSymFormat( "r12=%08x %08x %08x %08x" ); + l5[1].SetTargetProperty( iEngine.AddressInfo, "Pointer" ); + // + ParserLine l6 = ParserLine.NewSymFormat( "Current stack pointer: 0x%08x" ); + l6.SetTargetProperty( iEngine.AddressInfo, "Pointer" ); + // + ParserLine l7 = ParserLine.NewSymFormat( "sp: 0x%08x" ); + l7.SetTargetProperty( iEngine.AddressInfo, "Pointer" ); + // + ParserLine l8 = ParserLine.NewSymFormat( "sp: %08x" ); + l8.SetTargetProperty( iEngine.AddressInfo, "Pointer" ); + // + para.Add( l1, l2, l3, l4, l5, l6, l7, l8 ); + // + iPrefixEngine_Pointer.Add( para ); + } + + private void PreparePrefixes_CodeSegment() + { + ParserParagraph para = new ParserParagraph( "Fixed_CodeSegment" ); + // + ParserLine l1 = ParserLine.NewSymFormat( "%08x-%08x %S" ); + l1.SetTargetMethod( this, "TryToParseCodeSegment" ); + l1.DisableWhenComplete = false; + // + para.Add( l1 ); + para.DisableWhenComplete = false; + // + iPrefixEngine_CodeSegment.Add( para ); + } + #endregion + + #region Constants + #endregion + + #region Data members + private readonly StackEngine iEngine; + private ParserEngine iPrefixEngine_Pointer = new ParserEngine(); + private ParserEngine iPrefixEngine_CodeSegment = new ParserEngine(); + private List iParserEntries = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/StackElement.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/StackElement.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Text; +using SymbolLib; + +namespace StackLib +{ + public class StackElement + { + public class StackElementDescriptorInfo + { + #region Public enumerations + public enum TType + { + EBuf + } + #endregion + + #region API + public string AsString( out int aNumberOfLines, bool aPostfixInfo ) + { + aNumberOfLines = 1; + StringBuilder sb = new StringBuilder(); + // + int count = iDescriptorCharacters.Count; + for(int i=0; i '~' ) + { + sb.Append( KReplacementForUnprintableCharacters ); + } + else + { + sb.Append( character ); + } + + if ( sb.Length > 0 && ((sb.Length % KNumberOfCharactersPerLine ) == 0)) + { + sb.Append( System.Environment.NewLine ); + ++aNumberOfLines; + } + } + + if ( aPostfixInfo ) + { + string header = System.Environment.NewLine + System.Environment.NewLine + "[Len: " + iLength.ToString() + ", max: " + iMaxLength.ToString() + "]"; + aNumberOfLines += 2; + sb.Append( header ); + } + // + return sb.ToString(); + } + #endregion + + #region Internal constants + private const int KNumberOfCharactersPerLine = 64; + private const char KReplacementForUnprintableCharacters = '.'; + #endregion + + #region Data members + public TType iType; + public long iLength; + public long iMaxLength; + public int iByteWidth = 1; + public ArrayList iDescriptorCharacters = new ArrayList( 100 ); + #endregion + } + + #region Constructors & destructor + public StackElement( long aAddress, long aData, string aCharacterisedData ) + { + iAddress = aAddress; + iData = aData; + iCharacterisedData = aCharacterisedData; + iSymbol = null; + } + #endregion + + #region Properties + public long Address + { + get { return iAddress; } + set { iAddress = value; } + } + + public long Data + { + get { return iData; } + set { iData = value; } + } + + public string CharacterisedData + { + get { return iCharacterisedData; } + } + + public GenericSymbol Symbol + { + get { return iSymbol; } + set { iSymbol = value; } + } + + public bool IsDescriptor + { + get { return iDescriptorInfo != null; } + } + + public StackElementDescriptorInfo DescriptorInfo + { + get { return iDescriptorInfo; } + set { iDescriptorInfo = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + string fixedElement = "= " + iData.ToString("x8") + " " + iCharacterisedData + " "; + if (iSymbol != null) + { + return fixedElement + iSymbol.Symbol; + } + return fixedElement; + } + #endregion + + #region Data members + private GenericSymbol iSymbol; + private long iAddress; + private long iData; + private string iCharacterisedData; + private StackElementDescriptorInfo iDescriptorInfo = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/SymbianStackLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/SymbianStackLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,175 @@ + + + Local + 9.0.30729 + 2.0 + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3} + Debug + AnyCPU + + + + + SymbianStackLib + + + JScript + Grid + IE50 + false + Library + SymbianStackLib + OnBuildSuccess + + + + + + + 2.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + bin\Debug\ + false + 285212672 + false + + + DEBUG;TRACE + + + true + 4096 + false + + + false + false + false + false + 4 + full + prompt + + + bin\Release\ + false + 285212672 + false + + + TRACE + + + false + 4096 + false + + + true + false + false + false + 4 + none + prompt + + + + System + + + System.Data + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1} + SymbianParserLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + Code + + + + + + + + + + + + + + True + True + LibResources.resx + + + Code + + + Code + + + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + + + ResXFileCodeGenerator + LibResources.Designer.cs + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/SymbianStackLib.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/SymbianStackLib.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,69 @@ + + + 7.10.6030 + Debug + AnyCPU + D:\Programming\Visual Studio Projects\SourceLibrary\SourceLibrary\bin\Debug\;C:\USERS\Visual Studio Projects\SourceLibrary\SourceLibrary\bin\Debug\;D:\My Documents\Visual Studio Projects\SourceLibrary\SourceLibrary\bin\Debug\;C:\USERS\Visual Studio Projects\Libs\SourceLibrary\SourceLibrary\bin\Debug\;C:\Documents and Settings\PC User\My Documents\Visual Studio Projects\Libs\SourceLibrary\SourceLibrary\bin\Debug\ + + + + + 0 + ProjectFiles + 0 + + + + + + + + + + + en-US + false + + + false + false + false + false + false + + + Project + + + + + + + + + + + false + + + false + false + false + false + false + + + Project + + + + + + + + + + + false + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Utilities/BinaryFileToStackFormatConverter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStackLib/Utilities/BinaryFileToStackFormatConverter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,80 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianUtils.Utilities; + +namespace SymbianStackLib.Utilities +{ + public class BinaryFileToStackFormatConverter : AsyncBinaryFileReader + { + #region Constructors + public BinaryFileToStackFormatConverter( string aFileName ) + : base( aFileName ) + { + } + #endregion + + #region API + public void Convert() + { + base.AsyncRead(); + } + #endregion + + #region Properties + public string ConvertedData + { + get + { + return iOutput.ToString(); + } + } + #endregion + + #region From AsyncTextReader + protected override void HandleReadBytes( byte[] aData ) + { + foreach( byte b in aData ) + { + iBytes.Enqueue( b ); + } + + string data = RawByteUtility.ConvertDataToText( iBytes, false, ref iCurrentAddress ); + iOutput.Append( data ); + } + + protected override void HandleReadCompleted() + { + base.HandleReadCompleted(); + + string data = RawByteUtility.ConvertDataToText( iBytes, true, ref iCurrentAddress ); + iOutput.Append( data ); + } + #endregion + + #region Data members + private uint iCurrentAddress = 0; + private StringBuilder iOutput = new StringBuilder(); + private Queue iBytes = new Queue(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Disassembly/IArmDisassemblyTool.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Disassembly/IArmDisassemblyTool.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; + +namespace SymbianStructuresLib.Arm.Disassembler +{ + public interface IArmDisassembler + { + string Disassemble( IArmInstruction aInstruction ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Exceptions/ArmExceptions.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Exceptions/ArmExceptions.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianStructuresLib.Arm.Exceptions +{ + public enum TArmExceptionVectorLocation : uint + { + ENormal = 0x00000000, + EHigh = 0xFFFF0000 + } + + public enum TArmExceptionType + { + EUnknown = -1, + ENone = 0, + EHaltingDebug, + ESecureMonitorCall, + EAsyncDataAbort, + EJazelle, + EProcessorReset, + EUndefinedInstruction, + ESVC, + EPrefetchAbortOrSWBreakpoint, + ESyncDataAbortOrSWWatchpoint, + EGeneric, + EIRQ, + EFIQ + } + + public enum TArmExceptionVector + { + EReset = 0x00000000, + EUndefinedInstruction = 0x00000004, + ESVC = 0x00000008, + EPrefetchAbort = 0x0000000C, + EDataAbort = 0x00000010, + EIRQ = 0x00000018, + EFIQ = 0x0000001C + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmDataProcessingType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmDataProcessingType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; + +namespace SymbianStructuresLib.Arm.Instructions +{ + // NB: Do not reorder these + public enum TArmDataProcessingType + { + EUndefined = -1, + // + AND = 0, // Logical AND + EOR, // Logical EOR + SUB, // Subtract + RSB, // Reverse Subtract + ADD, // Add + ADC, // Add with Carry + SBC, // Subtract with Carry + RSC, // Reverse Subtract with Carry + TST, // Test + TEQ, // Test Equivalence + CMP, // Compare + CMN, // Compare Negative + ORR, // Logical OR + MOV, // Move + BIC, // Logical Bit Clear + MVN, // Move Not + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmDataTransferType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmDataTransferType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; + +namespace SymbianStructuresLib.Arm.Instructions +{ + // NB: Do not reorder these + public enum TArmDataTransferType + { + EUndefined = -1, + // + EStore = 0, + ELoad + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmInstructionAddressingMode.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmInstructionAddressingMode.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianStructuresLib.Arm.Instructions +{ + public enum TArmInstructionAddressingMode + { + EIncrementAfter = 01, // b01 + EIncrementBefore = 03, // b11 + EDecrementAfter = 00, // b00 + EDecrementBefore = 02, // b10 + } + + public enum TArmInstructionAddressingModeVFP + { + EUndefined = -1, + EUnindexed = 0, + EIncrement, + EOffsetNegative, + EDecrement, + EOffsetPositive, + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmInstructionCondition.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmInstructionCondition.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; + +namespace SymbianStructuresLib.Arm.Instructions +{ + public enum TArmInstructionCondition + { + [Description( "" )] + ENotApplicable = -1, + + [Description( "EQ" )] + EQ = 0, // 0000 EQ Equal Z set + + [Description( "NE" )] + NE = 1, // 0001 NE Not equal Z clear + + [Description( "CS" )] + CS = 2, // 0010 CS/HS Carry set/unsigned higher or same C set + + [Description( "CC" )] + CC = 3, // 0011 CC/LO Carry clear/unsigned lower C clear0011 CC/LO Carry clear/unsigned lower C clear + + [Description( "MI" )] + MI = 4, // 0100 MI Minus/negative N set + + [Description( "PL" )] + PL = 5, // 0101 PL Plus/positive or zero N clear + + [Description( "VS" )] + VS = 6, // 0110 VS Overflow V set + + [Description( "VC" )] + VC = 7, // 0111 VC No overflow V clear + + [Description( "HI" )] + HI = 8, // 1000 HI Unsigned higher C set and Z clear + + [Description( "LS" )] + LS = 9, // 1001 LS Unsigned lower or same C clear or Z set + + [Description( "GE" )] + GE = 10, // 1010 GE Signed greater than or equal. N set and V set, or N clear and V clear (N == V) + + [Description( "LT" )] + LT = 11, // 1011 LT Signed less than. N set and V clear, or N clear and V set (N != V) + + [Description( "GT" )] + GT = 12, // 1100 GT Signed greater than. Z clear, and either N set and V set, or N clear and V clear (Z == 0,N == V) + + [Description( "LE" )] + LE = 13, // 1101 LE Signed less than or equal. Z set, or N set and V clear, or N clear and V set (Z == 1 or N != V) + + [Description( "" )] + AL = 14, // 1110 AL Always (unconditional) - + + [Description( "" )] + EX = 15, // 1111 EX - Extension - See Condition code 0b1111 + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmInstructionGrouping.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmInstructionGrouping.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianStructuresLib.Arm.Instructions +{ + public enum TArmInstructionGroup + { + EGroupUndefined = 0, + EGroupDataProcessing, + EGroupDataTransfer, + EGroupMiscellaneous, + EGroupMedia, + EGroupBranch, + EGroupUnconditional, + EGroupStatusRegister, + EGroupExceptionGenerating, + EGroupRegisterTransfer + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmInstructionSet.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmInstructionSet.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianStructuresLib.Arm +{ + public enum TArmInstructionSet + { + EARM = 4, + ETHUMB = 2, + EJAZELLE = 0 + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmInstructionTarget.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/ArmInstructionTarget.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianStructuresLib.Arm.Instructions +{ + public enum TArmInstructionTarget + { + EDefault = 0, + ECoProcessor, + EVectorFloatingPoint, + EDSP + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/IArmInstruction.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/IArmInstruction.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.BasicTypes; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib; +using SymbianStructuresLib.Arm.Registers; + +namespace SymbianStructuresLib.Arm.Instructions +{ + public interface IArmInstruction + { + #region Properties + + /// + /// The instruction set encoding for the + /// instruction + /// + TArmInstructionSet AIType + { + get; + } + + /// + /// The instruction group/categorisation + /// + TArmInstructionGroup AIGroup + { + get; + } + + /// + /// The arm entity which the instruction operates upon + /// + TArmInstructionTarget AITarget + { + get; + } + + /// + /// The condition codes associated with the instruction + /// + TArmInstructionCondition AIConditionCode + { + get; + } + + /// + /// The raw instruction as a 32bit value + /// + SymUInt32 AIRawValue + { + get; + } + + /// + /// The raw instruction in binary notation, encoded as a string. + /// No leading prefix. + /// + string AIBinaryString + { + get; + } + + /// + /// The raw instruction in hexadecimal notation, encoded as a string. + /// No leading prefix. + /// + string AIHexString + { + get; + } + + /// + /// An optional disassembled interpretation of the instruction. + /// + string AIDisassembly + { + get; + } + + /// + /// The address from which the instruction was read. + /// + uint AIAddress + { + get; + } + + /// + /// The size, in bytes, of the instruction. E.g. ARM=4, THUMB=2 etc. + /// + uint AISize + { + get; + } + + /// + /// If the instruction was not recognised, then this returns true + /// + bool AIIsUnknown + { + get; + } + + /// + /// Get a bit by index + /// + SymBit this[ int aIndex ] + { + get; + } + + #endregion + + #region API + bool QueryInvolvement( TArmRegisterType aRegister ); + + bool QueryInvolvementAsSource( TArmRegisterType aRegister ); + + bool QueryInvolvementAsDestination( TArmRegisterType aRegister ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/IArmInstructionProvider.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Instructions/IArmInstructionProvider.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Range; +using SymbianStructuresLib.Arm; + +namespace SymbianStructuresLib.Arm.Instructions +{ + public interface IArmInstructionProvider + { + uint GetDataUInt32( uint aAddress ); + + ushort GetDataUInt16( uint aAddress ); + + bool IsInstructionAddressValid( uint aAddress ); + + bool GetInstructions( uint aAddress, TArmInstructionSet aInstructionSet, int aCount, out IArmInstruction[] aInstructions ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/CoProcessor/ArmCoProSystemControlRegisterCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/CoProcessor/ArmCoProSystemControlRegisterCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; + +namespace SymbianStructuresLib.Arm.Registers.CoProcessor +{ + public class ArmCoProSystemControlRegisterCollection : ArmRegisterCollection + { + #region Constructors + public ArmCoProSystemControlRegisterCollection() + : base( TArmRegisterBank.ETypeCoProSystemControl ) + { + AddDefaults(); + } + #endregion + + #region From ArmRegisterCollection + public override void AddDefaults() + { + base.Clear(); + // + Array items = Enum.GetValues( typeof( TArmRegisterType ) ); + foreach ( object enumEntry in items ) + { + TArmRegisterType value = (TArmRegisterType) enumEntry; + if ( value >= TArmRegisterType.EArmReg_SysCon_Control && value <= TArmRegisterType.EArmReg_SysCon_Control ) + { + Add( value, 0 ); + } + } + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/EmbeddedTrace/ArmETRegisterCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/EmbeddedTrace/ArmETRegisterCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,88 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; + +namespace SymbianStructuresLib.Arm.Registers.EmbeddedTrace +{ + public abstract class ArmETRegisterCollection : ArmRegisterCollection + { + #region Constructors + protected ArmETRegisterCollection( TArmRegisterBank aBank ) + : base( aBank ) + { + AddDefaults(); + } + #endregion + } + + public class ArmETMRegisterCollection : ArmETRegisterCollection + { + #region Constructors + public ArmETMRegisterCollection() + : base( TArmRegisterBank.ETypeETM ) + { + } + #endregion + + #region From ArmRegisterCollection + public override void AddDefaults() + { + base.Clear(); + // + Array items = Enum.GetValues( typeof( TArmRegisterType ) ); + foreach ( object enumEntry in items ) + { + TArmRegisterType value = (TArmRegisterType) enumEntry; + if ( value >= TArmRegisterType.EArmReg_ETM_Control && value <= TArmRegisterType.EArmReg_ETM_Id ) + { + Add( value, 0 ); + } + } + } + #endregion + } + + public class ArmETBRegisterCollection : ArmETRegisterCollection + { + #region Constructors + public ArmETBRegisterCollection() + : base( TArmRegisterBank.ETypeETM ) + { + } + #endregion + + #region From ArmRegisterCollection + public override void AddDefaults() + { + base.Clear(); + // + Array items = Enum.GetValues( typeof( TArmRegisterType ) ); + foreach ( object enumEntry in items ) + { + TArmRegisterType value = (TArmRegisterType) enumEntry; + if ( value >= TArmRegisterType.EArmReg_ETB_RamDepth && value <= TArmRegisterType.EArmReg_ETB_Id ) + { + Add( value, 0 ); + } + } + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/General/ArmRegister.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/General/ArmRegister.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,377 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Enum; + +namespace SymbianStructuresLib.Arm.Registers +{ + public class ArmRegister + { + #region Delegates & events + public delegate void ValueChangedHandler( ArmRegister aReg ); + public event ValueChangedHandler ValueChanged; + #endregion + + #region Constructors + public ArmRegister( ArmRegister aCopy ) + : this( aCopy.OriginalName, aCopy.Value ) + { + } + + public ArmRegister( string aOriginalName ) + : this( aOriginalName, 0 ) + { + } + + public ArmRegister( TArmRegisterType aType ) + : this( aType, 0 ) + { + } + + public ArmRegister( TArmRegisterType aType, uint aValue ) + : this( GetTypeName( aType ), aValue ) + { + } + + public ArmRegister( string aOriginalName, uint aValue ) + : this( GetTypeByName( aOriginalName ), aOriginalName, aValue ) + { + } + + public ArmRegister( TArmRegisterType aType, string aOriginalName, uint aValue ) + { + Value = aValue; + + // Save original name - used for UI presentation only + iOriginalName = aOriginalName; + + // First map the name to a native type (if possible) + RegType = aType; + + // Then map that type back onto a name, replacing + // what the client originally supplied. This is because + // we want to keep names consistent, e.g. R09 everwhere + // instead of R9 and R09 depending on client behaviour. + Name = GetTypeName( RegType ); + } + #endregion + + #region API + public static TArmRegisterType GetTypeByName( string aName ) + { + TArmRegisterType ret = TArmRegisterType.EArmReg_Other; + // + switch ( aName.ToUpper() ) + { + case "R0": + case "R00": + ret = TArmRegisterType.EArmReg_00; + break; + case "R1": + case "R01": + ret = TArmRegisterType.EArmReg_01; + break; + case "R2": + case "R02": + ret = TArmRegisterType.EArmReg_02; + break; + case "R3": + case "R03": + ret = TArmRegisterType.EArmReg_03; + break; + case "R4": + case "R04": + ret = TArmRegisterType.EArmReg_04; + break; + case "R5": + case "R05": + ret = TArmRegisterType.EArmReg_05; + break; + case "R6": + case "R06": + ret = TArmRegisterType.EArmReg_06; + break; + case "R7": + case "R07": + ret = TArmRegisterType.EArmReg_07; + break; + case "R8": + case "R08": + case "R8_FIQ": + case "R08_FIQ": + ret = TArmRegisterType.EArmReg_08; + break; + case "R9": + case "R09": + case "R9_FIQ": + case "R09_FIQ": + ret = TArmRegisterType.EArmReg_09; + break; + case "R10": + case "R10_FIQ": + ret = TArmRegisterType.EArmReg_10; + break; + case "R11": + case "R11_FIQ": + ret = TArmRegisterType.EArmReg_11; + break; + case "R12": + case "R12_FIQ": + ret = TArmRegisterType.EArmReg_12; + break; + case "R13": + case "R13_USR": + case "R13_FIQ": + case "R13_SVC": + case "R13_SYS": + case "R13_IRQ": + case "R13_ABT": + case "R13_UND": + case "SP": + ret = TArmRegisterType.EArmReg_SP; + break; + case "R14": + case "R14_USR": + case "R14_FIQ": + case "R14_SVC": + case "R14_IRQ": + case "R14_ABT": + case "R14_UND": + case "R14_SYS": + case "LR": + ret = TArmRegisterType.EArmReg_LR; + break; + case "R15": + case "R15_USR": + case "R15_FIQ": + case "R15_SVC": + case "R15_IRQ": + case "R15_ABT": + case "R15_UND": + case "R15_SYS": + case "PC": + ret = TArmRegisterType.EArmReg_PC; + break; + case "CPSR": + ret = TArmRegisterType.EArmReg_CPSR; + break; + case "SPSR": + case "SPSR_USR": + case "SPSR_SVC": + case "SPSR_IRQ": + case "SPSR_FIQ": + case "SPSR_ABT": + case "SPSR_UND": + case "SPSR_SYS": + ret = TArmRegisterType.EArmReg_SPSR; + break; + case "DACR": + ret = TArmRegisterType.EArmReg_DACR; + break; + case "FAR": + ret = TArmRegisterType.EArmReg_FAR; + break; + case "FSR": + ret = TArmRegisterType.EArmReg_FSR; + break; + case "CAR": + ret = TArmRegisterType.EArmReg_CAR; + break; + case "MMUID": + ret = TArmRegisterType.EArmReg_MMUID; + break; + case "MMUCR": + ret = TArmRegisterType.EArmReg_MMUCR; + break; + case "AUXCR": + ret = TArmRegisterType.EArmReg_AUXCR; + break; + case "FPEXC": + ret = TArmRegisterType.EArmReg_FPEXC; + break; + case "CTYPE": + ret = TArmRegisterType.EArmReg_CTYPE; + break; + case "EXC_CODE": + ret = TArmRegisterType.EArmReg_EXCCODE; + break; + case "EXC_PC": + ret = TArmRegisterType.EArmReg_EXCPC; + break; + + ///////////////////////////////// + // CO-PROCESSOR SYSTEM CONTROL + ///////////////////////////////// + case "SYSCON_CONTROL": + ret = TArmRegisterType.EArmReg_SysCon_Control; + break; + + ///////////////////// + // ETM + ///////////////////// + case "ETM_CONTROL": + ret = TArmRegisterType.EArmReg_ETM_Control; + break; + case "ETM_ID": + ret = TArmRegisterType.EArmReg_ETM_Id; + break; + + ///////////////////// + // ETB + ///////////////////// + case "ETB_RAM_DEPTH": + ret = TArmRegisterType.EArmReg_ETB_RamDepth; + break; + case "ETB_RAM_WIDTH": + ret = TArmRegisterType.EArmReg_ETB_RamWidth; + break; + case "ETB_STATUS": + ret = TArmRegisterType.EArmReg_ETB_Status; + break; + case "ETB_RAM_WRITE_POINTER": + ret = TArmRegisterType.EArmReg_ETB_RamWritePointer; + break; + case "ETB_TRIGGER_COUNTER": + ret = TArmRegisterType.EArmReg_ETB_TriggerCounter; + break; + case "ETB_CONTROL": + ret = TArmRegisterType.EArmReg_ETB_Control; + break; + case "ETB_ID": + ret = TArmRegisterType.EArmReg_ETB_Id; + break; + + ///////////////////// + // CATCH ALL + ///////////////////// + default: + break; + } + // + return ret; + } + + public static string GetTypeName( TArmRegisterType aType ) + { + string ret = "??"; + // + try + { + ret = EnumUtils.ToString( aType ); + } + catch ( Exception ) + { + } + // + return ret; + } + #endregion + + #region Properties + public uint Value + { + get { return iValue; } + set + { + if ( iValue != value ) + { + iValue = value; + + if ( ValueChanged != null ) + { + ValueChanged( this ); + } + } + } + } + + public string Name + { + get { return iName; } + set { iName = value; } + } + + public string OriginalName + { + get { return iOriginalName; } + } + + public string TypeName + { + get { return GetTypeName( RegType ); } + } + + public TArmRegisterType RegType + { + get { return iType; } + set { iType = value; } + } + + public ArmRegisterCollection Parent + { + get { return iParent; } + set { iParent = value; } + } + + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + #endregion + + #region Operators + public static implicit operator ArmRegister( uint aValue ) + { + return new ArmRegister( TArmRegisterType.EArmReg_Other, aValue ); + } + + public static implicit operator uint( ArmRegister aRegister ) + { + return aRegister.Value; + } + #endregion + + #region Internal methods + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + ret.AppendFormat( "{0,-12} = 0x{1:x8}", OriginalName, Value ); + // + return ret.ToString(); + } + #endregion + + #region Data members + private readonly string iOriginalName; + private uint iValue = 0; + private string iName = string.Empty; + private TArmRegisterType iType = TArmRegisterType.EArmReg_00; + private ArmRegisterCollection iParent = null; + private object iTag = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/General/ArmRegisterBank.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/General/ArmRegisterBank.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianStructuresLib.Arm.Registers +{ + public enum TArmRegisterBank + { + // Special values + ETypeUnknown = 0, + ETypeException = -1, + ETypeCommon = -2, + ETypeCoProcessor = -3, + ETypeETM = -4, + ETypeETB = -5, + ETypeCoProSystemControl = -6, + + // Corresponding CPSR binary values + ETypeUser = 0x10, // 0b10000 + ETypeFastInterrupt = 0x11, // 0b10001 + ETypeInterrupt = 0x12, // 0b10010 + ETypeSupervisor = 0x13, // 0b10011 + ETypeAbort = 0x17, // 0b10111 + ETypeUndefined = 0x1B, // 0b11011 + ETypeSystem = 0x1F // 0b11111 + } + + public static class ArmRegisterBankUtils + { + #region API + public static uint MakeStatusRegisterValue( TArmRegisterBank aBank ) + { + uint val = 0; + // + switch ( aBank ) + { + case TArmRegisterBank.ETypeUser: + case TArmRegisterBank.ETypeFastInterrupt: + case TArmRegisterBank.ETypeInterrupt: + case TArmRegisterBank.ETypeSupervisor: + case TArmRegisterBank.ETypeAbort: + case TArmRegisterBank.ETypeUndefined: + case TArmRegisterBank.ETypeSystem: + val = (uint) aBank; + break; + default: + break; + } + // + return val; + } + + public static TArmRegisterBank ExtractBank( uint aValue ) + { + uint val = aValue & KBankMask; + TArmRegisterBank bank = (TArmRegisterBank) val; + // + switch ( bank ) + { + case TArmRegisterBank.ETypeUser: + case TArmRegisterBank.ETypeFastInterrupt: + case TArmRegisterBank.ETypeInterrupt: + case TArmRegisterBank.ETypeSupervisor: + case TArmRegisterBank.ETypeAbort: + case TArmRegisterBank.ETypeUndefined: + case TArmRegisterBank.ETypeSystem: + break; + default: + bank = TArmRegisterBank.ETypeUndefined; + break; + } + // + return bank; + } + + public static TArmRegisterBank ExtractBank( ArmRegister aRegister ) + { + return ExtractBank( aRegister.Value ); + } + + public static string BankAsString( TArmRegisterBank aBank ) + { + string ret = string.Empty; + // + switch ( aBank ) + { + default: + case TArmRegisterBank.ETypeUnknown: + case TArmRegisterBank.ETypeCommon: + ret = string.Empty; + break; + case TArmRegisterBank.ETypeException: + ret = "EXC"; + break; + case TArmRegisterBank.ETypeCoProcessor: + ret = "COP"; + break; + case TArmRegisterBank.ETypeAbort: + ret = "ABT"; + break; + case TArmRegisterBank.ETypeFastInterrupt: + ret = "FIQ"; + break; + case TArmRegisterBank.ETypeInterrupt: + ret = "IRQ"; + break; + case TArmRegisterBank.ETypeSupervisor: + ret = "SVC"; + break; + case TArmRegisterBank.ETypeSystem: + ret = "SYS"; + break; + case TArmRegisterBank.ETypeUndefined: + ret = "UND"; + break; + case TArmRegisterBank.ETypeUser: + ret = "USR"; + break; + } + // + return ret; + } + + public static string BankAsStringLong( TArmRegisterBank aBank ) + { + string ret = string.Empty; + // + switch ( aBank ) + { + default: + case TArmRegisterBank.ETypeUnknown: + case TArmRegisterBank.ETypeCommon: + ret = string.Empty; + break; + case TArmRegisterBank.ETypeException: + ret = "Exception"; + break; + case TArmRegisterBank.ETypeCoProcessor: + ret = "Co-processor"; + break; + case TArmRegisterBank.ETypeAbort: + ret = "Abort"; + break; + case TArmRegisterBank.ETypeFastInterrupt: + ret = "Fast Interrupt"; + break; + case TArmRegisterBank.ETypeInterrupt: + ret = "Interrupt"; + break; + case TArmRegisterBank.ETypeSupervisor: + ret = "Supervisor"; + break; + case TArmRegisterBank.ETypeSystem: + ret = "System"; + break; + case TArmRegisterBank.ETypeUndefined: + ret = "Undefined"; + break; + case TArmRegisterBank.ETypeUser: + ret = "User"; + break; + } + // + return ret; + } + #endregion + + #region Internal constants + private const uint KBankMask = 0x1F; // 11111b + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/General/ArmRegisterCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/General/ArmRegisterCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,533 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianStructuresLib.Arm.Registers +{ + public class ArmRegisterCollection : IEnumerable, IComparer + { + #region Constructors + public ArmRegisterCollection() + : this( TArmRegisterBank.ETypeUnknown ) + { + } + + public ArmRegisterCollection( TArmRegisterBank aBank ) + : this( aBank, null ) + { + } + + public ArmRegisterCollection( TArmRegisterBank aBank, ArmRegisterCollection aLinkedWith ) + { + iBank = aBank; + iLinkedWith = aLinkedWith; + } + + public ArmRegisterCollection( ArmRegisterCollection aCopy ) + : this( aCopy.Bank, aCopy.iLinkedWith ) + { + foreach ( ArmRegister reg in aCopy ) + { + ArmRegister copy = new ArmRegister( reg ); + DoAdd( copy ); + } + } + #endregion + + #region API + public ArmRegister Add( ArmRegister aRegister ) + { + ArmRegister entry = null; + // + if ( iBackingStore != null ) + { + string name = aRegister.OriginalName; + entry = iBackingStore.ARCBSCreate( aRegister.RegType, name, aRegister.Value ); + entry = DoAdd( entry ); + } + else + { + entry = DoAdd( aRegister ); + } + // + return entry; + } + + public ArmRegister Add( TArmRegisterType aType, uint aValue ) + { + ArmRegister entry = null; + if ( iBackingStore != null ) + { + string name = ArmRegister.GetTypeName( aType ); + entry = iBackingStore.ARCBSCreate( aType, name, aValue ); + } + else + { + entry = new ArmRegister( aType, aValue ); + } + // + entry = DoAdd( entry ); + return entry; + } + + public ArmRegister Add( string aName, uint aValue ) + { + TArmRegisterType type = ArmRegister.GetTypeByName( aName ); + + ArmRegister entry = null; + if ( iBackingStore != null ) + { + entry = iBackingStore.ARCBSCreate( type, aName, aValue ); + } + else + { + entry = new ArmRegister( aName, aValue ); + } + // + entry = DoAdd( entry ); + return entry; + } + + public void Copy( ArmRegisterCollection aCollection ) + { + foreach ( ArmRegister reg in aCollection ) + { + Add( reg.OriginalName, reg.Value ); + } + } + + public virtual void AddDefaults() + { + Clear(); + // + Array items = Enum.GetValues( typeof( TArmRegisterType ) ); + foreach ( object enumEntry in items ) + { + TArmRegisterType value = (TArmRegisterType) enumEntry; + if ( value >= TArmRegisterType.EArmReg_00 && value <= TArmRegisterType.EArmReg_EXCPC ) + { + Add( value, 0 ); + } + } + } + + public void AddMany( params TArmRegisterType[] aTypes ) + { + foreach ( TArmRegisterType reg in aTypes ) + { + string name = ArmRegister.GetTypeName( reg ); + Add( name, 0 ); + } + } + + public void SetAll( uint aValue ) + { + foreach ( ArmRegister reg in this ) + { + reg.Value = aValue; + } + } + + public bool Contains( TArmRegisterType aType ) + { + if ( aType == TArmRegisterType.EArmReg_Other ) + { + throw new ArgumentException( "Type must be unique" ); + } + // + bool ret = false; + // + foreach ( ArmRegister reg in this ) + { + if ( reg.RegType == aType ) + { + ret = true; + break; + } + } + // + return ret; + } + + public bool Contains( string aName ) + { + // Need this to map the specified name into a common name. + // I.e. convert R14_USR to R14 + ArmRegister temp = new ArmRegister( aName, 0 ); + + // First try concrete entries + bool ret = iEntries.ContainsKey( temp.Name ); + if ( !ret && iLinkedWith != null ) + { + // Try linked + ret = iLinkedWith.Contains( temp.Name ); + } + + return ret; + } + + public void Clear() + { + if ( iBackingStore != null ) + { + iBackingStore.ARCBSClear(); + } + + iEntries.Clear(); + } + + public void Remove( TArmRegisterType aType ) + { + ArmRegister temp = new ArmRegister( aType, 0 ); + bool contains = iEntries.ContainsKey( temp.Name ); + if ( contains ) + { + temp = iEntries[ temp.Name ]; + iEntries.Remove( temp.Name ); + if ( iBackingStore != null ) + { + iBackingStore.ARCBSRemove( temp ); + } + } + } + #endregion + + #region Properties + public TArmRegisterBank Bank + { + get { return iBank; } + } + + public ArmRegister this[ ArmRegister aRegister ] + { + get + { + ArmRegister ret = this[ aRegister.Name ]; + return ret; + } + } + + public ArmRegister this[ TArmRegisterType aType ] + { + get + { + // We can only find entries which have a well known name + if ( aType == TArmRegisterType.EArmReg_Other ) + { + throw new ArgumentException( "Type must be unique" ); + } + + // Check for existing entry + foreach ( ArmRegister entry in this ) + { + if ( entry.RegType == aType ) + { + return entry; + } + } + + // The specified entry did not exist so silently + // add it and return a reference to the new entry + ArmRegister ret = Add( aType, 0 ); + return ret; + } + } + + public ArmRegister this[ string aName ] + { + get + { + ArmRegister ret = new ArmRegister( aName, 0 ); + + // First try concrete entries in this object + if ( iEntries.ContainsKey( ret.Name ) ) + { + ret = iEntries[ ret.Name ]; + } + else if ( iLinkedWith != null && iLinkedWith.Contains( ret.Name ) ) + { + // Try linked entries + ret = iLinkedWith[ ret.Name ]; + } + else + { + // Not found + Add( aName, 0 ); + } + // + return ret; + } + } + + public int Count + { + get + { + int ret = iEntries.Count; + // + if ( iLinkedWith != null ) + { + ret += iLinkedWith.Count; + } + // + return ret; + } + } + + public bool IsEmpty + { + get + { + bool empty = true; + // + foreach ( ArmRegister reg in this ) + { + if ( reg.Value != 0 ) + { + empty = false; + break; + } + } + // + return empty; + } + } + + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + + public IARCBackingStore BackingStore + { + get { return iBackingStore; } + set { iBackingStore = value; } + } + #endregion + + #region Internal methods + private void MakeDefaultEntries() + { + Add( TArmRegisterType.EArmReg_00, 0 ); + Add( TArmRegisterType.EArmReg_01, 0 ); + Add( TArmRegisterType.EArmReg_02, 0 ); + Add( TArmRegisterType.EArmReg_03, 0 ); + Add( TArmRegisterType.EArmReg_04, 0 ); + Add( TArmRegisterType.EArmReg_05, 0 ); + Add( TArmRegisterType.EArmReg_06, 0 ); + Add( TArmRegisterType.EArmReg_07, 0 ); + Add( TArmRegisterType.EArmReg_08, 0 ); + Add( TArmRegisterType.EArmReg_09, 0 ); + Add( TArmRegisterType.EArmReg_10, 0 ); + Add( TArmRegisterType.EArmReg_11, 0 ); + Add( TArmRegisterType.EArmReg_12, 0 ); + Add( TArmRegisterType.EArmReg_SP, 0 ); + Add( TArmRegisterType.EArmReg_LR, 0 ); + Add( TArmRegisterType.EArmReg_PC, 0 ); + Add( TArmRegisterType.EArmReg_CPSR, 0 ); + } + + private ArmRegister DoAdd( ArmRegister aRegister ) + { + ArmRegister ret = aRegister; + // + bool exists = iEntries.ContainsKey( aRegister.Name ); + if ( exists ) + { + ret = iEntries[ aRegister.Name ]; + ret.Value = aRegister.Value; + } + else + { + // Associate entry with this collection + aRegister.Parent = this; + iEntries.Add( aRegister.Name, aRegister ); + } + // + return ret; + } + #endregion + + #region From IComparer + public int Compare( ArmRegister aLeft, ArmRegister aRight ) + { + int ret = -1; + // + if ( aLeft == null || aRight == null ) + { + if ( aRight == null ) + { + ret = 1; + } + } + else + { + // Try to order the registers so that Rnn register names come first + // then CPSR, then the other stuff. + TArmRegisterType leftType = aLeft.RegType; + TArmRegisterType rightType = aRight.RegType; + // + if ( leftType != TArmRegisterType.EArmReg_Other && rightType == TArmRegisterType.EArmReg_Other ) + { + // Left is smaller since it's a standard register + ret = -1; + } + else if ( leftType == TArmRegisterType.EArmReg_Other && rightType != TArmRegisterType.EArmReg_Other ) + { + // Right is smaller since it's a standard register + ret = 1; + } + else if ( leftType == TArmRegisterType.EArmReg_Other && rightType == TArmRegisterType.EArmReg_Other ) + { + // Must compare names since both are non-standard registers + ret = aLeft.OriginalName.CompareTo( aRight.OriginalName ); + } + else + { + // Registers are not non-standard, compare based upon numerical value + if ( leftType == rightType ) + { + ret = 0; + } + else if ( leftType > rightType ) + { + ret = 1; + } + } + } + // + return ret; + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + SortedList entries = new SortedList(); + + // Get specific entries - we always take all of these + foreach ( KeyValuePair kvp in iEntries ) + { + ArmRegister reg = kvp.Value; + entries.Add( reg.Name, reg ); + } + + // And also common entries + if ( iLinkedWith != null ) + { + foreach ( ArmRegister reg in iLinkedWith ) + { + // Make sure that the concrete entries override + // any common values + if ( entries.ContainsKey( reg.Name ) == false ) + { + entries.Add( reg.Name, reg ); + } + } + } + + // Ensure list is really sorted. + List ret = new List(); + foreach ( KeyValuePair pair in entries ) + { + ret.Add( pair.Value ); + } + ret.Sort( this ); + + // Now we can iterate... + foreach ( ArmRegister entry in ret ) + { + yield return entry; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + SortedList entries = new SortedList(); + + // Get specific entries - we always take all of these + foreach ( KeyValuePair kvp in iEntries ) + { + ArmRegister reg = kvp.Value; + entries.Add( reg.Name, reg ); + } + + // And also common entries + if ( iLinkedWith != null ) + { + foreach ( ArmRegister reg in iLinkedWith ) + { + // Make sure that the concrete entries override + // any common values + if ( entries.ContainsKey( reg.Name ) == false ) + { + entries.Add( reg.Name, reg ); + } + } + } + + // Ensure list is really sorted. + List ret = new List(); + foreach ( KeyValuePair pair in entries ) + { + ret.Add( pair.Value ); + } + ret.Sort( this ); + + // Now we can iterate... + foreach ( ArmRegister entry in ret ) + { + yield return entry; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + foreach ( ArmRegister entry in this ) + { + ret.AppendLine( entry.ToString() ); + } + return ret.ToString(); + } + #endregion + + #region Data members + private object iTag = null; + private readonly TArmRegisterBank iBank; + private readonly ArmRegisterCollection iLinkedWith; + private string iName = string.Empty; + private IARCBackingStore iBackingStore = null; + private Dictionary iEntries = new Dictionary(); + #endregion + } + + #region Backing store interface + public interface IARCBackingStore + { + void ARCBSClear(); + + ArmRegister ARCBSCreate( TArmRegisterType aType, string aName, uint aValue ); + void ARCBSRemove( ArmRegister aRegister ); + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/General/ArmRegisterMachine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/General/ArmRegisterMachine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,357 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianStructuresLib.Arm.Registers +{ + public class ArmRegisterMachine : IEnumerable + { + #region Constructors + public ArmRegisterMachine() + : this( null ) + { + } + + public ArmRegisterMachine( IARMBackingStore aBackingStore ) + { + iBackingStore = aBackingStore; + // + Clear(); + } + #endregion + + #region API + public void Clear() + { + iBanks.Clear(); + + // Common registers + ArmRegisterCollection common = CreateCollection( TArmRegisterBank.ETypeCommon ); + common.AddMany( TArmRegisterType.EArmReg_CPSR, + TArmRegisterType.EArmReg_00, + TArmRegisterType.EArmReg_01, + TArmRegisterType.EArmReg_02, + TArmRegisterType.EArmReg_03, + TArmRegisterType.EArmReg_04, + TArmRegisterType.EArmReg_05, + TArmRegisterType.EArmReg_06, + TArmRegisterType.EArmReg_07, + TArmRegisterType.EArmReg_PC + ); + AddBank( common ); + + // User regs + ArmRegisterCollection user = CreateCollection( TArmRegisterBank.ETypeUser, common ); + user.AddMany( TArmRegisterType.EArmReg_08, + TArmRegisterType.EArmReg_09, + TArmRegisterType.EArmReg_10, + TArmRegisterType.EArmReg_11, + TArmRegisterType.EArmReg_12, + TArmRegisterType.EArmReg_SP, + TArmRegisterType.EArmReg_LR + ); + AddBank( user ); + + // These are all fairly normal. They have their own SP, LR and SPSR + // The others are common. + AddBank( TArmRegisterBank.ETypeAbort, user ); + AddBank( TArmRegisterBank.ETypeInterrupt, user ); + AddBank( TArmRegisterBank.ETypeSupervisor, user ); + AddBank( TArmRegisterBank.ETypeSystem, user ); + AddBank( TArmRegisterBank.ETypeUndefined, user ); + + // FIQ is special - it has shadows of R8->12 + AddBank( TArmRegisterBank.ETypeFastInterrupt, common, + TArmRegisterType.EArmReg_08, + TArmRegisterType.EArmReg_09, + TArmRegisterType.EArmReg_10, + TArmRegisterType.EArmReg_11, + TArmRegisterType.EArmReg_12 + ); + + // Don't forget co-processor or exception regs + ArmRegisterCollection exception = CreateCollection( TArmRegisterBank.ETypeException ); + exception.AddMany( TArmRegisterType.EArmReg_EXCCODE + ); + AddBank( exception ); + ArmRegisterCollection coprocessor = CreateCollection( TArmRegisterBank.ETypeCoProcessor ); + coprocessor.AddMany( TArmRegisterType.EArmReg_FAR, + TArmRegisterType.EArmReg_FSR + ); + AddBank( coprocessor ); + } + + public bool Available( TArmRegisterBank aType ) + { + bool ret = iBanks.ContainsKey( aType ); + return ret; + } + + public ArmRegisterCollection CurrentRegisters() + { + // Combine all relevant register values into a complete register collection + ArmRegisterCollection currentBank = CurrentBank; + + // Standard regs + ArmRegisterCollection ret = CreateCollection( TArmRegisterBank.ETypeUnknown ); + foreach( ArmRegister reg in currentBank ) + { + ret.Add( reg.OriginalName, reg.Value ); + } + + // Co-processor + ArmRegisterCollection cop = this[TArmRegisterBank.ETypeCoProcessor]; + foreach ( ArmRegister reg in cop ) + { + ret.Add( reg.OriginalName, reg.Value ); + } + + // Exception + ArmRegisterCollection exc = this[ TArmRegisterBank.ETypeException ]; + foreach ( ArmRegister reg in exc ) + { + ret.Add( reg.OriginalName, reg.Value ); + } + + return ret; + } + #endregion + + #region Properties + public int Count + { + get { return iBanks.Count; } + } + + public ArmRegister CPSR + { + get + { + ArmRegister ret = this[ TArmRegisterBank.ETypeCommon, TArmRegisterType.EArmReg_CPSR ]; + return ret; + } + set + { + ArmRegister cpsr = CPSR; + cpsr.Value = value.Value; + } + } + + public TArmRegisterBank CPSRBankType + { + get + { + ArmRegister cpsr = CPSR; + return ArmRegisterBankUtils.ExtractBank( cpsr ); + } + } + + public ArmRegister CurrentSP + { + get + { + TArmRegisterBank bank = CPSRBankType; + ArmRegister ret = this[ bank, TArmRegisterType.EArmReg_SP ]; + return ret; + } + } + + public ArmRegister CurrentLR + { + get + { + TArmRegisterBank bank = CPSRBankType; + ArmRegister ret = this[ bank, TArmRegisterType.EArmReg_LR ]; + return ret; + } + } + + public ArmRegisterCollection CurrentBank + { + get + { + TArmRegisterBank bank = CPSRBankType; + return this[ bank ]; + } + } + + public ArmRegisterCollection this[ TArmRegisterBank aBank ] + { + get + { + ArmRegisterCollection ret = iBanks[ aBank ]; + return ret; + } + } + + public ArmRegister this[ TArmRegisterBank aBank, string aName ] + { + get + { + ArmRegisterCollection bank = this[ aBank ]; + return bank[ aName ]; + } + } + + public ArmRegister this[ TArmRegisterBank aBank, TArmRegisterType aType ] + { + get + { + ArmRegisterCollection bank = this[ aBank ]; + return bank[ aType ]; + } + } + #endregion + + #region Internal methods + private ArmRegisterCollection AddBank( TArmRegisterBank aBank ) + { + return AddBank( aBank, null ); + } + + private ArmRegisterCollection AddBank( TArmRegisterBank aBank, ArmRegisterCollection aLinkedWith ) + { + TArmRegisterType[] empty = new TArmRegisterType[] { }; + return AddBank( aBank, aLinkedWith, empty ); + } + + private ArmRegisterCollection AddBank( TArmRegisterBank aBank, ArmRegisterCollection aLinkedWith, params TArmRegisterType[] aExtraRegs ) + { + ArmRegisterCollection regSet = CreateCollection( aBank, aLinkedWith ); + iBanks.Add( aBank, regSet ); + + // Create bank specific registers + string bankName = ArmRegisterBankUtils.BankAsString( aBank ); + regSet.Add( "R13_" + bankName, 0 ); + regSet.Add( "R14_" + bankName, 0 ); + regSet.Add( "SPSR_" + bankName, 0 ); + + // Create custom registers + foreach( TArmRegisterType custom in aExtraRegs ) + { + string name = ArmRegister.GetTypeName( custom ) + "_" + bankName; + regSet.Add( name, 0 ); + } + + return regSet; + } + + private ArmRegisterCollection AddBank( ArmRegisterCollection aRegSet ) + { + iBanks.Add( aRegSet.Bank, aRegSet ); + return aRegSet; + } + + private ArmRegisterCollection CreateCollection( TArmRegisterBank aBank ) + { + return CreateCollection( aBank, null ); + } + + private ArmRegisterCollection CreateCollection( TArmRegisterBank aBank, ArmRegisterCollection aLinkedWith ) + { + ArmRegisterCollection ret = null; + // + if ( iBackingStore != null ) + { + ret = iBackingStore.ARMBSCreate( aBank, aLinkedWith ); + } + else + { + ret = new ArmRegisterCollection( aBank, aLinkedWith ); + } + // + return ret; + } + #endregion + + #region Internal constants + #endregion + + #region From System.Object + public override string ToString() + { + return base.ToString(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + SortedList entries = new SortedList(); + + // Get specific entries - we always take all of these + foreach ( KeyValuePair kvp in iBanks ) + { + ArmRegisterCollection regs = kvp.Value; + foreach ( ArmRegister reg in regs ) + { + string key = reg.Value.ToString( "x8" ) + "_" + reg.OriginalName; + if ( !entries.ContainsKey( key ) ) + { + entries.Add( key, reg ); + } + } + } + + // Now we can iterate... + foreach ( ArmRegister entry in entries.Values ) + { + yield return entry; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + SortedList entries = new SortedList(); + + // Get specific entries - we always take all of these + foreach ( KeyValuePair kvp in iBanks ) + { + ArmRegisterCollection regs = kvp.Value; + foreach ( ArmRegister reg in regs ) + { + string key = reg.Value.ToString( "x8" ) + "_" + reg.OriginalName; + if ( !entries.ContainsKey( key ) ) + { + entries.Add( key, reg ); + } + } + } + + // Now we can iterate... + foreach ( ArmRegister entry in entries.Values ) + { + yield return entry; + } + } + #endregion + + #region Data members + private IARMBackingStore iBackingStore = null; + private Dictionary iBanks = new Dictionary(); + #endregion + } + + #region Machine backing store + public interface IARMBackingStore + { + ArmRegisterCollection ARMBSCreate( TArmRegisterBank aBank, ArmRegisterCollection aLinkedWith ); + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/General/ArmRegisterType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/General/ArmRegisterType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; + +namespace SymbianStructuresLib.Arm.Registers +{ + public enum TArmRegisterType : int + { + [Description( "??" )] + EArmReg_Other = -1, + + ///////////////////// + // COMMON REGISTERS + ///////////////////// + [Description("R00" )] + EArmReg_00 = 0, + + [Description( "R01" )] + EArmReg_01 = 1, + + [Description( "R02" )] + EArmReg_02 = 2, + + [Description( "R03" )] + EArmReg_03 = 3, + + [Description( "R04" )] + EArmReg_04 = 4, + + [Description( "R05" )] + EArmReg_05 = 5, + + [Description( "R06" )] + EArmReg_06 = 6, + + [Description( "R07" )] + EArmReg_07 = 7, + + [Description( "R08" )] + EArmReg_08 = 8, + + [Description( "R09" )] + EArmReg_09 = 9, + + [Description( "R10" )] + EArmReg_10 = 10, + + [Description( "R11" )] + EArmReg_11 = 11, + + [Description( "R12" )] + EArmReg_12 = 12, + + [Description( "SP" )] + EArmReg_SP = 13, + + [Description( "LR" )] + EArmReg_LR = 14, + + [Description( "PC" )] + EArmReg_PC = 15, + + [Description( "CPSR" )] + EArmReg_CPSR = 16, + + [Description( "SPSR" )] + EArmReg_SPSR, + + [Description( "DACR" )] + EArmReg_DACR, + + [Description( "FSR" )] + EArmReg_FSR, + + [Description( "FAR" )] + EArmReg_FAR, + + [Description( "CAR" )] + EArmReg_CAR, + + [Description( "MMUID" )] + EArmReg_MMUID, + + [Description( "MMUCR" )] + EArmReg_MMUCR, + + [Description( "AUXCR" )] + EArmReg_AUXCR, + + [Description( "FPEXC" )] + EArmReg_FPEXC, + + [Description( "CTYPE" )] + EArmReg_CTYPE, + + [Description( "EXC_CODE" )] + EArmReg_EXCCODE, + + [Description( "EXC_PC" )] + EArmReg_EXCPC, + + ///////////////////////////////// + // CO-PROCESSOR SYSTEM CONTROL + ///////////////////////////////// + [Description( "SYSCON_CONTROL" )] + EArmReg_SysCon_Control, + + ///////////////////// + // ETM + ///////////////////// + [Description( "ETM_CONTROL" )] + EArmReg_ETM_Control, + + [Description( "ETM_ID")] + EArmReg_ETM_Id, + + ///////////////////// + // ETB + ///////////////////// + [Description( "ETB_RAM_DEPTH" )] + EArmReg_ETB_RamDepth, + + [Description( "ETB_RAM_WIDTH" )] + EArmReg_ETB_RamWidth, + + [Description( "ETB_STATUS" )] + EArmReg_ETB_Status, + + [Description( "ETB_RAM_WRITE_POINTER" )] + EArmReg_ETB_RamWritePointer, + + [Description( "ETB_TRIGGER_COUNTER" )] + EArmReg_ETB_TriggerCounter, + + [Description( "ETB_CONTROL" )] + EArmReg_ETB_Control, + + [Description( "ETB_ID" )] + EArmReg_ETB_Id + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/VFP/ArmVectorFloatingPointRegisters.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/VFP/ArmVectorFloatingPointRegisters.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; + +namespace SymbianStructuresLib.Arm.Registers.VFP +{ + public enum TArmRegisterTypeVFP + { + // Double prevision + D00 = 0, + D01, + D02, + D03, + D04, + D05, + D06, + D07, + D08, + D09, + D10, + D11, + D12, + D13, + D14, + D15, + + // Single precision + S00 = 100, + S01, + S02, + S03, + S04, + S05, + S06, + S07, + S08, + S09, + S10, + S11, + S12, + S13, + S14, + S15, + S16, + S17, + S18, + S19, + S20, + S21, + S22, + S23, + S24, + S25, + S26, + S27, + S28, + S29, + S30, + S31, + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/VFP/ArmVectorFloatingPointUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Registers/VFP/ArmVectorFloatingPointUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; + +namespace SymbianStructuresLib.Arm.Registers.VFP +{ + public static class ArmVectorFloatingPointUtils + { + public static int RegisterSizeInBits( TArmRegisterTypeVFP aRegister ) + { + int ret = 32; + int value = (int) aRegister; + // + if ( value >= 0 && value < (int) TArmRegisterTypeVFP.S00 ) + { + ret *= 2; + } + // + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Security/ArmSecurityMode.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Arm/Security/ArmSecurityMode.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm.Registers; + +namespace SymbianStructuresLib.Arm.SecurityMode +{ + public enum TArmSecurityMode + { + EUnknown = -1, + ESecure = 0, + ENotSecure = 1 + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/CodeSegments/CodeSegDefinition.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/CodeSegments/CodeSegDefinition.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianStructuresLib.MemoryModel; + +namespace SymbianStructuresLib.CodeSegments +{ + public class CodeSegDefinition : AddressRange + { + #region Enumerations + [Flags] + public enum TAttributes + { + EAttributeNone = 0, + EAttributeXIP = 1, + EAttributeRAM = 2, + } + #endregion + + #region Constructors + public CodeSegDefinition() + : this( string.Empty ) + { + } + + public CodeSegDefinition( string aFileName ) + : this( aFileName, 0, 0 ) + { + } + + public CodeSegDefinition( string aFileName, uint aBase, uint aLimit ) + : base( aBase, aLimit ) + { + iFileName = aFileName; + } + #endregion + + #region Properties + public uint Checksum + { + get { return iChecksum; } + set { iChecksum = value; } + } + + public string FileName + { + get { return iFileName; } + set { iFileName = value; } + } + + public uint Base + { + get { return base.Min; } + set { base.Min = value; } + } + + public uint Limit + { + get { return base.Max; } + set { base.Max = value; } + } + + public TAttributes Attributes + { + get { return iAttributes; } + } + #endregion + + #region From AddressRange + protected override void OnChanged() + { + base.OnChanged(); + // + UpdateAttributes(); + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( base.ToString() ); + ret.Append( " " ); + ret.Append( iFileName ); + // + return ret.ToString(); + } + + public override int GetHashCode() + { + return iFileName.ToUpper().GetHashCode(); + } + + public override bool Equals( object aObject ) + { + bool ret = false; + // + if ( aObject is CodeSegDefinition ) + { + CodeSegDefinition other = (CodeSegDefinition) aObject; + // + string myName = this.FileName; + string otherName = other.FileName; + // + ret = string.Compare( myName, otherName, StringComparison.CurrentCultureIgnoreCase ) == 0; + } + else + { + ret = base.Equals( aObject ); + } + // + return ret; + } + #endregion + + #region Internal methods + private void UpdateAttributes() + { + // Remove XIP/RAM attrib before we work out the type... + iAttributes &= ~TAttributes.EAttributeRAM; + iAttributes &= ~TAttributes.EAttributeXIP; + + MemoryModel.TMemoryModelType type = MMUtilities.TypeByAddress( Base ); + if ( type != MemoryModel.TMemoryModelType.EMemoryModelUnknown ) + { + MemoryModel.TMemoryModelRegion region = MMUtilities.RegionByAddress( Base, type ); + // + if ( region == MemoryModel.TMemoryModelRegion.EMemoryModelRegionROM ) + { + iAttributes |= TAttributes.EAttributeXIP; + } + else if ( region == MemoryModel.TMemoryModelRegion.EMemoryModelRegionRAMLoadedCode ) + { + iAttributes |= TAttributes.EAttributeRAM; + } + } + } + #endregion + + #region Data members + private string iFileName = string.Empty; + private uint iChecksum = 0; + private TAttributes iAttributes = TAttributes.EAttributeNone; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/CodeSegments/CodeSegDefinitionCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/CodeSegments/CodeSegDefinitionCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,217 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace SymbianStructuresLib.CodeSegments +{ + public class CodeSegDefinitionCollection : IEnumerable + { + #region Constructors + public CodeSegDefinitionCollection() + : this( 10 ) + { + } + + public CodeSegDefinitionCollection( int aGranularity ) + { + iEntries = new List( aGranularity ); + } + + public CodeSegDefinitionCollection( IEnumerable aCopy ) + { + iEntries = new List(); + iEntries.AddRange( aCopy ); + } + #endregion + + #region API + public void Reset() + { + lock ( iEntries ) + { + iEntries.Clear(); + } + } + + public void Add( CodeSegDefinition aEntry ) + { + if ( string.IsNullOrEmpty( aEntry.FileName ) ) + { + throw new ArgumentException( "File name invalid" ); + } + + lock ( iEntries ) + { + if ( !Contains( aEntry ) ) + { + iEntries.Add( aEntry ); + } + } + } + + public void AddRange( IEnumerable aItems ) + { + foreach ( CodeSegDefinition entry in aItems ) + { + Add( entry ); + } + } + + public void Remove( CodeSegDefinition aEntry ) + { + lock ( iEntries ) + { + int index = IndexOf( aEntry ); + if ( index >= 0 ) + { + iEntries.RemoveAt( index ); + } + } + } + + public void SortByFileName() + { + lock ( iEntries ) + { + iEntries.Sort( new Internal.CSDCompareByFileName() ); + } + } + + public void SortByAddress() + { + lock ( iEntries ) + { + iEntries.Sort( new Internal.CSDCompareByAddress() ); + } + } + + public bool Contains( string aFileName ) + { + lock ( iEntries ) + { + CodeSegDefinition temp = new CodeSegDefinition( aFileName ); + return Contains( temp ); + } + } + + public bool Contains( CodeSegDefinition aEntry ) + { + lock ( iEntries ) + { + int index = IndexOf( aEntry ); + bool ret = ( index >= 0 ); + return ret; + } + } + + public int IndexOf( CodeSegDefinition aEntry ) + { + Predicate predicate = delegate( CodeSegDefinition search ) + { + return search.Equals( aEntry ); + }; + // + lock ( iEntries ) + { + int ret = iEntries.FindIndex( predicate ); + return ret; + } + } + + public CodeSegDefinition DefinitionByAddress( uint aAddress ) + { + Predicate predicate = delegate( CodeSegDefinition validate ) + { + return validate.Contains( aAddress ); + }; + // + lock ( iEntries ) + { + CodeSegDefinition ret = iEntries.Find( predicate ); + return ret; + } + } + #endregion + + #region Properties + public int Count + { + get + { + lock ( iEntries ) + { + return iEntries.Count; + } + } + } + + public CodeSegDefinition this[ int aIndex ] + { + get + { + lock ( iEntries ) + { + return iEntries[ aIndex ]; + } + } + } + + public CodeSegDefinition this[ uint aAddress ] + { + get + { + CodeSegDefinition ret = null; + // + foreach ( CodeSegDefinition entry in iEntries ) + { + if ( entry.Contains( aAddress ) ) + { + ret = entry; + break; + } + } + // + return ret; + } + } + #endregion + + #region IEnumerable Members + public IEnumerator GetEnumerator() + { + foreach ( CodeSegDefinition entry in iEntries ) + { + yield return entry; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( CodeSegDefinition entry in iEntries ) + { + yield return entry; + } + } + #endregion + + #region Data members + private readonly List iEntries; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/CodeSegments/CodeSegDefinitionParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/CodeSegments/CodeSegDefinitionParser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Generic; + +namespace SymbianStructuresLib.CodeSegments +{ + public static class CodeSegDefinitionParser + { + #region API + public static CodeSegDefinition ParseDefinition( string aLine ) + { + CodeSegDefinition ret = null; + // + Match m = KCodeSegRegEx.Match( aLine ); + if ( m.Success ) + { + ret = new CodeSegDefinition(); + // + string gpAddressStart = m.Groups[ "StartAddress" ].Value; + string gpAddressEnd = m.Groups[ "EndAddress" ].Value; + string gpBinary = m.Groups[ "Binary" ].Value; + // + ret.Base = uint.Parse( gpAddressStart, System.Globalization.NumberStyles.HexNumber ); + ret.Limit = uint.Parse( gpAddressEnd, System.Globalization.NumberStyles.HexNumber ); + ret.FileName = gpBinary; + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal constants + private static readonly Regex KCodeSegRegEx = new Regex( + @"(?[a-fA-F0-9]{8})-(?[a-fA-F0-9]{8})\s{1}(?.+)", + RegexOptions.IgnoreCase + ); + private const int KBaseHex = 16; + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/CodeSegments/Internal/Comparers.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/CodeSegments/Internal/Comparers.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace SymbianStructuresLib.CodeSegments.Internal +{ + internal class CSDCompareByFileName : IComparer + { + #region IComparer Members + public int Compare( object aLeft, object aRight ) + { + CodeSegDefinition left = (CodeSegDefinition) aLeft; + CodeSegDefinition right = (CodeSegDefinition) aRight; + // + return Compare( left, right ); + } + #endregion + + #region From IComparer + int IComparer.Compare( CodeSegDefinition aLeft, CodeSegDefinition aRight ) + { + return string.Compare( aLeft.FileName, aRight.FileName, StringComparison.CurrentCultureIgnoreCase ); + } + #endregion + } + + internal class CSDCompareByAddress : IComparer + { + #region IComparer Members + public int Compare( object aLeft, object aRight ) + { + CodeSegDefinition left = (CodeSegDefinition) aLeft; + CodeSegDefinition right = (CodeSegDefinition) aRight; + // + return Compare( left, right ); + } + #endregion + + #region IComparer Members + int IComparer.Compare( CodeSegDefinition aLeft, CodeSegDefinition aRight ) + { + int ret = -1; + if ( aLeft.Base == aRight.Base && aLeft.Limit == aRight.Limit ) + { + ret = 0; + } + else if ( aLeft.Limit == aRight.Base ) + { + System.Diagnostics.Debug.Assert( aLeft.Base < aRight.Base ); + System.Diagnostics.Debug.Assert( aRight.Limit >= aLeft.Limit ); + // + ret = -1; + } + else if ( aLeft.Base == aRight.Limit ) + { + System.Diagnostics.Debug.Assert( aRight.Base < aLeft.Base ); + System.Diagnostics.Debug.Assert( aLeft.Limit >= aRight.Limit ); + // + ret = 1; + } + else if ( aLeft.Base > aRight.Limit ) + { + System.Diagnostics.Debug.Assert( aLeft.Limit > aRight.Limit ); + System.Diagnostics.Debug.Assert( aLeft.Limit > aRight.Base ); + ret = 1; + } + else if ( aLeft.Limit < aRight.Base ) + { + System.Diagnostics.Debug.Assert( aLeft.Base < aRight.Limit ); + System.Diagnostics.Debug.Assert( aRight.Limit > aLeft.Limit ); + ret = -1; + } + // + return ret; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Compression/BytePair/SymbianDecompressorBytePair.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Compression/BytePair/SymbianDecompressorBytePair.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Runtime.InteropServices; +using SymbianStructuresLib.Compression.Common; + +namespace SymbianStructuresLib.Compression.BytePair +{ + public class SymbianDecompressorBytePair : SymbianDecompressor + { + #region Constructors + public SymbianDecompressorBytePair() + { + } + #endregion + + #region From SymbianDecompressor + public override TSymbianCompressionType Type + { + get { return TSymbianCompressionType.EBytePair; } + } + + protected override int DoDecompressRaw( IntPtr aSource, int aSourceLength, IntPtr aDestination, int aDestinationLength ) + { + int ret = SymbianBytePairUnpackRaw( aSource, aSourceLength, aDestination, aDestinationLength ); + return ret; + } + + protected override int DoDecompressImage( IntPtr aSource, int aSourceLength, IntPtr aDestination, int aDestinationLength, out int aAmountOfSourceRead ) + { + int ret = 0; + aAmountOfSourceRead = 0; + IntPtr pAmountSrcRead = Marshal.AllocHGlobal( 4 ); + // + try + { + ret = SymbianBytePairUnpackImage( aSource, aSourceLength, aDestination, aDestinationLength, pAmountSrcRead ); + aAmountOfSourceRead = (int) Marshal.PtrToStructure( pAmountSrcRead, typeof( Int32 ) ); + } + finally + { + Marshal.FreeHGlobal( pAmountSrcRead ); + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Native methods + [DllImport("SymbianNativeTools.dll")] + public static extern int SymbianBytePairUnpackRaw( IntPtr aSource, int aSourceSize, IntPtr aDest, int aDestSize ); + [DllImport("SymbianNativeTools.dll")] + public static extern int SymbianBytePairUnpackImage( IntPtr aSource, + int aSourceSize, + IntPtr aDest, + int aDestSize, + IntPtr aAmountOfSourceRead ); + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Compression/Common/SymbianCompressionType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Compression/Common/SymbianCompressionType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,32 @@ + +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Runtime.InteropServices; + +namespace SymbianStructuresLib.Compression.Common +{ + public enum TSymbianCompressionType + { + ENone = 0, + EDeflate = 0x101F7AFC, + EBytePair = 0x102822AA + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Compression/Common/SymbianDecompressor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Compression/Common/SymbianDecompressor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,133 @@ + +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Runtime.InteropServices; +using SymbianUtils; +using SymbianStructuresLib.Compression.BytePair; +using SymbianStructuresLib.Compression.Inflate; + +namespace SymbianStructuresLib.Compression.Common +{ + public abstract class SymbianDecompressor : DisposableObject + { + #region Factory + public static SymbianDecompressor NewByType( TSymbianCompressionType aType ) + { + SymbianDecompressor ret = null; + // + switch ( aType ) + { + case TSymbianCompressionType.EBytePair: + ret = new SymbianDecompressorBytePair(); + break; + case TSymbianCompressionType.EDeflate: + ret = new SymbianDecompressorInflate(); + break; + } + // + return ret; + } + #endregion + + #region Constructors + protected SymbianDecompressor() + { + } + #endregion + + #region Framework API + public abstract TSymbianCompressionType Type + { + get; + } + + protected abstract int DoDecompressRaw( IntPtr aSource, int aSourceLength, IntPtr aDestination, int aDestinationLength ); + + protected virtual int DoDecompressImage( IntPtr aSource, int aSourceLength, IntPtr aDestination, int aDestinationLength, out int aAmountOfSourceRead ) + { + throw new NotImplementedException(); + } + #endregion + + #region API + public int DecompressRaw( byte[] aSource, byte[] aDestination ) + { + if ( aSource == null || aDestination == null ) + { + throw new ArgumentException( "Must supply data buffers" ); + } + // + int ret = 0; + // + unsafe + { + fixed ( byte* source = aSource ) + { + fixed ( byte* dest = aDestination ) + { + IntPtr pSource = new IntPtr( source ); + IntPtr pDest = new IntPtr( dest ); + // + ret = DoDecompressRaw( pSource, aSource.Length, pDest, aDestination.Length ); + } + } + } + // + return ret; + } + + public int DecompressImage( byte[] aSource, byte[] aDestination, out int aAmountOfSourceRead ) + { + if ( aSource == null || aDestination == null ) + { + throw new ArgumentException( "Must supply data buffers" ); + } + // + int ret = 0; + // + unsafe + { + fixed ( byte* source = aSource ) + { + fixed ( byte* dest = aDestination ) + { + IntPtr pSource = new IntPtr( source ); + IntPtr pDest = new IntPtr( dest ); + // + ret = DoDecompressImage( pSource, aSource.Length, pDest, aDestination.Length, out aAmountOfSourceRead ); + } + } + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Compression/Deflate/SymbianDecompressorInflate.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Compression/Deflate/SymbianDecompressorInflate.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Runtime.InteropServices; +using SymbianStructuresLib.Compression.Common; + +namespace SymbianStructuresLib.Compression.Inflate +{ + public class SymbianDecompressorInflate : SymbianDecompressor + { + #region Constructors + public SymbianDecompressorInflate() + { + } + #endregion + + #region From SymbianDecompressor + public override TSymbianCompressionType Type + { + get { return TSymbianCompressionType.EDeflate; } + } + + protected override int DoDecompressRaw( IntPtr aSource, int aSourceLength, IntPtr aDestination, int aDestinationLength ) + { + throw new NotSupportedException(); + } + + protected override int DoDecompressImage( IntPtr aSource, int aSourceLength, IntPtr aDestination, int aDestinationLength, out int aAmountOfSourceRead ) + { + int ret = SymbianInflateImage( aSource, aSourceLength, aDestination, aDestinationLength ); + aAmountOfSourceRead = aSourceLength; + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + [DllImport("SymbianNativeTools.dll")] + public static extern int SymbianInflateImage( IntPtr aSource, int aSourceSize, IntPtr aDest, int aDestSize ); + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Code/Code/CodeCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Code/Code/CodeCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,453 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Streams; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Common.Id; +using SymbianStructuresLib.Debug.Common.FileName; +using SymbianStructuresLib.Debug.Common.Interfaces; +using SymbianStructuresLib.Debug.Code.Interfaces; + +namespace SymbianStructuresLib.Debug.Code +{ + public sealed class CodeCollection : DisposableObject, IComparable, IArmInstructionProvider + { + #region Static constructors + public static CodeCollection New( IPlatformIdAllocator aIdAllocator, string aFileNameInHost, string aFileNameInDevice ) + { + CodeCollection ret = new CodeCollection( aIdAllocator, aFileNameInHost, aFileNameInDevice ); + return ret; + } + + public static CodeCollection NewCopy( IPlatformIdAllocator aIdAllocator, CodeCollection aCollection ) + { + CodeCollection ret = new CodeCollection( aIdAllocator, aCollection ); + return ret; + } + + public static CodeCollection NewByHostFileName( IPlatformIdAllocator aIdAllocator, string aFileName ) + { + CodeCollection ret = new CodeCollection( aIdAllocator, aFileName ); + return ret; + } + #endregion + + #region Delegates & events + public delegate void RelocationStatusChangeHandler( CodeCollection aCollection ); + public event RelocationStatusChangeHandler RelocationStatusChanged; + #endregion + + #region Constructors + private CodeCollection( IPlatformIdAllocator aIdAllocator, string aFileNameInHost ) + { + iId = aIdAllocator.AllocateId(); + iFileName = PlatformFileName.NewByHostName( aFileNameInHost ); + } + + private CodeCollection( IPlatformIdAllocator aIdAllocator, string aFileNameInHost, string aFileNameInDevice ) + : this( aIdAllocator, aFileNameInHost ) + { + iFileName.FileNameInDevice = aFileNameInDevice; + } + + private CodeCollection( IPlatformIdAllocator aIdAllocator, CodeCollection aCopy ) + { + iId = aIdAllocator.AllocateId(); + // + iCode = aCopy.iCode; + iTag = aCopy.iTag; + iFlags = aCopy.iFlags; + iTagged = aCopy.iTagged; + iBaseAddress = aCopy.iBaseAddress; + iCodeSegmentResolver = aCopy.iCodeSegmentResolver; + iRelocationHandler = aCopy.iRelocationHandler; + iFileName = PlatformFileName.New( aCopy.FileName ); + iInstructionConverter = aCopy.IfaceInstructionConverter; + iCodeSegmentResolver = aCopy.IfaceCodeSegmentResolver; + iRelocationHandler = aCopy.IfaceRelocationHandler; + } + #endregion + + #region API + public bool Contains( uint aAddress ) + { + bool ret = IsInstructionAddressValid( aAddress ); + return ret; + } + + public bool IsMatchingCodeSegment( CodeSegDefinition aCodeSegment ) + { + bool ret = false; + // + if ( iCodeSegmentResolver != null ) + { + ret = iCodeSegmentResolver.IsMatchingCodeSegment( this, aCodeSegment ); + } + else + { + PlatformFileName codeSegName = PlatformFileName.NewByDeviceName( aCodeSegment.FileName ); + ret = FileName.Equals( codeSegName ); + } + // + return ret; + } + + public void Relocate( uint aTo ) + { + if ( aTo != iBaseAddress ) + { + uint old = iBaseAddress; + iBaseAddress = aTo; + // + if ( iRelocationHandler != null ) + { + iRelocationHandler.PrepareForRelocation( this, old, BaseAddress ); + } + } + } + #endregion + + #region Properties + public uint Size + { + get + { + uint ret = 0; + if ( iCode != null ) + { + ret = (uint) iCode.Length; + } + return ret; + } + } + + public bool Tagged + { + get { return iTagged; } + set + { + iTagged = value; + } + } + + public bool IsRelocatable + { + get { return ( iFlags & TFlags.EFlagsIsRelocatable ) == TFlags.EFlagsIsRelocatable; } + set + { + lock ( iFlagLock ) + { + bool wasSet = ( iFlags & TFlags.EFlagsIsRelocatable ) == TFlags.EFlagsIsRelocatable; + if ( wasSet != value ) + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsRelocatable; + } + else + { + iFlags &= ~TFlags.EFlagsIsRelocatable; + } + + // Report event if needed + if ( RelocationStatusChanged != null ) + { + RelocationStatusChanged( this ); + } + } + } + } + } + + public bool IsFixed + { + get { return !IsRelocatable; } + set { IsRelocatable = !value; } + } + + public object Tag + { + get { return iTag; } + set + { + iTag = value; + } + } + + public uint BaseAddress + { + get + { + uint ret = iBaseAddress; + return ret; + } + } + + public bool IsCodeAvailable + { + get { return iCode != null; } + } + + public byte[] Code + { + get { return iCode; } + set + { + iCode = value; + } + } + + public PlatformId Id + { + get { return iId; } + } + + public PlatformFileName FileName + { + get { return iFileName; } + } + + public CodeCollectionList ParentList + { + get { return iParentList; } + internal set { iParentList = value; } + } + #endregion + + #region Properties - interfaces + public ICodeCollectionCodeSegmentResolver IfaceCodeSegmentResolver + { + get { return iCodeSegmentResolver; } + set { iCodeSegmentResolver = value; } + } + + public ICodeCollectionRelocationHandler IfaceRelocationHandler + { + get { return iRelocationHandler; } + set { iRelocationHandler = value; } + } + + public ICodeCollectionInstructionConverter IfaceInstructionConverter + { + get { return iInstructionConverter; } + set { iInstructionConverter = value; } + } + #endregion + + #region Internal enumerations + [Flags] + private enum TFlags : byte + { + EFlagsNone = 0, + EFlagsIsRelocatable = 1 + }; + #endregion + + #region Internal constants + #endregion + + #region Internal methods + #endregion + + #region From IArmInstructionProvider + public bool IsInstructionAddressValid( uint aAddress ) + { + bool valid = false; + // + if ( IsCodeAvailable ) + { + AddressRange range = new AddressRange( this.BaseAddress, 0 ); + range.UpdateMax( range.Min + iCode.Length ); + // + valid = range.Contains( aAddress ); + } + // + return valid; + } + + public uint GetDataUInt32( uint aAddress ) + { + uint ret = 0; + IArmInstruction[] inst = null; + // + bool available = GetInstructions( aAddress, TArmInstructionSet.EARM, 1, out inst ); + if ( available && inst.Length >= 1 ) + { + ret = inst[ 0 ].AIRawValue; + } + // + return ret; + } + + public ushort GetDataUInt16( uint aAddress ) + { + ushort ret = 0; + IArmInstruction[] inst = null; + // + bool available = GetInstructions( aAddress, TArmInstructionSet.ETHUMB, 1, out inst ); + if ( available && inst.Length >= 1 ) + { + ret = inst[ 0 ].AIRawValue; + } + // + return ret; + } + + public bool GetInstructions( uint aAddress, TArmInstructionSet aInstructionSet, int aCount, out IArmInstruction[] aInstructions ) + { + bool valid = false; + aInstructions = new IArmInstruction[ 0 ]; + + // We need the code and the instruction converter + if ( IsCodeAvailable && IfaceInstructionConverter != null ) + { + // Check range is valid + AddressRange range = new AddressRange( iBaseAddress, 0 ); + range.UpdateMax( range.Min + iCode.Length ); + uint extent = aAddress + ( (uint) aCount * (uint) aInstructionSet ); + // + valid = range.Contains( aAddress ) && range.Contains( extent ); + if ( valid ) + { + List rawInstructions = new List(); + // + using ( SymbianStreamReaderLE reader = SymbianStreamReaderLE.New( new MemoryStream( iCode ) ) ) + { + uint address = aAddress - iBaseAddress; + reader.Seek( address ); + // + for ( int i = 0; i < aCount; i++ ) + { + uint value = 0; + // + switch ( aInstructionSet ) + { + case TArmInstructionSet.ETHUMB: + value = reader.ReadUInt16(); + break; + case TArmInstructionSet.EARM: + value = reader.ReadUInt32(); + break; + default: + case TArmInstructionSet.EJAZELLE: + throw new NotSupportedException( "Jazelle is not supported" ); + } + // + rawInstructions.Add( value ); + address += (uint) aInstructionSet; + } + } + // + aInstructions = iInstructionConverter.ConvertRawValuesToInstructions( aInstructionSet, rawInstructions.ToArray(), aAddress ); + } + } + + // Return empty array if not valid + return valid; + } + #endregion + + #region From IComparable + public int CompareTo( CodeCollection aCollection ) + { + int ret = ( aCollection.FileName == this.FileName ) ? 0 : -1; + // + if ( ret == 0 ) + { + if ( BaseAddress == aCollection.BaseAddress ) + { + ret = 0; + } + else if ( BaseAddress > aCollection.BaseAddress ) + { + ret = 1; + } + else + { + ret = -1; + } + } + // + return ret; + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iTag = null; + iParentList = null; + iInstructionConverter = null; + iCodeSegmentResolver = null; + iRelocationHandler = null; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return iFileName.ToString(); + } + + public override bool Equals( object aObject ) + { + if ( aObject != null && aObject is CodeCollection ) + { + CodeCollection col = (CodeCollection) aObject; + bool ret = ( col.FileName == this.FileName ); + return ret; + } + // + return base.Equals( aObject ); + } + + public override int GetHashCode() + { + return iFileName.GetHashCode(); + } + #endregion + + #region Data members + private readonly PlatformId iId; + private readonly PlatformFileName iFileName; + private object iTag = null; + private object iFlagLock = new object(); + private byte[] iCode = null; + private uint iBaseAddress = 0; + private bool iTagged = false; + private TFlags iFlags = TFlags.EFlagsNone; + private CodeCollectionList iParentList = null; + private ICodeCollectionCodeSegmentResolver iCodeSegmentResolver = null; + private ICodeCollectionRelocationHandler iRelocationHandler = null; + private ICodeCollectionInstructionConverter iInstructionConverter = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Code/Code/CodeCollectionList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Code/Code/CodeCollectionList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,286 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using SymbianUtils; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.Debug.Common.FileName; +using SymbianStructuresLib.CodeSegments; + +namespace SymbianStructuresLib.Debug.Code +{ + public class CodeCollectionList : IEnumerable + { + #region Constructors + public CodeCollectionList() + { + } + #endregion + + #region API + public void Clear() + { + lock ( iCollections ) + { + iCollections.Clear(); + } + } + + public void Add( CodeCollection aCollection ) + { + lock ( iCollections ) + { + if ( !Contains( aCollection ) ) + { + aCollection.ParentList = this; + iCollections.Add( aCollection ); + } + else + { + throw new ArgumentException( string.Format( "Collection \'{0}\' already exists", aCollection.FileName.FileNameInHost ) ); + } + } + } + + public void Remove( CodeCollection aCollection ) + { + Predicate predicate = delegate( CodeCollection collection ) + { + return collection.Equals( aCollection ); + }; + // + lock ( iCollections ) + { + iCollections.RemoveAll( predicate ); + } + } + + public void RemoveUntagged() + { + Predicate predicate = delegate( CodeCollection collection ) + { + return collection.Tagged == false; + }; + // + lock ( iCollections ) + { + iCollections.RemoveAll( predicate ); + } + } + + public bool Contains( uint aAddress ) + { + Predicate predicate = delegate( CodeCollection collection ) + { + return collection.Contains( aAddress ); + }; + // + bool ret = false; + // + lock ( iCollections ) + { + CodeCollection found = iCollections.Find( predicate ); + if ( found != null ) + { + // Implement last-access optimisation + MakeHeadOfMRU( found ); + ret = true; + } + } + // + return ret; + } + + public bool Contains( CodeCollection aCollection ) + { + Predicate predicate = delegate( CodeCollection collection ) + { + return collection.Equals( aCollection ); + }; + // + bool ret = false; + // + lock ( iCollections ) + { + ret = iCollections.Find( predicate ) != null; + } + // + return ret; + } + + public bool GetInstructions( uint aAddress, TArmInstructionSet aInstructionSet, int aCount, out IArmInstruction[] aInstructions ) + { + Predicate predicate = delegate( CodeCollection collection ) + { + return collection.Contains( aAddress ); + }; + // + bool ret = false; + // + lock ( iCollections ) + { + CodeCollection found = iCollections.Find( predicate ); + if ( found != null ) + { + // Implement last-access optimisation + ret = found.GetInstructions( aAddress, aInstructionSet, aCount, out aInstructions ); + } + else + { + aInstructions = new IArmInstruction[ 0 ]; + } + } + // + return ret; + } + #endregion + + #region Properties + public int Count + { + get + { + lock ( iCollections ) + { + return iCollections.Count; + } + } + } + + public bool IsEmpty + { + get { return Count == 0; } + } + + public bool Tagged + { + set + { + lock ( this ) + { + Action action = delegate( CodeCollection collection ) + { + collection.Tagged = value; + }; + iCollections.ForEach( action ); + } + } + } + + public object Tag + { + get { return iTag; } + set + { + iTag = value; + } + } + + public CodeCollection this[ int aIndex ] + { + get + { + lock ( iCollections ) + { + return iCollections[ aIndex ]; + } + } + } + + public CodeCollection this[ PlatformFileName aFileName ] + { + get + { + Predicate predicate = delegate( CodeCollection collection ) + { + bool same = collection.FileName.Equals( aFileName ); + return same; + }; + // + CodeCollection ret = null; + // + lock ( iCollections ) + { + ret = iCollections.Find( predicate ); + } + // + return ret; + } + } + + public CodeCollection this[ CodeSegDefinition aCodeSegment ] + { + get + { + Predicate predicate = delegate( CodeCollection collection ) + { + bool same = collection.IsMatchingCodeSegment( aCodeSegment ); + return same; + }; + // + CodeCollection ret = null; + // + lock ( iCollections ) + { + ret = iCollections.Find( predicate ); + } + // + return ret; + } + } + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( CodeCollection col in iCollections ) + { + yield return col; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CodeCollection col in iCollections ) + { + yield return col; + } + } + #endregion + + #region Internal methods + private void MakeHeadOfMRU( CodeCollection aCollection ) + { + lock ( iCollections ) + { + // Implement last-access optimisation + int pos = iCollections.IndexOf( aCollection ); + iCollections.RemoveAt( pos ); + iCollections.Insert( 0, aCollection ); + } + } + #endregion + + #region Data members + private object iTag = null; + private List iCollections = new List(); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Code/Interfaces/ICodeCollectionCodeSegmentResolver.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Code/Interfaces/ICodeCollectionCodeSegmentResolver.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.CodeSegments; + +namespace SymbianStructuresLib.Debug.Code.Interfaces +{ + public interface ICodeCollectionCodeSegmentResolver + { + bool IsMatchingCodeSegment( CodeCollection aCollection, CodeSegDefinition aCodeSegment ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Code/Interfaces/ICodeCollectionInstructionConverter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Code/Interfaces/ICodeCollectionInstructionConverter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.Arm.Instructions; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Common.Id; +using SymbianStructuresLib.Debug.Common.FileName; +using SymbianStructuresLib.Debug.Common.Interfaces; +using SymbianStructuresLib.Debug.Code.Interfaces; + +namespace SymbianStructuresLib.Debug.Code.Interfaces +{ + public interface ICodeCollectionInstructionConverter + { + IArmInstruction[] ConvertRawValuesToInstructions( TArmInstructionSet aInstructionSet, uint[] aRawValues, uint aStartingAddress ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Code/Interfaces/ICodeCollectionRelocationHandler.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Code/Interfaces/ICodeCollectionRelocationHandler.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.CodeSegments; + +namespace SymbianStructuresLib.Debug.Code.Interfaces +{ + public interface ICodeCollectionRelocationHandler + { + void PrepareForRelocation( CodeCollection aCollection, uint aOldBase, uint aNewBase ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Common/FileName/PlatformFileName.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Common/FileName/PlatformFileName.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,229 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using SymbianUtils; + +namespace SymbianStructuresLib.Debug.Common.FileName +{ + public class PlatformFileName + { + #region Static constructor + public static PlatformFileName New( PlatformFileName aCopy ) + { + PlatformFileName ret = new PlatformFileName(); + ret.FileNameInDevice = aCopy.FileNameInDevice; + ret.FileNameInHost = aCopy.FileNameInHost; + return ret; + } + + public static PlatformFileName NewByHostName( string aFileName ) + { + PlatformFileName ret = new PlatformFileName(); + + ret.FileNameInHost = aFileName; + + // Seed the device file name based upon the host info + string justFileName = Path.GetFileName( aFileName ); + ret.FileNameInDevice = Path.Combine( PlatformFileNameConstants.Device.KPathWildcardSysBin, justFileName ); + + return ret; + } + + public static PlatformFileName NewByDeviceName( string aFileName ) + { + PlatformFileName ret = new PlatformFileName(); + + ret.FileNameInDevice = aFileName; + + // Seed the device file name based upon the host info + string justFileName = Path.GetFileName( ret.FileNameInDevice ); + ret.FileNameInHost = Path.Combine( PlatformFileNameConstants.Host.KPathEpoc32ReleaseArmv5Urel, justFileName ); + + return ret; + } + #endregion + + #region Constructors + private PlatformFileName() + { + } + #endregion + + #region API + public bool Contains( string aText ) + { + string text = aText.ToUpper(); + bool ret = iFileNameInDevice.ToUpper().Contains( text ) || + iFileNameInHost.ToUpper().Contains( text ); + return ret; + } + #endregion + + #region Properties + public bool ContainsWildcard + { + get { return iFileNameInDevice.StartsWith( PlatformFileNameConstants.Device.KPathWildcardRoot ); } + } + + public string EitherFullNameButDevicePreferred + { + get + { + // Prefer the in-device file name if possible + string ret = iFileNameInDevice; + // + if ( string.IsNullOrEmpty( ret ) ) + { + ret = iFileNameInHost; + if ( string.IsNullOrEmpty( ret ) ) + { + ret = string.Empty; + } + } + // + return ret; + } + } + + public string FileNameInDevice + { + get { return iFileNameInDevice; } + set + { + string name = value; + if ( name.Length < 2 ) + { + throw new ArgumentException( "File name is invalid" ); + } + + // If the specified filename doesn't enclude a drive letter, then add one. + bool needsDrive = false; + if ( name.StartsWith( @"/" ) || name.StartsWith( @"\" ) ) + { + needsDrive = true; + } + else if ( name[ 1 ] != ':' ) + { + needsDrive = true; + } + + if ( needsDrive ) + { + StringBuilder fileName = new StringBuilder( name ); + if ( fileName[ 0 ] != Path.DirectorySeparatorChar ) + { + fileName.Insert( 0, @"\" ); + } + fileName.Insert( 0, PlatformFileNameConstants.Device.KPathWildcardRoot ); + iFileNameInDevice = string.Intern( fileName.ToString() ); + } + else + { + iFileNameInDevice = string.Intern( name ); + } + } + } + + public string FileNameInHost + { + get { return iFileNameInHost; } + set + { + iFileNameInHost = string.Intern( value ); + } + } + #endregion + + #region From System.Object + public override int GetHashCode() + { + return iFileNameInDevice.GetHashCode(); + } + + public override string ToString() + { + return EitherFullNameButDevicePreferred; + } + + public override bool Equals( object aObject ) + { + bool ret = false; + // + if ( aObject is PlatformFileName ) + { + PlatformFileName other = (PlatformFileName) aObject; + + // These are the strings we'll compare - we'll assume exact comparison + // required by default... + string pathHostThis = this.FileNameInHost; + string pathHostOther = other.FileNameInHost; + string pathDeviceThis = this.FileNameInDevice; + string pathDeviceOther = other.FileNameInDevice; + + // We must find out if this object (or aObject) contains a wildcard. + if ( this.ContainsWildcard || other.ContainsWildcard ) + { + // Compare just the in-device paths, not the drives, since one or + // other of the drive letters is unknown. + pathDeviceThis = this.FileNameInDeviceWithoutRoot; + pathDeviceOther = other.FileNameInDeviceWithoutRoot; + } + + // Now we can compare the two... + bool sameDevice = string.Compare( pathDeviceThis, pathDeviceOther, StringComparison.CurrentCultureIgnoreCase ) == 0; + bool sameHost = string.Compare( pathHostThis, pathHostOther, StringComparison.CurrentCultureIgnoreCase ) == 0; + // + ret = ( sameDevice || sameHost ); + } + else + { + ret = base.Equals( aObject ); + } + // + return ret; + } + #endregion + + #region Internal methods + internal string FileNameInDeviceWithoutRoot + { + get + { + string ret = iFileNameInDevice; + // + if ( ret.Length > 2 ) + { + if ( ret[ 1 ] == ':' ) + { + ret = ret.Substring( 2 ); + } + } + // + return ret; + } + } + #endregion + + #region Data members + private string iFileNameInDevice = string.Empty; + private string iFileNameInHost = string.Empty; + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Common/FileName/PlatformFileNameConstants.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Common/FileName/PlatformFileNameConstants.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianStructuresLib.Debug.Common.FileName +{ + public static class PlatformFileNameConstants + { + public static class Device + { + public const string KPathWildcardRoot = "?:"; + public const string KPathWildcardSysBin = @"?:\sys\bin\"; + } + + public static class Host + { + public const string KPathEpoc32ReleaseArmv5Urel = @"\epoc32\release\armv5\urel\"; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Common/Id/PlatformIdAllocator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Common/Id/PlatformIdAllocator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Text; +using SymbianStructuresLib.Debug.Common.Interfaces; + +namespace SymbianStructuresLib.Debug.Common.Id +{ + public class PlatformIdAllocator : IPlatformIdAllocator + { + #region Constructors + public PlatformIdAllocator() + : this( PlatformId.KInitialValue ) + { + } + + public PlatformIdAllocator( uint aInitialId ) + { + iId = aInitialId; + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal constants + #endregion + + #region IPlatformIdAllocator Members + public PlatformId AllocateId() + { + return new PlatformId( ++iId ); + } + #endregion + + #region Data members + private uint iId = 0u; + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Common/Id/PlatformlId.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Common/Id/PlatformlId.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections; +using System.Text; +using SymbianStructuresLib.Debug.Common.Interfaces; + +namespace SymbianStructuresLib.Debug.Common.Id +{ + public class PlatformId : IComparable + { + #region Constructors + public PlatformId( uint aId ) + { + iValue = aId; + } + + public PlatformId( PlatformId aId ) + : this( aId.Value ) + { + } + #endregion + + #region Constants + public const uint KInitialValue = 0; + #endregion + + #region API + #endregion + + #region Properties + public uint Value + { + get { return iValue; } + set { iValue = value; } + } + #endregion + + #region Operators + public static implicit operator ulong( PlatformId aElement ) + { + return aElement.Value; + } + + public static implicit operator string( PlatformId aElement ) + { + return aElement.ToString(); + } + #endregion + + #region From System.Object + public override string ToString() + { + return iValue.ToString(); + } + #endregion + + #region From IComparable + public int CompareTo( PlatformId aOther ) + { + int ret = 1; + // + if ( aOther != null ) + { + ret = this.Value.CompareTo( aOther.Value ); + } + // + return ret; + } + #endregion + + #region Data members + private uint iValue = KInitialValue; + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Common/Interfaces/IPlatformIdAllocator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Common/Interfaces/IPlatformIdAllocator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Debug.Common.Id; + +namespace SymbianStructuresLib.Debug.Common.Interfaces +{ + public interface IPlatformIdAllocator + { + PlatformId AllocateId(); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Constants/SymbolConstants.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Constants/SymbolConstants.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Debug.Common.FileName; + +namespace SymbianStructuresLib.Debug.Symbols.Constants +{ + public static class SymbolConstants + { + public const int KNullEntryAddress = 0; + + public const string KNonMatchingObjectName = "Unknown Object"; + public const string KNonMatchingInternedName = "Unknown Symbol"; + public const string KUnknownOffset = "[+ ??????]"; + + public static readonly string[] KVTableOrTypeInfoPrefixes = new string[] { "vtable for ", "typeinfo for ", "typeinfo name for " }; + + public const string KPrefixReadonly = "Image$$ER_RO$$"; + public const string KPrefixSubObject = "__sub_object()"; + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Interfaces/ISymbolCodeSegmentResolver.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Interfaces/ISymbolCodeSegmentResolver.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.CodeSegments; + +namespace SymbianStructuresLib.Debug.Symbols.Interfaces +{ + public interface ISymbolCodeSegmentResolver + { + bool IsMatchingCodeSegment( SymbolCollection aCollection, CodeSegDefinition aCodeSegment ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Interfaces/ISymbolCollectionRelocationHandler.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Interfaces/ISymbolCollectionRelocationHandler.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.CodeSegments; + +namespace SymbianStructuresLib.Debug.Symbols.Interfaces +{ + public interface ISymbolCollectionRelocationHandler + { + void PrepareForRelocation( SymbolCollection aCollection, uint aOldBase, uint aNewBase ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Symbols/InternedName.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Symbols/InternedName.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,176 @@ +#define TRACK_INTERNING_STATISTICS +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Text; +using System.Text.RegularExpressions; +using System.ComponentModel; +using SymbianUtils.Range; +using SymbianUtils.Strings; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.MemoryModel; +using SymbianStructuresLib.Debug.Symbols.Constants; +using SymbianStructuresLib.Debug.Common.Id; + +namespace SymbianStructuresLib.Debug.Symbols +{ + internal class InternedName + { + #region Static constructors + public static InternedName NewExplicit( string aText ) + { + InternedName ret = new InternedName( aText, string.Empty ); + return ret; + } + + public static InternedName New( string aText ) + { + InternedName ret = new InternedName( aText ); + return ret; + } + #endregion + + #region Constructors + private InternedName( string aName ) + { + int doubleColonPos = aName.LastIndexOf( "::" ); + if ( doubleColonPos > 0 ) + { + iNamePart1 = aName.Substring( 0, doubleColonPos + 2 ); + iNamePart2 = aName.Substring( doubleColonPos + 2 ); + } + else if ( aName.Contains( "typeinfo for " ) ) + { + iNamePart1 = "typeinfo for "; + iNamePart2 = aName.Substring( 13 ); + } + else if ( aName.Contains( "vtable for " ) ) + { + iNamePart1 = "vtable for "; + iNamePart2 = aName.Substring( 11 ); + } + else + { + iNamePart1 = aName; + iNamePart2 = string.Empty; + } + + // Record intern stats +#if TRACK_INTERNING_STATISTICS + UpdateStatistics(); +#endif + + // Now get the interned strings + iNamePart1 = string.Intern( iNamePart1 ); + iNamePart2 = string.Intern( iNamePart2 ); + } + + private InternedName( string aPart1, string aPart2 ) + { + iNamePart1 = string.Intern( aPart1 ); + iNamePart2 = string.Intern( aPart2 ); + } + #endregion + + #region API + public static bool IsFunction( string aText ) + { + bool ret = aText.Contains( "(" ) && aText.Contains( ")" ); + return ret; + } + + public static bool IsVTable( string aText ) + { + bool ret = StringUtils.StartsWithAny( SymbolConstants.KVTableOrTypeInfoPrefixes, aText ); + return ret; + } + + public static bool IsReadOnly( string aText ) + { + bool ret = aText.StartsWith( SymbolConstants.KPrefixReadonly ); + return ret; + } + + public static bool IsSubObject( string aText ) + { + bool ret = aText.EndsWith( SymbolConstants.KPrefixSubObject ); + return ret; + } + + public void PrintStats() + { +#if TRACK_INTERNING_STATISTICS +#endif + } + #endregion + + #region Internal methods +#if TRACK_INTERNING_STATISTICS + private void UpdateStatistics() + { + UpdateStatistics( iNamePart1 ); + UpdateStatistics( iNamePart2 ); + } + + private void UpdateStatistics( string aText ) + { + if ( string.IsInterned( aText ) != null ) + { + InternStats[ 0 ].Update( aText ); + } + else + { + InternStats[ 1 ].Update( aText ); + } + } +#endif + #endregion + + #region From System.Object + public override string ToString() + { + return iNamePart1 + iNamePart2; + } + #endregion + + #region Internal classes +#if TRACK_INTERNING_STATISTICS + private class InternStatistics + { + public void Update( string aText ) + { + ++iCount; + iSize += (uint) ( aText.Length * 2 ); + } + // + private uint iCount = 0; + private ulong iSize = 0; + } +#endif + #endregion + + #region Data members + private readonly string iNamePart1; + private readonly string iNamePart2; + +#if TRACK_INTERNING_STATISTICS + private static readonly InternStatistics[] InternStats = new InternStatistics[] { new InternStatistics(), new InternStatistics() }; +#endif + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Symbols/Symbol.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Symbols/Symbol.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,605 @@ +#define TRACE_INTERNING +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Text; +using System.Text.RegularExpressions; +using System.ComponentModel; +using SymbianUtils.Range; +using SymbianUtils.Strings; +using SymbianStructuresLib.Arm; +using SymbianStructuresLib.MemoryModel; +using SymbianStructuresLib.Debug.Symbols.Constants; +using SymbianStructuresLib.Debug.Common.Id; + +namespace SymbianStructuresLib.Debug.Symbols +{ + public class Symbol : IFormattable + { + #region Static constructors + public static Symbol New( SymbolCollection aCollection ) + { + return new Symbol( aCollection ); + } + + public static Symbol NewDefault() + { + Symbol ret = new Symbol( null ); + // + ret.IsDefault = true; + ret.Size = 0; + ret.OffsetAddress = SymbolConstants.KNullEntryAddress; + ret.Object = SymbolConstants.KNonMatchingObjectName; + ret.iName = InternedName.NewExplicit( SymbolConstants.KNonMatchingInternedName ); + // + return ret; + } + + internal static Symbol NewDefault( SymbolCollection aCollection ) + { + Symbol ret = new Symbol( aCollection ); + // + ret.IsDefault = true; + ret.Size = 0; + ret.OffsetAddress = SymbolConstants.KNullEntryAddress; + ret.Object = SymbolConstants.KNonMatchingObjectName; + ret.iName = InternedName.NewExplicit( SymbolConstants.KNonMatchingInternedName ); + // + return ret; + } + + internal static Symbol NewTemp( SymbolCollection aCollection, uint aAddress ) + { + Symbol ret = new Symbol( aCollection ); + // + ret.Size = 0; + ret.OffsetAddress = aAddress - aCollection.BaseAddress; + ret.iName = InternedName.NewExplicit( "TempInternal" ); + ret.Object = "TempInternal"; + // + return ret; + } + + internal static Symbol NewClone( SymbolCollection aCollection, Symbol aSymbol ) + { + return new Symbol( aCollection, aSymbol ); + } + #endregion + + #region Constructors + private Symbol( SymbolCollection aCollection ) + { + iCollection = aCollection; + // + if ( aCollection != null ) + { + iId = aCollection.IdAllocator.AllocateId().Value; + } + } + + private Symbol( SymbolCollection aCollection, Symbol aSymbol ) + : this( aCollection ) + { + iSize = aSymbol.iSize; + iOffsetAddress = aSymbol.iOffsetAddress; + iName = aSymbol.iName; + iObject = aSymbol.iObject; + iFlags = aSymbol.iFlags; + iId = aCollection.IdAllocator.AllocateId().Value; + } + #endregion + + #region API + public bool Contains( uint aAddress ) + { + bool ret = ( aAddress >= Address && aAddress <= EndAddress ); + return ret; + } + + public uint Offset( uint aInstructionAddress ) + { + uint offset = aInstructionAddress - Address; + return offset; + } + #endregion + + #region Properties + public uint Address + { + get + { + uint address = BaseAddress + OffsetAddress; + return address; + } + } + + public uint EndAddress + { + get + { + uint address = Address; + uint size = Size; + // + if ( size > 0 ) + { + address += ( size - 1 ); + } + // + return address; + } + } + + public uint Size + { + get { return iSize; } + set + { + iSize = value; + System.Diagnostics.Debug.Assert( OffsetEndAddress >= OffsetAddress ); + } + } + + public AddressRange AddressRange + { + get { return new AddressRange( Address, EndAddress ); } + } + + public string Name + { + get + { + string ret = string.Empty; + // + if ( iName != null ) + { + ret = iName.ToString(); + } + // + return ret; + } + set + { + iName = InternedName.New( value ); + + // Remove all property flags + iFlags &= ~TFlags.EFlagsIsFunction; + iFlags &= ~TFlags.EFlagsIsVTable; + iFlags &= ~TFlags.EFlagsIsReadonly; + iFlags &= ~TFlags.EFlagsIsSubObject; + + if ( InternedName.IsVTable( value ) ) + { + iFlags |= TFlags.EFlagsIsVTable; + } + else if ( InternedName.IsReadOnly( value ) ) + { + iFlags |= TFlags.EFlagsIsReadonly; + } + else if ( InternedName.IsSubObject( value ) ) + { + iFlags |= TFlags.EFlagsIsSubObject; + } + else if ( InternedName.IsFunction( value ) ) + { + iFlags |= TFlags.EFlagsIsFunction; + } + } + } + + public string NameWithoutVTablePrefix + { + get + { + StringBuilder ret = new StringBuilder( Name ); + // + ret = ret.Replace( "vtable for ", string.Empty ); + ret = ret.Replace( "typeinfo for ", string.Empty ); + ret = ret.Replace( "typeinfo name for ", string.Empty ); + // + return ret.ToString(); + } + } + + public string Object + { + get + { + string ret = string.Empty; + // + if ( iObject != null ) + { + ret = iObject; + } + // + return ret; + } + set + { + iObject = string.Intern( value ); + } + } + + public string ObjectWithoutSection + { + get + { + string ret = string.Empty; + // + if ( Object != null ) + { + ret = Object; + // + int bracketPos = ret.IndexOf( "(" ); + if ( bracketPos > 0 ) + { + ret = ret.Substring( 0, bracketPos ).Trim(); + } + } + // + return ret; + } + } + + public SymbolCollection Collection + { + // NB: can be null + get { return iCollection; } + } + + public TArmInstructionSet InstructionSet + { + get + { + TArmInstructionSet ret = TArmInstructionSet.EARM; + uint remainder = iOffsetAddress & 0x1; + if ( remainder != 0 ) + { + ret = TArmInstructionSet.ETHUMB; + } + return ret; + } + } + + public PlatformId Id + { + get { return new PlatformId( iId ); } + } + + [Browsable( false )] + [EditorBrowsable( EditorBrowsableState.Never )] + public uint OffsetAddress + { + get + { + // Don't include the top bit in any returned address + uint ret = iOffsetAddress & 0xFFFFFFFE; + return ret; + } + set + { + iOffsetAddress = value; + } + } + + [Browsable( false )] + [EditorBrowsable( EditorBrowsableState.Never )] + private uint OffsetEndAddress + { + get + { + uint ret = iOffsetAddress + iSize; + if ( InstructionSet == TArmInstructionSet.ETHUMB && iSize > 0 ) + { + // For thumb, the end address is one too big, due to the MSB. + --ret; + } + return ret; + } + } + #endregion + + #region Type query + public bool IsFunction + { + get + { + bool ret = ( iFlags & TFlags.EFlagsIsFunction ) != 0; + return ret; + } + } + + public bool IsVTable + { + get + { + bool ret = ( iFlags & TFlags.EFlagsIsVTable ) == TFlags.EFlagsIsVTable; + return ret; + } + } + + public bool IsDefault + { + get + { + bool ret = ( iFlags & TFlags.EFlagsIsDefault ) == TFlags.EFlagsIsDefault; + return ret; + } + set + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsDefault; + } + else + { + iFlags &= ~TFlags.EFlagsIsDefault; + } + } + } + + public bool IsFromRAMLoadedCode + { + get + { + uint address = this.Address; + TMemoryModelRegion region = MMUtilities.RegionByAddress( address ); + bool ret = ( region == TMemoryModelRegion.EMemoryModelRegionRAMLoadedCode ); + return ret; + } + } + + public TSymbolType Type + { + get + { + TSymbolType ret = TSymbolType.EUnknown; + + // First check against forced flags + if ( ( iFlags & TFlags.EFlagsIsForcedSection ) == TFlags.EFlagsIsForcedSection ) + { + ret = TSymbolType.ESection; + } + else if ( ( iFlags & TFlags.EFlagsIsForcedCode ) == TFlags.EFlagsIsForcedCode ) + { + ret = TSymbolType.ECode; + } + else if ( ( iFlags & TFlags.EFlagsIsForcedData ) == TFlags.EFlagsIsForcedData ) + { + ret = TSymbolType.EData; + } + else if ( ( iFlags & TFlags.EFlagsIsForcedNumber ) == TFlags.EFlagsIsForcedNumber ) + { + ret = TSymbolType.ENumber; + } + + // If still unknown, work it out... + if ( ret == TSymbolType.EUnknown ) + { + // First entries override type + if ( ( iFlags & TFlags.EFlagsIsReadonly ) != 0 ) + { + ret = TSymbolType.EReadOnlySymbol; + } + else if ( ( iFlags & TFlags.EFlagsIsSubObject ) != 0 ) + { + ret = TSymbolType.ESubObject; + } + else if ( Address >= 0xF8000000 && Address < 0xFFEFFFFF ) + { + // ROM Symbol, Moving Memory Model + ret = TSymbolType.EROMSymbol; + } + else if ( Address >= 0xF4000000 && Address < 0xF7FFFFFF ) + { + // RAM Symbol, Moving Memory Model + ret = TSymbolType.ERAMSymbol; + } + else if ( Address >= 0x64000000 && Address < 0x64FFFFFF ) + { + // Kernel global, Moving Memory Model + ret = TSymbolType.EKernelGlobalVariable; + } + else if ( Address >= 0xc8000000 && Address < 0xC8FFFFFF ) + { + // Kernel global, Multiple Memory Model + ret = TSymbolType.EKernelGlobalVariable; + } + else if ( Address >= 0x80000000 && Address < 0x8FFFFFFF ) + { + // ROM Symbol, Multiple Memory Model + ret = TSymbolType.EROMSymbol; + } + else if ( Address >= 0x3C000000 && Address < 0x3DFFFFFF ) + { + // RAM Symbol, Moving Memory Model [1gb] + ret = TSymbolType.ERAMSymbol; + } + else if ( Address >= 0x70000000 && Address < 0x7FFFFFFF ) + { + // RAM Symbol, Moving Memory Model [2gb] + ret = TSymbolType.ERAMSymbol; + } + else if ( Address < 0x10000000 ) + { + // A non-fixed up ROFS symbol entry + ret = TSymbolType.ERAMSymbol; + } + else if ( ret != TSymbolType.EKernelGlobalVariable ) + { + bool isFunction = IsFunction; + if ( isFunction == false ) + { + ret = TSymbolType.ELabel; + } + } + } + // + return ret; + } + set + { + iFlags &= ~TFlags.EFlagsIsForcedCode; + iFlags &= ~TFlags.EFlagsIsForcedData; + iFlags &= ~TFlags.EFlagsIsForcedNumber; + iFlags &= ~TFlags.EFlagsIsForcedSection; + // + switch ( value ) + { + case TSymbolType.ESection: + iFlags |= TFlags.EFlagsIsForcedSection; + break; + case TSymbolType.ECode: + iFlags |= TFlags.EFlagsIsForcedCode; + break; + case TSymbolType.EData: + iFlags |= TFlags.EFlagsIsForcedData; + break; + case TSymbolType.ENumber: + iFlags |= TFlags.EFlagsIsForcedNumber; + break; + default: + throw new ArgumentException( "Specified type cannot be programatically set" ); + } + } + } + + public TSymbolSource Source + { + get + { + TSymbolSource ret = TSymbolSource.ESourceWasUnknown; + // + if ( ( iFlags & TFlags.EFlagsIsFromMapFile ) == TFlags.EFlagsIsFromMapFile ) + { + ret = TSymbolSource.ESourceWasMapFile; + } + else if ( ( iFlags & TFlags.EFlagsIsFromSymbolFile ) == TFlags.EFlagsIsFromSymbolFile ) + { + ret = TSymbolSource.ESourceWasSymbolFile; + } + // + return ret; + } + set + { + iFlags &= ~TFlags.EFlagsIsFromMapFile; + iFlags &= ~TFlags.EFlagsIsFromSymbolFile; + // + switch ( value ) + { + case TSymbolSource.ESourceWasMapFile: + iFlags |= TFlags.EFlagsIsFromMapFile; + break; + case TSymbolSource.ESourceWasSymbolFile: + iFlags |= TFlags.EFlagsIsFromSymbolFile; + break; + default: + case TSymbolSource.ESourceWasUnknown: + break; + } + } + } + #endregion + + #region Internal enumerations + [Flags] + private enum TFlags : ushort + { + EFlagsNone = 0, + EFlagsIsDefault = 1, + EFlagsIsVTable = 2, + EFlagsIsFunction = 4, + EFlagsIsReadonly = 8, + EFlagsIsSubObject = 16, + EFlagsIsForcedCode = 32, + EFlagsIsForcedData = 64, + EFlagsIsForcedNumber = 128, + EFlagsIsForcedSection = 256, + EFlagsIsFromMapFile = 512, + EFlagsIsFromSymbolFile = 1024 + }; + #endregion + + #region Internal methods + private uint BaseAddress + { + get + { + if ( iCollection != null ) + { + return iCollection.BaseAddress; + } + // + return 0; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + string ret = ToString( null, null ); + return ret; + } + + public string ToStringOffset( uint aFrom ) + { + uint baseAddressOffset = Offset( aFrom ); + string text = "[+ 0x" + baseAddressOffset.ToString( "x4" ) + "]"; + return text; + } + #endregion + + #region IFormattable Members + public string ToString( string aFormat, IFormatProvider aFormatProvider ) + { + string ret = string.Empty; + // + if ( string.IsNullOrEmpty( aFormat ) ) + { + ret = string.Format( "{0:x8} {1:x4} {2} [{3}]", Address, Size, Name, Object ); + } + else + { + string format = aFormat.Trim().ToUpper(); + // + if ( format == "STREAM" ) + { + ret = string.Format( "{0:x8} {1:x4} {2} [{3}]", Address, Size, Name.PadRight( 40, ' ' ), Object ); + } + else + { + throw new FormatException( String.Format( "Invalid format string: '{0}'.", aFormat ) ); + } + } + // + return ret; + } + #endregion + + #region Data members + private readonly SymbolCollection iCollection; + private readonly uint iId; // This saves 8 bytes per instance over using PlatformId directly + private uint iSize; + private uint iOffsetAddress; + private string iObject = null; + private InternedName iName = null; + private TFlags iFlags = TFlags.EFlagsNone; + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Symbols/SymbolCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Symbols/SymbolCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,980 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using System.Threading; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols.Interfaces; +using SymbianStructuresLib.Debug.Common.Id; +using SymbianStructuresLib.Debug.Common.Interfaces; +using SymbianStructuresLib.Debug.Common.FileName; + +namespace SymbianStructuresLib.Debug.Symbols +{ + public class SymbolCollection : DisposableObject, IEnumerable, IComparable, IComparer, IFormattable + { + #region Static constructors + public static SymbolCollection New( IPlatformIdAllocator aIdAllocator, string aFileNameInHost, string aFileNameInDevice ) + { + SymbolCollection ret = new SymbolCollection( aIdAllocator, aFileNameInHost, aFileNameInDevice ); + return ret; + } + + public static SymbolCollection NewCopy( IPlatformIdAllocator aIdAllocator, SymbolCollection aCollection ) + { + SymbolCollection ret = new SymbolCollection( aIdAllocator, aCollection ); + return ret; + } + + public static SymbolCollection NewByHostFileName( IPlatformIdAllocator aIdAllocator, string aFileName ) + { + SymbolCollection ret = new SymbolCollection( aIdAllocator, aFileName ); + return ret; + } + #endregion + + #region Delegates & events + public delegate void RelocationStatusChangeHandler( SymbolCollection aCollection ); + public event RelocationStatusChangeHandler RelocationStatusChanged; + #endregion + + #region Constructors + private SymbolCollection( IPlatformIdAllocator aIdAllocator, string aFileNameInHost ) + { + iOriginalCollection = null; + iId = aIdAllocator.AllocateId(); + iIdAllocator = aIdAllocator; + iFileName = PlatformFileName.NewByHostName( aFileNameInHost ); + DefaultSymbolAdd(); + } + + private SymbolCollection( IPlatformIdAllocator aIdAllocator, string aFileNameInHost, string aFileNameInDevice ) + : this( aIdAllocator, aFileNameInHost ) + { + iFileName.FileNameInDevice = aFileNameInDevice; + } + + private SymbolCollection( IPlatformIdAllocator aIdAllocator, SymbolCollection aCopy ) + { + iId = aIdAllocator.AllocateId(); + iIdAllocator = aIdAllocator; + iTag = aCopy.iTag; + iOriginalCollection = aCopy; + iFlags = aCopy.iFlags; + iTagged = aCopy.iTagged; + iBaseAddress = aCopy.iBaseAddress; + iCodeSegmentResolver = aCopy.iCodeSegmentResolver; + iRelocationHandler = aCopy.iRelocationHandler; + iFileName = PlatformFileName.New( aCopy.FileName ); + iCodeSegmentResolver = aCopy.IfaceCodeSegmentResolver; + iRelocationHandler = aCopy.IfaceRelocationHandler; + + // Deep copy symbols + foreach ( Symbol symbol in aCopy ) + { + Symbol clone = Symbol.NewClone( this, symbol ); + iSymbols.Add( clone ); + } + + // Recalculate addresses + RecalculationAddressRange(); + } + #endregion + + #region API + public void Serialize( StreamWriter aWriter ) + { + StringBuilder temp = new StringBuilder(); + // + lock ( iFileName ) + { + temp.AppendLine( string.Empty ); + temp.AppendLine( "From " + iFileName.FileNameInHost ); + temp.AppendLine( string.Empty ); + } + // + lock ( iSymbols ) + { + foreach ( Symbol symbol in iSymbols ) + { + temp.AppendLine( symbol.ToString( "stream", null ) ); + } + } + + aWriter.Write( temp.ToString() ); + } + + public void Add( Symbol aSymbol ) + { + if ( aSymbol.IsDefault ) + { + throw new ArgumentException( "Cannot add default symbol" ); + } + // + lock ( iSymbols ) + { + int count = iSymbols.Count; + if ( count == 1 ) + { + // Possibly... + DefaultSymbolRemove(); + } + + // Because count might have changed if we removed default + // symbol. + count = iSymbols.Count; + if ( count >= 1 ) + { + Symbol last = iSymbols[ count - 1 ]; + if ( aSymbol.Address < last.Address ) + { + // We appear to be adding a symbol with an earlier address, + // which implies we need to sort the collection. + lock( iFlagLock ) + { + iFlags |= TFlags.EFlagsRequiresSorting; + } + } + } + + // Now add it + iSymbols.Add( aSymbol ); + // + if ( !InTransaction ) + { + RecalculationAddressRange(); + } + } + } + + public void AddRange( IEnumerable aSymbols ) + { + TransactionBegin(); + // + try + { + foreach ( Symbol symbol in aSymbols ) + { + Add( symbol ); + } + } + finally + { + TransactionEnd(); + } + } + + public void Clear() + { + lock ( iSymbols ) + { + iSymbols.Clear(); + + // We are definitely empty so force the default symbol to be + // added irrespective of flags + DefaultSymbolAdd( true ); + } + } + + public void Remove( Symbol aSymbol ) + { + if ( aSymbol.IsDefault ) + { + throw new ArgumentException( "Cannot remove default symbol" ); + } + // + lock ( iSymbols ) + { + iSymbols.Remove( aSymbol ); + if ( iSymbols.Count == 0 ) + { + // We are definitely empty so force the default symbol to be + // added irrespective of flags + DefaultSymbolAdd( true ); + System.Diagnostics.Debug.Assert( IsEmptyApartFromDefaultSymbol ); + } + } + } + + public void RemoveAt( int aIndex ) + { + lock ( iSymbols ) + { + Symbol symbol = iSymbols[ aIndex ]; + if ( symbol.IsDefault ) + { + throw new ArgumentException( "Cannot remove default symbol" ); + } + // + iSymbols.RemoveAt( aIndex ); + if ( iSymbols.Count == 0 ) + { + // We are definitely empty so force the default symbol to be + // added irrespective of flags + DefaultSymbolAdd( true ); + System.Diagnostics.Debug.Assert( IsEmptyApartFromDefaultSymbol ); + } + } + } + + public bool Contains( uint aAddress ) + { + if ( iAddresses == null ) + { + iAddresses = new AddressRangeCollection( (IEnumerable) this ); + RecalculationAddressRange(); + } + // + bool found = iAddresses.Contains( aAddress ); + return found; + } + + public bool IsMatchingCodeSegment( CodeSegDefinition aCodeSegment ) + { + bool ret = false; + // + if ( iCodeSegmentResolver != null ) + { + ret = iCodeSegmentResolver.IsMatchingCodeSegment( this, aCodeSegment ); + } + else + { + PlatformFileName codeSegName = PlatformFileName.NewByDeviceName( aCodeSegment.FileName ); + ret = FileName.Equals( codeSegName ); + } + // + return ret; + } + + public void Sort() + { + if ( ( iFlags & TFlags.EFlagsRequiresSorting ) == TFlags.EFlagsRequiresSorting ) + { + iSymbols.Sort( this ); + RecalculationAddressRange(); + } + } + + public void SortAsync() + { + if ( ( iFlags & TFlags.EFlagsRequiresSorting ) == TFlags.EFlagsRequiresSorting ) + { + ThreadPool.QueueUserWorkItem( new WaitCallback( InitiateAsyncSort ) ); + } + } + + public void Relocate( uint aTo ) + { + uint old = iBaseAddress; + iBaseAddress = aTo; + // + if ( iRelocationHandler != null ) + { + iRelocationHandler.PrepareForRelocation( this, old, BaseAddress ); + } + // + RecalculationAddressRange(); + } + + public void TransactionBegin() + { + lock ( iFlagLock ) + { + iFlags |= TFlags.EFlagsInTransaction; + } + } + + public void TransactionEnd() + { + lock ( iFlagLock ) + { + iFlags &= ~TFlags.EFlagsInTransaction; + } + + RecalculationAddressRange(); + } + + public void Clone( IEnumerable aSymbols ) + { + // Deep copy symbols + Clear(); + try + { + TransactionBegin(); + foreach ( Symbol symbol in aSymbols ) + { + // Make sure we don't try to add the default symbol. The symbol collection + // manages this automatically. + if ( symbol.IsDefault ) + { + } + else + { + Symbol clone = Symbol.NewClone( this, symbol ); + Add( clone ); + } + } + } + finally + { + TransactionEnd(); + } + } + #endregion + + #region Properties + public int Count + { + get + { + lock ( iSymbols ) + { + return iSymbols.Count; + } + } + } + + public Symbol this[ int aIndex ] + { + get + { + lock ( iSymbols ) + { + return iSymbols[ aIndex ]; + } + } + } + + public Symbol this[ uint aAddress ] + { + get + { + // For debugging + int x = 0; + if ( x > 0 ) + { + string dump = Dump( aAddress ); + System.Diagnostics.Debug.WriteLine( dump ); + } + // + Symbol ret = null; + Symbol temp = Symbol.NewTemp( this, aAddress ); + // + lock ( iSymbols ) + { + AddressFindingComparer comparer = new AddressFindingComparer(); + int pos = iSymbols.BinarySearch( temp, comparer ); + int count = iSymbols.Count; + // + if ( pos >= 0 && pos < count ) + { + ret = iSymbols[ pos ]; + System.Diagnostics.Debug.Assert( ret.AddressRange.Contains( aAddress ) ); + } + } + // + return ret; + } + } + + public Symbol FirstSymbol + { + get + { + Symbol ret = null; + lock ( iSymbols ) + { + if ( Count > 0 ) + { + ret = this[ 0 ]; + } + } + return ret; + } + } + + public Symbol LastSymbol + { + get + { + Symbol ret = null; + lock ( iSymbols ) + { + if ( Count > 0 ) + { + ret = this[ Count - 1 ]; + } + } + return ret; + } + } + + public bool Tagged + { + get { return iTagged; } + set + { + // The 'tagged' property is one of the few that we must (and can safely) + // cascade to the original underlying collection. + // + // We do this, because when working with ROFS/relocated symbols, we generally + // clone and fixup, rather than fixup the original. This permits us to use + // a symbol collection at multiple base addresses (i.e. use the same symbols within + // different process-relative views of the "world"). + // + // If we don't cascade the tagged attribute to the original (i.e. primary) symbol + // collection, then when the client application wants to serialized tagged collections + // the ROFS collections will potentially be missing (if they have been unloaded). + if ( iOriginalCollection != null ) + { + iOriginalCollection.Tagged = value; + iTagged = value; + } + else if ( iTagged != value ) + { + iTagged = value; + if ( iTagged ) + { + System.Diagnostics.Debug.WriteLine( string.Format( "[S] TAGGING: 0x{0:x8}, {1}", this.BaseAddress, iFileName ) ); + } + } + } + } + + public bool InTransaction + { + get { return ( iFlags & TFlags.EFlagsInTransaction ) == TFlags.EFlagsInTransaction; } + } + + public bool IsRelocatable + { + get { return ( iFlags & TFlags.EFlagsIsRelocatable ) == TFlags.EFlagsIsRelocatable; } + set + { + lock ( iFlagLock ) + { + bool wasSet = ( iFlags & TFlags.EFlagsIsRelocatable ) == TFlags.EFlagsIsRelocatable; + if ( wasSet != value ) + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsRelocatable; + } + else + { + iFlags &= ~TFlags.EFlagsIsRelocatable; + } + + // Report event if needed + if ( RelocationStatusChanged != null ) + { + RelocationStatusChanged( this ); + } + } + } + } + } + + public bool IsFixed + { + get { return !IsRelocatable; } + set + { + IsRelocatable = !value; + } + } + + public bool IsEmptyApartFromDefaultSymbol + { + get + { + bool ret = ( iFlags & TFlags.EFlagsIsEmptyApartFromDefaultSymbol ) == TFlags.EFlagsIsEmptyApartFromDefaultSymbol; + return ret; + } + private set + { + lock ( iFlagLock ) + { + if ( value ) + { + iFlags |= TFlags.EFlagsIsEmptyApartFromDefaultSymbol; + } + else + { + iFlags &= ~TFlags.EFlagsIsEmptyApartFromDefaultSymbol; + } + } + } + } + + public object Tag + { + get { return iTag; } + set + { + iTag = value; + } + } + + public uint BaseAddress + { + get + { + uint ret = iBaseAddress; + return ret; + } + } + + public PlatformId Id + { + get { return iId; } + } + + public PlatformFileName FileName + { + get { return iFileName; } + } + + public SymbolCollectionList ParentList + { + get { return iParentList; } + internal set { iParentList = value; } + } + + public AddressRange SubsumedPrimaryRange + { + get + { + AddressRange ret = new AddressRange( this.BaseAddress, this.BaseAddress ); + // + if ( iAddresses != null ) + { + int count = iAddresses.Count; + for( int i=0; i= ret.Min ); + + // If the segmented address range doesn't sit within the existing + // range we are building, then we may need to extend our return + // value. + if ( !ret.Contains( segment ) ) + { + uint diff = segment.Min - ret.Max; + if ( diff <= KMaximumNonConsecutiveAddressRangeDifferenceToSubsume ) + { + ret.UpdateMax( segment.Max ); + } + } + } + } + // + return ret; + } + } + + public object SyncRoot + { + get + { + return iSymbols; + } + } + #endregion + + #region Properties - interfaces + public ISymbolCodeSegmentResolver IfaceCodeSegmentResolver + { + get { return iCodeSegmentResolver; } + set { iCodeSegmentResolver = value; } + } + + public ISymbolCollectionRelocationHandler IfaceRelocationHandler + { + get { return iRelocationHandler; } + set { iRelocationHandler = value; } + } + #endregion + + #region From IComparable + public int CompareTo( SymbolCollection aCollection ) + { + int ret = ( aCollection.FileName == this.FileName ) ? 0 : -1; + // + if ( ret == 0 ) + { + if ( BaseAddress == aCollection.BaseAddress ) + { + ret = 0; + } + else if ( BaseAddress > aCollection.BaseAddress ) + { + ret = 1; + } + else + { + ret = -1; + } + } + // + return ret; + } + #endregion + + #region From IComparer + public int Compare( Symbol aLeft, Symbol aRight ) + { + System.Diagnostics.Debug.Assert( aLeft.EndAddress >= aLeft.Address ); + System.Diagnostics.Debug.Assert( aRight.EndAddress >= aRight.Address ); + // + int ret = -1; + // + if ( aLeft.Address == aRight.Address && aLeft.EndAddress == aRight.EndAddress ) + { + ret = 0; + } + else if ( aLeft.EndAddress == aRight.Address ) + { + System.Diagnostics.Debug.Assert( aLeft.Address < aRight.Address ); + System.Diagnostics.Debug.Assert( aRight.EndAddress >= aLeft.EndAddress ); + // + ret = -1; + } + else if ( aLeft.Address == aRight.EndAddress ) + { + System.Diagnostics.Debug.Assert( aRight.Address < aLeft.Address ); + System.Diagnostics.Debug.Assert( aLeft.EndAddress >= aRight.EndAddress ); + // + ret = 1; + } + else if ( aLeft.Address > aRight.EndAddress ) + { + System.Diagnostics.Debug.Assert( aLeft.EndAddress > aRight.EndAddress ); + System.Diagnostics.Debug.Assert( aLeft.EndAddress > aRight.Address ); + ret = 1; + } + else if ( aLeft.EndAddress < aRight.Address ) + { + System.Diagnostics.Debug.Assert( aLeft.Address < aRight.EndAddress ); + System.Diagnostics.Debug.Assert( aRight.EndAddress > aLeft.EndAddress ); + ret = -1; + } + // + return ret; + } + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( Symbol entry in iSymbols ) + { + yield return entry; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( Symbol entry in iSymbols ) + { + yield return entry; + } + } + #endregion + + #region From IFormattable + public string ToString( string aFormat, IFormatProvider aFormatProvider ) + { + string ret = string.Empty; + // + if ( aFormat == null ) + { + ret = iFileName.ToString(); + } + else if ( aFormat.ToUpper() == "FULL" ) + { + ret = Dump(); + } + else + { + throw new FormatException( string.Format( "Invalid format string: '{0}'.", aFormat ) ); + } + // + return ret; + } + #endregion + + #region From System.Object + public override string ToString() + { + return iFileName.ToString(); + } + + public override bool Equals( object aObject ) + { + if ( aObject != null && aObject is SymbolCollection ) + { + SymbolCollection col = (SymbolCollection) aObject; + bool ret = ( col.FileName == this.FileName ); + return ret; + } + // + return base.Equals( aObject ); + } + + public override int GetHashCode() + { + return iFileName.GetHashCode(); + } + #endregion + + #region Internal enumerations + [Flags] + private enum TFlags : byte + { + EFlagsNone = 0, + EFlagsInTransaction = 1, + EFlagsIsRelocatable = 2, + EFlagsIsEmptyApartFromDefaultSymbol = 4, + EFlagsRequiresSorting = 8, + }; + #endregion + + #region Internal constants + private const uint KMaximumNonConsecutiveAddressRangeDifferenceToSubsume = 512; + #endregion + + #region Internal methods + private string Dump() + { + string ret = Dump( uint.MaxValue ); + return ret; + } + + private string Dump( uint aAddress ) + { +#if SYMCOL_INVARIANT_CHECK + DebugCheckInvariant(); +#endif + // + StringBuilder ret = new StringBuilder(); + // + int i = 0; + string line = string.Empty; + // + lock ( iSymbols ) + { + foreach ( Symbol entry in iSymbols ) + { + if ( aAddress != uint.MaxValue && entry.Contains( aAddress ) ) + { + line = i.ToString( "d8" ) + " * [" + entry.Address.ToString( "x8" ) + "-" + entry.EndAddress.ToString( "x8" ) + "] " + entry.Name; + } + else + { + line = i.ToString( "d8" ) + " [" + entry.Address.ToString( "x8" ) + "-" + entry.EndAddress.ToString( "x8" ) + "] " + entry.Name; + } + // + ret.AppendLine( line ); + i++; + } + } + // + return ret.ToString(); + } + + private void DefaultSymbolAdd() + { + DefaultSymbolAdd( false ); + } + + private void DefaultSymbolAdd( bool aForce ) + { +#if SYMCOL_INVARIANT_CHECK + DebugCheckInvariant(); +#endif + // + if ( !IsEmptyApartFromDefaultSymbol || aForce ) + { + lock ( iSymbols ) + { + System.Diagnostics.Debug.Assert( Count == 0 ); + Symbol def = Symbol.NewDefault( this ); + iSymbols.Add( def ); + IsEmptyApartFromDefaultSymbol = true; + } + } + } + + private void DefaultSymbolRemove() + { +#if SYMCOL_INVARIANT_CHECK + DebugCheckInvariant(); +#endif + // + if ( IsEmptyApartFromDefaultSymbol ) + { + lock ( iSymbols ) + { + int count = iSymbols.Count; + // + if ( IsEmptyApartFromDefaultSymbol ) + { + System.Diagnostics.Debug.Assert( count == 1 && this.FirstSymbol.IsDefault ); + iSymbols.RemoveAt( 0 ); + IsEmptyApartFromDefaultSymbol = false; + } +#if SYMCOL_INVARIANT_CHECK + else if ( count > 0 ) + { + System.Diagnostics.Debug.Assert( this.FirstSymbol.IsDefault == false ); + } +#endif + } + } + } + + private void InitiateAsyncSort( object aNotUsed ) + { + Sort(); + } + +#if SYMCOL_INVARIANT_CHECK + private void DebugCheckInvariant() + { + lock ( iSymbols ) + { + int count = Count; + if ( count > 0 ) + { + Symbol first = this.FirstSymbol; + if ( first.IsDefault ) + { + System.Diagnostics.Debug.Assert( IsEmptyApartFromDefaultSymbol ); + System.Diagnostics.Debug.Assert( count == 1 ); + } + } + } + } +#endif + + private void RecalculationAddressRange() + { +#if SYMCOL_INVARIANT_CHECK + DebugCheckInvariant(); +#endif + // + if ( !InTransaction ) + { + AddressRangeCollection range = new AddressRangeCollection(); + lock ( iSymbols ) + { + foreach ( Symbol entry in iSymbols ) + { + range.Add( entry.AddressRange ); + } + } + // + iAddresses = range; + } + } + #endregion + + #region Internal properties + internal IPlatformIdAllocator IdAllocator + { + get { return iIdAllocator; } + } + + internal AddressRangeCollection AddressRangeCollection + { + get { return iAddresses; } + } + #endregion + + #region Internal classes + internal class AddressFindingComparer : IComparer + { + public int Compare( Symbol aLeft, Symbol aRight ) + { + int ret = -1; + // + AddressRange lr = aLeft.AddressRange; + AddressRange rr = aRight.AddressRange; + // + if ( lr.Contains( rr ) || rr.Contains( lr ) ) + { + ret = 0; + } + else + { + ret = lr.CompareTo( rr ); + } + // + return ret; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iTag = null; + if ( iAddresses != null ) + { + iAddresses.Clear(); + } + iSymbols.Clear(); + iParentList = null; + iCodeSegmentResolver = null; + iRelocationHandler = null; + } + } + #endregion + + #region Data members + private readonly PlatformId iId; + private readonly IPlatformIdAllocator iIdAllocator; + private readonly PlatformFileName iFileName; + private readonly SymbolCollection iOriginalCollection = null; + private object iTag = null; + private object iFlagLock = new object(); + private bool iTagged = false; + private TFlags iFlags = TFlags.EFlagsNone; + private uint iBaseAddress = 0; + private AddressRangeCollection iAddresses = null; + private List iSymbols = new List(); + private SymbolCollectionList iParentList = null; + private ISymbolCodeSegmentResolver iCodeSegmentResolver = null; + private ISymbolCollectionRelocationHandler iRelocationHandler = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Symbols/SymbolCollectionList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Symbols/SymbolCollectionList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,512 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Common.FileName; + +namespace SymbianStructuresLib.Debug.Symbols +{ + public class SymbolCollectionList : IEnumerable + { + #region Constructors + public SymbolCollectionList() + { + } + #endregion + + #region API + public void Clear() + { + lock ( iCollections ) + { + iCollections.Clear(); + } + lock ( iLookupCache ) + { + iLookupCache.Clear(); + } + lock ( iFileNameDictionary ) + { + iFileNameDictionary.Clear(); + } + } + + public void Add( SymbolCollection aCollection ) + { + // Check not already added + PlatformFileName name = aCollection.FileName; + lock ( iFileNameDictionary ) + { + if ( iFileNameDictionary.ContainsKey( name ) ) + { + throw new ArgumentException( string.Format( "Collection \'{0}\' already exists", name ) ); + } + } + + // Add to file name dictionary + iFileNameDictionary.Add( name, aCollection ); + + // Add to non-optimised collection + iCollections.Add( aCollection ); + } + + public void AddAndBuildCache( SymbolCollection aCollection ) + { + Add( aCollection ); + UpdateCacheForCollection( aCollection ); + } + + public void Remove( SymbolCollection aCollection ) + { + Predicate predicate = delegate( SymbolCollection collection ) + { + return collection.Equals( aCollection ); + }; + // + lock ( iCollections ) + { + iCollections.RemoveAll( predicate ); + } + // + RemoveFromCache( aCollection ); + } + + public void RemoveUntagged() + { + Predicate predicate = delegate( SymbolCollection collection ) + { + return collection.Tagged == false; + }; + // + lock ( iCollections ) + { + iCollections.RemoveAll( predicate ); + } + + // MRU can be left intact since implicitly it should only contained tagged + // collections + } + + public void Serialize( Stream aStream ) + { + using ( StreamWriter writer = new StreamWriter( aStream ) ) + { + Action action = delegate( SymbolCollection collection ) + { + if ( collection.Tagged ) + { + collection.Serialize( writer ); + } + }; + // + lock ( this ) + { + iCollections.ForEach( action ); + } + } + } + + public bool Contains( uint aAddress ) + { + WaitForLookupCache(); + // + bool ret = false; + // + AddressCollectionPair temp = new AddressCollectionPair( new AddressRange( aAddress, aAddress ), null ); + AddressCollectionPairComparer comparer = new AddressCollectionPairComparer(); + // + lock ( iLookupCache ) + { + int pos = iLookupCache.BinarySearch( temp, comparer ); + ret = ( pos >= 0 ); + } + // + return ret; + } + + public bool Contains( SymbolCollection aCollection ) + { + bool ret = false; + + // Check not already added + PlatformFileName name = aCollection.FileName; + lock ( iFileNameDictionary ) + { + ret = iFileNameDictionary.ContainsKey( name ); + } + // + return ret; + } + + public Symbol Lookup( uint aAddress, out SymbolCollection aCollection ) + { + WaitForLookupCache(); + // + Symbol ret = null; + aCollection = null; + // + AddressCollectionPair temp = new AddressCollectionPair( new AddressRange( aAddress, aAddress ), null ); + AddressCollectionPairComparer comparer = new AddressCollectionPairComparer(); + // + lock ( iLookupCache ) + { + int pos = iLookupCache.BinarySearch( temp, comparer ); + if ( pos >= 0 ) + { + temp = iLookupCache[ pos ]; + aCollection = temp.Collection; + ret = aCollection[ aAddress ]; + } + } + // + return ret; + } + + public void SortByCollectionAddress() + { + Comparison comparer = delegate( SymbolCollection aCol1, SymbolCollection aCol2 ) + { + int ret = aCol1.BaseAddress.CompareTo( aCol2.BaseAddress ); + return ret; + }; + // + iCollections.Sort( comparer ); + } + + public void BuildLookupCache() + { + WaitForLookupCache(); + // + lock ( iLookupCache ) + { + iLookupCache.Clear(); + } + + // Build the cache in a separate thread. + // Must take the lock to either create or destroy waiter. + lock ( iWaiterSyncRoot ) + { + if ( iLookUpCacheWaiter == null ) + { + iLookUpCacheWaiter = new AutoResetEvent( false ); + ThreadPool.QueueUserWorkItem( new WaitCallback( BackgroundThreadBuildLookupCache ), null ); + } + } + } + #endregion + + #region Properties + public int Count + { + get + { + lock ( iCollections ) + { + return iCollections.Count; + } + } + } + + public bool IsEmpty + { + get { return Count == 0; } + } + + public bool Tagged + { + set + { + lock ( this ) + { + Action action = delegate( SymbolCollection collection ) + { + collection.Tagged = value; + }; + iCollections.ForEach( action ); + } + } + } + + public object Tag + { + get { return iTag; } + set + { + iTag = value; + } + } + + public SymbolCollection this[ int aIndex ] + { + get + { + lock ( iCollections ) + { + return iCollections[ aIndex ]; + } + } + } + + public SymbolCollection this[ PlatformFileName aFileName ] + { + get + { + Predicate predicate = delegate( SymbolCollection collection ) + { + bool same = collection.FileName.Equals( aFileName ); + return same; + }; + // + SymbolCollection ret = null; + // + lock ( iCollections ) + { + ret = iCollections.Find( predicate ); + } + // + return ret; + } + } + + public SymbolCollection this[ CodeSegDefinition aCodeSegment ] + { + get + { + Predicate predicate = delegate( SymbolCollection collection ) + { + bool same = collection.IsMatchingCodeSegment( aCodeSegment ); + return same; + }; + // + SymbolCollection ret = null; + // + lock ( iCollections ) + { + ret = iCollections.Find( predicate ); + } + // + return ret; + } + } + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( SymbolCollection col in iCollections ) + { + yield return col; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( SymbolCollection col in iCollections ) + { + yield return col; + } + } + #endregion + + #region Internal methods + private void WaitForLookupCache() + { + if ( iLookUpCacheWaiter != null ) + { + // Wait for the cache to become ready + iLookUpCacheWaiter.WaitOne(); + + // Must take the lock to either create or destroy waiter + lock ( iWaiterSyncRoot ) + { + iLookUpCacheWaiter.Close(); + iLookUpCacheWaiter = null; + } + } + } + + private void RemoveFromCache( SymbolCollection aCollection ) + { + // Must wait if it's being built already + WaitForLookupCache(); + + // Must take the lock to either create or destroy waiter + lock ( iWaiterSyncRoot ) + { + System.Diagnostics.Debug.Assert( iLookUpCacheWaiter == null ); + // + iLookUpCacheWaiter = new AutoResetEvent( false ); + ThreadPool.QueueUserWorkItem( new WaitCallback( BackgroundThreadRemoveFromCache ), aCollection ); + } + } + + private void BackgroundThreadBuildLookupCache( object aNotUsed ) + { + System.Diagnostics.Debug.Assert( iLookUpCacheWaiter != null ); + + // This comparer will help us sort the ranges + AddressCollectionPairComparer comparer = new AddressCollectionPairComparer(); + + // Make sorted list entries + lock ( iCollections ) + { + int colCount = iCollections.Count; + for ( int colIndex = 0; colIndex < colCount; colIndex++ ) + { + SymbolCollection collection = iCollections[ colIndex ]; + // + UpdateCacheForCollection( collection ); + } + } + + // Done building cache + iLookUpCacheWaiter.Set(); + } + + private void BackgroundThreadRemoveFromCache( object aCollection ) + { + System.Diagnostics.Debug.Assert( iLookUpCacheWaiter != null ); + SymbolCollection collection = (SymbolCollection) aCollection; + // + Predicate predicate = delegate( AddressCollectionPair pair ) + { + bool match = ( pair.Collection == collection ); + return match; + }; + // + lock ( iLookupCache ) + { + AddressCollectionPair temp = new AddressCollectionPair( new AddressRange(), collection ); + iLookupCache.RemoveAll( predicate ); + } + // + iLookUpCacheWaiter.Set(); + } + + private void UpdateCacheForCollection( SymbolCollection aCollection ) + { + bool isEmpty = aCollection.IsEmptyApartFromDefaultSymbol; + if ( isEmpty == false ) + { + AddressRangeCollection ranges = aCollection.AddressRangeCollection; + if ( ranges != null ) + { + // This comparer will help us sort the ranges + AddressCollectionPairComparer comparer = new AddressCollectionPairComparer(); + + int rangeCount = ranges.Count; + for ( int rangeIndex = 0; rangeIndex < rangeCount; rangeIndex++ ) + { + AddressRange range = ranges[ rangeIndex ]; + AddressCollectionPair pair = new AddressCollectionPair( range, aCollection ); + // + lock ( iLookupCache ) + { + int pos = iLookupCache.BinarySearch( pair, comparer ); + if ( pos >= 0 ) + { + AddressCollectionPair overlapsWith = iLookupCache[ pos ]; + System.Diagnostics.Debug.WriteLine( string.Format( "Collection {0} [{1}] overlaps with existing collection: {2} [{3}]", pair.Collection.FileName, pair.Range, overlapsWith.Collection, overlapsWith.Range ) ); + } + else + { + pos = ~pos; + iLookupCache.Insert( pos, pair ); + } + } + } + } + } + } + #endregion + + #region Internal classes + private class AddressCollectionPair + { + #region Constructors + public AddressCollectionPair( AddressRange aRange, SymbolCollection aCollection ) + { + iRange = aRange; + iCollection = aCollection; + } + #endregion + + #region Properties + public AddressRange Range + { + get { return iRange; } + } + + public SymbolCollection Collection + { + get { return iCollection; } + } + #endregion + + #region From System.Object + public override string ToString() + { + string ret = string.Format( "{0} {1}", iRange, iCollection.FileName.FileNameInDevice ); + return ret; + } + #endregion + + #region Data members + private readonly AddressRange iRange; + private readonly SymbolCollection iCollection; + #endregion + } + + private class AddressCollectionPairComparer : IComparer + { + public int Compare( AddressCollectionPair aLeft, AddressCollectionPair aRight ) + { + int ret = -1; + // + AddressRange lr = aLeft.Range; + AddressRange rr = aRight.Range; + // + if ( lr.Contains( rr ) || rr.Contains( lr ) ) + { + ret = 0; + } + else + { + ret = lr.CompareTo( rr ); + } + // + return ret; + } + } + #endregion + + #region Data members + private object iTag = null; + private object iWaiterSyncRoot = new object(); + private AutoResetEvent iLookUpCacheWaiter = null; + private List iCollections = new List(); + private List iLookupCache = new List(); + private Dictionary iFileNameDictionary = new Dictionary(); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Types/SymbolSource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Types/SymbolSource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Text; +using System.Text.RegularExpressions; +using SymbianUtils.Range; + +namespace SymbianStructuresLib.Debug.Symbols +{ + public enum TSymbolSource : sbyte + { + ESourceWasUnknown = 0, + ESourceWasMapFile, + ESourceWasSymbolFile + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Types/SymbolType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Types/SymbolType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Text; +using System.Text.RegularExpressions; +using SymbianUtils.Range; + +namespace SymbianStructuresLib.Debug.Symbols +{ + /// + /// The 'type' associated with a symbol. Note that the types are + /// ordered such that e.g. a RAM-loaded subobject will be reported + /// as "sub object" even though it is also RAM-loaded. Therefore, + /// do not rely purely on "RAM loaded" to identify all RAM loaded + /// types! + /// + public enum TSymbolType : sbyte + { + // Do not change the order - these are priority based with + // the most important symbol type appearing with a larger + // value + EUnknown = -1, + EReadOnlySymbol = 0, + EKernelGlobalVariable, + ESubObject, + ELabel, + ERAMSymbol, + EROMSymbol, + ECode, + EData, + ENumber, + ESection + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Utilities/SymbolCollectionHarmoniser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Symbols/Utilities/SymbolCollectionHarmoniser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,532 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianStructuresLib.MemoryModel; + +namespace SymbianStructuresLib.Debug.Symbols.Utilities +{ + public class SymbolCollectionHarmoniser : DisposableObject + { + #region Enumerations + public enum TCollectionType + { + EXIP = 0, + ENotXIP, + EPossiblyXIP + } + #endregion + + #region Constructors + public SymbolCollectionHarmoniser( SymbolCollection aCollection ) + : this( aCollection, TCollectionType.ENotXIP ) + { + } + + public SymbolCollectionHarmoniser( SymbolCollection aCollection, TCollectionType aType ) + { + iCollection = aCollection; + iType = aType; + + // If the collection is not XIP, then we can definitely say it is relocatable + if ( aType == TCollectionType.ENotXIP ) + { + iCollection.IsFixed = false; + } + else if ( aType == TCollectionType.EXIP ) + { + iCollection.IsFixed = true; + } + } + #endregion + + #region API + public bool Add( Symbol aSymbol ) + { + Debug( aSymbol ); + + // Perform pre-filter, which might currently include a blanket ban + // on new symbols for this collection + bool save = PreFilterBasedUponFlags( aSymbol ); + if ( save ) + { + // Flags indicate we can accept the symbol, so perform + // normal checks based upon symbol meta-data + Symbol last = this.LastSymbol; + if ( last != null && !last.IsDefault ) + { + if ( aSymbol.Size == 0 ) + { + save = ShouldSaveWhenNewSymbolHasNoSize( last, aSymbol ); + } + else + { + save = ShouldSaveWhenNewSymbolHasValidSize( last, aSymbol ); + } + } + // + if ( save ) + { + Collection.Add( aSymbol ); + } + } + + // Perform any final updates + PostFilterBasedUponFlags( aSymbol ); + // + return save; + } + #endregion + + #region Properties + public bool DisallowSymbolsOnceReadOnlyLimitReached + { + get + { + bool disallow = false; + + // We can only do this once we have one non-default symbol and after + // we have set the base address. + if ( ( iFlags & TFlags.EFlagsHaveSetXIPBaseAddress ) == TFlags.EFlagsHaveSetXIPBaseAddress ) + { + bool isEmpty = Collection.IsEmptyApartFromDefaultSymbol; + if ( !isEmpty ) + { + Symbol first = Collection.FirstSymbol; + disallow = ( first.Address == 0 ); + } + } + // + return disallow; + } + } + #endregion + + #region Internal enumerations + [Flags] + private enum TFlags + { + EFlagsNone = 0, + EFlagsUpdateLengthOfPreviousSymbol = 1, + EFlagsDisallowFurtherSymbolsForCollection = 2, + EFlagsHaveSetXIPBaseAddress = 4, + } + #endregion + + #region Internal constants + private const uint KMaxAutomaticLengthUpdateDelta = 4 * 1024 * 1024; + private const string KSectionNameMarker = "$$"; + private const string KSectionNameUserBase = "Image$$ER_RO$$Base"; + private const string KSectionNameUserLimit = "Image$$ER_RO$$Limit"; + #endregion + + #region Internal properties + private SymbolCollection Collection + { + get { return iCollection; } + } + + private Symbol LastSymbol + { + get + { + Symbol ret = null; + // + if ( Collection.Count > 0 ) + { + ret = Collection.LastSymbol; + } + // + return ret; + } + } + #endregion + + #region Internal methods + private void Debug( Symbol aSymbol ) + { + } + + private bool PreFilterBasedUponFlags( Symbol aSymbol ) + { + // Do we need to update the length of the previous symbol? + if ( ( iFlags & TFlags.EFlagsUpdateLengthOfPreviousSymbol ) == TFlags.EFlagsUpdateLengthOfPreviousSymbol ) + { + FlagBasedUpdateOfLastSymbolLength( aSymbol ); + } + + // Check for Image$$ER_RO$$Base + // This symbol is emitted for user-side code and can be used to work around some maksym problems. + string symbolName = aSymbol.Name; + if ( symbolName == KSectionNameUserBase ) + { + int count = iCollection.Count; + if ( !iCollection.IsEmptyApartFromDefaultSymbol ) + { + // Discard all the entries we've seen so far because most likely + // they are invalid. + System.Diagnostics.Debug.WriteLine( string.Format( "Discarding {0} invalid symbols for library: {1}", count, iCollection.FileName ) ); + iCollection.Clear(); + + // At this point, we need to reset the base address because any symbols that have gone + // before are invalid. + iFlags &= ~TFlags.EFlagsHaveSetXIPBaseAddress; + } + } + + // Do we need to set the base address for the symbol collection? + bool haveSetXIPBase = ( ( iFlags & TFlags.EFlagsHaveSetXIPBaseAddress ) == TFlags.EFlagsHaveSetXIPBaseAddress ); + if ( !haveSetXIPBase && iType != TCollectionType.ENotXIP ) + { + // If we're seeing the first valid symbol, then try to set the base address + bool needToSet = true; + if ( iType == TCollectionType.EPossiblyXIP ) + { + // Perhaps we're dealing with an XIP collection. In which case, we need to check + // with the memory model utility to decide if it really is or not. + // + // If the symbol address is zero (NULL), then we can't be dealing with an + // XIP collection. + if ( aSymbol.Address == 0 ) + { + // ROFS + needToSet = true; + } + else + { + TMemoryModelRegion region = MMUtilities.RegionByAddress( aSymbol.Address ); + needToSet = ( region == TMemoryModelRegion.EMemoryModelRegionROM ); + } + } + + if ( needToSet ) + { + SetCollectionBaseAddress( aSymbol ); + } + } + + bool disallowNewSymbols = ( iFlags & TFlags.EFlagsDisallowFurtherSymbolsForCollection ) == TFlags.EFlagsDisallowFurtherSymbolsForCollection; + return !disallowNewSymbols; + } + + private void PostFilterBasedUponFlags( Symbol aSymbol ) + { + string symbolName = aSymbol.Name; + if ( symbolName.Contains( KSectionNameMarker ) ) + { + if ( symbolName == KSectionNameUserLimit ) + { + // User data follows - don't update length of previous symbol + iFlags &= ~TFlags.EFlagsUpdateLengthOfPreviousSymbol; + + // If we're reading a ROFS symbol then most likely we don't want + // to allow any more entries since they start to be a little wacky... + bool disallow = this.DisallowSymbolsOnceReadOnlyLimitReached; + if ( disallow ) + { + iFlags |= TFlags.EFlagsDisallowFurtherSymbolsForCollection; + } + } + else if ( symbolName.Contains( "$$Limit" ) ) + { + // Don't change the length of a limit symbol should we happen to encounter a data item. + iFlags &= ~TFlags.EFlagsUpdateLengthOfPreviousSymbol; + } + } + } + + /// + /// Called when the new proposed symbol has no size. + /// + private bool ShouldSaveWhenNewSymbolHasNoSize( Symbol aLastSymbol, Symbol aNewSymbol ) + { + bool save = true; + // + if ( aLastSymbol.Contains( aNewSymbol.Address ) ) + { + // The new symbol overlaps the previous one. Additionally, the new symbol has a size of zero. + // + // E.g. #1: + // + // _E32Dll 0x00008000 ARM Code 40 uc_dll_.o(.emb_text) + // Symbian$$CPP$$Exception$$Descriptor 0x00008014 Data 0 uc_dll_.o(.emb_text) + // + // E.g. #2: + // + // RArray::RArray() 0x00009289 Thumb Code 10 abcd.in(t._ZN6RArrayImEC1Ev) + // RArray::RArray__sub_object() 0x00009289 Thumb Code 0 abcd.in(t._ZN6RArrayImEC1Ev) + // + // => NEW SYMBOL IS DISCARDED + // + save = false; + } + else if ( aNewSymbol.Address > aLastSymbol.EndAddress ) + { + // The new symbol has a size of zero, but it doesn't overlap with prior symbol address. + // + // _E32Dll_Body 0x00008ecd Thumb Code 34 uc_dll.o(.text) + // __DLL_Export_Table__ 0x00008f5c ARM Code 0 abcd{000a0000}.exp(ExportTable) + // DLL##ExportTableSize 0x00008f60 Data 0 abcd{000a0000}.exp(ExportTable) + // DLL##ExportTable 0x00008f64 Data 0 abcd{000a0000}.exp(ExportTable) + // CActive::Cancel() 0x00008f9c ARM Code 0 euser{000a0000}-1088.o(StubCode) + // aSymbol ==> CActive::SetActive() 0x00008fa4 ARM Code 0 euser{000a0000}-1090.o(StubCode) + // CActive::CActive__sub_object(int) 0x00008fac ARM Code 0 euser{000a0000}-1091.o(StubCode) + // CActive::~CActive__sub_object() 0x00008fb4 ARM Code 0 euser{000a0000}-1094.o(StubCode) + // RArrayBase::At(int) const 0x00008fbc ARM Code 0 euser{000a0000}-1507.o(StubCode) + // + // => NEW SYMBOL IS SAVED + // + iFlags |= TFlags.EFlagsUpdateLengthOfPreviousSymbol; + } + // + return save; + } + + /// + /// Called when the new symbol has a valid size + /// + private bool ShouldSaveWhenNewSymbolHasValidSize( Symbol aLastSymbol, Symbol aNewSymbol ) + { + bool save = true; + + if ( aLastSymbol.Contains( aNewSymbol.Address ) ) + { + // The new symbol and the last symbol somehow overlap. + if ( aLastSymbol.Address == aNewSymbol.Address && aLastSymbol.Size == aNewSymbol.Size ) + { + // The symbols start at the same address: + // + // E.g. #1: + // + // CABCMonitor::~CABCMonitor() 0x000091a5 Thumb Code 0 abcmonitor.in(i._ZN11CABCMonitorD2Ev) + // CABCMonitor::~CABCMonitor__sub_object() 0x000091a5 Thumb Code 8 abcmonitor.in(i._ZN11CABCMonitorD2Ev) + // + // E.g. #2: + // + // 8022ab10 0060 Math::DivMod64(long long, long long, long long&) + // 8022ab70 0014 Math::UDivMod64(unsigned long long, unsigned long long, unsigned long long&) + // 8022ab84 0000 $v0 + // >>> 8022ab84 0018 TRealX::Set(int) + // 8022ab9c 0044 TRealX::operator =(int) + // + // For example #1, we want to discard the new symbol and keep the original. + // For example #2, we want to discard the original symbol and keep the new one. + // + // + if ( !aLastSymbol.IsFunction ) + { + // E.g. #2 => discard old symbol + Collection.RemoveAt( Collection.Count - 1 ); + } + else + { + // E.g. #1 => discard new symbol + save = false; + } + } + else if ( aLastSymbol.Address == aNewSymbol.Address && aLastSymbol.Size == 0 ) + { + // E.g. : + // + // 8342d6b8 0000 Image$$ER_RO$$Base anon$$obj.o(linker$$defined$$symbols) + // >>> 8342d6b8 0070 _E32Startup uc_exe_.o(.emb_text) + // + Collection.RemoveAt( Collection.Count - 1 ); + } + else + { + // The symbols start at different addresses, but somehow they still overlap. + // + // E.g.: + // + // typeinfo name for CABCMonitorCapMapper 0x000094a8 Data 23 accmonitor.in(.constdata__ZTS20CABCMonitorCapMapper) + // typeinfo name for CABCMonitorContainer 0x000094bf Data 23 accmonitor.in(.constdata__ZTS20CABCMonitorContainer) + // + // In this scenario, the size of the 0x94a8 entry (23 bytes) causes it's address to overlap + // with the first byte from the entry starting at 0x94bf. + // + // In this scenario, we make an assumption that the size of the 0x94A8 entry is incorrect/invalid + uint overlap = aLastSymbol.AddressRange.Max - aNewSymbol.Address + 1; + aLastSymbol.Size = aLastSymbol.Size - overlap; + } + } + else + { + if ( aLastSymbol.Address > aNewSymbol.Address ) + { + + } + } + // + return save; + } + + private void FlagBasedUpdateOfLastSymbolLength( Symbol aSymbol ) + { + System.Diagnostics.Debug.Assert( ( iFlags & TFlags.EFlagsUpdateLengthOfPreviousSymbol ) == TFlags.EFlagsUpdateLengthOfPreviousSymbol ); + bool clearFlag = true; + + // Don't set the length of the default symbol! + if ( !Collection.IsEmptyApartFromDefaultSymbol ) + { + // Must have some existing symbol. + int count = Collection.Count; + System.Diagnostics.Debug.Assert( count > 0 ); + + // Last symbol must have bad size? + Symbol previousSymbol = LastSymbol; + System.Diagnostics.Debug.Assert( previousSymbol.Size == 0 ); + + // The new symbol must be exactly the same address as the last symbol + // (in which case, the new symbol must have a valid size or else we're + // unable to do anything sensible with it) + // + // OR + // + // The new symbol must be after the last symbol. It cannot be before. + if ( aSymbol.Address < previousSymbol.Address ) + { + // Data can confuse us, so skip when the address is earlier. E.g.: + // + // 83409b88 0000 .ARM.exidx$$Base uc_exe_.o(.ARM.exidx) + // 83409f80 0000 .ARM.exidx$$Limit xxx.in(.ARM.exidx) + // 83409f80 0000 Image$$ER_RO$$Limit anon$$obj.o(linker$$defined$$symbols) + // >> 00400000 0008 AllCapabilities xxx.in(.data) + // 00400008 0008 DisabledCapabilities xxx.in(.data) + // + clearFlag = true; + } + else + { + if ( aSymbol.Address == previousSymbol.Address ) + { + if ( aSymbol.Size > 0 ) + { + // Okay, the new symbol has a valid size, the old one didn't. + previousSymbol.Size = aSymbol.Size; + } + else + { + // Hmm, neither the last or new symbol have a valid size. + // Nothing we can do in this case... + clearFlag = false; + } + } + else + { + // Need to work out the length of the previous symbol by comparing the + // address of this symbol against it. + uint delta = aSymbol.Address - previousSymbol.Address; + + if ( delta > KMaxAutomaticLengthUpdateDelta ) + { + // The delta is huge. Don't allow this kind of update. + } + else if ( delta > 1 ) + { + // It's okay, this symbol had a later address than the last one + // This is normal. + previousSymbol.Size = delta - 1; + } + else + { + // This is not good. Two symbols both have the same address. In this + // situation discard the old symbol and take the new one instead because + // in all aspects other than name, they are identical. + Collection.RemoveAt( count - 1 ); + } + } + } + } + + if ( clearFlag ) + { + iFlags &= ~TFlags.EFlagsUpdateLengthOfPreviousSymbol; + } + } + + private void SetCollectionBaseAddress( Symbol aSymbolToUse ) + { + uint baseAddress = aSymbolToUse.Address; + bool haveSet = ( iFlags & TFlags.EFlagsHaveSetXIPBaseAddress ) == TFlags.EFlagsHaveSetXIPBaseAddress; + System.Diagnostics.Debug.Assert( haveSet == false ); + + // Relocate (changes base address) + iCollection.Relocate( baseAddress ); + iFlags |= TFlags.EFlagsHaveSetXIPBaseAddress; + + // The symbol address needs to be reset to zero (i.e. start of collection) + uint symbolSize = aSymbolToUse.Size; + aSymbolToUse.OffsetAddress = 0; + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + // When we aren't sure if we're being used to harmonise an XIP collection + // we must check whether the base address has been set to something other than + // zero and that the address is in the XIP range. + // NB: Other cases are handled in the constructor. + if ( iType == TCollectionType.EPossiblyXIP ) + { + if ( !iCollection.IsEmptyApartFromDefaultSymbol ) + { + Symbol first = iCollection.FirstSymbol; + uint address = first.Address; + if ( address > 0 ) + { + TMemoryModelRegion region = MMUtilities.RegionByAddress( address ); + bool isFixed = ( region == TMemoryModelRegion.EMemoryModelRegionROM ); + iCollection.IsFixed = isFixed; + } + else + { + // First address is zero, indicates RAM-loaded code and therefore + // non-XIP. + iCollection.IsFixed = false; + } + } + else + { + // The collection only contains the default symbol so in that case + // it can be thought to be relocatable (although in practise that wouldn't + // be very helpful). The main point is that we don't want this collection + // to start matching null addresses (quite common when performing symbolic + // lookup). + iCollection.IsFixed = false; + } + } + } + } + #endregion + + #region Data members + private readonly SymbolCollection iCollection; + private readonly TCollectionType iType; + private TFlags iFlags = TFlags.EFlagsNone; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Trace/TraceIdentifier.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Trace/TraceIdentifier.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SymbianUtils; +using SymbianUtils.Threading; + +namespace SymbianStructuresLib.Debug.Trace +{ + public class TraceIdentifier + { + #region Constructors + public TraceIdentifier( uint aComponent, uint aGroup, uint aId ) + { + iComponent = aComponent; + iGroup = aGroup; + iId = aId; + } + #endregion + + #region API + #endregion + + #region Properties + public uint Component + { + get { return iComponent; } + } + + public uint Group + { + get { return iGroup; } + } + + public uint Id + { + get { return iId; } + } + + public TraceLocation Location + { + get { return iLocation; } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "[{0:x8} | {1:x4} | {2:x4}]", iComponent, iGroup, iId ); + return ret.ToString(); + } + #endregion + + #region Data members + private readonly uint iComponent; + private readonly uint iGroup; + private readonly uint iId; + private TraceLocation iLocation = new TraceLocation(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Trace/TraceLine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Trace/TraceLine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,342 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SymbianUtils; +using SymbianUtils.Threading; + +namespace SymbianStructuresLib.Debug.Trace +{ + public class TraceLine : IFormattable + { + #region Enumerations + public enum TType + { + /// + /// Plain text trace data + /// + ETypeText = 0, + + /// + /// Binary trace data that has been decoded back to text + /// + ETypeBinary, + + /// + /// Raw trace data is (usually) binary data that could not be decoded + /// + ETypeRaw + } + #endregion + + #region Factory + public static TraceLine NewText( TraceTimeStamp aTimeStamp, string aPayload ) + { + TraceLine ret = new TraceLine( aTimeStamp, aPayload, TType.ETypeText ); + return ret; + } + + public static TraceLine NewRaw( TraceTimeStamp aTimeStamp, byte[] aRawData ) + { + TraceLine ret = new TraceLine( aTimeStamp, aRawData ); + return ret; + } + + public static TraceLine NewBinary( TraceTimeStamp aTimeStamp, string aPayload ) + { + TraceLine ret = new TraceLine( aTimeStamp, aPayload, TType.ETypeBinary ); + return ret; + } + #endregion + + #region Constructors + static TraceLine() + { + TraceIdentifier temp = new TraceIdentifier( 0, 0, 0 ); + iTraceIdentifierWidthInCharacters = temp.ToString().Length; + } + + private TraceLine( TraceTimeStamp aTimeStamp, string aPayload, TType aType ) + { + iTimeStamp = aTimeStamp; + iPayload = aPayload; + iType = aType; + } + + private TraceLine( TraceTimeStamp aTimeStamp, byte[] aRawData ) + : this( aTimeStamp, string.Empty, TType.ETypeRaw ) + { + StringBuilder payload = new StringBuilder(); + // + foreach ( byte b in aRawData ) + { + payload.AppendFormat( "{0:x2} ", b ); + } + // + iPayload = payload.ToString(); + } + #endregion + + #region API + public void AddPrefix( int aOrder, string aValue ) + { + if ( string.IsNullOrEmpty( aValue ) == false ) + { + TXffix item = new TXffix( aOrder, aValue ); + InsertInSortedOrder( ref iPrefixes, item ); + } + } + + public void AddSuffix( int aOrder, string aValue ) + { + if ( string.IsNullOrEmpty( aValue ) == false ) + { + TXffix item = new TXffix( aOrder, aValue ); + InsertInSortedOrder( ref iSuffixes, item ); + } + } + #endregion + + #region Properties + public TType Type + { + get { return iType; } + } + + public string Prefix + { + get + { + string ret = XffixListToString( iPrefixes ); + return ret; + } + } + + public string Suffix + { + get + { + string ret = XffixListToString( iSuffixes ); + return ret; + } + } + + public string Payload + { + get { return iPayload; } + } + + public uint ContextId + { + get { return iContextId; } + set { iContextId = value; } + } + + public bool HasIdentifier + { + get { return iIdentifier != null; } + } + + public TraceTimeStamp TimeStamp + { + get { return iTimeStamp; } + } + + public TraceIdentifier Identifier + { + get { return iIdentifier; } + set { iIdentifier = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + + // First comes time stamp + ret.Append( iTimeStamp.ToString() + " " ); + + // Prefix with type + switch ( iType ) + { + case TType.ETypeBinary: + ret.Append( "[BIN]" ); + break; + case TType.ETypeRaw: + ret.Append( "[RAW]" ); + break; + case TType.ETypeText: + ret.Append( "[ASC]" ); + break; + default: + ret.Append( "[???]" ); + break; + } + ret.Append( " " ); + + // Context Id (if available) + if ( iContextId != 0 ) + { + ret.AppendFormat( "THD: [{0:x8}]", iContextId ); + } + else + { + ret.Append( " " ); + } + ret.Append( " " ); + + // Add identifier if present + if ( iIdentifier != null ) + { + ret.Append( "ID: " + iIdentifier.ToString() ); + } + else + { + ret.Append( " " ); + ret.Append( "".PadRight( iTraceIdentifierWidthInCharacters, ' ' ) ); + } + + // Text aspect + ret.Append( this.GetText() ); + + // Done + return ret.ToString(); + } + #endregion + + #region From IFormattable + public string ToString( string aFormat, IFormatProvider formatProvider ) + { + string ret = string.Empty; + // + if ( aFormat.ToUpper() == "TEXT" ) + { + ret = this.GetText(); + } + else + { + ret = this.ToString(); + } + // + return ret; + } + #endregion + + #region Internal constants + #endregion + + #region Internal class + private class TXffix : IComparer + { + #region Constructors + public TXffix( int aOrder, string aValue ) + { + iOrder = aOrder; + iValue = aValue; + } + #endregion + + #region From System.Object + public override string ToString() + { + return iValue; + } + #endregion + + #region From IComparer + public int Compare( TXffix aLeft, TXffix aRight ) + { + int ret = aLeft.iOrder.CompareTo( aRight.iOrder ); + return ret; + } + #endregion + + #region Data members + private readonly int iOrder; + private readonly string iValue; + #endregion + } + #endregion + + #region Internal methods + private void InsertInSortedOrder( ref List aList, TXffix aValue ) + { + if ( aList == null ) + { + aList = new List(); + aList.Add( aValue ); + } + else + { + int pos = aList.BinarySearch( aValue, aValue as IComparer ); + if ( pos < 0 ) + { + pos = ~pos; + } + aList.Insert( pos, aValue ); + } + } + + private string XffixListToString( List aList ) + { + string ret = string.Empty; + // + if ( aList != null ) + { + StringBuilder sb = new StringBuilder(); + // + foreach ( TXffix item in aList ) + { + sb.Append( item ); + sb.Append( " " ); + } + // + ret = sb.ToString(); + } + // + return ret; + } + + private string GetText() + { + StringBuilder ret = new StringBuilder(); + + // Now prefix, payload, suffix + string prefix = XffixListToString( iPrefixes ); + string suffix = XffixListToString( iSuffixes ); + + ret.AppendFormat( " {0}{1}{2}", prefix, iPayload, suffix ); + + return ret.ToString(); + } + #endregion + + #region Data members + private static int iTraceIdentifierWidthInCharacters; + private readonly TraceTimeStamp iTimeStamp; + private readonly string iPayload; + private readonly TType iType; + private uint iContextId = 0; + private List iPrefixes = null; + private List iSuffixes = null; + private TraceIdentifier iIdentifier = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Trace/TraceLocation.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Trace/TraceLocation.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SymbianUtils; +using SymbianUtils.Threading; + +namespace SymbianStructuresLib.Debug.Trace +{ + public class TraceLocation + { + #region Constructors + public TraceLocation() + { + } + #endregion + + #region API + #endregion + + #region Properties + public string File + { + get { return iFile; } + set { iFile = value; } + } + + public uint Line + { + get { return iLine; } + set { iLine = value; } + } + + public string Class + { + get { return iClass; } + set { iClass = value; } + } + + public string Method + { + get { return iMethod; } + set { iMethod = value; } + } + #endregion + + #region Data members + private string iFile = string.Empty; + private string iClass = string.Empty; + private string iMethod = string.Empty; + private uint iLine = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Trace/TraceTimeStamp.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Debug/Trace/TraceTimeStamp.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using SymbianUtils; +using SymbianUtils.Threading; + +namespace SymbianStructuresLib.Debug.Trace +{ + public class TraceTimeStamp : IFormattable + { + #region Constructors + public TraceTimeStamp( ulong aNanoSeconds ) + { + iValue = aNanoSeconds; + } + #endregion + + #region API + #endregion + + #region Properties + public ulong NanoSeconds + { + get { return iValue; } + } + #endregion + + #region From System.Object + public override string ToString() + { + string ret = ToString( "full", null ); + return ret; + } + #endregion + + #region From IFormattable + public string ToString( string aFormat, IFormatProvider aFormatProvider ) + { + StringBuilder ret = new StringBuilder(); + // + if ( aFormat == "nanoseconds" ) + { + ret.AppendFormat( "[{0:d}]", iValue ); + } + else + { + try + { + ulong milliseconds = iValue / KNanosecondsToMilliseconds; + ulong ticks = milliseconds * (ulong) TimeSpan.TicksPerMillisecond; + + // Now we have a time span, but it includes the rather ugly number of days + // and also an inaccurate number of microseconds. + TimeSpan ts = new TimeSpan( (long) ticks ); + + // First with discard all the milli seconds + ts = ts.Subtract( new TimeSpan( 0, 0, 0, 0, ts.Milliseconds ) ); + + // Next, we calculate the microseconds fraction + ulong oneNsInSeconds = KNanosecondsToMilliseconds * 1000; + ulong totalNsInSeconds = (ulong) ( ts.TotalSeconds * oneNsInSeconds ); + ulong nsLeftOver = iValue % totalNsInSeconds; + float usFraction = (float) nsLeftOver / (float) oneNsInSeconds; + + // Now discard the number of days - we're not interested in this at all. + ts = ts.Subtract( new TimeSpan( ts.Days, 0, 0, 0, 0 ) ); + + // Finally, we can assemble the time stamp. First we'll add in the + // hh:mm:ss part, and there will be no ms, so the decimal aspect is + // entirely missing at this stage. + ret.Append( ts.ToString() ); + + // Next, we'll add back in the fractional part, ignoring the leading 0 prefix + // (i.e. the non fraction part of the string representation of a fractional number, + // e.g. in 0.05, we throw away the leading 0, to leave .05). + string fraction = usFraction.ToString( "0.00000000" ).Substring( 1 ); + ret.Append( fraction ); + } + catch + { + // Fall back + ret.Append( this.ToString() ); + } + } + // + return ret.ToString(); + } + #endregion + + #region Internal constants + private const ulong KNanosecondsToMilliseconds = 1000000; + + private const int TEN = 10; + private const int THOUSAND = 1000; + private const int HOURS_IN_DAY = 24; + private const int MINUTES_IN_HOUR = 60; + private const int SECONDS_IN_MINUTE = 60; + private const int MILLISECS_IN_SECOND = THOUSAND; + private const ulong MILLISECS_IN_MINUTE = MILLISECS_IN_SECOND * SECONDS_IN_MINUTE; + private const ulong MILLISECS_IN_HOUR = MILLISECS_IN_MINUTE * MINUTES_IN_HOUR; + private const ulong MILLISECS_IN_DAY = MILLISECS_IN_HOUR * HOURS_IN_DAY; + #endregion + + #region Data members + private ulong iValue; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/MemoryModel/MMUtilities.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/MemoryModel/MMUtilities.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,343 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; + +#region MOVING MEMORY MODEL +// 00000000-003FFFFF Unmapped +// 00400000-2FFFFFFF Moving process data +// 30000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M, always ends at 40000000) +// 40000000-5FFFFFFF RAM drive +// 60000000-60001FFF Super page/CPU page +// 61000000-61003FFF Page directory (16K) +// 61020000-6103FFFF Page table info (4096 * 8bytes = 32K) +// 61100000-611FFFFF Cache flush area +// 61200000-612FFFFF Alternate cache flush area +// 62000000-623FFFFF Page tables (up to 4096 * 1K) +// 63000000-63FFFFFF Primary I/O mappings +// 64000000-64FFFFFF Kernel .data/.bss, initial stack, kernel heap +// 65000000-655FFFFF fixed processes - usually 2 or 3Mb each. +// 65600000-F1FFFFFF Kernel section (includes extra I/O mappings) +// F2000000-F3FFFFFF Kernel code (RAM size/2) +// F4000000-F7FFFFFF User code (RAM size) +// F8000000-FFEFFFFF ROM +// FFF00000-FFFFFFFF Exception vectors +#endregion +#region MULTIPLE MEMORY MODEL +// Linear address map (1Gb configuration): +// 00000000-003FFFFF Unmapped +// 00400000-1FFFFFFF Local data +// 20000000-3BFFFFFF Shared data +// 3C000000-3DFFFFFF RAM loaded code (=phys ram size up to 256M) +// 3E000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M) +// 40000000-7FFFFFFF Unused +// +// 80000000-8FFFFFFF ROM +// 90000000-9FFFFFFF User Global Area +// A0000000-BFFFFFFF RAM drive +// C0000000-C0001FFF Super page/CPU page +// C0040000-C00403FF ASID info (256 ASIDs) +// C0080000-C00FFFFF Page table info +// C1000000-C13FFFFF Page directories (up to 256 * 16KB) +// C2000000-C5FFFFFF Page tables +// C6000000-C6FFFFFF Primary I/O mappings +// C7000000-C7FFFFFF +// C8000000-C8FFFFFF Kernel .data/.bss, initial stack, kernel heap +// C9000000-C91FFFFF Kernel stacks +// C9200000-FFEFFFFF Extra kernel mappings (I/O, RAM loaded device drivers) +// FFF00000-FFFFFFFF Exception vectors +// +// +// Linear address map (2Gb configuration): +// 00000000-003FFFFF Unmapped +// 00400000-37FFFFFF Local data +// 38000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M) +// 40000000-6FFFFFFF Shared data +// 70000000-7FFFFFFF RAM loaded code (=phys ram size up to 256M) +// +// 80000000-8FFFFFFF ROM +// 90000000-9FFFFFFF User Global Area +// A0000000-BFFFFFFF RAM drive +// C0000000-C0001FFF Super page/CPU page +// C0040000-C00403FF ASID info (256 ASIDs) +// C0080000-C00FFFFF Page table info +// C1000000-C13FFFFF Page directories (up to 256 * 16KB) +// C2000000-C5FFFFFF Page tables +// C6000000-C6FFFFFF Primary I/O mappings +// C7000000-C7FFFFFF +// C8000000-C8FFFFFF Kernel .data/.bss, initial stack, kernel heap +// C9000000-C91FFFFF Kernel stacks +// C9200000-FFEFFFFF Extra kernel mappings (I/O, RAM loaded device drivers) +// FFF00000-FFFFFFFF Exception vectors +#endregion + +namespace SymbianStructuresLib.MemoryModel +{ + public static class MMUtilities + { + public static TMemoryModelType TypeByAddress( long aAddress ) + { + // This is not a very good way of doing this. Should be + // either a UI option or then something in the symbol file + // that we are reading... + TMemoryModelType ret = TMemoryModelType.EMemoryModelUnknown; + // + if ( aAddress >= 0xc8000000 && aAddress < 0xC8FFFFFF) + { + // Kernel global, Multiple Memory Model + ret = TMemoryModelType.EMemoryModelMultiple; + } + else if ( aAddress >= 0x80000000 && aAddress < 0x8FFFFFFF ) + { + // ROM Symbol, Multiple Memory Model + ret = TMemoryModelType.EMemoryModelMultiple; + } + else if ( aAddress >= 0x3C000000 && aAddress < 0x3DFFFFFF ) + { + // [1gb] RAM Symbol, Moving Memory Model + ret = TMemoryModelType.EMemoryModelMultiple; + } + else if ( aAddress >= 0x70000000 && aAddress < 0x7FFFFFFF ) + { + // [2gb] RAM Symbol, Moving Memory Model + ret = TMemoryModelType.EMemoryModelMultiple; + } + else if ( aAddress >= 0xF8000000 && aAddress < 0xFFEFFFFF ) + { + // ROM Symbol, Moving Memory Model + ret = TMemoryModelType.EMemoryModelMoving; + } + else if ( aAddress >= 0xF4000000 && aAddress < 0xF7FFFFFF ) + { + // RAM Symbol, Moving Memory Model + ret = TMemoryModelType.EMemoryModelMoving; + } + else if ( aAddress >= 0x64000000 && aAddress < 0x64FFFFFF ) + { + // Kernel global, Moving Memory Model + ret = TMemoryModelType.EMemoryModelMoving; + } + + return ret; + } + + public static TMemoryModelRegion RegionByAddress( long aAddress ) + { + TMemoryModelRegion region = TMemoryModelRegion.EMemoryModelRegionUnknown; + // + TMemoryModelType type = TypeByAddress( aAddress ); + if ( type != TMemoryModelType.EMemoryModelUnknown ) + { + region = RegionByAddress( aAddress, type ); + } + // + return region; + } + + public static TMemoryModelRegion RegionByAddress( long aAddress, TMemoryModelType aType ) + { + TMemoryModelRegion ret = TMemoryModelRegion.EMemoryModelRegionUnknown; + // + if ( aType == TMemoryModelType.EMemoryModelMoving ) + { + #region Moving Memory Model + if ( aAddress >= 0x00000000 && aAddress < 0x003FFFFF ) + { + // 00000000-003FFFFF Unmapped + ret = TMemoryModelRegion.EMemoryModelRegionUnmapped; + } + else if ( aAddress >= 0x00400000 && aAddress < 0x2FFFFFFF ) + { + // 00400000-2FFFFFFF Moving process data + ret = TMemoryModelRegion.EMemoryModelRegionMovingProcessData; + } + else if ( aAddress >= 0x30000000 && aAddress < 0x3FFFFFFF ) + { + // 30000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M, always ends at 40000000) + ret = TMemoryModelRegion.EMemoryModelRegionDLLStaticData; + } + else if ( aAddress >= 0x40000000 && aAddress < 0x5FFFFFFF ) + { + // 40000000-5FFFFFFF RAM drive + ret = TMemoryModelRegion.EMemoryModelRegionRAMDrive; + } + else if ( aAddress >= 0x60000000 && aAddress < 0x60001FFF ) + { + // 60000000-60001FFF Super page/CPU page + ret = TMemoryModelRegion.EMemoryModelRegionSuperAndCPUPages; + } + else if ( aAddress >= 0x61000000 && aAddress < 0x61003FFF ) + { + // 61000000-61003FFF Page directory (16K) + ret = TMemoryModelRegion.EMemoryModelRegionPageDirectories; + } + else if ( aAddress >= 0x61020000 && aAddress < 0x6103FFFF ) + { + // 61020000-6103FFFF Page table info (4096 * 8bytes = 32K) + ret = TMemoryModelRegion.EMemoryModelRegionPageTableInfo; + } + else if ( aAddress >= 0x61100000 && aAddress < 0x611FFFFF ) + { + // 61100000-611FFFFF Cache flush area + ret = TMemoryModelRegion.EMemoryModelRegionCacheFlushArea; + } + else if ( aAddress >= 0x61200000 && aAddress < 0x612FFFFF ) + { + // 61200000-612FFFFF Alternate cache flush area + ret = TMemoryModelRegion.EMemoryModelRegionCacheFlushAreaAlternate; + } + else if ( aAddress >= 0x62000000 && aAddress < 0x623FFFFF ) + { + // 62000000-623FFFFF Page tables (up to 4096 * 1K) + ret = TMemoryModelRegion.EMemoryModelRegionPageTables; + } + else if ( aAddress >= 0x63000000 && aAddress < 0x63FFFFFF ) + { + // 63000000-63FFFFFF Primary I/O mappings + ret = TMemoryModelRegion.EMemoryModelRegionPrimaryIOMappings; + } + else if ( aAddress >= 0x64000000 && aAddress < 0x64FFFFFF ) + { + // 64000000-64FFFFFF Kernel .data/.bss, initial stack, kernel heap + ret = TMemoryModelRegion.EMemoryModelRegionKernelGlobalsInitialStackKernelHeap; + } + else if ( aAddress >= 0x65000000 && aAddress < 0x655FFFFF ) + { + // 65000000-655FFFFF fixed processes - usually 2 or 3Mb each. + ret = TMemoryModelRegion.EMemoryModelRegionFixedProcesses; + } + else if ( aAddress >= 0x65600000 && aAddress < 0xF1FFFFFF ) + { + // 65600000-F1FFFFFF Kernel section (includes extra I/O mappings) + ret = TMemoryModelRegion.EMemoryModelRegionExtraKernelMappings; + } + else if ( aAddress >= 0xF2000000 && aAddress < 0xF3FFFFFF ) + { + // F2000000-F3FFFFFF Kernel code (RAM size/2) + ret = TMemoryModelRegion.EMemoryModelRegionKernelCode; + } + else if ( aAddress >= 0xF4000000 && aAddress < 0xF7FFFFFF ) + { + // F4000000-F7FFFFFF User code (RAM size) + ret = TMemoryModelRegion.EMemoryModelRegionUserCode; + } + else if ( aAddress >= 0xF8000000 && aAddress < 0xFFEFFFFF ) + { + // F8000000-FFEFFFFF ROM + ret = TMemoryModelRegion.EMemoryModelRegionROM; + } + else if ( aAddress >= 0xFFF00000 && aAddress < 0xFFFFFFFF ) + { + // FFF00000-FFFFFFFF Exception vectors + ret = TMemoryModelRegion.EMemoryModelRegionExceptionVectors; + } + #endregion + } + else if ( aType == TMemoryModelType.EMemoryModelMultiple ) + { + #region Multiple Memory Model + if ( aAddress >= 0x00000000 && aAddress < 0x003FFFFF ) + { + // 00000000-003FFFFF Unmapped + ret = TMemoryModelRegion.EMemoryModelRegionUnmapped; + } + else if ( aAddress >= 0x00400000 && aAddress < 0x6FFFFFFF ) + { + // Skip overlapping 2gb vs 1gb regions + ret = TMemoryModelRegion.EMemoryModelRegionUnknown; + } + else if ( aAddress >= 0x70000000 && aAddress < 0x7FFFFFFF ) + { + // 70000000-7FFFFFFF RAM Loaded Code + ret = TMemoryModelRegion.EMemoryModelRegionRAMLoadedCode; + } + else if ( aAddress >= 0x80000000 && aAddress < 0x8FFFFFFF ) + { + // 80000000-8FFFFFFF ROM + ret = TMemoryModelRegion.EMemoryModelRegionROM; + } + else if ( aAddress >= 0x90000000 && aAddress < 0x9FFFFFFF ) + { + // 90000000-9FFFFFFF User Global Area + ret = TMemoryModelRegion.EMemoryModelRegionUserGlobalArea; + } + else if ( aAddress >= 0xA0000000 && aAddress < 0xBFFFFFFF ) + { + // A0000000-BFFFFFFF RAM drive + ret = TMemoryModelRegion.EMemoryModelRegionRAMDrive; + } + else if ( aAddress >= 0xC0000000 && aAddress < 0xC0001FFF ) + { + // C0000000-C0001FFF Super page/CPU page + ret = TMemoryModelRegion.EMemoryModelRegionSuperAndCPUPages; + } + else if ( aAddress >= 0xC0040000 && aAddress < 0xC00403FF ) + { + // C0040000-C00403FF ASID info (256 ASIDs) + ret = TMemoryModelRegion.EMemoryModelRegionASIDInfo; + } + else if ( aAddress >= 0xC0080000 && aAddress < 0xC00FFFFF ) + { + // C0080000-C00FFFFF Page table info + ret = TMemoryModelRegion.EMemoryModelRegionPageTableInfo; + } + else if ( aAddress >= 0xC1000000 && aAddress < 0xC13FFFFF ) + { + // C1000000-C13FFFFF Page directories (up to 256 * 16KB) + ret = TMemoryModelRegion.EMemoryModelRegionPageDirectories; + } + else if ( aAddress >= 0xC2000000 && aAddress < 0xC5FFFFFF ) + { + // C2000000-C5FFFFFF Page tables + ret = TMemoryModelRegion.EMemoryModelRegionPageTables; + } + else if ( aAddress >= 0xC6000000 && aAddress < 0xC6FFFFFF ) + { + // C6000000-C6FFFFFF Primary I/O mappings + ret = TMemoryModelRegion.EMemoryModelRegionPrimaryIOMappings; + } + else if ( aAddress >= 0xC7000000 && aAddress < 0xC7FFFFFF ) + { + // C7000000-C7FFFFFF + ret = TMemoryModelRegion.EMemoryModelRegionUnknown; + } + else if ( aAddress >= 0xC8000000 && aAddress < 0xC8FFFFFF ) + { + // C8000000-C8FFFFFF Kernel .data/.bss, initial stack, kernel heap + ret = TMemoryModelRegion.EMemoryModelRegionKernelGlobalsInitialStackKernelHeap; + } + else if ( aAddress >= 0xC9000000 && aAddress < 0xC91FFFFF ) + { + // C9000000-C91FFFFF Kernel stacks + ret = TMemoryModelRegion.EMemoryModelRegionKernelStacks; + } + else if ( aAddress >= 0xC9200000 && aAddress < 0xFFEFFFFF ) + { + // C9200000-FFEFFFFF Extra kernel mappings (I/O, RAM loaded device drivers) + ret = TMemoryModelRegion.EMemoryModelRegionExtraKernelMappings; + } + else if ( aAddress >= 0xFFF00000 && aAddress < 0xFFFFFFFF ) + { + // FFF00000-FFFFFFFF Exception vectors + ret = TMemoryModelRegion.EMemoryModelRegionExceptionVectors; + } + #endregion + } + // + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/MemoryModel/TMemoryModelRegion.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/MemoryModel/TMemoryModelRegion.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; + +#region MOVING MEMORY MODEL +// 00000000-003FFFFF Unmapped +// 00400000-2FFFFFFF Moving process data +// 30000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M, always ends at 40000000) +// 40000000-5FFFFFFF RAM drive +// 60000000-60001FFF Super page/CPU page +// 61000000-61003FFF Page directory (16K) +// 61020000-6103FFFF Page table info (4096 * 8bytes = 32K) +// 61100000-611FFFFF Cache flush area +// 61200000-612FFFFF Alternate cache flush area +// 62000000-623FFFFF Page tables (up to 4096 * 1K) +// 63000000-63FFFFFF Primary I/O mappings +// 64000000-64FFFFFF Kernel .data/.bss, initial stack, kernel heap +// 65000000-655FFFFF fixed processes - usually 2 or 3Mb each. +// 65600000-F1FFFFFF Kernel section (includes extra I/O mappings) +// F2000000-F3FFFFFF Kernel code (RAM size/2) +// F4000000-F7FFFFFF User code (RAM size) +// F8000000-FFEFFFFF ROM +// FFF00000-FFFFFFFF Exception vectors +#endregion +#region MULTIPLE MEMORY MODEL +// Linear address map (1Gb configuration): +// 00000000-003FFFFF Unmapped +// 00400000-1FFFFFFF Local data +// 20000000-3BFFFFFF Shared data +// 3C000000-3DFFFFFF RAM loaded code (=phys ram size up to 256M) +// 3E000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M) +// 40000000-7FFFFFFF Unused +// +// 80000000-8FFFFFFF ROM +// 90000000-9FFFFFFF User Global Area +// A0000000-BFFFFFFF RAM drive +// C0000000-C0001FFF Super page/CPU page +// C0040000-C00403FF ASID info (256 ASIDs) +// C0080000-C00FFFFF Page table info +// C1000000-C13FFFFF Page directories (up to 256 * 16KB) +// C2000000-C5FFFFFF Page tables +// C6000000-C6FFFFFF Primary I/O mappings +// C7000000-C7FFFFFF +// C8000000-C8FFFFFF Kernel .data/.bss, initial stack, kernel heap +// C9000000-C91FFFFF Kernel stacks +// C9200000-FFEFFFFF Extra kernel mappings (I/O, RAM loaded device drivers) +// FFF00000-FFFFFFFF Exception vectors +// +// +// Linear address map (2Gb configuration): +// 00000000-003FFFFF Unmapped +// 00400000-37FFFFFF Local data +// 38000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M) +// 40000000-6FFFFFFF Shared data +// 70000000-7FFFFFFF RAM loaded code (=phys ram size up to 256M) +// +// 80000000-8FFFFFFF ROM +// 90000000-9FFFFFFF User Global Area +// A0000000-BFFFFFFF RAM drive +// C0000000-C0001FFF Super page/CPU page +// C0040000-C00403FF ASID info (256 ASIDs) +// C0080000-C00FFFFF Page table info +// C1000000-C13FFFFF Page directories (up to 256 * 16KB) +// C2000000-C5FFFFFF Page tables +// C6000000-C6FFFFFF Primary I/O mappings +// C7000000-C7FFFFFF +// C8000000-C8FFFFFF Kernel .data/.bss, initial stack, kernel heap +// C9000000-C91FFFFF Kernel stacks +// C9200000-FFEFFFFF Extra kernel mappings (I/O, RAM loaded device drivers) +// FFF00000-FFFFFFFF Exception vectors +#endregion + +namespace SymbianStructuresLib.MemoryModel +{ + public enum TMemoryModelRegion + { + // Common + EMemoryModelRegionUnmapped = 0, + EMemoryModelRegionDLLStaticData, + EMemoryModelRegionRAMLoadedCode, + EMemoryModelRegionROM, + EMemoryModelRegionUserGlobalArea, + EMemoryModelRegionRAMDrive, + EMemoryModelRegionSuperAndCPUPages, + EMemoryModelRegionPageTableInfo, + EMemoryModelRegionPageDirectories, + EMemoryModelRegionPageTables, + EMemoryModelRegionPrimaryIOMappings, + EMemoryModelRegionUnknown, + EMemoryModelRegionKernelGlobalsInitialStackKernelHeap, + EMemoryModelRegionExtraKernelMappings, + EMemoryModelRegionExceptionVectors, + + // Moving + EMemoryModelRegionMovingProcessData, + EMemoryModelRegionCacheFlushArea, + EMemoryModelRegionCacheFlushAreaAlternate, + EMemoryModelRegionKernelCode, + EMemoryModelRegionFixedProcesses, + EMemoryModelRegionUserCode, + + // Multiple + EMemoryModelRegionSharedData, + EMemoryModelRegionLocalData, + EMemoryModelRegionASIDInfo, + EMemoryModelRegionKernelStacks, + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/MemoryModel/TMemoryModelType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/MemoryModel/TMemoryModelType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; + +#region MOVING MEMORY MODEL +// 00000000-003FFFFF Unmapped +// 00400000-2FFFFFFF Moving process data +// 30000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M, always ends at 40000000) +// 40000000-5FFFFFFF RAM drive +// 60000000-60001FFF Super page/CPU page +// 61000000-61003FFF Page directory (16K) +// 61020000-6103FFFF Page table info (4096 * 8bytes = 32K) +// 61100000-611FFFFF Cache flush area +// 61200000-612FFFFF Alternate cache flush area +// 62000000-623FFFFF Page tables (up to 4096 * 1K) +// 63000000-63FFFFFF Primary I/O mappings +// 64000000-64FFFFFF Kernel .data/.bss, initial stack, kernel heap +// 65000000-655FFFFF fixed processes - usually 2 or 3Mb each. +// 65600000-F1FFFFFF Kernel section (includes extra I/O mappings) +// F2000000-F3FFFFFF Kernel code (RAM size/2) +// F4000000-F7FFFFFF User code (RAM size) +// F8000000-FFEFFFFF ROM +// FFF00000-FFFFFFFF Exception vectors +#endregion +#region MULTIPLE MEMORY MODEL +// Linear address map (1Gb configuration): +// 00000000-003FFFFF Unmapped +// 00400000-1FFFFFFF Local data +// 20000000-3BFFFFFF Shared data +// 3C000000-3DFFFFFF RAM loaded code (=phys ram size up to 256M) +// 3E000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M) +// 40000000-7FFFFFFF Unused +// +// 80000000-8FFFFFFF ROM +// 90000000-9FFFFFFF User Global Area +// A0000000-BFFFFFFF RAM drive +// C0000000-C0001FFF Super page/CPU page +// C0040000-C00403FF ASID info (256 ASIDs) +// C0080000-C00FFFFF Page table info +// C1000000-C13FFFFF Page directories (up to 256 * 16KB) +// C2000000-C5FFFFFF Page tables +// C6000000-C6FFFFFF Primary I/O mappings +// C7000000-C7FFFFFF +// C8000000-C8FFFFFF Kernel .data/.bss, initial stack, kernel heap +// C9000000-C91FFFFF Kernel stacks +// C9200000-FFEFFFFF Extra kernel mappings (I/O, RAM loaded device drivers) +// FFF00000-FFFFFFFF Exception vectors +// +// +// Linear address map (2Gb configuration): +// 00000000-003FFFFF Unmapped +// 00400000-37FFFFFF Local data +// 38000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M) +// 40000000-6FFFFFFF Shared data +// 70000000-7FFFFFFF RAM loaded code (=phys ram size up to 256M) +// +// 80000000-8FFFFFFF ROM +// 90000000-9FFFFFFF User Global Area +// A0000000-BFFFFFFF RAM drive +// C0000000-C0001FFF Super page/CPU page +// C0040000-C00403FF ASID info (256 ASIDs) +// C0080000-C00FFFFF Page table info +// C1000000-C13FFFFF Page directories (up to 256 * 16KB) +// C2000000-C5FFFFFF Page tables +// C6000000-C6FFFFFF Primary I/O mappings +// C7000000-C7FFFFFF +// C8000000-C8FFFFFF Kernel .data/.bss, initial stack, kernel heap +// C9000000-C91FFFFF Kernel stacks +// C9200000-FFEFFFFF Extra kernel mappings (I/O, RAM loaded device drivers) +// FFF00000-FFFFFFFF Exception vectors +#endregion + +namespace SymbianStructuresLib.MemoryModel +{ + public enum TMemoryModelType + { + EMemoryModelUnknown = -1, + EMemoryModelMoving = 0, + EMemoryModelMultiple, + EMemoryModelFlexible + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "d397b228-ebc7-4ce6-b2bb-4185c638e822" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Security/Capability.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Security/Capability.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; + +namespace SymbianStructuresLib.Security +{ + public enum TCapability + { + [Description( "TCB" )] + ECapabilityTCB = 0, + + [Description( "CommDD" )] + ECapabilityCommDD = 1, + + [Description( "PowerMgmt" )] + ECapabilityPowerMgmt = 2, + + [Description( "MultimediaDD" )] + ECapabilityMultimediaDD = 3, + + [Description( "ReadDeviceData" )] + ECapabilityReadDeviceData = 4, + + [Description( "WriteDeviceData" )] + ECapabilityWriteDeviceData = 5, + + [Description( "DRM" )] + ECapabilityDRM = 6, + + [Description( "TrustedUI" )] + ECapabilityTrustedUI = 7, + + [Description( "ProtServ" )] + ECapabilityProtServ = 8, + + [Description( "DiskAdmin" )] + ECapabilityDiskAdmin = 9, + + [Description( "NetworkControl" )] + ECapabilityNetworkControl = 10, + + [Description( "AllFiles" )] + ECapabilityAllFiles = 11, + + [Description( "SwEvent" )] + ECapabilitySwEvent = 12, + + [Description( "NetworkServices" )] + ECapabilityNetworkServices = 13, + + [Description( "LocalServices" )] + ECapabilityLocalServices = 14, + + [Description( "ReadUserData" )] + ECapabilityReadUserData = 15, + + [Description( "WriteUserData" )] + ECapabilityWriteUserData = 16, + + [Description( "Location" )] + ECapabilityLocation = 17, + + [Description( "SurroundingsDD" )] + ECapabilitySurroundingsDD = 18, + + [Description( "UserEnvironment" )] + ECapabilityUserEnvironment = 19, + + [Description( "" )] + ECapability_Limit, + + [Description( "" )] + ECapability_HardLimit = 255, + + [Description( "" )] + ECapability_None = -1, // Special value used to specify 'do not care' or 'no capability' + + [Description( "" )] + ECapability_Denied = -2 // Special value used to indicate a capability that is never granted + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Security/CapabilitySet.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Security/CapabilitySet.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Enum; +using SymbianUtils.Streams; + +namespace SymbianStructuresLib.Security +{ + public class SCapabilitySet : IEnumerable + { + #region Constructors + public SCapabilitySet() + { + } + + public SCapabilitySet( SymbianStreamReaderLE aReader ) + { + ulong caps = aReader.ReadUInt32(); + uint high = aReader.ReadUInt32(); + caps += ( high << 32 ); + // + for ( int i = 0; i < KMaxBitIndex; i++ ) + { + ulong checkVal = (ulong) 1 << i; + if ( ( checkVal & caps ) == checkVal ) + { + TCapability cap = (TCapability) i; + iCapabilities.Add( cap ); + } + } + } + #endregion + + #region API + #endregion + + #region Properties + public bool this[ TCapability aCapability ] + { + get + { + return iCapabilities.Contains( aCapability ); + } + } + #endregion + + #region Internal constants + private const int KMaxBitIndex = 64; + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + foreach( TCapability cap in iCapabilities ) + { + string name = EnumUtils.ToString( cap ); + // + if ( ret.Length > 0 ) + { + ret.Append( ", " ); + } + // + ret.Append( name ); + } + // + return ret.ToString(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( TCapability cap in iCapabilities ) + { + yield return cap; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( TCapability cap in iCapabilities ) + { + yield return cap; + } + } + #endregion + + #region Data members + private List iCapabilities = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Security/SecurityInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Security/SecurityInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Streams; + +namespace SymbianStructuresLib.Security +{ + public class SSecurityInfo + { + #region Constructors + public SSecurityInfo() + { + iCaps = new SCapabilitySet(); + } + + public SSecurityInfo( SymbianStreamReaderLE aReader ) + { + iSecureId = aReader.ReadUInt32(); + iVendorId = aReader.ReadUInt32(); + iCaps = new SCapabilitySet( aReader ); + } + #endregion + + #region API + #endregion + + #region Properties + public uint SecureId + { + get + { + return iSecureId; + } + set + { + iSecureId = value; + } + } + + public uint VendorId + { + get + { + return iVendorId; + } + set + { + iVendorId = value; + } + } + + public SCapabilitySet Capabilities + { + get { return iCaps; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + #endregion + + #region Data members + private uint iSecureId = 0; + private uint iVendorId = 0; + private readonly SCapabilitySet iCaps; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/SymbianStructuresLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/SymbianStructuresLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,160 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + Library + Properties + SymbianStructuresLib + SymbianStructuresLib + v2.0 + 512 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/SymbianStructuresLib.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/SymbianStructuresLib.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + en-US + false + + + true + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Uids/TCheckedUid.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Uids/TCheckedUid.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Streams; + +namespace SymbianStructuresLib.Uids +{ + public class TCheckedUid + { + #region Constructors + public TCheckedUid() + { + } + + public TCheckedUid( SymbianStreamReaderLE aReader ) + { + iType = new UidType( aReader ); + iCheck = aReader.ReadUInt32(); + } + #endregion + + #region API + #endregion + + #region Properties + public uint Check + { + get + { + return iCheck; + } + set + { + iCheck = value; + } + } + + public UidType Type + { + get { return iType; } + set { iType = value; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "{0} [{1:x8}]", iType, iCheck ); + return ret.ToString(); + } + #endregion + + #region Data members + private UidType iType = new UidType(); + private uint iCheck = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Uids/UidType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Uids/UidType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Streams; + +namespace SymbianStructuresLib.Uids +{ + public class UidType + { + #region Constructors + public UidType() + { + iUids.Add( 0 ); + iUids.Add( 0 ); + iUids.Add( 0 ); + } + + public UidType( SymbianStreamReaderLE aReader ) + { + iUids.Add( aReader.ReadUInt32() ); + iUids.Add( aReader.ReadUInt32() ); + iUids.Add( aReader.ReadUInt32() ); + } + #endregion + + #region API + #endregion + + #region Properties + public int Count + { + get { return iUids.Count; } + } + + public uint this[ int aIndex ] + { + get + { + return iUids[ aIndex ]; + } + set + { + iUids[ aIndex ] = value; + } + } + + public uint MostSignificant + { + get + { + uint ret = 0; + // + if ( Count > 0 ) + { + ret = this[ Count - 1 ]; + } + // + return ret; + } + set + { + iUids[ iUids.Count - 1 ] = value; + } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + for( int i=0; i iUids = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Version/TVersion.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianStructuresLib/Version/TVersion.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; +using System.Runtime.InteropServices; +using SymbianUtils.Streams; + +namespace SymbianStructuresLib.Version +{ + public class TVersion + { + #region Constructors + public TVersion() + { + iMajor = 0; + iMinor = 0; + iBuild = 0; + } + + public TVersion( SymbianStreamReaderLE aReader ) + { + iMajor = aReader.ReadInt8(); + iMinor = aReader.ReadInt8(); + iBuild = aReader.ReadInt16(); + } + #endregion + + #region API + public void Read( BinaryReader aReader ) + { + Major = aReader.ReadSByte(); + Minor = aReader.ReadSByte(); + Build = aReader.ReadInt16(); + } + #endregion + + #region Properties + public uint Size + { + get { return 4; } + } + + public sbyte Major + { + get { return iMajor; } + set { iMajor = value; } + } + + public sbyte Minor + { + get { return iMinor; } + set { iMinor = value; } + } + + public Int16 Build + { + get { return iBuild; } + set { iBuild = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "{0}.{1}.{2:d4}", iMajor, iMinor, iBuild ); + return ret.ToString(); + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private sbyte iMajor; + private sbyte iMinor; + private Int16 iBuild; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/DbgEnginePlugin/SymbolPlugin.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/DbgEnginePlugin/SymbolPlugin.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System.Collections.Generic; +using SymbianDebugLib.Engine; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianSymbolLib.SourceManagement.Source; + +namespace SymbianSymbolLib.DbgEnginePlugin +{ + internal class SymbolPlugin : DbgEngineSymbol + { + #region Constructors + public SymbolPlugin( DbgEngine aEngine ) + : base( aEngine ) + { + iSourceManager = new SymSourceManager( this ); + iProvisioningManager = new SymSourceProviderManager( this, aEngine.IdAllocator ); + } + #endregion + + #region From DbgSymbolEngine + public override bool IsReady + { + get { return true; } + } + + public override string Name + { + get { return "DbgSymbolPlugin"; } + } + + public override bool IsSupported( string aFileName, out string aType ) + { + SymSourceProvider provider = iProvisioningManager.GetProvider( aFileName ); + // + if ( provider != null ) + { + aType = provider.Name; + } + else + { + aType = string.Empty; + } + // + return provider != null; + } + + public override DbgPluginPrimer CreatePrimer() + { + return new SymbolPrimer( this ); + } + + protected override DbgPluginView DoCreateView( string aName ) + { + SymbolView ret = new SymbolView( aName, this ); + return ret; + } + + protected override void DoClear() + { + if ( iSourceManager != null ) + { + iSourceManager.Dispose(); + } + iSourceManager = new SymSourceManager( this ); + } + #endregion + + #region API + internal void StoreSourcesThatWillBePrimed( IEnumerable aSourcesThatWillBePrimed ) + { + SourceManager.AddRange( aSourcesThatWillBePrimed ); + } + #endregion + + #region Properties + internal SymSourceManager SourceManager + { + get { return iSourceManager; } + } + + internal SymSourceProviderManager ProvisioningManager + { + get { return iProvisioningManager; } + } + #endregion + + #region Internal methods + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iProvisioningManager.Dispose(); + iSourceManager.Dispose(); + } + } + #endregion + + #region Data members + private SymSourceManager iSourceManager; + private readonly SymSourceProviderManager iProvisioningManager; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/DbgEnginePlugin/SymbolPrimer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/DbgEnginePlugin/SymbolPrimer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,231 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using SymbianDebugLib.Entity; +using SymbianDebugLib.PluginAPI; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianUtils; + +namespace SymbianSymbolLib.DbgEnginePlugin +{ + internal class SymbolPrimer : DbgPluginPrimer, IEnumerable + { + #region Constructors + public SymbolPrimer( SymbolPlugin aPlugin ) + : base( aPlugin ) + { + // If we've been created then presumably this is the reason... + ProvisioningManager.PrepareToCreateSources(); + } + #endregion + + #region From DbgPluginPrimer + public override void Add( DbgEntity aEntity ) + { + SymSourceProvider provider = null; + // + if ( aEntity.FSEntity.IsFile ) + { + if ( aEntity.Exists && aEntity.FSEntity.IsValid ) + { + provider = ProvisioningManager.GetProvider( aEntity.FSEntity.FullName ); + } + // + if ( provider != null ) + { + using ( SymSourceCollection sources = provider.CreateSources( aEntity.FullName ) ) + { + // Make sure the time to read attribute is setup in alignment with + // whether the entity was explicitly added by the user or found implicitly + // by scanning. + if ( aEntity.WasAddedExplicitly == false ) + { + foreach ( SymSource source in sources ) + { + // This means, don't read this source until it is actually + // referenced by the client. I.e. until the client activates + // a code segment that refers to this + source.TimeToRead = SymSource.TTimeToRead.EReadWhenNeeded; + } + } + + // Ownership is transferred + iSources.AddRange( sources ); + sources.Clear(); + } + } + else + { + throw new NotSupportedException( "Specified file type is not supported" ); + } + } + else + { + throw new ArgumentException( "SymbianSymbolLib does not support directory entities" ); + } + } + + public override void Prime( TSynchronicity aSynchronicity ) + { + SymbolPlugin plugin = this.Plugin; + + // Wipe any state ready for new priming attempt + base.OnPrepareToPrime(); + if ( base.ResetEngineBeforePriming ) + { + plugin.Clear(); + } + + // Tell the plugin which sources we are reading + plugin.StoreSourcesThatWillBePrimed( this ); + + // Listen to soure events so that we can report progress + SourceEventsSubscribe(); + + // Report the "priming started event" + base.ReportEvent( TPrimeEvent.EEventPrimingStarted, null ); + + // Now we can start the sources running. + foreach ( SymSource source in iSources ) + { + // If the source wants to read it's data immediately, then activated + // it right now... + if ( source.TimeToRead == SymSource.TTimeToRead.EReadWhenPriming ) + { + source.Read( aSynchronicity ); + } + else + { + // This source will read it's data on it's own terms so skip + // it to ensure that we can track when all the other sources + // (that do actually read their files now..) are ready. + Skip( source ); + } + } + } + + protected override int Count + { + get { return iSources.Count; } + } + #endregion + + #region API + internal void Skip( SymSource aSource ) + { + System.Diagnostics.Debug.Assert( aSource.TimeToRead == SymSource.TTimeToRead.EReadWhenNeeded ); + bool primeCompleted = base.AddToCompleted( aSource ); + CheckForCompletion( primeCompleted ); + } + #endregion + + #region Properties + internal SymbolPlugin Plugin + { + get { return base.Engine as SymbolPlugin; } + } + + internal SymSourceManager SourceManager + { + get { return Plugin.SourceManager; } + } + + internal SymSourceProviderManager ProvisioningManager + { + get { return Plugin.ProvisioningManager; } + } + #endregion + + #region Internal methods + private void SourceEventsSubscribe() + { + SourceEventsUnsubscribe(); + // + foreach ( SymSource source in iSources ) + { + source.EventHandler += new SymSource.EventHandlerFunction( Source_EventHandler ); + } + } + + private void SourceEventsUnsubscribe() + { + foreach ( SymSource source in iSources ) + { + source.EventHandler -= new SymSource.EventHandlerFunction( Source_EventHandler ); + } + } + + private void Source_EventHandler( SymSource.TEvent aEvent, SymSource aSource, object aData ) + { + bool primeCompleted = false; + + // Map source event onto a primer event + if ( aEvent == SymSource.TEvent.EReadingProgress ) + { + base.SaveLatestProgress( aSource, (int) aData ); + } + + // If all sources are complete, then are we also done? + if ( aEvent == SymSource.TEvent.EReadingComplete ) + { + // We don't need to listen to this source anymore + aSource.EventHandler -= new SymSource.EventHandlerFunction( Source_EventHandler ); + + // Source is 100% complete now. + base.SaveLatestProgress( aSource, 100 ); + + // It's complete, so record as such so that we can tell when all the sources + // are now ready. + primeCompleted = base.AddToCompleted( aSource ); + } + + CheckForCompletion( primeCompleted ); + } + + private void CheckForCompletion( bool aAmIComplete ) + { + // Report any progress + base.ReportProgressIfNeeded( aAmIComplete ); + + // Tidy up and report completion + if ( aAmIComplete ) + { + base.OnPrimeComplete(); + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return iSources.GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return iSources.GetEnumerator(); + } + #endregion + + #region Data members + private SymSourceCollection iSources = new SymSourceCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/DbgEnginePlugin/SymbolView.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/DbgEnginePlugin/SymbolView.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,256 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System.Collections.Generic; +using System.IO; +using SymbianDebugLib.PluginAPI.Types.Symbol; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Common.FileName; +using SymbianStructuresLib.Debug.Symbols; +using SymbianSymbolLib.QueryAPI; +using SymbianSymbolLib.Relocator; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianUtils.FileSystem.FilePair; + +namespace SymbianSymbolLib.DbgEnginePlugin +{ + internal class SymbolView : DbgViewSymbol + { + #region Constructors + public SymbolView( string aName, SymbolPlugin aPlugin ) + : base( aName, aPlugin ) + { + iRelocator = new SymbolRelocator( aPlugin ); + iQueryAPI = new SymbolQueryAPI( iRelocator ); + } + #endregion + + #region From DbgPluginView + public override bool Contains( uint aAddress ) + { + bool ret = iQueryAPI.Contains( aAddress ); + return ret; + } + + public override bool Activate( CodeSegDefinition aCodeSegment ) + { + bool activated = ActivateAndGetCollection( aCodeSegment ) != null; + return activated; + } + + public override bool Deactivate( CodeSegDefinition aCodeSegment ) + { + return iRelocator.Deactivate( aCodeSegment ); + } + + public override bool SerializeTaggedCollections( FileNamePairCollection aFilesToSave ) + { + int initialFileCount = aFilesToSave.Count; + + // Will contain tagged fixed collections + SymbolCollectionList symColFixed = new SymbolCollectionList(); + + // Will contain dynamically relocated collections + SymbolCollectionList symColDynamicRelocations = new SymbolCollectionList(); + + // Find tagged collections + string fixedSymbolCollectionFileName = string.Empty; + SymSourceManager sourceManager = iQueryAPI.SourceManager; + foreach ( SymSource source in sourceManager ) + { + int count = source.Count; + for( int i=0; i 0 ) + { + SerializeCollection( aFilesToSave, Path.GetFileNameWithoutExtension( fixedSymbolCollectionFileName ) + ".symbol", symColFixed ); + } + if ( symColDynamicRelocations.Count > 0 ) + { + foreach ( SymbolCollection col in symColDynamicRelocations ) + { + // For the dynamically relocated collections, we must generate a file name based + // upon the collection details. + string fileName = Path.GetFileNameWithoutExtension( col.FileName.EitherFullNameButDevicePreferred ) + ".symbol"; + SerializeCollection( aFilesToSave, fileName, col ); + } + } + + return ( aFilesToSave.Count != initialFileCount ); + } + + public override bool IsReady + { + get + { + // For a view to be ready we must have at least one + // activated, i.e. 'ready' symbol source. + int count = 0; + + // Check with dynamic activations + foreach ( SymSourceAndCollection pair in iRelocator ) + { + if ( pair.Source.TimeToRead == SymSource.TTimeToRead.EReadWhenPriming ) + { + ++count; + break; // No need to count anymore + } + } + + // Try to find any fixed activation entries + if ( count == 0 ) + { + SymSourceManager allSources = this.SourceManager; + foreach ( SymSource source in allSources ) + { + count += source.CountActivated; + if ( count > 0 ) + { + break; + } + } + } + + return ( count > 0 ); + } + } + #endregion + + #region From DbgViewSymbols + public override Symbol Lookup( uint aAddress, out SymbolCollection aCollection ) + { + Symbol ret = iQueryAPI.Lookup( aAddress, out aCollection ); + return ret; + } + + public override SymbolCollection CollectionByAddress( uint aAddress ) + { + SymbolCollection ret = iQueryAPI.CollectionByAddress( aAddress ); + return ret; + } + + public override SymbolCollection ActivateAndGetCollection( CodeSegDefinition aCodeSegment ) + { + SymbolCollection ret = iRelocator.Activate( aCodeSegment ); + return ret; + } + + public override SymbolCollection this[ CodeSegDefinition aCodeSeg ] + { + get + { + SymbolCollection ret = iQueryAPI[ aCodeSeg ]; + return ret; + } + } + + public override SymbolCollection this[ PlatformFileName aFileName ] + { + get + { + SymbolCollection ret = iQueryAPI[ aFileName ]; + return ret; + } + } + + protected override IEnumerator GetEnumeratorSymbolCollection() + { + return iQueryAPI.GetEnumerator(); + } + #endregion + + #region API + #endregion + + #region Properties + internal SymbolPlugin Plugin + { + get { return base.Engine as SymbolPlugin; } + } + + internal SymbolQueryAPI QueryAPI + { + get { return iQueryAPI; } + } + + internal SymSourceManager SourceManager + { + get { return Plugin.SourceManager; } + } + #endregion + + #region Internal methods + private void SerializeCollection( FileNamePairCollection aFilesToSave, string aProposedFileName, SymbolCollection aCollection ) + { + SymbolCollectionList list = new SymbolCollectionList(); + list.Add( aCollection ); + SerializeCollection( aFilesToSave, aProposedFileName, list ); + } + + private void SerializeCollection( FileNamePairCollection aFilesToSave, string aProposedFileName, SymbolCollectionList aList ) + { + string tempFileName = Path.GetTempFileName(); + // + FileNamePair fileNamePair = new FileNamePair( tempFileName ); + fileNamePair.Destination = string.Format( "/Symbols/{0}", Path.GetFileName( aProposedFileName ) ); + fileNamePair.DeleteFile = true; + + // Make sure the collections are sorted in order + aList.SortByCollectionAddress(); + + using ( FileStream stream = new FileStream( tempFileName, FileMode.Create ) ) + { + aList.Serialize( stream ); + } + // + aFilesToSave.Add( fileNamePair ); + } + #endregion + + #region Data members + private readonly SymbolQueryAPI iQueryAPI; + private readonly SymbolRelocator iRelocator; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "SLPluginMap" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Symbian Software Ltd" )] +[assembly: AssemblyProduct( "SLPluginMap" )] +[assembly: AssemblyCopyright( "Copyright © Symbian Software Ltd 2008" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "6c8ad50c-37b0-432c-ab8e-c7f4d866fd05" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Provider/MapSourceProvider.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Provider/MapSourceProvider.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Debug.Symbols.Interfaces; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils.FileTypes; +using SymbianUtils; +using SLPluginMap.Utilities; +using SLPluginMap.Reader; +using SLPluginMap.Reader.RVCT; +using SLPluginMap.Reader.GCCE; + +namespace SLPluginMap.Provider +{ + public class MapSourceProvider : SymSourceProvider + { + #region Constructors + public MapSourceProvider( SymSourceProviderManager aManager ) + : base( aManager ) + { + } + #endregion + + #region From SymSourceProvider + public override SymSourceCollection CreateSources( string aFileName ) + { + // In order to get the host binary name, we remove the map file extension + string fileName = aFileName; + string extension = Path.GetExtension( fileName ).ToUpper(); + if ( extension.EndsWith( KMapFileExtension ) ) + { + string name = fileName.Substring( 0, fileName.Length - extension.Length ); + fileName = name; + } + + // A map file source contains just a single collection. We don't know + // the device-side file name at this point. + SymbolCollection collection = SymbolCollection.NewByHostFileName( base.IdAllocator, fileName ); + collection.IsRelocatable = true; + // + SymSource source = new SymSource( aFileName, this, collection ); + return new SymSourceCollection( source ); + } + + public override void ReadSource( SymSource aSource, TSynchronicity aSynchronicity ) + { + // Need to work out if it's a GCCE or RVCT map file. + TMapFileType type = MapFileUtils.Type( aSource.FileName ); + // + MapReader reader = null; + switch( type ) + { + case TMapFileType.ETypeRVCT: + reader = new RVCTMapFileReader( aSource, base.Tracer ); + break; + case TMapFileType.ETypeGCCE: + reader = new GCCEMapFileReader( aSource, base.Tracer ); + break; + case TMapFileType.ETypeUnknown: + default: + throw new NotSupportedException(); + } + // + reader.Read( aSynchronicity ); + } + + public override SymFileTypeList FileTypes + { + get + { + SymFileTypeList ret = new SymFileTypeList(); + // + ret.Add( new SymFileType( ".map", "Map Files" ) ); + // + return ret; + } + } + + public override string Name + { + get { return "MAP"; } + } + #endregion + + #region Properties + #endregion + + #region Event handlers + + #endregion + + #region Internal constants + private const string KMapFileExtension = ".MAP"; + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Reader/GCCE/GCCEMapFileReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Reader/GCCE/GCCEMapFileReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,264 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianStructuresLib.Debug.Symbols; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils; +using SymbianUtils.FileTypes; +using SymbianUtils.Tracer; + +namespace SLPluginMap.Reader.GCCE +{ + internal class GCCEMapFileReader : MapReader + { + #region Delegates & events + #endregion + + #region Constructors + public GCCEMapFileReader( SymSource aSource, ITracer aTracer ) + : base( aSource, aTracer ) + { + base.TrimLine = false; + iSymbolParser = new GCCESymbolCreator( this, base.Collection ); + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From AsyncTextReaderBase + protected override void HandleFilteredLine( string aLine ) + { + switch ( iStateGlobal ) + { + case TGlobalState.EWaitingForImage_ER_RO_Base: + ParseGlobalBaseAddress( aLine ); + break; + case TGlobalState.EProcessingSymbols: + ParseSymbols( aLine ); + break; + default: + break; + } + } + + protected override void HandleReadCompleted() + { + try + { + SortAndSize(); + } + finally + { + base.HandleReadCompleted(); + } + } + #endregion + + #region Internal methods + private void ParseGlobalBaseAddress( string aLine ) + { + Match m = KGlobalBaseAddressRegEx.Match( aLine ); + if ( m.Success ) + { + string value = m.Groups[ 1 ].Value; + base.GlobalBaseAddress = uint.Parse( value, System.Globalization.NumberStyles.HexNumber ); + iStateGlobal = TGlobalState.EProcessingSymbols; + } + } + + private void ParseSymbols( string aLine ) + { + try + { + // It's the start of a section... + Match m = KSectionRegEx.Match( aLine ); + if ( m.Success ) + { + iSectionType = GetSection( aLine ); + iLastSeenObjectName = string.Empty; + } + else if ( iSectionType != TSection.ESectionUnsupported ) + { + m = KSizeAndObjectRegEx.Match( aLine ); + if ( m.Success ) + { + iLastSeenObjectName = m.Groups[ "Object" ].Value.Trim(); + } + else + { + Symbol sym = iSymbolParser.Parse( aLine ); + if ( sym != null ) + { + // Update object with cached information + sym.Object = iLastSeenObjectName; + iUnsortedSymbols.Add( sym ); + } + } + } + } + catch( Exception ) + { + } + } + + private void ListSymbols( IEnumerable aList ) + { + foreach ( Symbol sym in aList ) + { + string line = sym.ToString(); + if ( sym.InstructionSet == SymbianStructuresLib.Arm.TArmInstructionSet.ETHUMB ) + { + line = "T " + line; + } + else + { + line = " " + line; + } + // + System.Diagnostics.Debug.WriteLine( line ); + } + } + + private void SortAndSize() + { + // Sort the symbols into ascending address order + Comparison comparer = delegate( Symbol aLeft, Symbol aRight ) + { + // compare by address + int ret = aLeft.Address.CompareTo( aRight.Address ); + return ret; + }; + iUnsortedSymbols.Sort( comparer ); + + // Subsume duplicates + int count = iUnsortedSymbols.Count; + for ( int i = count - 1; i >= 1; i-- ) + { + Symbol sym1 = iUnsortedSymbols[ i - 0]; + Symbol sym2 = iUnsortedSymbols[ i - 1 ]; + // + if ( sym1.Name == sym2.Name && sym1.Object == sym2.Object ) + { + // Since the symbol is the same and since we do not have any + // size information for GCCE map files, then we can safely + // discard one of the symbols. + iUnsortedSymbols.RemoveAt( i ); + } + } + + // Now calculate sizes + count = iUnsortedSymbols.Count; + for ( int i = 0; i < count - 1; i++ ) + { + Symbol sym1 = iUnsortedSymbols[ i + 0 ]; + Symbol sym2 = iUnsortedSymbols[ i + 1 ]; + + // Calculate the symbol size based upon the address of the next symbol. + // This may not be totally accurate, but it's the best we can do + sym1.Size = ( sym2.Address - sym1.Address ); + + // Save the symbol + base.ReportSymbol( sym1 ); + } + } + + private static TSection GetSection( string aText ) + { + TSection ret = TSection.ESectionUnsupported; + // + Match m = KSectionRegEx.Match( aText ); + if ( m.Success ) + { + string sectionName = m.Groups[ 0 ].Value; + switch ( sectionName ) + { + case ".text": + ret = TSection.ESectionText; + break; + case ".emb_text": + ret = TSection.ESectionEmbText; + break; + case ".rodata": + ret = TSection.ESectionReadOnlyData; + break; + default: + break; + } + } + // + return ret; + } + #endregion + + #region Internal enumerations + private enum TGlobalState + { + EWaitingForImage_ER_RO_Base = 0, + EProcessingSymbols + } + + private enum TSection + { + ESectionUnsupported = -1, + ESectionText = 0, + ESectionEmbText, + ESectionReadOnlyData + } + #endregion + + #region Internal constants + private readonly static Regex KGlobalBaseAddressRegEx = new Regex( + @"\s*0x(?
[A-Fa-f0-9]{8})\s+PROVIDE \(Image\$\$ER_RO\$\$Base", + RegexOptions.Multiline + | RegexOptions.CultureInvariant + | RegexOptions.Compiled + ); + + private readonly static Regex KSectionRegEx = new Regex( + "^\\.([a-zA-Z0-9_\\$\\.]*)", + RegexOptions.Multiline + | RegexOptions.CultureInvariant + | RegexOptions.Compiled + ); + private readonly static Regex KSizeAndObjectRegEx = new Regex( + "(?.+?)0x(?
[A-Fa-f0-9]{8})\\s+0x(?[A-F" + + "a-f0-9]{1,8})\\s(?.+)", + RegexOptions.Multiline + | RegexOptions.CultureInvariant + | RegexOptions.Compiled + ); + #endregion + + #region Data members + private TGlobalState iStateGlobal = TGlobalState.EWaitingForImage_ER_RO_Base; + private readonly GCCESymbolCreator iSymbolParser; + private List iUnsortedSymbols = new List(); + private string iLastSeenObjectName = string.Empty; + private TSection iSectionType = TSection.ESectionUnsupported; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Reader/GCCE/GCCESymbolCreator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Reader/GCCE/GCCESymbolCreator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianStructuresLib.Debug.Symbols; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils; +using SymbianUtils.FileTypes; +using SymbianUtils.Tracer; + +namespace SLPluginMap.Reader.GCCE +{ + internal class GCCESymbolCreator + { + #region Constructors + public GCCESymbolCreator( MapReader aReader, SymbolCollection aCollection ) + { + iReader = aReader; + iCollection = aCollection; + } + #endregion + + #region Properties + #endregion + + #region API + public Symbol Parse( string aLine ) + { + Symbol ret = null; + // + Match m = KMapParserRegex.Match( aLine ); + if ( m.Success ) + { + GroupCollection groups = m.Groups; + // + uint globalBaseAddress = iReader.GlobalBaseAddress; + string symbol = groups[ "Function" ].Value; + uint offsetAddress = uint.Parse( groups[ "Address" ].Value, System.Globalization.NumberStyles.HexNumber ) - globalBaseAddress; + // + if ( symbol != null ) + { + symbol = symbol.Trim(); + // + if ( !string.IsNullOrEmpty( symbol ) ) + { + if ( symbol.StartsWith( "PROVIDE" ) ) + { + } + else + { + ret = Symbol.New( iCollection ); + ret.OffsetAddress = offsetAddress; + ret.Size = 0; + ret.Object = string.Empty; + ret.Name = symbol; + } + } + } + } + // + return ret; + } + #endregion + + #region Internal constants + private readonly static Regex KMapParserRegex = new Regex( + " 0x(?
[A-Fa-f0-9]{8}) (?.+)", + RegexOptions.Multiline + | RegexOptions.CultureInvariant + | RegexOptions.Compiled + ); + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly MapReader iReader; + private readonly SymbolCollection iCollection; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Reader/MapReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Reader/MapReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,133 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Debug.Symbols.Utilities; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; + +namespace SLPluginMap.Reader +{ + internal abstract class MapReader : AsyncTextFileReader + { + #region Constructors + protected MapReader( SymSource aSource, ITracer aTracer ) + : base( aSource.FileName, aTracer ) + { + iSource = aSource; + iHarmoniser = new SymbolCollectionHarmoniser( Collection ); + } + #endregion + + #region API + public void Read( TSynchronicity aSynchronicity ) + { + base.Trace( "[SLPluginMap] Starting to read: {0}", base.FileName ); + base.StartRead( aSynchronicity ); + } + #endregion + + #region Properties + public uint GlobalBaseAddress + { + get { return iGlobalBaseAddress; } + set { iGlobalBaseAddress = value; } + } + + protected SymbolCollection Collection + { + get + { + SymbianUtils.SymDebug.SymDebugger.Assert( iSource.Count == 1 ); + return iSource[ 0 ]; + } + } + #endregion + + #region Internal framework API + protected void ReportSymbol( Symbol aSymbol ) + { + // Make sure it's tagged as a map file symbol + aSymbol.Source = TSymbolSource.ESourceWasMapFile; + + // Hand off to harmoniser for filing + if ( iHarmoniser != null ) + { + bool saved = iHarmoniser.Add( aSymbol ); + } + } + #endregion + + #region From AsyncTextReaderBase + protected override void HandleReadStarted() + { + iSource.ReportEvent( SymSource.TEvent.EReadingStarted ); + Collection.TransactionBegin(); + base.HandleReadStarted(); + } + + protected override void HandleReadCompleted() + { + try + { + iHarmoniser.Dispose(); + iHarmoniser = null; + Collection.TransactionEnd(); + base.Trace( "[SLPluginMap] Finished read of: {0}", base.FileName ); + iSource.ReportEvent( SymSource.TEvent.EReadingComplete ); + } + finally + { + base.HandleReadCompleted(); + } + } + + protected override void OnProgressChanged( int aProgress ) + { + iSource.ReportEvent( SymSource.TEvent.EReadingProgress, aProgress ); + base.OnProgressChanged( aProgress ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iHarmoniser.Dispose(); + } + } + #endregion + + #region Data members + private readonly SymSource iSource; + private SymbolCollectionHarmoniser iHarmoniser; + private uint iGlobalBaseAddress = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Reader/RVCT/RVCTMapFileReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Reader/RVCT/RVCTMapFileReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianStructuresLib.Debug.Symbols; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils; +using SymbianUtils.FileTypes; +using SymbianUtils.Tracer; + +namespace SLPluginMap.Reader.RVCT +{ + internal class RVCTMapFileReader : MapReader + { + #region Delegates & events + #endregion + + #region Constructors + public RVCTMapFileReader( SymSource aSource, ITracer aTracer ) + : base( aSource, aTracer ) + { + iSymbolParser = new RVCTSymbolCreator( this, base.Collection ); + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region From AsyncTextReaderBase + protected override void HandleFilteredLine( string aLine ) + { + if ( aLine == "Global Symbols" ) + { + iState = TState.EInGlobalRegion; + } + else if ( aLine == "Local Symbols" ) + { + iState = TState.EInLocalRegion; + } + else + { + switch( iState ) + { + case TState.EInUnknownRegion: + break; + case TState.EInLocalRegion: + ParseLineRegionLocal( aLine ); + break; + case TState.EInGlobalRegion: + ParseLineRegionGlobal( aLine ); + break; + case TState.EComplete: + System.Diagnostics.Debug.Assert(false); + break; + } + } + } + #endregion + + #region Local & global (high level) line handlers + private void ParseLineRegionLocal( string aLine ) + { + } + + private void ParseLineRegionGlobal( string aLine ) + { + switch( iStateGlobal ) + { + case TGlobalState.EWaitingForImage_ER_RO_Base: + ParseGlobalBaseAddress( aLine ); + break; + case TGlobalState.EProcessingSymbols: + ParseGlobalSymbol( aLine ); + break; + default: + break; + } + } + #endregion + + #region Global section line parse methods + private void ParseGlobalBaseAddress( string aLine ) + { + Match m = KGlobalBaseAddressRegEx.Match( aLine ); + if ( m.Success ) + { + string value = m.Groups[ 1 ].Value; + base.GlobalBaseAddress = uint.Parse( value, System.Globalization.NumberStyles.HexNumber ); + iStateGlobal = TGlobalState.EProcessingSymbols; + } + } + + private void ParseGlobalSymbol( string aLine ) + { + try + { + Symbol sym = iSymbolParser.Parse( aLine ); + if ( sym != null ) + { + base.ReportSymbol( sym ); + } + } + catch( Exception ) + { + } + } + #endregion + + #region Internal enumerations + private enum TState + { + EInUnknownRegion = 0, + EInLocalRegion, + EInGlobalRegion, + EComplete + } + + private enum TGlobalState + { + EWaitingForImage_ER_RO_Base = 0, + EProcessingSymbols + } + #endregion + + #region Internal constants + private readonly static Regex KGlobalBaseAddressRegEx = new Regex( + "\\s*Image\\$\\$ER_RO\\$\\$Base\\s+0x([A-Fa-f0-9]{8})\\s"+ + "+Number", + RegexOptions.CultureInvariant + | RegexOptions.Compiled + ); + #endregion + + #region Data members + private TState iState = TState.EInUnknownRegion; + private TGlobalState iStateGlobal = TGlobalState.EWaitingForImage_ER_RO_Base; + private readonly RVCTSymbolCreator iSymbolParser; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Reader/RVCT/RVCTSymbolCreator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Reader/RVCT/RVCTSymbolCreator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,178 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianStructuresLib.Debug.Symbols; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils; +using SymbianUtils.FileTypes; +using SymbianUtils.Tracer; + +namespace SLPluginMap.Reader.RVCT +{ + internal class RVCTSymbolCreator + { + #region Enumerations + public enum TType + { + EUnknown = 0, + EARMCode, + EThumbCode, + EData, + ENumber, + ESection + } + #endregion + + #region Constructors + public RVCTSymbolCreator( MapReader aReader, SymbolCollection aCollection ) + { + iReader = aReader; + iCollection = aCollection; + } + #endregion + + #region Properties + #endregion + + #region API + public Symbol Parse( string aLine ) + { + Symbol ret = null; + // + Match m = KMapParserRegex.Match( aLine ); + if ( m.Success ) + { + GroupCollection groups = m.Groups; + // + uint globalBaseAddress = iReader.GlobalBaseAddress; + string typeString = groups[ "Type" ].Value; + // + string objectName = groups[ "Binary" ].Value; + uint size = uint.Parse( groups[ "Size" ].Value ); + string symbol = groups[ "Function" ].Value; + uint offsetAddress = uint.Parse( groups[ "Address" ].Value, System.Globalization.NumberStyles.HexNumber ) - globalBaseAddress; + TSymbolType type = TypeByString( typeString ); + // + ret = Symbol.New( iCollection ); + ret.OffsetAddress = offsetAddress; + ret.Size = size; + ret.Object = objectName; + ret.Name = symbol; + ret.Type = type; + + TSymbolType tt = ret.Type; + + // If the MAP file indicated thumb code then ensure our symbol library agrees. + if ( typeString == "Thumb Code" ) + { + System.Diagnostics.Debug.Assert( ret.InstructionSet == SymbianStructuresLib.Arm.TArmInstructionSet.ETHUMB ); + } + } + // + return ret; + } + #endregion + + #region Internal constants + // + // Regular expression built for C# on: Fri, Aug 15, 2008, 11:19:15 AM + // Using Expresso Version: 3.0.2766, http://www.ultrapico.com + // + // A description of the regular expression: + // + // Match expression but don't capture it. [\s+] + // Whitespace, one or more repetitions + // [Function]: A named capture group. [.+?] + // Any character, one or more repetitions, as few as possible + // Match expression but don't capture it. [\s+] + // Whitespace, one or more repetitions + // 0x + // 0x + // [Address]: A named capture group. [[A-Fa-f0-9]{8}] + // Any character in this class: [A-Fa-f0-9], exactly 8 repetitions + // Match expression but don't capture it. [\s+] + // Whitespace, one or more repetitions + // [Type]: A named capture group. [(?:Data|Section|Number|ARM Code|Thumb Code)] + // Match expression but don't capture it. [Data|Section|Number|ARM Code|Thumb Code] + // Select from 5 alternatives + // Data + // Data + // Section + // Section + // Number + // Number + // ARM Code + // ARM + // Space + // Code + // Thumb Code + // Thumb + // Space + // Code + // Match expression but don't capture it. [\s+] + // Whitespace, one or more repetitions + // [Size]: A named capture group. [\d+] + // Any digit, one or more repetitions + // Match expression but don't capture it. [\s+] + // Whitespace, one or more repetitions + // [Binary]: A named capture group. [.+] + // Any character, one or more repetitions + // + // + // + private static readonly Regex KMapParserRegex = new Regex( + "(?:\\s*)(?.+?)(?:\\s+)0x(?
[A-Fa-f0-9]{8})"+ + "(?:\\s+)(?(?:Data|Section|Number|ARM Code|Thumb Code))"+ + "(?:\\s+)(?\\d+)(?:\\s+)(?.+)", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.Compiled + ); + #endregion + + #region Internal methods + private static TSymbolType TypeByString( string aTypeAsString ) + { + TSymbolType ret = TSymbolType.EUnknown; + // + if ( aTypeAsString == "ARM Code" ) + ret = TSymbolType.ECode; + else if ( aTypeAsString == "Thumb Code" ) + ret = TSymbolType.ECode; + else if ( aTypeAsString == "Section" ) + ret = TSymbolType.ESection; + else if ( aTypeAsString == "Data" ) + ret = TSymbolType.EData; + else if ( aTypeAsString == "Number" ) + ret = TSymbolType.ENumber; + // + return ret; + } + #endregion + + #region Data members + private readonly MapReader iReader; + private readonly SymbolCollection iCollection; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/SLPluginMap.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/SLPluginMap.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,79 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {2E619377-8639-49F9-9494-4FAD25CBC05E} + Library + Properties + SLPluginMap + SLPluginMap.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC} + SymbianSymbolLib + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Utilities/MapFileType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Utilities/MapFileType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; + +namespace SLPluginMap.Utilities +{ + internal enum TMapFileType + { + ETypeUnknown = -1, + ETypeRVCT = 0, + ETypeGCCE + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Utilities/MapFileUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginMap/Utilities/MapFileUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; + +namespace SLPluginMap.Utilities +{ + internal static class MapFileUtils + { + public static TMapFileType Type( string aFileName ) + { + TMapFileType ret = TMapFileType.ETypeUnknown; + // + if ( File.Exists( aFileName ) ) + { + ret = TMapFileType.ETypeGCCE; + // + using ( StreamReader reader = new StreamReader( aFileName ) ) + { + string firstLine = reader.ReadLine().Trim().ToUpper(); + if ( firstLine.StartsWith( "ARM LINKER, RVCT" ) ) + { + ret = TMapFileType.ETypeRVCT; + } + } + } + // + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginObey/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginObey/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "SLPluginObey" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Symbian Software Ltd" )] +[assembly: AssemblyProduct( "SLPluginObey" )] +[assembly: AssemblyCopyright( "Copyright © Symbian Software Ltd 2008" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "edcd7511-c37c-46f3-9d60-59ec701faf10" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginObey/Provider/ObeySourceProvider.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginObey/Provider/ObeySourceProvider.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Debug.Symbols; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils.FileTypes; +using SymbianUtils; +using SLPluginObey.Reader; +using SLPluginObey.Source; + +namespace SLPluginObey.Provider +{ + public class ObeySourceProvider : SymSourceProvider + { + #region Constructors + public ObeySourceProvider( SymSourceProviderManager aManager ) + : base( aManager ) + { + } + #endregion + + #region From SymSourceProvider + public override bool IsSupported( string aFileName ) + { + bool ret = base.IsSupported( aFileName ); + if ( ret ) + { + FindMapProvider(); + + // Check that the MAP file source is supported + bool exists = File.Exists( aFileName ); + ret = ( iMapProvider != null ) && exists; + } + // + return ret; + } + + public override SymSourceCollection CreateSources( string aFileName ) + { + System.Diagnostics.Debug.Assert( iMapProvider != null ); + + // Read OBY file and resolve to map files in host file system. + iTransientSources = new SymSourceCollection(); + try + { + ObeyFileReader reader = new ObeyFileReader( aFileName ); + reader.EntryRead += new ObeyFileReader.ObyEntryHandler( Reader_EntryRead ); + reader.Read( TSynchronicity.ESynchronous ); + } + catch ( Exception ) + { + iTransientSources.Clear(); + } + + // This source provider doesn't directly create any sources + SymSourceCollection ret = iTransientSources; + iTransientSources = null; + return ret; + } + + public override SymFileTypeList FileTypes + { + get + { + SymFileTypeList ret = new SymFileTypeList(); + // + ret.Add( new SymFileType( ".oby", "Symbian OS Obey Files" ) ); + // + return ret; + } + } + + public override string Name + { + get { return "OBY"; } + } + #endregion + + #region Properties + #endregion + + #region Event handlers + private void Reader_EntryRead( ObeyFileReader aReader, string aHost, string aDevice ) + { + // Check if there is a corresponding map file in the host file system. + FileInfo mapFile = new FileInfo( aHost + KMapFileExtension ); + if ( mapFile.Exists ) + { + bool supported = iMapProvider.IsSupported( mapFile.FullName ); + if ( supported ) + { + // First get the map provider to create its own concrete list of + // sources for the specified map file. This should just be a single + // source and a single collection since that is the logical encapsulating + // domain for a given map file. + SymSourceCollection mapSources = iMapProvider.CreateSources( mapFile.FullName ); + + // Next, we iterate through any sources (probably just one) and then + // extract the collection & provider that was specified for that source. + // + // We want to effectively sit the OBY source plugin in between the symbol + // engine and the map plugin so that it can ensure that we only read a + // given map file at the point when the map file symbol collection is activated. + foreach ( SymSource mapSource in mapSources ) + { + SymSource obeySource = new ObeySource( mapSource.URI, this, mapSource ); + iTransientSources.Add( obeySource ); + } + } + else + { + SymbianUtils.SymDebug.SymDebugger.Break(); + } + } + } + #endregion + + #region Internal constants + private const string KMapFileExtension = ".map"; + #endregion + + #region Internal methods + private void FindMapProvider() + { + if ( iMapProvider == null ) + { + iMapProvider = base.ProvisioningManager[ "MAP" ]; + } + } + #endregion + + #region Data members + private SymSourceProvider iMapProvider; + private SymSourceCollection iTransientSources = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginObey/Reader/ObeyReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginObey/Reader/ObeyReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianStructuresLib.Debug.Symbols; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils.FileTypes; +using SymbianUtils; + +namespace SLPluginObey.Reader +{ + internal class ObeyFileReader : AsyncTextFileReader + { + #region Delegates & events + public delegate void ObyEntryHandler( ObeyFileReader aReader, string aHost, string aDevice ); + public event ObyEntryHandler EntryRead; + #endregion + + #region Constructors + public ObeyFileReader( string aFileName ) + : base( aFileName ) + { + // We should identify what kind of prefix to apply to all the (host) file name + // entries that we read from the OBY file. + // + // For example, the OBY might say: + // + // \epoc32\release\ARMV5\urel\somebinary.dll "..." + // + // We must work out where that '\epoc32' directory is relative to, and then + // use this as the basis of the prefix to apply to every line we read + // from the OBY itself. + // + // Pre-conditions: + // * We will only ever look on the host drive that contains the actual OBY file. + // + // Algorithm: + // + // 1) We will search up the directory tree, starting at the directory containing the OBY + // and check whether it contains an \epoc32\ subdirectory. + // 2) If an \epoc32 subdirectory exists, then this is our prefix. + // 3) If no such subdirectory exists, then we pop a level from the directory (i.e. move to parent) + // and try again. + // 4) Eventually, we'll end up with [OBY drive letter]:\epoc32\ - at this point, even if + // the specified directory does not exist, we'll just give up. + // + + // Fail safe + iRootPathToApplyToAllHostFileNames = Path.GetPathRoot( base.FileName ); + try + { + DirectoryInfo dirInfo = new DirectoryInfo( Path.GetDirectoryName( aFileName ) ); + while( dirInfo.Exists ) + { + string path = Path.Combine( dirInfo.FullName, KStandardEpoc32Path ); + if ( Directory.Exists( path ) ) + { + iRootPathToApplyToAllHostFileNames = dirInfo.FullName; + break; + } + else + { + dirInfo = new DirectoryInfo( dirInfo.Parent.FullName ); + } + } + } + catch + { + } + } + #endregion + + #region API + public void Read( TSynchronicity aSynchronicity ) + { + base.StartRead( aSynchronicity ); + } + #endregion + + #region Properties + #endregion + + #region From AsyncTextFileReader + protected override void HandleFilteredLine( string aLine ) + { + Match m = KMapParserRegex.Match( aLine ); + if ( m.Success ) + { + GroupCollection groups = m.Groups; + string type = groups[ "Type" ].Value; + string host = groups[ "Host" ].Value; + string device = groups[ "Device" ].Value; + + // Fix up names + try + { + if ( type != "ROFS_HEADER" ) + { + host = CombineWithHostDrive( host ); + device = CombineWithDeviceDrive( device ); + + if ( EntryRead != null ) + { + EntryRead( this, host, device ); + } + } + } + catch ( Exception ) + { + base.Trace( "WARNING: exception when trying to parse OBY line: [{0}], file: [{1}]", aLine, base.FileName ); + } + } + } + #endregion + + #region Internal constants + public static readonly Regex KMapParserRegex = new Regex( + @"(?.+)\=(\x22|)(?.+?)(\x22|)(?:\s+)\x22(?.+)\x22", + RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + private const string KStandardEpoc32Path = @"epoc32\"; + #endregion + + #region Internal methods + private string CombineWithHostDrive( string aFileAndPath ) + { + string fileName = aFileAndPath.Trim(); + if ( fileName.StartsWith( @"\" ) ) + { + fileName = fileName.Substring( 1 ); + } + + string ret = Path.Combine( iRootPathToApplyToAllHostFileNames, fileName ); + return ret; + } + + private string CombineWithDeviceDrive( string aFileAndPath ) + { + string ret = Path.Combine( @"Z:\", aFileAndPath ); + return ret; + } + #endregion + + #region Data members + private readonly string iRootPathToApplyToAllHostFileNames; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginObey/SLPluginObey.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginObey/SLPluginObey.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8} + Library + Properties + SLPluginObey + SLPluginObey.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC} + SymbianSymbolLib + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginObey/Source/ObeySource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginObey/Source/ObeySource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,122 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Debug.Symbols.Interfaces; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils.FileTypes; +using SymbianUtils; + +namespace SLPluginObey.Source +{ + internal class ObeySource : SymSource, ISymbolCollectionRelocationHandler + { + #region Constructors + public ObeySource( string aURI, SymSourceProvider aProvider, SymSource aOriginalMapSource ) + : base( aURI, aProvider ) + { + foreach ( SymbolCollection mapCollection in aOriginalMapSource ) + { + mapCollection.IfaceRelocationHandler = this as ISymbolCollectionRelocationHandler; + base.Add( mapCollection ); + } + iOriginalMapSource = aOriginalMapSource; + } + #endregion + + #region API + #endregion + + #region From SymSource + public override void Read( TSynchronicity aSynchronicity ) + { + // This method is typically called when the engine is primed with a list of files. + // We've already read the OBY file content, so there's no need to do anything there + // at all. In fact, this method is never invoked in that scenario because the OBY + // file is never registered as a SymSource. + // + // The usual invocation context for this method is when a map file prime request is + // received. Because we associated every MAP file [that we were able to locate from the + // OBY data] with the OBY provider, we can intercept the requests to read the MAP content. + // + // This allows us to ignore those read requests that occur during priming, and thereby + // allow "on demand" reading of MAP file content only when an explicit code segment + // activation (relocation/fixup) API call is made to the SymbolView class. + // + // When the symbol collection is activated (relocated/fixed up) we will be notified by + // way of the SymbolCollection's "relocated" event. This will then allow us to syncronously + // read the MAP file content and update the collection with a list of real symbols. All of + // this is managed by the ObeySource class. + // + // This therefore explains why this method is implemented, but is empty. + // Also see Reader_EntryRead for further details. + base.ReportEvent( TEvent.EReadingComplete ); + } + #endregion + + #region Properties + public SymSource OriginalMapSource + { + get { return iOriginalMapSource; } + } + #endregion + + #region Event handlers + #endregion + + #region Internal constants + #endregion + + #region Internal methods + #endregion + + #region ISymbolCollectionRelocationHandler Members + void ISymbolCollectionRelocationHandler.PrepareForRelocation( SymbolCollection aCollection, uint aOldBase, uint aNewBase ) + { + // This is invoked when a map file is activated. Because we've probably not yet read the + // source content, we will synchronously parse the map file now so that we have a full set + // of symbols available to the client. + if ( aCollection.IsEmptyApartFromDefaultSymbol ) + { + // This will read into the original map source and original map collection. + iOriginalMapSource.Read( TSynchronicity.ESynchronous ); + + // If the specified aCollection is a clone, i.e. not the original, then we may need + // to copy symbols over. + if ( iOriginalMapSource.Count > 0 ) + { + SymbolCollection primaryMapCollection = iOriginalMapSource[ 0 ]; + if ( aCollection != primaryMapCollection ) + { + aCollection.Clone( primaryMapCollection ); + } + } + } + } + #endregion + + #region Data members + private readonly SymSource iOriginalMapSource; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Data/SymbolCollectionSegment.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Data/SymbolCollectionSegment.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Debug.Symbols.Interfaces; +using SymbianStructuresLib.Debug.Common.Interfaces; +using SymbianStructuresLib.Debug.Common.FileName; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SLPluginSymbol.Source; + +namespace SLPluginSymbol.Data +{ + internal class SymbolCollectionSegment : DisposableObject, IEnumerable + { + #region Constructors + public SymbolCollectionSegment( IPlatformIdAllocator aIdAllocator, string aHostFileName ) + { + iCollection = SymbolCollection.NewByHostFileName( aIdAllocator, aHostFileName ); + } + #endregion + + #region API + public SymbolCollection ExcavateSymbolCollection() + { + SymbolCollection ret = iCollection; + iCollection = null; + return ret; + } + + public void AddLine( string aLine ) + { + iLines.Add( aLine ); + } + #endregion + + #region Properties + public int Count + { + get { return iLines.Count; } + } + + public SymbolCollection Collection + { + get { return iCollection; } + } + + public PlatformFileName FileName + { + get { return iCollection.FileName; } + } + #endregion + + #region Internal constants + #endregion + + #region Internal methods + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( string line in iLines ) + { + yield return line; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( string line in iLines ) + { + yield return line; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iCollection = null; + iLines.Clear(); + } + } + #endregion + + #region Data members + private SymbolCollection iCollection = null; + private List iLines = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Data/SymbolFileData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Data/SymbolFileData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,244 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Debug.Symbols.Interfaces; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianUtils.Threading; +using SLPluginSymbol.Source; + +namespace SLPluginSymbol.Data +{ + internal class SymbolFileData : DisposableObject, IEnumerable + { + #region Delegates & events + public delegate void DataPreparedHandler( SymbolFileData aData ); + public event DataPreparedHandler DataPrepared = delegate { }; + #endregion + + #region Constructors + public SymbolFileData( SymbolSource aSource ) + { + iSource = aSource; + iData = File.ReadAllBytes( aSource.URI ); + } + #endregion + + #region API + public void Split( int aSegmentCount ) + { + int chunkSize = (int) iData.Length / aSegmentCount; + int blockPosStart = 0; + int length = 0; + // + for ( int i = 0; i < aSegmentCount; i++ ) + { + int pos = 0; + int blockPosEnd = Math.Min( iData.Length - 1, blockPosStart + chunkSize ); + while ( pos >= 0 ) + { + pos = Array.IndexOf( iData, KPattern[ 0 ], blockPosEnd ); + if ( pos > 0 ) + { + if ( pos + 8 >= iData.Length ) + { + break; + } + else if ( pos + 8 < iData.Length && iData[ pos + 7 ] == KPattern[ 7 ] ) + { + bool isMatch = CompareByteArrays( KPattern, iData, pos ); + if ( isMatch ) + { + length = pos - blockPosStart; + //System.Diagnostics.Debug.WriteLine( string.Format( "Block {0:d2} @ 0x{1:x8}, length: {2:d8}", i, blockPosStart, length ) ); + // + iSegments.Add( new SymbolFileSegment( this, blockPosStart, length ) ); + blockPosStart = pos; + break; + } + else + { + // Didn't find a match, move forwards + blockPosEnd = pos + 1; + } + } + else + { + // Didn't find a match, move forwards + blockPosEnd = pos + 1; + } + } + else + { + // Searched to end of file and didn't find another block, so just create + // a new reader for everything that remains. + length = iData.Length - blockPosStart; + //System.Diagnostics.Debug.WriteLine( string.Format( "Block {0:d2} @ 0x{1:x8}, length: {2:d8}", i, blockPosStart, length ) ); + iSegments.Add( new SymbolFileSegment( this, blockPosStart, length ) ); + // + break; + } + } + } + + iCollectionIdentifier = new MultiThreadedProcessor( this ); + } + + public void FindCollections() + { + System.Diagnostics.Debug.Assert( iCollectionIdentifier != null ); + iCollectionIdentifier.ProcessItem += new MultiThreadedProcessor.ItemProcessor( CollectionIdentifier_ProcessItem ); + iCollectionIdentifier.EventHandler += new MultiThreadedProcessor.ProcessorEventHandler( CollectionIdentifier_EventHandler ); + iCollectionIdentifier.Start( TSynchronicity.EAsynchronous ); + } + #endregion + + #region Properties + public SymbolSource Source + { + get { return iSource; } + } + #endregion + + #region Operators + public static implicit operator byte[]( SymbolFileData aData ) + { + return aData.iData; + } + #endregion + + #region Internal constants + private static readonly byte[] KPattern = new byte[] { (byte) 'F', (byte) 'r', (byte) 'o', (byte) 'm', (byte) ' ', (byte) ' ', (byte) ' ', (byte) ' ' }; + #endregion + + #region Event handlers + private void CollectionIdentifier_EventHandler( MultiThreadedProcessor.TEvent aEvent ) + { + switch ( aEvent ) + { + default: + break; + case MultiThreadedProcessor.TEvent.EEventStarting: + break; + case MultiThreadedProcessor.TEvent.EEventCompleted: + iCollectionIdentifier.ProcessItem -= new MultiThreadedProcessor.ItemProcessor( CollectionIdentifier_ProcessItem ); + iCollectionIdentifier.EventHandler -= new MultiThreadedProcessor.ProcessorEventHandler( CollectionIdentifier_EventHandler ); + iCollectionIdentifier.Dispose(); + iCollectionIdentifier = null; + DataPrepared( this ); + break; + } + } + + private void CollectionIdentifier_ProcessItem( SymbolFileSegment aItem ) + { + aItem.PerformInitialCollectionIdentification(); + } + #endregion + + #region Internal methods + private static bool CompareByteArrays( byte[] aSearchFor, byte[] aSearchIn, int aStartPos ) + { + bool areEqual = true; + // + for ( int i = 0; i < aSearchFor.Length; i++ ) + { + byte c = aSearchFor[ i ]; + + int bigBufferIndex = aStartPos + i; + if ( bigBufferIndex > aSearchIn.Length ) + { + // We ran out of data + areEqual = false; + break; + } + else + { + byte b = aSearchIn[ bigBufferIndex ]; + if ( b != c ) + { + areEqual = false; + break; + } + } + } + // + return areEqual; + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach( SymbolFileSegment segment in iSegments ) + { + yield return segment; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( SymbolFileSegment segment in iSegments ) + { + yield return segment; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + foreach ( SymbolFileSegment seg in iSegments ) + { + seg.Dispose(); + } + // + if ( iCollectionIdentifier != null ) + { + iCollectionIdentifier.Dispose(); + iCollectionIdentifier = null; + } + // + iSegments.Clear(); + iData = null; + } + } + #endregion + + #region Data members + private readonly SymbolSource iSource; + private byte[] iData = null; + private List iSegments = new List(); + private MultiThreadedProcessor iCollectionIdentifier; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Data/SymbolFileSegment.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Data/SymbolFileSegment.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,185 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianStructuresLib.Debug.Symbols; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SLPluginSymbol.Source; + +namespace SLPluginSymbol.Data +{ + internal class SymbolFileSegment : DisposableObject, IEnumerable + { + #region Delegates & events + public delegate void CompletionHandler( SymbolFileSegment aSegment ); + public event CompletionHandler Completed = null; + #endregion + + #region Constructors + public SymbolFileSegment( SymbolFileData aData, int aOffset, int aLength ) + { + iData = aData; + iOffset = aOffset; + iLength = aLength; + } + #endregion + + #region API + public void PerformInitialCollectionIdentification() + { + SymbolCollectionSegment current = null; + // + long lineCount = 0; + // + using ( StreamReader reader = NewStream() ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + ++lineCount; + if ( line.StartsWith( "From " ) ) + { + string hostFileName = line.Substring( 4 ).Trim(); + UpdateLineCount( current ); + current = NewCollectionSegment( hostFileName ); + } + else if ( current != null && line != string.Empty ) + { + current.AddLine( line ); + } + + line = reader.ReadLine(); + } + } + + UpdateLineCount( current ); + iIsReady = true; + + if ( Completed != null ) + { + Completed( this ); + } + } + #endregion + + #region Properties + public bool IsReady + { + get { return iIsReady; } + } + + public long NumberOfLines + { + get { return iNumberOfLines; } + } + + public int Count + { + get { return iCollectionSegments.Count; } + } + + public SymbolCollectionSegment this[ int aIndex ] + { + get { return iCollectionSegments[ aIndex ]; } + } + + public SymbolSource Source + { + get { return iData.Source; } + } + #endregion + + #region Internal constants + #endregion + + #region Internal methods + private void UpdateLineCount( SymbolCollectionSegment aFinalisedSegment ) + { + if ( aFinalisedSegment != null ) + { + iNumberOfLines += aFinalisedSegment.Count; + } + } + + private SymbolCollectionSegment NewCollectionSegment( string aFileNameInHost ) + { + SymbolCollectionSegment ret = new SymbolCollectionSegment( iData.Source.Provider.IdAllocator, aFileNameInHost ); + iCollectionSegments.Add( ret ); + return ret; + } + + private StreamReader NewStream() + { + return new StreamReader( new MemoryStream( iData, iOffset, iLength ) ); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( SymbolCollectionSegment segment in iCollectionSegments ) + { + yield return segment; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( SymbolCollectionSegment segment in iCollectionSegments ) + { + yield return segment; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + foreach ( SymbolCollectionSegment segment in iCollectionSegments ) + { + segment.Dispose(); + } + iCollectionSegments.Clear(); + iCollectionSegments = null; + } + } + #endregion + + #region Data members + private readonly SymbolFileData iData; + private readonly int iOffset; + private readonly int iLength; + private bool iIsReady = false; + private long iNumberOfLines = 0; + private List iCollectionSegments = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Program.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Program.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,311 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianUtils.Range; + +namespace SymbianSymbolLibTest +{ + class Program + { + class Binary + { + public string iFileName = string.Empty; + public byte[] iData = null; + public long iDataStart = 0; + public long iDataEnd = 0; + } + + class Binary2 + { + public string iFileName = string.Empty; + public List iData = new List(); + } + + class Store + { + public Store() + { + } + + public void Add( string aFileName, Binary2 aData ) + { + lock ( iEntries ) + { + if ( !iEntries.ContainsKey( aFileName ) ) + { + iEntries.Add( aFileName, aData ); + } + } + } + + public int Count + { + get { return iEntries.Count; } + } + + public void Dump() + { + } + + private Dictionary iEntries = new Dictionary(); + } + + class ThreadReader + { + public delegate void CompletionHandler( ThreadReader aReader ); + public event CompletionHandler Completed = null; + + public ThreadReader( byte[] aData, int aStart, int aCount, Store aStore ) + { + iData = aData; + iStart = aStart; + iCount = aCount; + iStore = aStore; + } + + public void Read() + { + //System.Console.WriteLine( string.Format( "Reading starting - pos: 0x{0}, len: {1:d8}", iStart, iCount ) ); + DateTime timeStamp = DateTime.Now; + + Binary2 currentBinary = null; + + long binaryCount = 0; + long lineCount = 0; + using ( StreamReader reader = new StreamReader( new MemoryStream( iData, iStart, iCount ) ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + ++lineCount; + if ( line.StartsWith( "From " ) ) + { + currentBinary = new Binary2(); + currentBinary.iFileName = line.Substring( 8 ); + // + ++binaryCount; + iStore.Add( currentBinary.iFileName, currentBinary ); + } + else if ( currentBinary != null ) + { + currentBinary.iData.Add( line ); + } + + line = reader.ReadLine(); + } + } + + DateTime endTime = DateTime.Now; + TimeSpan span = ( endTime - timeStamp ); + //System.Console.WriteLine( string.Format( "Reading complete - {0} time, {1} lines, {2} binaries", span, lineCount, binaryCount ) ); + + if ( Completed != null ) + { + Completed( this ); + } + } + + private readonly byte[] iData; + private readonly int iStart; + private readonly int iCount; + private readonly Store iStore; + } + + class SymbolFile + { + #region Constructors + public SymbolFile( FileInfo aFile ) + { + iFile = aFile; + } + #endregion + + #region API + public void Read() + { + Partition(); + // + iWaiter = new AutoResetEvent( false ); + for( int i=iReaders.Count-1; i>=0; i-- ) + { + ThreadReader reader = iReaders[ i ]; + reader.Completed += new ThreadReader.CompletionHandler( Reader_Completed ); + ThreadPool.QueueUserWorkItem( new WaitCallback(StartReader ), reader ); + } + + // Now wait + using ( iWaiter ) + { + iWaiter.WaitOne(); + } + iWaiter = null; + } + #endregion + + #region Properties + public int Count + { + get { return iStore.Count; } + } + #endregion + + #region Event handlers + private void Reader_Completed( ThreadReader aReader ) + { + iCompleted.Add( aReader ); + iReaders.Remove( aReader ); + // + if ( iReaders.Count == 0 ) + { + iWaiter.Set(); + } + } + #endregion + + #region Internal methods + private static void StartReader( object aThreadReader ) + { + ThreadReader reader = (ThreadReader) aThreadReader; + reader.Read(); + } + + private void Partition() + { + // Read entire file into buffer + byte[] data = new byte[ iFile.Length ]; + using ( Stream reader = new FileStream( iFile.FullName, FileMode.Open ) ) + { + reader.Read( data, 0, data.Length ); + } + + // This is the pattern we are searching for: + byte[] pattern = new byte[] { (byte) 'F', (byte) 'r', (byte) 'o', (byte) 'm', (byte) ' ', (byte) ' ', (byte) ' ', (byte) ' ' }; + + int threadCount = System.Environment.ProcessorCount; + int chunkSize = (int) iFile.Length / threadCount; + + // + int blockPosStart = 0; + for ( int i = 0; i < threadCount; i++ ) + { + int pos = 0; + int blockPosEnd = Math.Min( data.Length - 1, blockPosStart + chunkSize ); + while ( pos >= 0 ) + { + pos = Array.IndexOf( data, pattern[ 0 ], blockPosEnd ); + if ( pos > 0 ) + { + if ( pos + 8 >= data.Length ) + { + break; + } + else if ( pos + 8 < data.Length && data[ pos + 7 ] == pattern[ 7 ] ) + { + bool isMatch = CompareByteArrays( pattern, data, pos ); + if ( isMatch ) + { + int length = pos - blockPosStart; + System.Console.WriteLine( string.Format( "Block {0:d2} @ 0x{1:x8}, length: {2:d8}", i, blockPosStart, length ) ); + // + ThreadReader reader = new ThreadReader( data, blockPosStart, length, iStore ); + iReaders.Add( reader ); + + blockPosStart = pos; + break; + } + } + else + { + // Didn't find a match, move forwards + blockPosEnd = pos + 1; + } + } + else + { + // Searched to end of file and didn't find another block, so just create + // a new reader for everything that remains. + int length2 = data.Length - blockPosStart; + System.Console.WriteLine( string.Format( "Block {0:d2} @ 0x{1:x8}, length: {2:d8}", i, blockPosStart, length2 ) ); + // + ThreadReader reader2 = new ThreadReader( data, blockPosStart, length2, iStore ); + iReaders.Add( reader2 ); + break; + } + } + } + } + + private static bool CompareByteArrays( byte[] aSearchFor, byte[] aSearchIn, int aStartPos ) + { + bool areEqual = true; + // + for ( int i = aStartPos; i < aSearchFor.Length; i++ ) + { + byte b = aSearchIn[ i ]; + byte c = aSearchFor[ i - aStartPos ]; + if ( b != c ) + { + areEqual = false; + break; + } + } + // + return areEqual; + } + #endregion + + #region Data members + private readonly FileInfo iFile; + private AutoResetEvent iWaiter = null; + private Store iStore = new Store(); + private List iCompleted = new List(); + private List iReaders = new List(); + #endregion + } + + static void Main( string[] args ) + { + string path = @"C:\Tool Demo Files\2. Crash Data\File43\CoreImage"; // C:\Tool Demo Files\2. Crash Data\File28\"; + DirectoryInfo dir = new DirectoryInfo( path ); + FileInfo[] files = dir.GetFiles( "*.symbol" ); + // + // + foreach ( FileInfo file in files ) + { + // + DateTime timeStamp = DateTime.Now; + System.Console.WriteLine( string.Format( "[{0}] - Reading starting...", file.Name ) ); + + SymbolFile symbolFile = new SymbolFile( file ); + symbolFile.Read(); + + DateTime endTime = DateTime.Now; + TimeSpan span = ( endTime - timeStamp ); + + System.Console.WriteLine( string.Format( "[{0}] - Reading complete - {1} time, {2} binaries", file.Name, span, symbolFile.Count ) ); + System.Console.WriteLine( " " ); + System.Console.WriteLine( " " ); + System.Console.WriteLine( " " ); + System.Console.ReadKey(); + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "SLPluginSymbol" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia" )] +[assembly: AssemblyProduct( "SLPluginSymbol" )] +[assembly: AssemblyCopyright( "Copyright © Nokia 2009" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "40aa85d5-4055-45b8-b3d0-0b897e29ef2e" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Provider/SymbolSourceProvider.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Provider/SymbolSourceProvider.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianStructuresLib.Debug.Symbols; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils.FileTypes; +using SymbianUtils; +using SLPluginSymbol.Data; +using SLPluginSymbol.Reader; +using SLPluginSymbol.Source; +using SLPluginSymbol.Utilities; + +namespace SLPluginSymbol.Provider +{ + public class SymbolSourceProvider : SymSourceProvider + { + #region Constructors + public SymbolSourceProvider( SymSourceProviderManager aManager ) + : base( aManager ) + { + } + #endregion + + #region From SymSourceProvider + public override SymSourceCollection CreateSources( string aFileName ) + { + System.Diagnostics.Debug.WriteLine( string.Format( "[Symbol Memory] START -> {0:d12}, source: {1}", System.GC.GetTotalMemory( true ), aFileName ) ); + SymbolSource source = new SymbolSource( aFileName, this ); + return new SymSourceCollection( source ); + } + + public override void ReadSource( SymSource aSource, TSynchronicity aSynchronicity ) + { + SymbolSource source = (SymbolSource) aSource; + // + SymbolFileData data = source.ExcavateData(); + SymbolFileReader reader = new SymbolFileReader( source, data ); + reader.Read( aSynchronicity ); + } + + public override SymFileTypeList FileTypes + { + get + { + SymFileTypeList ret = new SymFileTypeList(); + // + ret.Add( new SymFileType( ".symbol", "Symbian OS Symbolic Information File" ) ); + // + return ret; + } + } + + public override string Name + { + get { return "SYMBOL"; } + } + #endregion + + #region Properties + #endregion + + #region Event handlers + + #endregion + + #region Internal constants + private const string KSymbolFileExtension = ".SYMBOL"; + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Reader/SymbolCreator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Reader/SymbolCreator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianStructuresLib.Debug.Symbols; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; + +namespace SLPluginSymbol.Reader +{ + internal class SymbolCreator + { + #region Constructors + public SymbolCreator() + { + } + #endregion + + #region API + public static BasicSymbol Parse( string aLine ) + { + BasicSymbol ret = null; + // + Match m = KSimpleSymbolRegEx.Match( aLine ); + if ( m.Success ) + { + BasicSymbol symbol = new BasicSymbol(); + + symbol.iAddress = uint.Parse( m.Groups[ "Address" ].Value, System.Globalization.NumberStyles.HexNumber ); + symbol.iSize = uint.Parse( m.Groups[ "Size" ].Value, System.Globalization.NumberStyles.HexNumber ); + + string symbolAndObject = m.Groups[ "SymbolAndObject" ].Value; + ParseSymbolText( symbolAndObject, out symbol.iName, out symbol.iObject ); + + ret = symbol; + } + // + return ret; + } + + public Symbol Parse( string aLine, SymbolCollection aCollection ) + { + Symbol ret = null; + // + BasicSymbol basicSymbol = Parse( aLine ); + if ( basicSymbol != null ) + { + uint baseAddress = aCollection.BaseAddress; + uint offsetAddress = basicSymbol.iAddress - baseAddress; + if ( basicSymbol.iAddress < baseAddress ) + { + ret = null; + } + else + { + ret = Symbol.New( aCollection ); + // + ret.OffsetAddress = offsetAddress; + ret.Size = basicSymbol.iSize; + ret.Name = basicSymbol.iName; + ret.Object = basicSymbol.iObject; + + // Make sure it's tagged as coming from a symbol file + ret.Source = TSymbolSource.ESourceWasSymbolFile; + } + } + // + return ret; + } + #endregion + + #region Classes + public class BasicSymbol + { + #region Data members + public uint iAddress = 0; + public uint iSize = 0; + public string iName = string.Empty; + public string iObject = string.Empty; + #endregion + } + #endregion + + #region Internal constants + private static readonly Regex KSimpleSymbolRegEx = new Regex( "(?
[A-Fa-f0-9]{8}) \\s+ (?[A-Fa-f0-9]{4,}) \\s+ (?.+)", + RegexOptions.CultureInvariant + | RegexOptions.Compiled + ); + #endregion + + #region Internal methods + private static void ParseSymbolText( string aText, out string aName, out string aObject ) + { + int splitPos = aText.LastIndexOf( ' ' ); + if ( splitPos > 0 ) + { + aName = aText.Substring( 0, splitPos ).TrimEnd(); + aObject = aText.Substring( splitPos ).TrimStart(); + } + else + { + aName = aText; + aObject = string.Empty; + } + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Reader/SymbolFileReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Reader/SymbolFileReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.Threading; +using SymbianUtils.FileTypes; +using SymbianUtils.TextUtilities.Readers.Types.Array; +using SymbianStructuresLib.Debug.Symbols; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SLPluginSymbol.Data; +using SLPluginSymbol.Source; + +namespace SLPluginSymbol.Reader +{ + internal class SymbolFileReader : MultiThreadedProcessor + { + #region Constructors + public SymbolFileReader( SymbolSource aSource, SymbolFileData aData ) + : base( aData, System.Threading.ThreadPriority.Lowest ) + { + iSource = aSource; + iData = aData; + + // Count the total number of lines - this enables us to report progress + foreach ( SymbolFileSegment segment in iData ) + { + iTotalNumberOfLines += segment.NumberOfLines; + } + } + #endregion + + #region API + public void Read( TSynchronicity aSynchronicity ) + { + base.Start( aSynchronicity ); + } + #endregion + + #region Properties + #endregion + + #region Event handlers + private void SymbolFileSegmentReader_Progress( SymbolFileSegmentReader aReader, long aTotalNumberOfLines, long aChunkSizeProcessed ) + { + bool report = false; + int progress = 0; + // + lock ( iSyncRoot ) + { + iProgressSoFar += aChunkSizeProcessed; + // + float progressF = (float) iProgressSoFar / (float) iTotalNumberOfLines; + progress = (int) ( progressF * 100.0f ); + // + if ( iProgressLastReported != progress ) + { + iProgressLastReported = progress; + report = true; + } + // + if ( report ) + { + System.Diagnostics.Debug.WriteLine( "SymbolFileReader - progress: " + progress ); + iSource.ReportEvent( SymSource.TEvent.EReadingProgress, progress ); + } + } + } + #endregion + + #region Internal methods + #endregion + + #region From MultiThreadedProcessor + protected override void OnEvent( MultiThreadedProcessor.TEvent aEvent ) + { + base.OnEvent( aEvent ); + // + switch ( aEvent ) + { + case MultiThreadedProcessor.TEvent.EEventStarting: + iSource.ReportEvent( SymSource.TEvent.EReadingStarted ); + break; + case MultiThreadedProcessor.TEvent.EEventCompleted: + iSource.ReportEvent( SymSource.TEvent.EReadingComplete ); + this.Dispose(); + System.Diagnostics.Debug.WriteLine( string.Format( "[Symbol Memory] END -> {0:d12}, source: {1}", System.GC.GetTotalMemory( true ), iSource.FileName ) ); + break; + default: + break; + } + } + + protected override bool Process( SymbolFileSegment aItem ) + { + SymbolFileSegmentReader reader = new SymbolFileSegmentReader( aItem ); + reader.Progress += new SymbolFileSegmentReader.ProgressHandler( SymbolFileSegmentReader_Progress ); + reader.Read( TSynchronicity.ESynchronous ); + return true; + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iData.Dispose(); + + // Since we've just flushed a large portion of file data (symbol files are BIG) + // ensure that disposed objects are released in order to reduce memory footprint. + GC.Collect(); + GC.WaitForPendingFinalizers(); + } + } + #endregion + + #region Data members + private readonly SymbolSource iSource; + private readonly SymbolFileData iData; + private readonly long iTotalNumberOfLines; + private long iProgressSoFar = 0; + private object iSyncRoot = new object(); + private int iProgressLastReported = -1; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Reader/SymbolFileSegmentReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Reader/SymbolFileSegmentReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,243 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.ComponentModel; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianUtils.TextUtilities.Readers.Types.Array; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Debug.Symbols.Utilities; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SLPluginSymbol.Data; +using SLPluginSymbol.Source; + +namespace SLPluginSymbol.Reader +{ + internal class SymbolFileSegmentReader : DisposableObject + { + #region Delegates & events + public delegate void ProgressHandler( SymbolFileSegmentReader aReader, long aTotalNumberOfLines, long aNumberProcessed ); + public event ProgressHandler Progress; + + public delegate void OperationHandler( SymbolFileSegmentReader aReader ); + public event OperationHandler OperationStarted; + public event OperationHandler OperationCompleted; + #endregion + + #region Constructors + public SymbolFileSegmentReader( SymbolFileSegment aSegment ) + { + iSegment = aSegment; + } + #endregion + + #region API + public void Read( TSynchronicity aSynchronicity ) + { + switch ( aSynchronicity ) + { + default: + case TSynchronicity.EAsynchronous: + ThreadPool.QueueUserWorkItem( new WaitCallback( InitiateReadAsync ) ); + break; + case TSynchronicity.ESynchronous: + InitiateRead(); + break; + } + } + #endregion + + #region Properties + public SymbolSource Source + { + get { return iSegment.Source; } + } + + public SymbolFileSegment FileSegment + { + get { return iSegment; } + } + #endregion + + #region Internal methods + private void InitiateReadAsync( object aNotUsed ) + { + InitiateRead(); + } + + private void InitiateRead() + { + if ( OperationStarted != null ) + { + OperationStarted( this ); + } + // + int count = iSegment.Count; + for ( int i = count - 1; i >= 0; i-- ) + { + SymbolCollectionSegment segment = iSegment[ i ]; + // + ReadLines( segment ); + } + // + if ( OperationCompleted != null ) + { + OperationCompleted( this ); + } + } + + private void ReadLines( SymbolCollectionSegment aSegment ) + { + long count = 0; + + // Make a new collection to which we'll add symbols + SymbolCollection collection = aSegment.Collection; + collection.TransactionBegin(); + + // We'll use this to filter out bad symbols + try + { + using ( SymbolCollectionHarmoniser harmoniser = new SymbolCollectionHarmoniser( collection, SymbolCollectionHarmoniser.TCollectionType.EPossiblyXIP ) ) + { + // Then create symbols + SymbolCreator creator = new SymbolCreator(); + foreach ( string line in aSegment ) + { + Symbol symbol = creator.Parse( line, collection ); + if ( symbol != null ) + { + harmoniser.Add( symbol ); + } + // + ++count; + } + } + } + finally + { + collection.TransactionEnd(); + + // Collection is now complete - run final validation in + // background thread + ValidateAndSaveCollection( collection ); + } + + ReportProgress( count ); + +#if INSPECT_SYMBOL_DATA + using ( StreamWriter writer = new StreamWriter( @"C:\Temp\NewSymbols\" + Path.GetFileName( collection.FileName.FileNameInHost ) + ".symbol" ) ) + { + WriteToStream( collection, writer ); + } +#endif + } + + private void ValidateAndSaveCollection( SymbolCollection aCollection ) + { + // We don't save empty collections since they have no size + bool isEmpty = aCollection.IsEmptyApartFromDefaultSymbol; + if ( !isEmpty ) + { + // Make sure that the collection contains at least one entry with a valid size + bool save = false; + + int count = aCollection.Count; + for ( int i = 0; i < count; i++ ) + { + Symbol sym = aCollection[ i ]; + if ( sym.Size > 0 ) + { + save = true; + break; + } + } + + if ( save ) + { + try + { + // If the source does not accept the collection then just continue to the next + // entry in the file. + aCollection.SortAsync(); + Source.Add( aCollection ); + } + catch + { + } + } + } + } + + private void ReportProgress( long aChunkSize ) + { + if ( Progress != null ) + { + Progress( this, iSegment.NumberOfLines, aChunkSize ); + } + } + +#if INSPECT_SYMBOL_DATA + private void WriteToStream( SymbolCollection aCollection, StreamWriter aWriter ) + { + // First write the binary name + aWriter.WriteLine( string.Empty ); + aWriter.WriteLine( "From " + aCollection.FileName.FileNameInHost ); + aWriter.WriteLine( string.Empty ); + + foreach ( Symbol symbol in aCollection ) + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( symbol.Address.ToString( "x8" ) ); + ret.Append( " " ); + ret.Append( symbol.Size.ToString( "x4" ) ); + ret.Append( " " ); + ret.Append( symbol.Name.PadRight( 40, ' ' ) ); + ret.Append( " " ); + ret.Append( symbol.Object ); + // + aWriter.WriteLine( ret.ToString() ); + } + } +#endif + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + } + } + #endregion + + #region Data members + private readonly SymbolFileSegment iSegment; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/SLPluginSymbol.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/SLPluginSymbol.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,82 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {E921F00D-5F82-454E-9CBE-59381C48781C} + Library + Properties + SLPluginSymbol + SLPluginSymbol.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC} + SymbianSymbolLib + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Source/SymbolSource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Source/SymbolSource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Debug.Symbols.Interfaces; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.SourceManagement.Provisioning; +using SymbianUtils.FileTypes; +using SymbianUtils; +using SLPluginSymbol.Data; +using SLPluginSymbol.Reader; +using SLPluginSymbol.Utilities; + +namespace SLPluginSymbol.Source +{ + internal class SymbolSource : SymSource + { + #region Constructors + public SymbolSource( string aURI, SymSourceProvider aProvider ) + : base( aURI, aProvider ) + { + iData = new SymbolFileData( this ); + // + FindCollections(); + } + #endregion + + #region API + public SymbolFileData ExcavateData() + { + SymbolFileData ret = iData; + iData = null; + return ret; + } + #endregion + + #region From SymSource + public override void Read( TSynchronicity aSynchronicity ) + { + EnsureCollectionsAreFound(); + // + base.Read( aSynchronicity ); + } + #endregion + + #region Properties + public new SymSourceProvider Provider + { + get + { + SymSourceProvider provider = (SymSourceProvider) base.Provider; + return provider; + } + } + #endregion + + #region Event handlers + #endregion + + #region Internal constants + #endregion + + #region Internal methods + private void EnsureCollectionsAreFound() + { + System.Diagnostics.Debug.Assert( iFindCollectionsARE != null ); + using ( iFindCollectionsARE ) + { + iFindCollectionsARE.WaitOne(); + } + // + iFindCollectionsARE = null; + } + + private void FindCollections() + { + iFindCollectionsARE = new AutoResetEvent( false ); + // + iData.Split( System.Environment.ProcessorCount ); + iData.DataPrepared += new SymbolFileData.DataPreparedHandler( SymbolFileData_DataPrepared ); + iData.FindCollections(); + } + + private void SymbolFileData_DataPrepared( SymbolFileData aData ) + { + System.Diagnostics.Debug.Assert( iFindCollectionsARE != null ); + System.Diagnostics.Debug.Assert( base.HaveBeenDisposedOf == false ); + // + lock ( iAutoResetEventLock ) + { + iFindCollectionsARE.Set(); + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iFindCollectionsARE != null ) + { + iFindCollectionsARE.Close(); + iFindCollectionsARE = null; + } + } + } + #endregion + + #region Data members + private SymbolFileData iData; + private object iAutoResetEventLock = new object(); + private AutoResetEvent iFindCollectionsARE = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Utilities/SymbolFileUtilities.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Plugins/SLPluginSymbol/Utilities/SymbolFileUtilities.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,51 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SLPluginSymbol.Reader; + +namespace SLPluginSymbol.Utilities +{ + internal static class SymbolFileUtils + { + public static bool IsRelocatable( string aFileName ) + { + bool ret = false; + // + using ( StreamReader reader = new StreamReader( aFileName ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + SymbolCreator.BasicSymbol symbol = SymbolCreator.Parse( line ); + if ( symbol != null ) + { + ret = ( symbol.iAddress == 0 ); + break; + } + // + line = reader.ReadLine(); + } + } + // + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "SymbianSymbolLib" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Symbian Software Ltd" )] +[assembly: AssemblyProduct( "SymbianSymbolLib" )] +[assembly: AssemblyCopyright( "Copyright © Symbian Software Ltd 2008" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "93998d0a-3067-4aa4-96fd-cc9cc6c95675" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/QueryAPI/SymbolQueryAPI.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/QueryAPI/SymbolQueryAPI.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Common.FileName; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.Relocator; + +namespace SymbianSymbolLib.QueryAPI +{ + internal class SymbolQueryAPI : IEnumerable + { + #region Constructors + internal SymbolQueryAPI( SymbolRelocator aRelocator ) + { + iRelocator = aRelocator; + } + #endregion + + #region API + public bool Contains( uint aAddress ) + { + // First check with the relocated/activated symbol collections, + // i.e. RAM-loaded code that has been fixed up. + bool ret = iRelocator.CollectionList.Contains( aAddress ); + if ( ret == false ) + { + // Wasn't a relocated symbol collection, so search through + // all sources for ROM/XIP symbols that might match. + foreach ( SymSource source in SourceManager ) + { + if ( source.Contains( aAddress ) ) + { + ret = true; + break; + } + } + } + // + return ret; + } + + public Symbol Lookup( uint aAddress, out SymbolCollection aCollection ) + { + aCollection = null; + + // First check with the relocated/activated symbol collections, + // i.e. RAM-loaded code that has been fixed up. + Symbol ret = iRelocator.CollectionList.Lookup( aAddress, out aCollection ); + if ( ret == null && aCollection == null ) + { + foreach ( SymSource source in SourceManager ) + { + if ( source.Contains( aAddress ) ) + { + ret = source.Lookup( aAddress, out aCollection ); + break; + } + } + } + + // Tag the collection because it provided a symbol + if ( aCollection != null ) + { + aCollection.Tagged = true; + } + + return ret; + } + + public SymbolCollection CollectionByAddress( uint aAddress ) + { + SymbolCollection collection = null; + Symbol symbol = Lookup( aAddress, out collection ); + return collection; + } + #endregion + + #region Properties + public Symbol this[ uint aAddress ] + { + get + { + SymbolCollection collection = null; + Symbol ret = Lookup( aAddress, out collection ); + return ret; + } + } + + public SymbolCollection this[ CodeSegDefinition aCodeSeg ] + { + get + { + SymbolCollection ret = null; + SymSourceAndCollection pair = SourceManager[ aCodeSeg ]; + if ( pair != null ) + { + ret = pair.Collection; + } + return ret; + } + } + + public SymbolCollection this[ PlatformFileName aFileName ] + { + get + { + SymbolCollection ret = null; + // + foreach ( SymSource source in SourceManager ) + { + SymbolCollection col = source[ aFileName ]; + if ( col != null ) + { + ret = col; + break; + } + } + // + return ret; + } + } + #endregion + + #region Internal methods + internal SymSourceManager SourceManager + { + get { return iRelocator.SourceManager; } + } + #endregion + + #region Internal enumerator + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + // This gives us explicit activations + SymbolCollectionList list = iRelocator.CollectionList; + foreach ( SymbolCollection col in list ) + { + yield return col; + } + + // Next we need fixed collections + IEnumerable fixedCols = iRelocator.SourceManager.GetFixedCollectionEnumerator(); + foreach ( SymbolCollection col in fixedCols ) + { + if ( col.IsFixed ) + { + yield return col; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + // This gives us explicit activations + SymbolCollectionList list = iRelocator.CollectionList; + foreach ( SymbolCollection col in list ) + { + yield return col; + } + + // Next we need fixed collections + IEnumerable fixedCols = iRelocator.SourceManager.GetFixedCollectionEnumerator(); + foreach ( SymbolCollection col in fixedCols ) + { + if ( col.IsFixed ) + { + yield return col; + } + } + } + #endregion + + #region Data members + private readonly SymbolRelocator iRelocator; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Relocator/SymbolRelocator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Relocator/SymbolRelocator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,207 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.CodeSegments; +using SymbianSymbolLib.DbgEnginePlugin; +using SymbianSymbolLib.SourceManagement.Source; +using SymbianSymbolLib.QueryAPI; + +namespace SymbianSymbolLib.Relocator +{ + internal class SymbolRelocator : IEnumerable + { + #region Constructors + public SymbolRelocator( SymbolPlugin aPlugin ) + { + iPlugin = aPlugin; + } + #endregion + + #region API + public SymbolCollection Activate( CodeSegDefinition aCodeSegment ) + { + SymbolCollection ret = null; + + // Find the corresponding code seg + SymSourceAndCollection pair = SourceManager[ aCodeSegment ]; + if ( pair != null ) + { + SymbolCollection col = pair.Collection; + lock ( col.SyncRoot ) + { + if ( col.IsFixed ) + { + // Cannot activate a fixed code segment - TODO: should this return "true", i.e. already activated? + } + else + { + bool safe = CheckSafeToActivate( aCodeSegment ); + if ( safe ) + { + // Deep copy the collection + SymbolCollection dupe = SymbolCollection.NewCopy( iPlugin.ProvisioningManager.IdAllocator, col ); + + // Set new process-specific relocated base address + dupe.Relocate( aCodeSegment.Base ); + + // Save so that we can unload it later + pair = new SymSourceAndCollection( pair, dupe ); + AddToActivationList( pair, aCodeSegment ); + + // We managed to activate a binary, so return the collection + ret = dupe; + + iPlugin.Trace( "[S] ACTIVATE - {0}", aCodeSegment ); + } + } + } + } + // + return ret; + } + + public bool Deactivate( CodeSegDefinition aCodeSegment ) + { + bool activated = iActivationLUT.ContainsKey( aCodeSegment ); + if ( activated ) + { + SymSourceAndCollection pair = iActivationLUT[ aCodeSegment ]; + // + lock ( iActivatedCollections ) + { + iActivatedCollections.Remove( pair.Collection ); + } + lock ( iActivationLUT ) + { + iActivationLUT.Remove( aCodeSegment ); + } + // + iPlugin.Trace( "[S] DEACTIVATE - {0} @ {1}", pair.Collection.FileName, aCodeSegment ); + } + // + return activated; + } + #endregion + + #region Properties + public SymbolCollectionList CollectionList + { + get { return iActivatedCollections; } + } + + public int Count + { + get + { + lock ( iActivatedCollections ) + { + lock ( iActivationLUT ) + { + System.Diagnostics.Debug.Assert( iActivatedCollections.Count == iActivationLUT.Count ); + return iActivationLUT.Count; + } + } + } + } + #endregion + + #region Internal methods + internal SymbolPlugin Plugin + { + get { return iPlugin; } + } + + internal SymSourceManager SourceManager + { + get { return Plugin.SourceManager; } + } + + private void AddToActivationList( SymSourceAndCollection aEntry, CodeSegDefinition aCodeSegment ) + { + lock ( iActivatedCollections ) + { + iActivatedCollections.AddAndBuildCache( aEntry.Collection ); + } + lock ( iActivationLUT ) + { + iActivationLUT.Add( aCodeSegment, aEntry ); + } + } + + private bool CheckSafeToActivate( CodeSegDefinition aCodeSegment ) + { + lock ( iActivationLUT ) + { + bool alreadyExists = iActivationLUT.ContainsKey( aCodeSegment ); + if ( alreadyExists ) + { + // Specified code segment already activated + return false; + } + else + { + // We must check that there's no overlap in activation ranges between code segments. + foreach ( KeyValuePair kvp in iActivationLUT ) + { + AddressRange range = kvp.Key; + if ( range.Contains( aCodeSegment ) ) + { + // Overlaps with existing activated code segment + return false; + } + } + } + // + return true; + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( KeyValuePair kvp in iActivationLUT ) + { + yield return kvp.Value; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair kvp in iActivationLUT ) + { + yield return kvp.Value; + } + } + #endregion + + #region Data members + private readonly SymbolPlugin iPlugin; + private SymbolCollectionList iActivatedCollections = new SymbolCollectionList(); + private Dictionary iActivationLUT = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Provisioning/SymSourceProvider.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Provisioning/SymSourceProvider.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianStructuresLib.Debug.Common.Id; +using SymbianStructuresLib.Debug.Common.Interfaces; +using SymbianSymbolLib.DbgEnginePlugin; +using SymbianSymbolLib.SourceManagement.Source; + +namespace SymbianSymbolLib.SourceManagement.Provisioning +{ + // + // A source provider is an entity that understands how to read a certain + // format of file that contains symbolic information. + // + // The provider's purpose is to read a specified source and transform it + // into generic symbol data. + // + public abstract class SymSourceProvider + { + #region Constructors + protected SymSourceProvider( SymSourceProviderManager aManager ) + { + iManager = aManager; + } + #endregion + + #region Framework API + public virtual bool IsSupported( string aFileName ) + { + SymFileTypeList fileTypes = FileTypes; + string extension = Path.GetExtension( aFileName ); + // + bool ret = fileTypes.IsSupported( extension ); + return ret; + } + + public virtual SymSourceCollection CreateSources( string aName ) + { + throw new NotSupportedException( "Support not implemented by " + this.GetType().ToString() ); + } + + public virtual void ReadSource( SymSource aSource, TSynchronicity aSynchronicity ) + { + throw new NotSupportedException(); + } + + public abstract SymFileTypeList FileTypes + { + get; + } + + public abstract string Name + { + get; + } + + public virtual string GetFileName( SymSource aSource ) + { + string ret = aSource.URI; + return ret; + } + + public virtual void PrepareToCreateSources() + { + } + #endregion + + #region Properties + public ITracer Tracer + { + get { return iManager; } + } + + public IPlatformIdAllocator IdAllocator + { + get { return iManager.IdAllocator; } + } + + protected SymSourceProviderManager ProvisioningManager + { + get { return iManager; } + } + #endregion + + #region Data members + private readonly SymSourceProviderManager iManager; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Provisioning/SymSourceProviderManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Provisioning/SymSourceProviderManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,183 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.FileTypes; +using SymbianUtils.PluginManager; +using SymbianStructuresLib.Debug.Common.Interfaces; +using SymbianSymbolLib.DbgEnginePlugin; +using SymbianSymbolLib.SourceManagement.Source; + +namespace SymbianSymbolLib.SourceManagement.Provisioning +{ + public class SymSourceProviderManager : DisposableObject, IEnumerable, ITracer + { + #region Constructors + internal SymSourceProviderManager( SymbolPlugin aPlugin, IPlatformIdAllocator aIdAllocator ) + { + iPlugin = aPlugin; + iIdAllocator = aIdAllocator; + // + iProviders.Load( new object[] { this } ); + } + #endregion + + #region API + public SymFileTypeList SupportedFileTypes() + { + SymFileTypeList ret = new SymFileTypeList(); + // + foreach ( SymSourceProvider provider in iProviders ) + { + SymFileTypeList list = provider.FileTypes; + ret.AddRange( list ); + } + // + return ret; + } + + public SymSourceProvider GetProvider( string aFileName ) + { + SymSourceProvider ret = null; + // + foreach ( SymSourceProvider provider in iProviders ) + { + bool canRead = provider.IsSupported( aFileName ); + if ( canRead ) + { + ret = provider; + break; + } + } + // + return ret; + } + + public IEnumerator GetSourceEnumerator() + { + return iPlugin.SourceManager.GetEnumerator(); + } + + public void PrepareToCreateSources() + { + foreach ( SymSourceProvider provider in iProviders ) + { + provider.PrepareToCreateSources(); + } + } + #endregion + + #region Properties + public int Count + { + get { return iProviders.Count; } + } + + public SymSourceProvider this[ string aName ] + { + get + { + SymSourceProvider ret = null; + // + foreach ( SymSourceProvider prov in iProviders ) + { + if ( prov.Name == aName ) + { + ret = prov; + break; + } + } + // + return ret; + } + } + + public IPlatformIdAllocator IdAllocator + { + get { return iIdAllocator; } + } + + public SymSourceProvider this[ int aIndex ] + { + get { return iProviders[ aIndex ]; } + } + #endregion + + #region Internal methods + internal SymbolPlugin Plugin + { + get { return iPlugin; } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( SymSourceProvider prov in iProviders ) + { + yield return prov; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( SymSourceProvider prov in iProviders ) + { + yield return prov; + } + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + iPlugin.Trace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iPlugin.Trace( aFormat, aParams ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iProviders.Unload(); + iProviders.Dispose(); + } + } + #endregion + + #region Data members + private readonly SymbolPlugin iPlugin; + private readonly IPlatformIdAllocator iIdAllocator; + private PluginManager iProviders = new PluginManager(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Source/SymSource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Source/SymSource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,398 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.Debug.Symbols.Interfaces; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Common.FileName; +using SymbianSymbolLib.SourceManagement.Provisioning; + +namespace SymbianSymbolLib.SourceManagement.Source +{ + public class SymSource : DisposableObject, IEnumerable, ISymbolCollectionRelocationHandler + { + #region Delegates & events + public delegate void EventHandlerFunction( TEvent aEvent, SymSource aSource, object aData ); + public event EventHandlerFunction EventHandler; + #endregion + + #region Enumerations + public enum TEvent + { + EReadingStarted = 0, + EReadingProgress, + EReadingComplete + } + + public enum TTimeToRead + { + EReadWhenPriming = 0, + EReadWhenNeeded // i.e. relocated + } + #endregion + + #region Constructors + public SymSource( string aURI, SymSourceProvider aProvider ) + { + iURI = aURI; + iProvider = aProvider; + } + + public SymSource( string aURI, SymSourceProvider aProvider, SymbolCollection aCollection ) + : this( aURI, aProvider ) + { + Add( aCollection ); + } + #endregion + + #region API + public virtual void Read( TSynchronicity aSynchronicity ) + { + iProvider.ReadSource( this, aSynchronicity ); + } + + public virtual void Add( SymbolCollection aCollection ) + { + // We want to be told if the collection changes it's relocation state. + aCollection.RelocationStatusChanged += new SymbolCollection.RelocationStatusChangeHandler( Collection_RelocationStatusChanged ); + + lock ( iCollectionsAll ) + { + iCollectionsAll.Add( aCollection ); + } + + CategoriseCollection( aCollection ); + } + + public virtual void Remove( SymbolCollection aCollection ) + { + aCollection.RelocationStatusChanged -= new SymbolCollection.RelocationStatusChangeHandler( Collection_RelocationStatusChanged ); + // + lock ( iCollectionsAll ) + { + iCollectionsAll.Remove( aCollection ); + } + lock ( iAlwaysActivatedCollections ) + { + iAlwaysActivatedCollections.Remove( aCollection ); + } + } + + public virtual bool Contains( uint aAddress ) + { + lock ( iAlwaysActivatedCollections ) + { + return iAlwaysActivatedCollections.Contains( aAddress ); + } + } + + public virtual Symbol Lookup( uint aAddress, out SymbolCollection aCollection ) + { + lock ( iAlwaysActivatedCollections ) + { + aCollection = null; + // + Symbol ret = iAlwaysActivatedCollections.Lookup( aAddress, out aCollection ); + return ret; + } + } + + protected virtual void OnAddedToCollection( SymSourceCollection aCollection ) + { + ++iReferenceCount; + } + + protected virtual void OnRemovedFromCollection( SymSourceCollection aCollection ) + { + if ( --iReferenceCount <= 0 ) + { + this.Dispose(); + } + } + + protected virtual void OnPrepareForRelocation( SymbolCollection aCollection, uint aOldBase, uint aNewBase ) + { + // If we read our data during priming, then we don't need to do anything... otherwise, we should + // read the data now. + if ( TimeToRead == TTimeToRead.EReadWhenNeeded ) + { + this.Read( TSynchronicity.ESynchronous ); + } + } + #endregion + + #region API - framework + public void ReportEvent( TEvent aEvent ) + { + if ( aEvent == TEvent.EReadingComplete ) + { + iAlwaysActivatedCollections.BuildLookupCache(); + } + + ReportEvent( aEvent, null ); + } + + public void ReportEvent( TEvent aEvent, object aData ) + { + if ( EventHandler != null ) + { + EventHandler( aEvent, this, aData ); + } + } + #endregion + + #region Event handlers + private void Collection_RelocationStatusChanged( SymbolCollection aCollection ) + { + CategoriseCollection( aCollection ); + } + #endregion + + #region Properties + public int Count + { + get + { + lock ( iCollectionsAll ) + { + return iCollectionsAll.Count; + } + } + } + + public string URI + { + get + { + lock ( iURI ) + { + return iURI; + } + } + set + { + lock ( iURI ) + { + iURI = value; + } + } + + } + + public string FileName + { + get { return iProvider.GetFileName( this ); } + } + + public TTimeToRead TimeToRead + { + get { return iTimeToRead; } + set + { + iTimeToRead = value; + } + } + + public SymSourceProvider Provider + { + get + { + lock ( iProvider ) + { + return iProvider; + } + } + } + + public SymbolCollection this[ int aIndex ] + { + get + { + lock ( iCollectionsAll ) + { + return iCollectionsAll[ aIndex ]; + } + } + } + + public virtual SymbolCollection this[ CodeSegDefinition aCodeSegment ] + { + get + { + lock ( iCollectionsAll ) + { + SymbolCollection ret = iCollectionsAll[ aCodeSegment ]; + return ret; + } + } + } + + public virtual SymbolCollection this[ PlatformFileName aFileName ] + { + get + { + lock ( iCollectionsAll ) + { + SymbolCollection ret = iCollectionsAll[ aFileName ]; + return ret; + } + } + } + #endregion + + #region Internal methods + internal int CountActivated + { + get + { + lock ( iAlwaysActivatedCollections ) + { + return iAlwaysActivatedCollections.Count; + } + } + } + + internal void AddedToCollection( SymSourceCollection aCollection ) + { + OnAddedToCollection( aCollection ); + } + + internal void RemovedFromCollection( SymSourceCollection aCollection ) + { + OnRemovedFromCollection( aCollection ); + } + + private void CategoriseCollection( SymbolCollection aCollection ) + { + // Reset state + lock ( iAlwaysActivatedCollections ) + { + iAlwaysActivatedCollections.Remove( aCollection ); + aCollection.IfaceRelocationHandler = null; + } + + // Collections which do not move from their pre-determined base address + // are transparently "activated" which means that they will be queried + // automatically during symbolic look up. + if ( aCollection.IsFixed ) + { + lock ( iAlwaysActivatedCollections ) + { + iAlwaysActivatedCollections.Add( aCollection ); + } + } + else + { + aCollection.IfaceRelocationHandler = this; + } + } + #endregion + + #region From ISymbolCollectionRelocationHandler + public void PrepareForRelocation( SymbolCollection aCollection, uint aOldBase, uint aNewBase ) + { + OnPrepareForRelocation( aCollection, aOldBase, aNewBase ); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + lock ( iCollectionsAll ) + { + foreach ( SymbolCollection col in iCollectionsAll ) + { + yield return col; + } + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + lock ( iCollectionsAll ) + { + foreach ( SymbolCollection col in iCollectionsAll ) + { + yield return col; + } + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + int count = iCollectionsAll.Count; + for ( int i = count - 1; i >= 0; i-- ) + { + SymbolCollection col = iCollectionsAll[ i ]; + Remove( col ); + col.Dispose(); + } + + // These should both be empty in any case + iCollectionsAll.Clear(); + iAlwaysActivatedCollections.Clear(); + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return URI; + } + + public override int GetHashCode() + { + return URI.GetHashCode(); + } + + public override bool Equals( object aObject ) + { + if ( aObject is SymSource ) + { + SymSource other = (SymSource) aObject; + bool ret = ( string.Compare( other.URI, this.URI, StringComparison.CurrentCultureIgnoreCase ) == 0 ); + return ret; + } + // + return base.Equals( aObject ); + } + #endregion + + #region Data members + private readonly SymSourceProvider iProvider; + private string iURI = string.Empty; + private int iReferenceCount = 0; + private TTimeToRead iTimeToRead = TTimeToRead.EReadWhenPriming; + private SymbolCollectionList iCollectionsAll = new SymbolCollectionList(); + private SymbolCollectionList iAlwaysActivatedCollections = new SymbolCollectionList(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Source/SymSourceAndCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Source/SymSourceAndCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.CodeSegments; +using SymbianSymbolLib.DbgEnginePlugin; + +namespace SymbianSymbolLib.SourceManagement.Source +{ + public class SymSourceAndCollection + { + #region Constructors + internal SymSourceAndCollection( SymSource aSource, SymbolCollection aCollection ) + { + System.Diagnostics.Debug.Assert( aSource != null && aCollection != null ); + // + iSource = aSource; + iCollection = aCollection; + } + + internal SymSourceAndCollection( SymSourceAndCollection aCopy ) + { + iSource = aCopy.Source; + iCollection = aCopy.Collection; + } + + internal SymSourceAndCollection( SymSourceAndCollection aCopy, SymbolCollection aCollection ) + { + iSource = aCopy.Source; + iCollection = aCollection; + } + #endregion + + #region Properties + public SymSource Source + { + get { return iSource; } + internal set { iSource = value; } + } + + public SymbolCollection Collection + { + get { return iCollection; } + internal set { iCollection = value; } + } + #endregion + + #region Data members + private SymSource iSource; + private SymbolCollection iCollection; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Source/SymSourceCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Source/SymSourceCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,206 @@ +/* +* Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Collections; + +namespace SymbianSymbolLib.SourceManagement.Source +{ + public class SymSourceCollection : DisposableObject, IEnumerable + { + #region Constructors + public SymSourceCollection() + { + } + + public SymSourceCollection( SymSource aSource ) + { + Add( aSource ); + } + #endregion + + #region API + public void Clear() + { + lock ( iSources ) + { + IList list = iSources.Values; + int count = list.Count; + for ( int i = count - 1; i >= 0; i-- ) + { + SymSource source = list[ i ]; + Remove( source ); + } + } + } + + public void Add( SymSource aSource ) + { + bool added = false; + // + lock ( iSources ) + { + if ( !Contains( aSource ) ) + { + string uri = aSource.URI; + iSources.Add( uri, aSource ); + added = true; + } + } + // + if ( added ) + { + OnAdded( aSource ); + } + } + + public void AddRange( IEnumerable aSources ) + { + foreach ( SymSource source in aSources ) + { + Add( source ); + } + } + + public bool Remove( SymSource aSource ) + { + bool ret = false; + SymSource source = null; + // + lock( iSources ) + { + string uri = aSource.URI; + // + if ( iSources.TryGetValue( uri, out source ) ) + { + ret = iSources.Remove( uri ); + } + } + + // Notify outside of the lock + if ( source != null ) + { + OnRemoved( source ); + } + // + return ret; + } + + public bool Contains( string aURI ) + { + lock ( iSources ) + { + return iSources.ContainsKey( aURI ); + } + } + + public bool Contains( SymSource aSource ) + { + return Contains( aSource.URI ); + } + #endregion + + #region Properties + public int Count + { + get + { + lock ( iSources ) + { + return iSources.Count; + } + } + } + + public bool IsEmpty + { + get { return Count == 0; } + } + + public SymSource this[ int aIndex ] + { + get + { + lock ( iSources ) + { + string key = iSources.Keys[ aIndex ]; + return iSources[ key ]; + } + } + } + #endregion + + #region Internal methods + protected virtual void OnAdded( SymSource aSource ) + { + aSource.AddedToCollection( this ); + } + + protected virtual void OnRemoved( SymSource aSource ) + { + aSource.RemovedFromCollection( this ); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( KeyValuePair kvp in iSources ) + { + yield return kvp.Value; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair kvp in iSources ) + { + yield return kvp.Value; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + foreach ( KeyValuePair kvp in iSources ) + { + SymSource source = kvp.Value; + source.Dispose(); + } + iSources.Clear(); + } + } + #endregion + + #region Data members + private SortedList iSources = new SortedList(); + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Source/SymSourceManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SourceManagement/Source/SymSourceManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,79 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; +using SymbianStructuresLib.Debug.Symbols; +using SymbianStructuresLib.CodeSegments; +using SymbianSymbolLib.DbgEnginePlugin; + +namespace SymbianSymbolLib.SourceManagement.Source +{ + internal class SymSourceManager : SymSourceCollection + { + #region Constructors + public SymSourceManager( SymbolPlugin aPlugin ) + { + iPlugin = aPlugin; + } + #endregion + + #region API + public IEnumerable GetFixedCollectionEnumerator() + { + foreach ( SymSource source in this ) + { + foreach ( SymbolCollection col in source ) + { + if ( col.IsFixed ) + { + yield return col; + } + } + } + } + #endregion + + #region Properties + public SymSourceAndCollection this[ CodeSegDefinition aCodeSeg ] + { + get + { + SymSourceAndCollection ret = null; + // + foreach ( SymSource source in this ) + { + SymbolCollection col = source[ aCodeSeg ]; + if ( col != null ) + { + ret = new SymSourceAndCollection( source, col ); + break; + } + } + // + return ret; + } + } + #endregion + + #region Data members + private readonly SymbolPlugin iPlugin; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SymbianSymbolLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/SymbianSymbolLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC} + Library + Properties + SymbianSymbolLib + SymbianSymbolLib.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/AsyncData.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/AsyncData.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbols; + + +namespace SymbianSymbolLibTest +{ + class AsyncData + { + #region Constructors + public AsyncData( DbgViewSymbols aView, AutoResetEvent aWaiter, SymbolCollection aCollection, int aIterations ) + { + iView = aView; + iWaiter = aWaiter; + iCollection = aCollection; + iIterations = aIterations; + } + #endregion + + #region Data members + public readonly DbgViewSymbols iView; + public readonly AutoResetEvent iWaiter; + public readonly SymbolCollection iCollection; + public readonly int iIterations; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/Program.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/Program.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianUtils.Range; +using SymbianUtils.Tracer; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbols; + + +namespace SymbianSymbolLibTest +{ + class EntryPoint + { + static void Main( string[] args ) + { + using ( TestCode tests = new TestCode() ) + { + tests.RunTests(); + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "SymbianSymbolLibTest" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia" )] +[assembly: AssemblyProduct( "SymbianSymbolLibTest" )] +[assembly: AssemblyCopyright( "Copyright © Nokia 2009" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "0adca65d-1787-440a-9908-7fb9a1fef529" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/SymbianSymbolLibTest.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/SymbianSymbolLibTest.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {CD291641-4350-4E6D-949D-F877CF08A295} + Exe + Properties + SymbianSymbolLibTest + SymbianSymbolLibTest + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC} + SymbianSymbolLib + + + + + + copy "$(SolutionDir)$(OutDir)\*.*" "$(TargetDir)" + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/TSymLookupEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/TSymLookupEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,5214 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbols; + + +namespace SymbianSymbolLibTest +{ + class TSymLookupEntry + { + #region Constructors + public TSymLookupEntry( uint aAddress, int aCount, string aSymbol, string aCollection ) + { + iAddress = aAddress; + iCount = aCount; + iSymbol = aSymbol; + iCollection = aCollection; + } + #endregion + + #region Constants + public static readonly TSymLookupEntry[] KHeapSymbols = new TSymLookupEntry[] + { + new TSymLookupEntry( 0x00000000, 04068, "", "" ), + new TSymLookupEntry( 0x00000001, 02667, "", "" ), + new TSymLookupEntry( 0x00000002, 00602, "", "" ), + new TSymLookupEntry( 0x00000003, 00134, "", "" ), + new TSymLookupEntry( 0x00000004, 00095, "", "" ), + new TSymLookupEntry( 0x00000005, 00043, "", "" ), + new TSymLookupEntry( 0x00000006, 00028, "", "" ), + new TSymLookupEntry( 0x00000007, 00048, "", "" ), + new TSymLookupEntry( 0x00000008, 00029, "", "" ), + new TSymLookupEntry( 0x00000009, 00036, "", "" ), + new TSymLookupEntry( 0x0000000a, 00066, "", "" ), + new TSymLookupEntry( 0x0000000b, 00019, "", "" ), + new TSymLookupEntry( 0x0000000c, 00023, "", "" ), + new TSymLookupEntry( 0x0000000d, 00015, "", "" ), + new TSymLookupEntry( 0x0000000e, 00022, "", "" ), + new TSymLookupEntry( 0x0000000f, 00300, "", "" ), + new TSymLookupEntry( 0x00000010, 00011, "", "" ), + new TSymLookupEntry( 0x00000011, 00008, "", "" ), + new TSymLookupEntry( 0x00000012, 00013, "", "" ), + new TSymLookupEntry( 0x00000013, 00012, "", "" ), + new TSymLookupEntry( 0x00000014, 00008, "", "" ), + new TSymLookupEntry( 0x00000015, 00009, "", "" ), + new TSymLookupEntry( 0x00000016, 00013, "", "" ), + new TSymLookupEntry( 0x00000017, 00021, "", "" ), + new TSymLookupEntry( 0x00000018, 00010, "", "" ), + new TSymLookupEntry( 0x00000019, 00008, "", "" ), + new TSymLookupEntry( 0x0000001a, 00005, "", "" ), + new TSymLookupEntry( 0x0000001b, 00011, "", "" ), + new TSymLookupEntry( 0x0000001c, 00015, "", "" ), + new TSymLookupEntry( 0x0000001d, 00011, "", "" ), + new TSymLookupEntry( 0x0000001e, 00011, "", "" ), + new TSymLookupEntry( 0x0000001f, 00038, "", "" ), + new TSymLookupEntry( 0x00000020, 00024, "", "" ), + new TSymLookupEntry( 0x00000021, 00011, "", "" ), + new TSymLookupEntry( 0x00000022, 00015, "", "" ), + new TSymLookupEntry( 0x00000023, 00009, "", "" ), + new TSymLookupEntry( 0x00000024, 00005, "", "" ), + new TSymLookupEntry( 0x00000025, 00004, "", "" ), + new TSymLookupEntry( 0x00000026, 00008, "", "" ), + new TSymLookupEntry( 0x00000027, 00009, "", "" ), + new TSymLookupEntry( 0x00000028, 00008, "", "" ), + new TSymLookupEntry( 0x00000029, 00013, "", "" ), + new TSymLookupEntry( 0x0000002a, 00013, "", "" ), + new TSymLookupEntry( 0x0000002b, 00010, "", "" ), + new TSymLookupEntry( 0x0000002c, 00019, "", "" ), + new TSymLookupEntry( 0x0000002d, 00005, "", "" ), + new TSymLookupEntry( 0x0000002e, 00011, "", "" ), + new TSymLookupEntry( 0x0000002f, 00020, "", "" ), + new TSymLookupEntry( 0x00000030, 00007, "", "" ), + new TSymLookupEntry( 0x00000031, 00009, "", "" ), + new TSymLookupEntry( 0x00000032, 00003, "", "" ), + new TSymLookupEntry( 0x00000033, 00019, "", "" ), + new TSymLookupEntry( 0x00000034, 00004, "", "" ), + new TSymLookupEntry( 0x00000035, 00003, "", "" ), + new TSymLookupEntry( 0x00000036, 00006, "", "" ), + new TSymLookupEntry( 0x00000037, 00006, "", "" ), + new TSymLookupEntry( 0x00000038, 00005, "", "" ), + new TSymLookupEntry( 0x00000039, 00003, "", "" ), + new TSymLookupEntry( 0x0000003a, 00006, "", "" ), + new TSymLookupEntry( 0x0000003b, 00003, "", "" ), + new TSymLookupEntry( 0x0000003c, 00003, "", "" ), + new TSymLookupEntry( 0x0000003d, 00010, "", "" ), + new TSymLookupEntry( 0x0000003e, 00005, "", "" ), + new TSymLookupEntry( 0x0000003f, 00008, "", "" ), + new TSymLookupEntry( 0x00000040, 00004, "", "" ), + new TSymLookupEntry( 0x00000041, 00005, "", "" ), + new TSymLookupEntry( 0x00000042, 00003, "", "" ), + new TSymLookupEntry( 0x00000043, 00004, "", "" ), + new TSymLookupEntry( 0x00000044, 00003, "", "" ), + new TSymLookupEntry( 0x00000045, 00003, "", "" ), + new TSymLookupEntry( 0x00000046, 00004, "", "" ), + new TSymLookupEntry( 0x00000047, 00005, "", "" ), + new TSymLookupEntry( 0x00000048, 00004, "", "" ), + new TSymLookupEntry( 0x00000049, 00003, "", "" ), + new TSymLookupEntry( 0x0000004a, 00003, "", "" ), + new TSymLookupEntry( 0x0000004b, 00003, "", "" ), + new TSymLookupEntry( 0x0000004c, 00003, "", "" ), + new TSymLookupEntry( 0x0000004d, 00003, "", "" ), + new TSymLookupEntry( 0x0000004e, 00003, "", "" ), + new TSymLookupEntry( 0x0000004f, 00003, "", "" ), + new TSymLookupEntry( 0x00000050, 00005, "", "" ), + new TSymLookupEntry( 0x00000051, 00003, "", "" ), + new TSymLookupEntry( 0x00000052, 00019, "", "" ), + new TSymLookupEntry( 0x00000053, 00003, "", "" ), + new TSymLookupEntry( 0x00000054, 00006, "", "" ), + new TSymLookupEntry( 0x00000055, 00003, "", "" ), + new TSymLookupEntry( 0x00000056, 00003, "", "" ), + new TSymLookupEntry( 0x00000057, 00004, "", "" ), + new TSymLookupEntry( 0x00000058, 00003, "", "" ), + new TSymLookupEntry( 0x00000059, 00003, "", "" ), + new TSymLookupEntry( 0x0000005a, 00004, "", "" ), + new TSymLookupEntry( 0x0000005b, 00003, "", "" ), + new TSymLookupEntry( 0x0000005c, 00003, "", "" ), + new TSymLookupEntry( 0x0000005d, 00003, "", "" ), + new TSymLookupEntry( 0x0000005e, 00003, "", "" ), + new TSymLookupEntry( 0x0000005f, 00003, "", "" ), + new TSymLookupEntry( 0x00000060, 00003, "", "" ), + new TSymLookupEntry( 0x00000061, 00005, "", "" ), + new TSymLookupEntry( 0x00000062, 00003, "", "" ), + new TSymLookupEntry( 0x00000063, 00005, "", "" ), + new TSymLookupEntry( 0x00000064, 00003, "", "" ), + new TSymLookupEntry( 0x00000065, 00005, "", "" ), + new TSymLookupEntry( 0x00000066, 00004, "", "" ), + new TSymLookupEntry( 0x00000067, 00008, "", "" ), + new TSymLookupEntry( 0x00000068, 00003, "", "" ), + new TSymLookupEntry( 0x00000069, 00015, "", "" ), + new TSymLookupEntry( 0x0000006a, 00005, "", "" ), + new TSymLookupEntry( 0x0000006b, 00003, "", "" ), + new TSymLookupEntry( 0x0000006c, 00005, "", "" ), + new TSymLookupEntry( 0x0000006d, 00004, "", "" ), + new TSymLookupEntry( 0x0000006e, 00005, "", "" ), + new TSymLookupEntry( 0x0000006f, 00004, "", "" ), + new TSymLookupEntry( 0x00000070, 00005, "", "" ), + new TSymLookupEntry( 0x00000071, 00006, "", "" ), + new TSymLookupEntry( 0x00000072, 00005, "", "" ), + new TSymLookupEntry( 0x00000073, 00005, "", "" ), + new TSymLookupEntry( 0x00000074, 00004, "", "" ), + new TSymLookupEntry( 0x00000075, 00004, "", "" ), + new TSymLookupEntry( 0x00000076, 00003, "", "" ), + new TSymLookupEntry( 0x00000077, 00003, "", "" ), + new TSymLookupEntry( 0x00000078, 00004, "", "" ), + new TSymLookupEntry( 0x00000079, 00004, "", "" ), + new TSymLookupEntry( 0x0000007a, 00004, "", "" ), + new TSymLookupEntry( 0x0000007b, 00003, "", "" ), + new TSymLookupEntry( 0x0000007c, 00003, "", "" ), + new TSymLookupEntry( 0x0000007d, 00003, "", "" ), + new TSymLookupEntry( 0x0000007e, 00006, "", "" ), + new TSymLookupEntry( 0x0000007f, 00007, "", "" ), + new TSymLookupEntry( 0x00000080, 00005, "", "" ), + new TSymLookupEntry( 0x00000081, 00003, "", "" ), + new TSymLookupEntry( 0x00000082, 00004, "", "" ), + new TSymLookupEntry( 0x00000083, 00003, "", "" ), + new TSymLookupEntry( 0x00000084, 00003, "", "" ), + new TSymLookupEntry( 0x00000085, 00003, "", "" ), + new TSymLookupEntry( 0x00000086, 00003, "", "" ), + new TSymLookupEntry( 0x00000087, 00003, "", "" ), + new TSymLookupEntry( 0x00000088, 00003, "", "" ), + new TSymLookupEntry( 0x00000089, 00004, "", "" ), + new TSymLookupEntry( 0x0000008a, 00003, "", "" ), + new TSymLookupEntry( 0x0000008b, 00003, "", "" ), + new TSymLookupEntry( 0x0000008c, 00003, "", "" ), + new TSymLookupEntry( 0x0000008d, 00003, "", "" ), + new TSymLookupEntry( 0x0000008e, 00003, "", "" ), + new TSymLookupEntry( 0x0000008f, 00003, "", "" ), + new TSymLookupEntry( 0x00000090, 00002, "", "" ), + new TSymLookupEntry( 0x00000091, 00002, "", "" ), + new TSymLookupEntry( 0x00000092, 00002, "", "" ), + new TSymLookupEntry( 0x00000093, 00002, "", "" ), + new TSymLookupEntry( 0x00000094, 00002, "", "" ), + new TSymLookupEntry( 0x00000095, 00002, "", "" ), + new TSymLookupEntry( 0x00000096, 00002, "", "" ), + new TSymLookupEntry( 0x00000097, 00002, "", "" ), + new TSymLookupEntry( 0x00000098, 00003, "", "" ), + new TSymLookupEntry( 0x00000099, 00002, "", "" ), + new TSymLookupEntry( 0x0000009a, 00002, "", "" ), + new TSymLookupEntry( 0x0000009b, 00002, "", "" ), + new TSymLookupEntry( 0x0000009c, 00003, "", "" ), + new TSymLookupEntry( 0x0000009d, 00002, "", "" ), + new TSymLookupEntry( 0x0000009e, 00002, "", "" ), + new TSymLookupEntry( 0x0000009f, 00002, "", "" ), + new TSymLookupEntry( 0x000000a0, 00005, "", "" ), + new TSymLookupEntry( 0x000000a1, 00002, "", "" ), + new TSymLookupEntry( 0x000000a2, 00002, "", "" ), + new TSymLookupEntry( 0x000000a3, 00002, "", "" ), + new TSymLookupEntry( 0x000000a4, 00002, "", "" ), + new TSymLookupEntry( 0x000000a5, 00002, "", "" ), + new TSymLookupEntry( 0x000000a6, 00002, "", "" ), + new TSymLookupEntry( 0x000000a7, 00002, "", "" ), + new TSymLookupEntry( 0x000000a8, 00002, "", "" ), + new TSymLookupEntry( 0x000000a9, 00002, "", "" ), + new TSymLookupEntry( 0x000000aa, 00002, "", "" ), + new TSymLookupEntry( 0x000000ab, 00003, "", "" ), + new TSymLookupEntry( 0x000000ac, 00002, "", "" ), + new TSymLookupEntry( 0x000000ad, 00002, "", "" ), + new TSymLookupEntry( 0x000000ae, 00002, "", "" ), + new TSymLookupEntry( 0x000000af, 00003, "", "" ), + new TSymLookupEntry( 0x000000b0, 00002, "", "" ), + new TSymLookupEntry( 0x000000b1, 00002, "", "" ), + new TSymLookupEntry( 0x000000b2, 00002, "", "" ), + new TSymLookupEntry( 0x000000b3, 00002, "", "" ), + new TSymLookupEntry( 0x000000b4, 00002, "", "" ), + new TSymLookupEntry( 0x000000b5, 00002, "", "" ), + new TSymLookupEntry( 0x000000b6, 00002, "", "" ), + new TSymLookupEntry( 0x000000b7, 00003, "", "" ), + new TSymLookupEntry( 0x000000b8, 00003, "", "" ), + new TSymLookupEntry( 0x000000b9, 00002, "", "" ), + new TSymLookupEntry( 0x000000ba, 00002, "", "" ), + new TSymLookupEntry( 0x000000bb, 00002, "", "" ), + new TSymLookupEntry( 0x000000bc, 00002, "", "" ), + new TSymLookupEntry( 0x000000bd, 00002, "", "" ), + new TSymLookupEntry( 0x000000be, 00002, "", "" ), + new TSymLookupEntry( 0x000000bf, 00002, "", "" ), + new TSymLookupEntry( 0x000000c0, 00002, "", "" ), + new TSymLookupEntry( 0x000000c1, 00002, "", "" ), + new TSymLookupEntry( 0x000000c7, 00001, "", "" ), + new TSymLookupEntry( 0x000000c9, 00001, "", "" ), + new TSymLookupEntry( 0x000000ff, 00002, "", "" ), + new TSymLookupEntry( 0x00000100, 00014, "", "" ), + new TSymLookupEntry( 0x00000104, 00057, "", "" ), + new TSymLookupEntry( 0x0000012a, 00002, "", "" ), + new TSymLookupEntry( 0x0000014c, 00001, "", "" ), + new TSymLookupEntry( 0x0000015a, 00002, "", "" ), + new TSymLookupEntry( 0x00000160, 00001, "", "" ), + new TSymLookupEntry( 0x00000176, 00001, "", "" ), + new TSymLookupEntry( 0x000001b8, 00001, "", "" ), + new TSymLookupEntry( 0x00000200, 00001, "", "" ), + new TSymLookupEntry( 0x00000209, 00001, "", "" ), + new TSymLookupEntry( 0x00000213, 00001, "", "" ), + new TSymLookupEntry( 0x0000023b, 00001, "", "" ), + new TSymLookupEntry( 0x00000256, 00001, "", "" ), + new TSymLookupEntry( 0x0000025a, 00001, "", "" ), + new TSymLookupEntry( 0x00000286, 00001, "", "" ), + new TSymLookupEntry( 0x00000378, 00001, "", "" ), + new TSymLookupEntry( 0x00000bb8, 00001, "", "" ), + new TSymLookupEntry( 0x00000bb9, 00001, "", "" ), + new TSymLookupEntry( 0x00004030, 00001, "", "" ), + new TSymLookupEntry( 0x00004038, 00001, "", "" ), + new TSymLookupEntry( 0x00004106, 00002, "", "" ), + new TSymLookupEntry( 0x00004428, 00001, "", "" ), + new TSymLookupEntry( 0x0000442a, 00001, "", "" ), + new TSymLookupEntry( 0x0000442c, 00001, "", "" ), + new TSymLookupEntry( 0x0000442e, 00001, "", "" ), + new TSymLookupEntry( 0x000044ee, 00001, "", "" ), + new TSymLookupEntry( 0x00010000, 00012, "", "" ), + new TSymLookupEntry( 0x00010001, 00013, "", "" ), + new TSymLookupEntry( 0x00010002, 00006, "", "" ), + new TSymLookupEntry( 0x00010003, 00003, "", "" ), + new TSymLookupEntry( 0x0001ffff, 00007, "", "" ), + new TSymLookupEntry( 0x00020003, 00001, "", "" ), + new TSymLookupEntry( 0x00030002, 00002, "", "" ), + new TSymLookupEntry( 0x00038002, 00016, "", "" ), + new TSymLookupEntry( 0x00060005, 00001, "", "" ), + new TSymLookupEntry( 0x00088001, 00001, "", "" ), + new TSymLookupEntry( 0x00090008, 00001, "", "" ), + new TSymLookupEntry( 0x0009000a, 00023, "", "" ), + new TSymLookupEntry( 0x000a0009, 00001, "", "" ), + new TSymLookupEntry( 0x000a000a, 00020, "", "" ), + new TSymLookupEntry( 0x000a003a, 00002, "", "" ), + new TSymLookupEntry( 0x000b000a, 00001, "", "" ), + new TSymLookupEntry( 0x000c000b, 00001, "", "" ), + new TSymLookupEntry( 0x000d000c, 00001, "", "" ), + new TSymLookupEntry( 0x000e000d, 00001, "", "" ), + new TSymLookupEntry( 0x000f000e, 00001, "", "" ), + new TSymLookupEntry( 0x0010000f, 00001, "", "" ), + new TSymLookupEntry( 0x00100023, 00001, "", "" ), + new TSymLookupEntry( 0x00100027, 00001, "", "" ), + new TSymLookupEntry( 0x00110010, 00001, "", "" ), + new TSymLookupEntry( 0x00116bba, 00001, "", "" ), + new TSymLookupEntry( 0x00120011, 00001, "", "" ), + new TSymLookupEntry( 0x00130012, 00001, "", "" ), + new TSymLookupEntry( 0x00140013, 00001, "", "" ), + new TSymLookupEntry( 0x00160015, 00001, "", "" ), + new TSymLookupEntry( 0x00170016, 00002, "", "" ), + new TSymLookupEntry( 0x00190018, 00001, "", "" ), + new TSymLookupEntry( 0x001a0019, 00001, "", "" ), + new TSymLookupEntry( 0x0020000a, 00129, "", "" ), + new TSymLookupEntry( 0x00200022, 00003, "", "" ), + new TSymLookupEntry( 0x0020002c, 00001, "", "" ), + new TSymLookupEntry( 0x00200030, 00001, "", "" ), + new TSymLookupEntry( 0x00200031, 00009, "", "" ), + new TSymLookupEntry( 0x00200033, 00004, "", "" ), + new TSymLookupEntry( 0x00200034, 00008, "", "" ), + new TSymLookupEntry( 0x00200035, 00009, "", "" ), + new TSymLookupEntry( 0x00200036, 00004, "", "" ), + new TSymLookupEntry( 0x00200037, 00002, "", "" ), + new TSymLookupEntry( 0x00200039, 00002, "", "" ), + new TSymLookupEntry( 0x00200049, 00004, "", "" ), + new TSymLookupEntry( 0x00200050, 00002, "", "" ), + new TSymLookupEntry( 0x0020005d, 00001, "", "" ), + new TSymLookupEntry( 0x002000bb, 00002, "", "" ), + new TSymLookupEntry( 0x0024002d, 00001, "", "" ), + new TSymLookupEntry( 0x0024005f, 00001, "", "" ), + new TSymLookupEntry( 0x0025001d, 00001, "", "" ), + new TSymLookupEntry( 0x0026001e, 00001, "", "" ), + new TSymLookupEntry( 0x0028002d, 00001, "", "" ), + new TSymLookupEntry( 0x0028005e, 00013, "", "" ), + new TSymLookupEntry( 0x00290027, 00003, "", "" ), + new TSymLookupEntry( 0x0029002a, 00001, "", "" ), + new TSymLookupEntry( 0x0029002b, 00004, "", "" ), + new TSymLookupEntry( 0x002a003e, 00001, "", "" ), + new TSymLookupEntry( 0x002b002e, 00001, "", "" ), + new TSymLookupEntry( 0x002c0027, 00002, "", "" ), + new TSymLookupEntry( 0x002d0020, 00027, "", "" ), + new TSymLookupEntry( 0x002d0028, 00001, "", "" ), + new TSymLookupEntry( 0x002d0058, 00002, "", "" ), + new TSymLookupEntry( 0x002d005c, 00001, "", "" ), + new TSymLookupEntry( 0x002d007a, 00001, "", "" ), + new TSymLookupEntry( 0x002e002e, 00002, "", "" ), + new TSymLookupEntry( 0x002e0031, 00003, "", "" ), + new TSymLookupEntry( 0x002e005e, 00001, "", "" ), + new TSymLookupEntry( 0x002f0020, 00001, "", "" ), + new TSymLookupEntry( 0x002f002a, 00001, "", "" ), + new TSymLookupEntry( 0x002f002d, 00001, "", "" ), + new TSymLookupEntry( 0x002f003c, 00099, "", "" ), + new TSymLookupEntry( 0x00300024, 00001, "", "" ), + new TSymLookupEntry( 0x00300030, 00001, "", "" ), + new TSymLookupEntry( 0x00300031, 00001, "", "" ), + new TSymLookupEntry( 0x00300032, 00021, "", "" ), + new TSymLookupEntry( 0x00300033, 00001, "", "" ), + new TSymLookupEntry( 0x00300035, 00001, "", "" ), + new TSymLookupEntry( 0x00310024, 00004, "", "" ), + new TSymLookupEntry( 0x00310030, 00002, "", "" ), + new TSymLookupEntry( 0x00310059, 00001, "", "" ), + new TSymLookupEntry( 0x0031005b, 00001, "", "" ), + new TSymLookupEntry( 0x00310063, 00001, "", "" ), + new TSymLookupEntry( 0x00310068, 00001, "", "" ), + new TSymLookupEntry( 0x00320024, 00001, "", "" ), + new TSymLookupEntry( 0x00320025, 00006, "", "" ), + new TSymLookupEntry( 0x00320031, 00003, "", "" ), + new TSymLookupEntry( 0x00320033, 00001, "", "" ), + new TSymLookupEntry( 0x00320063, 00001, "", "" ), + new TSymLookupEntry( 0x00320068, 00001, "", "" ), + new TSymLookupEntry( 0x00330063, 00001, "", "" ), + new TSymLookupEntry( 0x00330068, 00001, "", "" ), + new TSymLookupEntry( 0x00340031, 00003, "", "" ), + new TSymLookupEntry( 0x00340063, 00001, "", "" ), + new TSymLookupEntry( 0x00340068, 00001, "", "" ), + new TSymLookupEntry( 0x00350031, 00002, "", "" ), + new TSymLookupEntry( 0x00350032, 00001, "", "" ), + new TSymLookupEntry( 0x00350068, 00001, "", "" ), + new TSymLookupEntry( 0x00360053, 00001, "", "" ), + new TSymLookupEntry( 0x00360062, 00003, "", "" ), + new TSymLookupEntry( 0x00360068, 00001, "", "" ), + new TSymLookupEntry( 0x00380054, 00001, "", "" ), + new TSymLookupEntry( 0x00390035, 00002, "", "" ), + new TSymLookupEntry( 0x00390061, 00001, "", "" ), + new TSymLookupEntry( 0x003a0063, 00004, "", "" ), + new TSymLookupEntry( 0x003b0029, 00002, "", "" ), + new TSymLookupEntry( 0x003c0028, 00001, "", "" ), + new TSymLookupEntry( 0x003c003e, 00001, "", "" ), + new TSymLookupEntry( 0x003c005e, 00001, "", "" ), + new TSymLookupEntry( 0x003d0021, 00001, "", "" ), + new TSymLookupEntry( 0x003d0024, 00001, "", "" ), + new TSymLookupEntry( 0x003d002a, 00001, "", "" ), + new TSymLookupEntry( 0x003d002d, 00001, "", "" ), + new TSymLookupEntry( 0x003d003d, 00001, "", "" ), + new TSymLookupEntry( 0x003d005e, 00001, "", "" ), + new TSymLookupEntry( 0x003d005f, 00001, "", "" ), + new TSymLookupEntry( 0x003d007e, 00001, "", "" ), + new TSymLookupEntry( 0x003e0022, 00001, "", "" ), + new TSymLookupEntry( 0x003e005e, 00002, "", "" ), + new TSymLookupEntry( 0x003f0028, 00002, "", "" ), + new TSymLookupEntry( 0x003f003d, 00002, "", "" ), + new TSymLookupEntry( 0x003f005c, 00003, "", "" ), + new TSymLookupEntry( 0x00400020, 00015, "", "" ), + new TSymLookupEntry( 0x0040005b, 00001, "", "" ), + new TSymLookupEntry( 0x0041004d, 00001, "", "" ), + new TSymLookupEntry( 0x00420022, 00003, "", "" ), + new TSymLookupEntry( 0x00420041, 00002, "", "" ), + new TSymLookupEntry( 0x00420042, 00001, "", "" ), + new TSymLookupEntry( 0x0043003c, 00001, "", "" ), + new TSymLookupEntry( 0x00440041, 00002, "", "" ), + new TSymLookupEntry( 0x0044005c, 00001, "", "" ), + new TSymLookupEntry( 0x00450047, 00012, "", "" ), + new TSymLookupEntry( 0x00460049, 00001, "", "" ), + new TSymLookupEntry( 0x00490050, 00001, "", "" ), + new TSymLookupEntry( 0x00490054, 00001, "", "" ), + new TSymLookupEntry( 0x004b004f, 00016, "", "" ), + new TSymLookupEntry( 0x004d0058, 00003, "", "" ), + new TSymLookupEntry( 0x004f0044, 00012, "", "" ), + new TSymLookupEntry( 0x004f004e, 00003, "", "" ), + new TSymLookupEntry( 0x004f0050, 00002, "", "" ), + new TSymLookupEntry( 0x00510066, 00001, "", "" ), + new TSymLookupEntry( 0x0051006a, 00003, "", "" ), + new TSymLookupEntry( 0x00520047, 00002, "", "" ), + new TSymLookupEntry( 0x00520055, 00002, "", "" ), + new TSymLookupEntry( 0x00520063, 00001, "", "" ), + new TSymLookupEntry( 0x00530043, 00002, "", "" ), + new TSymLookupEntry( 0x00530049, 00002, "", "" ), + new TSymLookupEntry( 0x0053004a, 00001, "", "" ), + new TSymLookupEntry( 0x00540055, 00001, "", "" ), + new TSymLookupEntry( 0x005b0028, 00001, "", "" ), + new TSymLookupEntry( 0x005b005b, 00024, "", "" ), + new TSymLookupEntry( 0x005b005e, 00003, "", "" ), + new TSymLookupEntry( 0x005c0028, 00002, "", "" ), + new TSymLookupEntry( 0x005c003d, 00001, "", "" ), + new TSymLookupEntry( 0x005c005c, 00002, "", "" ), + new TSymLookupEntry( 0x005c005e, 00007, "", "" ), + new TSymLookupEntry( 0x005c0068, 00001, "", "" ), + new TSymLookupEntry( 0x005d0022, 00001, "", "" ), + new TSymLookupEntry( 0x005e005b, 00001, "", "" ), + new TSymLookupEntry( 0x005f005f, 00005, "", "" ), + new TSymLookupEntry( 0x006001d0, 00001, "", "" ), + new TSymLookupEntry( 0x00600284, 00001, "", "" ), + new TSymLookupEntry( 0x00600800, 00001, "", "" ), + new TSymLookupEntry( 0x00600bb0, 00001, "", "" ), + new TSymLookupEntry( 0x00600c78, 00001, "", "" ), + new TSymLookupEntry( 0x00600fc8, 00001, "", "" ), + new TSymLookupEntry( 0x006010a8, 00001, "", "" ), + new TSymLookupEntry( 0x006010f8, 00001, "", "" ), + new TSymLookupEntry( 0x00601604, 00001, "", "" ), + new TSymLookupEntry( 0x0060195c, 00001, "", "" ), + new TSymLookupEntry( 0x00601a30, 00001, "", "" ), + new TSymLookupEntry( 0x00601ec8, 00001, "", "" ), + new TSymLookupEntry( 0x00602140, 00001, "", "" ), + new TSymLookupEntry( 0x00602168, 00001, "", "" ), + new TSymLookupEntry( 0x006021f0, 00001, "", "" ), + new TSymLookupEntry( 0x00602510, 00001, "", "" ), + new TSymLookupEntry( 0x00602548, 00001, "", "" ), + new TSymLookupEntry( 0x00602668, 00001, "", "" ), + new TSymLookupEntry( 0x00602690, 00001, "", "" ), + new TSymLookupEntry( 0x00602740, 00001, "", "" ), + new TSymLookupEntry( 0x006027d8, 00001, "", "" ), + new TSymLookupEntry( 0x00602978, 00001, "", "" ), + new TSymLookupEntry( 0x00602a00, 00001, "", "" ), + new TSymLookupEntry( 0x00602b60, 00001, "", "" ), + new TSymLookupEntry( 0x00602be8, 00001, "", "" ), + new TSymLookupEntry( 0x00602c70, 00001, "", "" ), + new TSymLookupEntry( 0x00602cf8, 00001, "", "" ), + new TSymLookupEntry( 0x00602d80, 00001, "", "" ), + new TSymLookupEntry( 0x00602e90, 00001, "", "" ), + new TSymLookupEntry( 0x00602f0c, 00001, "", "" ), + new TSymLookupEntry( 0x0060368c, 00001, "", "" ), + new TSymLookupEntry( 0x006036f4, 00001, "", "" ), + new TSymLookupEntry( 0x006039f8, 00001, "", "" ), + new TSymLookupEntry( 0x00603ce0, 00001, "", "" ), + new TSymLookupEntry( 0x00603dbc, 00001, "", "" ), + new TSymLookupEntry( 0x00603df4, 00001, "", "" ), + new TSymLookupEntry( 0x00603fdc, 00001, "", "" ), + new TSymLookupEntry( 0x00604140, 00001, "", "" ), + new TSymLookupEntry( 0x006044c8, 00001, "", "" ), + new TSymLookupEntry( 0x00604cbc, 00001, "", "" ), + new TSymLookupEntry( 0x0060539c, 00001, "", "" ), + new TSymLookupEntry( 0x00605ba8, 00002, "", "" ), + new TSymLookupEntry( 0x006060b0, 00001, "", "" ), + new TSymLookupEntry( 0x00606218, 00001, "", "" ), + new TSymLookupEntry( 0x00606308, 00001, "", "" ), + new TSymLookupEntry( 0x00606808, 00001, "", "" ), + new TSymLookupEntry( 0x00606980, 00001, "", "" ), + new TSymLookupEntry( 0x00606a08, 00002, "", "" ), + new TSymLookupEntry( 0x00606aa0, 00001, "", "" ), + new TSymLookupEntry( 0x00607260, 00005, "", "" ), + new TSymLookupEntry( 0x006074f0, 00001, "", "" ), + new TSymLookupEntry( 0x00607788, 00001, "", "" ), + new TSymLookupEntry( 0x00607850, 00001, "", "" ), + new TSymLookupEntry( 0x00607a00, 00001, "", "" ), + new TSymLookupEntry( 0x00607ac8, 00001, "", "" ), + new TSymLookupEntry( 0x00607b30, 00001, "", "" ), + new TSymLookupEntry( 0x006080a0, 00001, "", "" ), + new TSymLookupEntry( 0x00608138, 00001, "", "" ), + new TSymLookupEntry( 0x00608610, 00001, "", "" ), + new TSymLookupEntry( 0x00608758, 00001, "", "" ), + new TSymLookupEntry( 0x00608f70, 00001, "", "" ), + new TSymLookupEntry( 0x00609080, 00001, "", "" ), + new TSymLookupEntry( 0x00609178, 00001, "", "" ), + new TSymLookupEntry( 0x006092b0, 00006, "", "" ), + new TSymLookupEntry( 0x0060c0ec, 00001, "", "" ), + new TSymLookupEntry( 0x0060c1b0, 00002, "", "" ), + new TSymLookupEntry( 0x0060c1e8, 00001, "", "" ), + new TSymLookupEntry( 0x0060c468, 00001, "", "" ), + new TSymLookupEntry( 0x0060cb78, 00001, "", "" ), + new TSymLookupEntry( 0x0060ce48, 00001, "", "" ), + new TSymLookupEntry( 0x0060d290, 00001, "", "" ), + new TSymLookupEntry( 0x0060d538, 00001, "", "" ), + new TSymLookupEntry( 0x0060d980, 00001, "", "" ), + new TSymLookupEntry( 0x0060dcd8, 00001, "", "" ), + new TSymLookupEntry( 0x0060df88, 00001, "", "" ), + new TSymLookupEntry( 0x0060dfc8, 00001, "", "" ), + new TSymLookupEntry( 0x0060e030, 00001, "", "" ), + new TSymLookupEntry( 0x0060e3cc, 00001, "", "" ), + new TSymLookupEntry( 0x0060ee98, 00001, "", "" ), + new TSymLookupEntry( 0x0060f038, 00001, "", "" ), + new TSymLookupEntry( 0x0060f0b0, 00002, "", "" ), + new TSymLookupEntry( 0x0060f178, 00001, "", "" ), + new TSymLookupEntry( 0x0060f268, 00002, "", "" ), + new TSymLookupEntry( 0x0060f63c, 00001, "", "" ), + new TSymLookupEntry( 0x0060f6b0, 00001, "", "" ), + new TSymLookupEntry( 0x0060f70c, 00001, "", "" ), + new TSymLookupEntry( 0x0060f778, 00001, "", "" ), + new TSymLookupEntry( 0x0060f868, 00002, "", "" ), + new TSymLookupEntry( 0x0060fa30, 00001, "", "" ), + new TSymLookupEntry( 0x0060fc10, 00001, "", "" ), + new TSymLookupEntry( 0x0060fde0, 00001, "", "" ), + new TSymLookupEntry( 0x00610020, 00001, "", "" ), + new TSymLookupEntry( 0x00610026, 00001, "", "" ), + new TSymLookupEntry( 0x0061003c, 00002, "", "" ), + new TSymLookupEntry( 0x00610043, 00003, "", "" ), + new TSymLookupEntry( 0x00610044, 00002, "", "" ), + new TSymLookupEntry( 0x0061004a, 00003, "", "" ), + new TSymLookupEntry( 0x0061004c, 00004, "", "" ), + new TSymLookupEntry( 0x0061004d, 00008, "", "" ), + new TSymLookupEntry( 0x0061004e, 00003, "", "" ), + new TSymLookupEntry( 0x00610050, 00001, "", "" ), + new TSymLookupEntry( 0x00610052, 00003, "", "" ), + new TSymLookupEntry( 0x00610053, 00006, "", "" ), + new TSymLookupEntry( 0x00610054, 00001, "", "" ), + new TSymLookupEntry( 0x00610061, 00002, "", "" ), + new TSymLookupEntry( 0x00610062, 00013, "", "" ), + new TSymLookupEntry( 0x00610063, 00011, "", "" ), + new TSymLookupEntry( 0x00610064, 00009, "", "" ), + new TSymLookupEntry( 0x00610065, 00004, "", "" ), + new TSymLookupEntry( 0x00610066, 00008, "", "" ), + new TSymLookupEntry( 0x00610067, 00001, "", "" ), + new TSymLookupEntry( 0x00610068, 00016, "", "" ), + new TSymLookupEntry( 0x0061006a, 00011, "", "" ), + new TSymLookupEntry( 0x0061006c, 00017, "", "" ), + new TSymLookupEntry( 0x0061006d, 00040, "", "" ), + new TSymLookupEntry( 0x0061006e, 00015, "", "" ), + new TSymLookupEntry( 0x00610070, 00039, "", "" ), + new TSymLookupEntry( 0x00610072, 00014, "", "" ), + new TSymLookupEntry( 0x00610073, 00006, "", "" ), + new TSymLookupEntry( 0x00610074, 00014, "", "" ), + new TSymLookupEntry( 0x00610076, 00008, "", "" ), + new TSymLookupEntry( 0x00610077, 00003, "", "" ), + new TSymLookupEntry( 0x0061007b, 00002, "", "" ), + new TSymLookupEntry( 0x00610350, 00001, "", "" ), + new TSymLookupEntry( 0x006103a0, 00001, "", "" ), + new TSymLookupEntry( 0x006107d8, 00001, "", "" ), + new TSymLookupEntry( 0x00610818, 00001, "", "" ), + new TSymLookupEntry( 0x00611f08, 00001, "", "" ), + new TSymLookupEntry( 0x006130b4, 00001, "", "" ), + new TSymLookupEntry( 0x006137d0, 00001, "", "" ), + new TSymLookupEntry( 0x00613c30, 00001, "", "" ), + new TSymLookupEntry( 0x0061533c, 00001, "", "" ), + new TSymLookupEntry( 0x00615520, 00002, "", "" ), + new TSymLookupEntry( 0x00615570, 00001, "", "" ), + new TSymLookupEntry( 0x006155d8, 00003, "", "" ), + new TSymLookupEntry( 0x00615730, 00001, "", "" ), + new TSymLookupEntry( 0x00615768, 00002, "", "" ), + new TSymLookupEntry( 0x00615c38, 00001, "", "" ), + new TSymLookupEntry( 0x00615f4c, 00001, "", "" ), + new TSymLookupEntry( 0x006160a0, 00001, "", "" ), + new TSymLookupEntry( 0x006160fc, 00001, "", "" ), + new TSymLookupEntry( 0x00616648, 00001, "", "" ), + new TSymLookupEntry( 0x00616718, 00002, "", "" ), + new TSymLookupEntry( 0x00616888, 00001, "", "" ), + new TSymLookupEntry( 0x00616950, 00001, "", "" ), + new TSymLookupEntry( 0x00616df0, 00001, "", "" ), + new TSymLookupEntry( 0x00617058, 00001, "", "" ), + new TSymLookupEntry( 0x00617098, 00001, "", "" ), + new TSymLookupEntry( 0x00617560, 00001, "", "" ), + new TSymLookupEntry( 0x006175d8, 00001, "", "" ), + new TSymLookupEntry( 0x00617628, 00001, "", "" ), + new TSymLookupEntry( 0x00617a84, 00001, "", "" ), + new TSymLookupEntry( 0x00617f60, 00001, "", "" ), + new TSymLookupEntry( 0x006181ac, 00001, "", "" ), + new TSymLookupEntry( 0x00618bc4, 00001, "", "" ), + new TSymLookupEntry( 0x00619030, 00001, "", "" ), + new TSymLookupEntry( 0x00619c40, 00001, "", "" ), + new TSymLookupEntry( 0x0061b858, 00001, "", "" ), + new TSymLookupEntry( 0x0061b980, 00007, "", "" ), + new TSymLookupEntry( 0x0061bac0, 00001, "", "" ), + new TSymLookupEntry( 0x0061bad0, 00001, "", "" ), + new TSymLookupEntry( 0x0061bbb8, 00001, "", "" ), + new TSymLookupEntry( 0x0061bda0, 00001, "", "" ), + new TSymLookupEntry( 0x0061be20, 00001, "", "" ), + new TSymLookupEntry( 0x0061c0f8, 00001, "", "" ), + new TSymLookupEntry( 0x0061c178, 00001, "", "" ), + new TSymLookupEntry( 0x0061c1d0, 00001, "", "" ), + new TSymLookupEntry( 0x0061c228, 00001, "", "" ), + new TSymLookupEntry( 0x0061c2a8, 00001, "", "" ), + new TSymLookupEntry( 0x0061c300, 00001, "", "" ), + new TSymLookupEntry( 0x0061c388, 00001, "", "" ), + new TSymLookupEntry( 0x0061c3e0, 00001, "", "" ), + new TSymLookupEntry( 0x0061c440, 00001, "", "" ), + new TSymLookupEntry( 0x0061c468, 00001, "", "" ), + new TSymLookupEntry( 0x0061c490, 00001, "", "" ), + new TSymLookupEntry( 0x0061c548, 00001, "", "" ), + new TSymLookupEntry( 0x0061c5a0, 00001, "", "" ), + new TSymLookupEntry( 0x0061c5f8, 00001, "", "" ), + new TSymLookupEntry( 0x0061c6b0, 00001, "", "" ), + new TSymLookupEntry( 0x0061c710, 00001, "", "" ), + new TSymLookupEntry( 0x0061c768, 00001, "", "" ), + new TSymLookupEntry( 0x0061c7c8, 00001, "", "" ), + new TSymLookupEntry( 0x0061c820, 00001, "", "" ), + new TSymLookupEntry( 0x0061c870, 00001, "", "" ), + new TSymLookupEntry( 0x0061c8f0, 00001, "", "" ), + new TSymLookupEntry( 0x0061c988, 00001, "", "" ), + new TSymLookupEntry( 0x0061c9f0, 00001, "", "" ), + new TSymLookupEntry( 0x0061ca78, 00001, "", "" ), + new TSymLookupEntry( 0x0061cad8, 00001, "", "" ), + new TSymLookupEntry( 0x0061cb78, 00001, "", "" ), + new TSymLookupEntry( 0x0061cbd0, 00001, "", "" ), + new TSymLookupEntry( 0x0061cc20, 00001, "", "" ), + new TSymLookupEntry( 0x0061cc78, 00001, "", "" ), + new TSymLookupEntry( 0x0061cd00, 00001, "", "" ), + new TSymLookupEntry( 0x0061cd50, 00001, "", "" ), + new TSymLookupEntry( 0x0061cda0, 00001, "", "" ), + new TSymLookupEntry( 0x0061cdf8, 00001, "", "" ), + new TSymLookupEntry( 0x0061ce50, 00001, "", "" ), + new TSymLookupEntry( 0x0061cea8, 00001, "", "" ), + new TSymLookupEntry( 0x0061d128, 00001, "", "" ), + new TSymLookupEntry( 0x0061d488, 00001, "", "" ), + new TSymLookupEntry( 0x0061d7e0, 00001, "", "" ), + new TSymLookupEntry( 0x0061d808, 00001, "", "" ), + new TSymLookupEntry( 0x0061e2d0, 00030, "", "" ), + new TSymLookupEntry( 0x0061e508, 00001, "", "" ), + new TSymLookupEntry( 0x0061e578, 00001, "", "" ), + new TSymLookupEntry( 0x0061ea10, 00006, "", "" ), + new TSymLookupEntry( 0x0061eb00, 00007, "", "" ), + new TSymLookupEntry( 0x0061ec08, 00002, "", "" ), + new TSymLookupEntry( 0x0061ec58, 00006, "", "" ), + new TSymLookupEntry( 0x0061ece8, 00001, "", "" ), + new TSymLookupEntry( 0x0061ee38, 00001, "", "" ), + new TSymLookupEntry( 0x0061f078, 00001, "", "" ), + new TSymLookupEntry( 0x0061fa68, 00001, "", "" ), + new TSymLookupEntry( 0x0061fad8, 00001, "", "" ), + new TSymLookupEntry( 0x0061fc20, 00001, "", "" ), + new TSymLookupEntry( 0x0061fc48, 00001, "", "" ), + new TSymLookupEntry( 0x0061fcc1, 00001, "", "" ), + new TSymLookupEntry( 0x0061fce0, 00001, "", "" ), + new TSymLookupEntry( 0x0061ffa8, 00001, "", "" ), + new TSymLookupEntry( 0x0062002e, 00005, "", "" ), + new TSymLookupEntry( 0x0062003c, 00002, "", "" ), + new TSymLookupEntry( 0x00620041, 00001, "", "" ), + new TSymLookupEntry( 0x0062004f, 00001, "", "" ), + new TSymLookupEntry( 0x0062005e, 00004, "", "" ), + new TSymLookupEntry( 0x00620061, 00010, "", "" ), + new TSymLookupEntry( 0x00620064, 00001, "", "" ), + new TSymLookupEntry( 0x00620069, 00001, "", "" ), + new TSymLookupEntry( 0x0062006b, 00001, "", "" ), + new TSymLookupEntry( 0x0062006f, 00011, "", "" ), + new TSymLookupEntry( 0x00620070, 00001, "", "" ), + new TSymLookupEntry( 0x00620074, 00005, "", "" ), + new TSymLookupEntry( 0x00620077, 00001, "", "" ), + new TSymLookupEntry( 0x00620158, 00002, "", "" ), + new TSymLookupEntry( 0x00620198, 00001, "", "" ), + new TSymLookupEntry( 0x00620208, 00001, "", "" ), + new TSymLookupEntry( 0x006203b9, 00001, "", "" ), + new TSymLookupEntry( 0x006203d0, 00001, "", "" ), + new TSymLookupEntry( 0x00620450, 00001, "", "" ), + new TSymLookupEntry( 0x006204c0, 00001, "", "" ), + new TSymLookupEntry( 0x00620538, 00001, "", "" ), + new TSymLookupEntry( 0x00620630, 00001, "", "" ), + new TSymLookupEntry( 0x00620658, 00001, "", "" ), + new TSymLookupEntry( 0x00620711, 00001, "", "" ), + new TSymLookupEntry( 0x00620738, 00001, "", "" ), + new TSymLookupEntry( 0x00620760, 00001, "", "" ), + new TSymLookupEntry( 0x00620801, 00001, "", "" ), + new TSymLookupEntry( 0x00620828, 00001, "", "" ), + new TSymLookupEntry( 0x00620fd0, 00010, "", "" ), + new TSymLookupEntry( 0x00621138, 00001, "", "" ), + new TSymLookupEntry( 0x006213a0, 00001, "", "" ), + new TSymLookupEntry( 0x00621440, 00001, "", "" ), + new TSymLookupEntry( 0x006215c8, 00001, "", "" ), + new TSymLookupEntry( 0x00621641, 00001, "", "" ), + new TSymLookupEntry( 0x00621668, 00001, "", "" ), + new TSymLookupEntry( 0x00621bb1, 00001, "", "" ), + new TSymLookupEntry( 0x00621c31, 00001, "", "" ), + new TSymLookupEntry( 0x00621cd6, 00001, "", "" ), + new TSymLookupEntry( 0x00621ce8, 00001, "", "" ), + new TSymLookupEntry( 0x00622080, 00001, "", "" ), + new TSymLookupEntry( 0x006224b8, 00003, "", "" ), + new TSymLookupEntry( 0x00622f28, 00001, "", "" ), + new TSymLookupEntry( 0x00625fb0, 00017, "", "" ), + new TSymLookupEntry( 0x00626398, 00003, "", "" ), + new TSymLookupEntry( 0x006268e8, 00001, "", "" ), + new TSymLookupEntry( 0x00627718, 00001, "", "" ), + new TSymLookupEntry( 0x00627990, 00001, "", "" ), + new TSymLookupEntry( 0x00627b30, 00001, "", "" ), + new TSymLookupEntry( 0x00627bf0, 00001, "", "" ), + new TSymLookupEntry( 0x00627c20, 00001, "", "" ), + new TSymLookupEntry( 0x00627ca0, 00056, "", "" ), + new TSymLookupEntry( 0x00627fd0, 00001, "", "" ), + new TSymLookupEntry( 0x006281a8, 00001, "", "" ), + new TSymLookupEntry( 0x00628378, 00001, "", "" ), + new TSymLookupEntry( 0x00629668, 00001, "", "" ), + new TSymLookupEntry( 0x0062b830, 00001, "", "" ), + new TSymLookupEntry( 0x0062be00, 00001, "", "" ), + new TSymLookupEntry( 0x0062c060, 00001, "", "" ), + new TSymLookupEntry( 0x0062d101, 00001, "", "" ), + new TSymLookupEntry( 0x0062d3d8, 00001, "", "" ), + new TSymLookupEntry( 0x0062d640, 00001, "", "" ), + new TSymLookupEntry( 0x0062d7d0, 00001, "", "" ), + new TSymLookupEntry( 0x0062dba0, 00001, "", "" ), + new TSymLookupEntry( 0x0062dcb0, 00001, "", "" ), + new TSymLookupEntry( 0x0062dd28, 00001, "", "" ), + new TSymLookupEntry( 0x0062dd78, 00001, "", "" ), + new TSymLookupEntry( 0x0062ddf0, 00001, "", "" ), + new TSymLookupEntry( 0x0062de40, 00001, "", "" ), + new TSymLookupEntry( 0x0062de90, 00001, "", "" ), + new TSymLookupEntry( 0x0062df08, 00001, "", "" ), + new TSymLookupEntry( 0x0062df58, 00001, "", "" ), + new TSymLookupEntry( 0x0062dfa8, 00001, "", "" ), + new TSymLookupEntry( 0x0062dff8, 00001, "", "" ), + new TSymLookupEntry( 0x0062e048, 00001, "", "" ), + new TSymLookupEntry( 0x0062e098, 00001, "", "" ), + new TSymLookupEntry( 0x0062e0e8, 00001, "", "" ), + new TSymLookupEntry( 0x0062e138, 00001, "", "" ), + new TSymLookupEntry( 0x0062e188, 00001, "", "" ), + new TSymLookupEntry( 0x0062e1d8, 00001, "", "" ), + new TSymLookupEntry( 0x0062e228, 00001, "", "" ), + new TSymLookupEntry( 0x0062e278, 00001, "", "" ), + new TSymLookupEntry( 0x0062e2c8, 00001, "", "" ), + new TSymLookupEntry( 0x0062e318, 00001, "", "" ), + new TSymLookupEntry( 0x0062e408, 00001, "", "" ), + new TSymLookupEntry( 0x0062e458, 00001, "", "" ), + new TSymLookupEntry( 0x0062e4a8, 00001, "", "" ), + new TSymLookupEntry( 0x0062e4f8, 00001, "", "" ), + new TSymLookupEntry( 0x0062e548, 00001, "", "" ), + new TSymLookupEntry( 0x0062e598, 00001, "", "" ), + new TSymLookupEntry( 0x0062e5e8, 00001, "", "" ), + new TSymLookupEntry( 0x0062e638, 00001, "", "" ), + new TSymLookupEntry( 0x0062e688, 00001, "", "" ), + new TSymLookupEntry( 0x0062e6d8, 00001, "", "" ), + new TSymLookupEntry( 0x0062e728, 00001, "", "" ), + new TSymLookupEntry( 0x0062e7a0, 00001, "", "" ), + new TSymLookupEntry( 0x0062e7f0, 00001, "", "" ), + new TSymLookupEntry( 0x0062e840, 00001, "", "" ), + new TSymLookupEntry( 0x0062e890, 00001, "", "" ), + new TSymLookupEntry( 0x0062e8e0, 00001, "", "" ), + new TSymLookupEntry( 0x0062e930, 00001, "", "" ), + new TSymLookupEntry( 0x0062e980, 00001, "", "" ), + new TSymLookupEntry( 0x0062e9f8, 00001, "", "" ), + new TSymLookupEntry( 0x0062ea48, 00001, "", "" ), + new TSymLookupEntry( 0x0062ea98, 00001, "", "" ), + new TSymLookupEntry( 0x0062eae8, 00001, "", "" ), + new TSymLookupEntry( 0x0062eb38, 00001, "", "" ), + new TSymLookupEntry( 0x0062eb88, 00001, "", "" ), + new TSymLookupEntry( 0x0062ebd8, 00001, "", "" ), + new TSymLookupEntry( 0x0062ec28, 00001, "", "" ), + new TSymLookupEntry( 0x0062ec78, 00001, "", "" ), + new TSymLookupEntry( 0x0062ecc8, 00001, "", "" ), + new TSymLookupEntry( 0x0062ed18, 00001, "", "" ), + new TSymLookupEntry( 0x0062ed60, 00001, "", "" ), + new TSymLookupEntry( 0x0062edb0, 00001, "", "" ), + new TSymLookupEntry( 0x0062ee00, 00001, "", "" ), + new TSymLookupEntry( 0x0062ef40, 00001, "", "" ), + new TSymLookupEntry( 0x0062ef90, 00001, "", "" ), + new TSymLookupEntry( 0x0062efe0, 00001, "", "" ), + new TSymLookupEntry( 0x0062f0d0, 00001, "", "" ), + new TSymLookupEntry( 0x0062f120, 00001, "", "" ), + new TSymLookupEntry( 0x0062f170, 00001, "", "" ), + new TSymLookupEntry( 0x0062f1c0, 00001, "", "" ), + new TSymLookupEntry( 0x0062f210, 00001, "", "" ), + new TSymLookupEntry( 0x0062f260, 00001, "", "" ), + new TSymLookupEntry( 0x0062f2b0, 00001, "", "" ), + new TSymLookupEntry( 0x0062f300, 00001, "", "" ), + new TSymLookupEntry( 0x0062f350, 00001, "", "" ), + new TSymLookupEntry( 0x0062f3c8, 00001, "", "" ), + new TSymLookupEntry( 0x0062f9e0, 00001, "", "" ), + new TSymLookupEntry( 0x0062fa30, 00001, "", "" ), + new TSymLookupEntry( 0x0062fc10, 00001, "", "" ), + new TSymLookupEntry( 0x0062fc60, 00001, "", "" ), + new TSymLookupEntry( 0x0062fe68, 00001, "", "" ), + new TSymLookupEntry( 0x0062feb8, 00001, "", "" ), + new TSymLookupEntry( 0x0062ff08, 00001, "", "" ), + new TSymLookupEntry( 0x0062ff58, 00001, "", "" ), + new TSymLookupEntry( 0x0062ffa8, 00001, "", "" ), + new TSymLookupEntry( 0x0062fff8, 00001, "", "" ), + new TSymLookupEntry( 0x00630022, 00001, "", "" ), + new TSymLookupEntry( 0x00630023, 00001, "", "" ), + new TSymLookupEntry( 0x00630026, 00002, "", "" ), + new TSymLookupEntry( 0x00630027, 00001, "", "" ), + new TSymLookupEntry( 0x00630028, 00001, "", "" ), + new TSymLookupEntry( 0x0063002d, 00010, "", "" ), + new TSymLookupEntry( 0x0063002f, 00003, "", "" ), + new TSymLookupEntry( 0x0063003c, 00001, "", "" ), + new TSymLookupEntry( 0x00630041, 00004, "", "" ), + new TSymLookupEntry( 0x00630048, 00001, "", "" ), + new TSymLookupEntry( 0x00630061, 00010, "", "" ), + new TSymLookupEntry( 0x00630065, 00002, "", "" ), + new TSymLookupEntry( 0x00630069, 00001, "", "" ), + new TSymLookupEntry( 0x0063006d, 00001, "", "" ), + new TSymLookupEntry( 0x00630073, 00034, "", "" ), + new TSymLookupEntry( 0x0063007b, 00002, "", "" ), + new TSymLookupEntry( 0x006308a0, 00001, "", "" ), + new TSymLookupEntry( 0x006308f0, 00001, "", "" ), + new TSymLookupEntry( 0x00630940, 00001, "", "" ), + new TSymLookupEntry( 0x00630990, 00001, "", "" ), + new TSymLookupEntry( 0x006309e0, 00001, "", "" ), + new TSymLookupEntry( 0x00630d78, 00001, "", "" ), + new TSymLookupEntry( 0x00630e90, 00001, "", "" ), + new TSymLookupEntry( 0x00630ee0, 00001, "", "" ), + new TSymLookupEntry( 0x00630f30, 00001, "", "" ), + new TSymLookupEntry( 0x00630fa8, 00001, "", "" ), + new TSymLookupEntry( 0x00630ff8, 00001, "", "" ), + new TSymLookupEntry( 0x00631048, 00001, "", "" ), + new TSymLookupEntry( 0x006310e8, 00001, "", "" ), + new TSymLookupEntry( 0x00631160, 00001, "", "" ), + new TSymLookupEntry( 0x006311b0, 00001, "", "" ), + new TSymLookupEntry( 0x00631228, 00001, "", "" ), + new TSymLookupEntry( 0x00631278, 00001, "", "" ), + new TSymLookupEntry( 0x006312c8, 00001, "", "" ), + new TSymLookupEntry( 0x00631340, 00001, "", "" ), + new TSymLookupEntry( 0x00631390, 00001, "", "" ), + new TSymLookupEntry( 0x006313e0, 00001, "", "" ), + new TSymLookupEntry( 0x00631430, 00001, "", "" ), + new TSymLookupEntry( 0x00631480, 00001, "", "" ), + new TSymLookupEntry( 0x006314d0, 00001, "", "" ), + new TSymLookupEntry( 0x00631520, 00001, "", "" ), + new TSymLookupEntry( 0x00631570, 00001, "", "" ), + new TSymLookupEntry( 0x006315c0, 00001, "", "" ), + new TSymLookupEntry( 0x00631610, 00001, "", "" ), + new TSymLookupEntry( 0x00631660, 00001, "", "" ), + new TSymLookupEntry( 0x006316b0, 00001, "", "" ), + new TSymLookupEntry( 0x00631700, 00001, "", "" ), + new TSymLookupEntry( 0x00631750, 00001, "", "" ), + new TSymLookupEntry( 0x00631840, 00001, "", "" ), + new TSymLookupEntry( 0x00631890, 00001, "", "" ), + new TSymLookupEntry( 0x006318e0, 00001, "", "" ), + new TSymLookupEntry( 0x00631930, 00001, "", "" ), + new TSymLookupEntry( 0x00631980, 00001, "", "" ), + new TSymLookupEntry( 0x006319d0, 00001, "", "" ), + new TSymLookupEntry( 0x00631a20, 00001, "", "" ), + new TSymLookupEntry( 0x00631a70, 00001, "", "" ), + new TSymLookupEntry( 0x00631ac0, 00001, "", "" ), + new TSymLookupEntry( 0x00631b10, 00001, "", "" ), + new TSymLookupEntry( 0x00631b60, 00001, "", "" ), + new TSymLookupEntry( 0x00631bd8, 00001, "", "" ), + new TSymLookupEntry( 0x00631c28, 00001, "", "" ), + new TSymLookupEntry( 0x00631c78, 00001, "", "" ), + new TSymLookupEntry( 0x00631cc8, 00001, "", "" ), + new TSymLookupEntry( 0x00631d18, 00001, "", "" ), + new TSymLookupEntry( 0x00631d68, 00001, "", "" ), + new TSymLookupEntry( 0x00631db8, 00001, "", "" ), + new TSymLookupEntry( 0x00631e30, 00001, "", "" ), + new TSymLookupEntry( 0x00631e80, 00001, "", "" ), + new TSymLookupEntry( 0x00631ed0, 00001, "", "" ), + new TSymLookupEntry( 0x00631f20, 00001, "", "" ), + new TSymLookupEntry( 0x00631f70, 00001, "", "" ), + new TSymLookupEntry( 0x00631fc0, 00001, "", "" ), + new TSymLookupEntry( 0x00632010, 00001, "", "" ), + new TSymLookupEntry( 0x00632060, 00001, "", "" ), + new TSymLookupEntry( 0x006320b0, 00001, "", "" ), + new TSymLookupEntry( 0x00632100, 00001, "", "" ), + new TSymLookupEntry( 0x00632150, 00001, "", "" ), + new TSymLookupEntry( 0x00632198, 00001, "", "" ), + new TSymLookupEntry( 0x006321e8, 00001, "", "" ), + new TSymLookupEntry( 0x00632238, 00001, "", "" ), + new TSymLookupEntry( 0x00632378, 00001, "", "" ), + new TSymLookupEntry( 0x006323c8, 00001, "", "" ), + new TSymLookupEntry( 0x00632418, 00001, "", "" ), + new TSymLookupEntry( 0x00632508, 00001, "", "" ), + new TSymLookupEntry( 0x00632558, 00001, "", "" ), + new TSymLookupEntry( 0x006325a8, 00001, "", "" ), + new TSymLookupEntry( 0x006325f8, 00001, "", "" ), + new TSymLookupEntry( 0x00632648, 00001, "", "" ), + new TSymLookupEntry( 0x00632698, 00001, "", "" ), + new TSymLookupEntry( 0x006326e8, 00001, "", "" ), + new TSymLookupEntry( 0x00632738, 00001, "", "" ), + new TSymLookupEntry( 0x00632788, 00001, "", "" ), + new TSymLookupEntry( 0x00632800, 00001, "", "" ), + new TSymLookupEntry( 0x00632e18, 00001, "", "" ), + new TSymLookupEntry( 0x00632e68, 00001, "", "" ), + new TSymLookupEntry( 0x00633048, 00001, "", "" ), + new TSymLookupEntry( 0x00633098, 00001, "", "" ), + new TSymLookupEntry( 0x006332a0, 00001, "", "" ), + new TSymLookupEntry( 0x006332f0, 00001, "", "" ), + new TSymLookupEntry( 0x00633340, 00001, "", "" ), + new TSymLookupEntry( 0x00633390, 00001, "", "" ), + new TSymLookupEntry( 0x006333e0, 00001, "", "" ), + new TSymLookupEntry( 0x00633430, 00001, "", "" ), + new TSymLookupEntry( 0x00633480, 00001, "", "" ), + new TSymLookupEntry( 0x00633cd8, 00001, "", "" ), + new TSymLookupEntry( 0x00633d28, 00001, "", "" ), + new TSymLookupEntry( 0x00633d78, 00001, "", "" ), + new TSymLookupEntry( 0x00633dc8, 00001, "", "" ), + new TSymLookupEntry( 0x00633e18, 00001, "", "" ), + new TSymLookupEntry( 0x006341b0, 00001, "", "" ), + new TSymLookupEntry( 0x006342c8, 00001, "", "" ), + new TSymLookupEntry( 0x00634318, 00001, "", "" ), + new TSymLookupEntry( 0x00634368, 00001, "", "" ), + new TSymLookupEntry( 0x006343e0, 00001, "", "" ), + new TSymLookupEntry( 0x00634430, 00001, "", "" ), + new TSymLookupEntry( 0x00634480, 00001, "", "" ), + new TSymLookupEntry( 0x00634568, 00001, "", "" ), + new TSymLookupEntry( 0x006347e8, 00001, "", "" ), + new TSymLookupEntry( 0x00634838, 00001, "", "" ), + new TSymLookupEntry( 0x00634888, 00001, "", "" ), + new TSymLookupEntry( 0x00634920, 00001, "", "" ), + new TSymLookupEntry( 0x00634970, 00001, "", "" ), + new TSymLookupEntry( 0x006349f8, 00001, "", "" ), + new TSymLookupEntry( 0x00634a48, 00001, "", "" ), + new TSymLookupEntry( 0x00634a98, 00001, "", "" ), + new TSymLookupEntry( 0x00634bf8, 00001, "", "" ), + new TSymLookupEntry( 0x00634c88, 00001, "", "" ), + new TSymLookupEntry( 0x00634de0, 00001, "", "" ), + new TSymLookupEntry( 0x00634e98, 00001, "", "" ), + new TSymLookupEntry( 0x006351b0, 00001, "", "" ), + new TSymLookupEntry( 0x006351d8, 00001, "", "" ), + new TSymLookupEntry( 0x00635200, 00001, "", "" ), + new TSymLookupEntry( 0x00635228, 00001, "", "" ), + new TSymLookupEntry( 0x00635250, 00001, "", "" ), + new TSymLookupEntry( 0x00635278, 00001, "", "" ), + new TSymLookupEntry( 0x006352a0, 00001, "", "" ), + new TSymLookupEntry( 0x00635578, 00001, "", "" ), + new TSymLookupEntry( 0x006355a0, 00001, "", "" ), + new TSymLookupEntry( 0x006355c8, 00001, "", "" ), + new TSymLookupEntry( 0x00635690, 00001, "", "" ), + new TSymLookupEntry( 0x006356b8, 00001, "", "" ), + new TSymLookupEntry( 0x006356e0, 00001, "", "" ), + new TSymLookupEntry( 0x00635708, 00001, "", "" ), + new TSymLookupEntry( 0x00635730, 00001, "", "" ), + new TSymLookupEntry( 0x00635758, 00001, "", "" ), + new TSymLookupEntry( 0x00635780, 00001, "", "" ), + new TSymLookupEntry( 0x00635878, 00001, "", "" ), + new TSymLookupEntry( 0x006359d8, 00002, "", "" ), + new TSymLookupEntry( 0x00635af0, 00001, "", "" ), + new TSymLookupEntry( 0x00635b88, 00001, "", "" ), + new TSymLookupEntry( 0x00635bb0, 00001, "", "" ), + new TSymLookupEntry( 0x00635c50, 00001, "", "" ), + new TSymLookupEntry( 0x00635c78, 00001, "", "" ), + new TSymLookupEntry( 0x00635ca0, 00001, "", "" ), + new TSymLookupEntry( 0x00635cc8, 00001, "", "" ), + new TSymLookupEntry( 0x00635d18, 00003, "", "" ), + new TSymLookupEntry( 0x00635de0, 00001, "", "" ), + new TSymLookupEntry( 0x00635e08, 00001, "", "" ), + new TSymLookupEntry( 0x00635e30, 00001, "", "" ), + new TSymLookupEntry( 0x00635e58, 00001, "", "" ), + new TSymLookupEntry( 0x00635e80, 00001, "", "" ), + new TSymLookupEntry( 0x00635ea8, 00001, "", "" ), + new TSymLookupEntry( 0x00635ed0, 00001, "", "" ), + new TSymLookupEntry( 0x00636068, 00001, "", "" ), + new TSymLookupEntry( 0x006360b8, 00001, "", "" ), + new TSymLookupEntry( 0x00636108, 00001, "", "" ), + new TSymLookupEntry( 0x00636400, 00001, "", "" ), + new TSymLookupEntry( 0x00636d98, 00001, "", "" ), + new TSymLookupEntry( 0x00636dc0, 00001, "", "" ), + new TSymLookupEntry( 0x00636de8, 00001, "", "" ), + new TSymLookupEntry( 0x00636e10, 00001, "", "" ), + new TSymLookupEntry( 0x00636ed8, 00001, "", "" ), + new TSymLookupEntry( 0x00636f00, 00001, "", "" ), + new TSymLookupEntry( 0x00636f28, 00001, "", "" ), + new TSymLookupEntry( 0x00636f50, 00001, "", "" ), + new TSymLookupEntry( 0x00637078, 00001, "", "" ), + new TSymLookupEntry( 0x00637328, 00001, "", "" ), + new TSymLookupEntry( 0x00637350, 00001, "", "" ), + new TSymLookupEntry( 0x006374b8, 00001, "", "" ), + new TSymLookupEntry( 0x006374e0, 00001, "", "" ), + new TSymLookupEntry( 0x00637508, 00001, "", "" ), + new TSymLookupEntry( 0x00637530, 00001, "", "" ), + new TSymLookupEntry( 0x00637768, 00003, "", "" ), + new TSymLookupEntry( 0x006377b8, 00030, "", "" ), + new TSymLookupEntry( 0x00637808, 00002, "", "" ), + new TSymLookupEntry( 0x00637858, 00003, "", "" ), + new TSymLookupEntry( 0x006378a8, 00001, "", "" ), + new TSymLookupEntry( 0x006378f8, 00006, "", "" ), + new TSymLookupEntry( 0x00637bd8, 00031, "", "" ), + new TSymLookupEntry( 0x00637cc8, 00001, "", "" ), + new TSymLookupEntry( 0x00637d68, 00001, "", "" ), + new TSymLookupEntry( 0x00637dd0, 00001, "", "" ), + new TSymLookupEntry( 0x00637e30, 00001, "", "" ), + new TSymLookupEntry( 0x00637ea0, 00001, "", "" ), + new TSymLookupEntry( 0x00637f58, 00001, "", "" ), + new TSymLookupEntry( 0x006380f0, 00001, "", "" ), + new TSymLookupEntry( 0x006381c0, 00001, "", "" ), + new TSymLookupEntry( 0x006383d0, 00001, "", "" ), + new TSymLookupEntry( 0x00638578, 00001, "", "" ), + new TSymLookupEntry( 0x006388e8, 00001, "", "" ), + new TSymLookupEntry( 0x00638910, 00001, "", "" ), + new TSymLookupEntry( 0x006389d8, 00001, "", "" ), + new TSymLookupEntry( 0x00638be0, 00001, "", "" ), + new TSymLookupEntry( 0x00638c08, 00001, "", "" ), + new TSymLookupEntry( 0x00638c30, 00001, "", "" ), + new TSymLookupEntry( 0x00638c58, 00001, "", "" ), + new TSymLookupEntry( 0x00638c80, 00001, "", "" ), + new TSymLookupEntry( 0x00638ca8, 00001, "", "" ), + new TSymLookupEntry( 0x00638ee8, 00001, "", "" ), + new TSymLookupEntry( 0x00638f10, 00001, "", "" ), + new TSymLookupEntry( 0x00638f38, 00001, "", "" ), + new TSymLookupEntry( 0x00638f60, 00001, "", "" ), + new TSymLookupEntry( 0x00638f88, 00001, "", "" ), + new TSymLookupEntry( 0x00638fb0, 00001, "", "" ), + new TSymLookupEntry( 0x00639078, 00001, "", "" ), + new TSymLookupEntry( 0x006390a0, 00001, "", "" ), + new TSymLookupEntry( 0x006390c8, 00001, "", "" ), + new TSymLookupEntry( 0x006390f0, 00001, "", "" ), + new TSymLookupEntry( 0x00639118, 00001, "", "" ), + new TSymLookupEntry( 0x00639140, 00001, "", "" ), + new TSymLookupEntry( 0x00639350, 00001, "", "" ), + new TSymLookupEntry( 0x00639378, 00001, "", "" ), + new TSymLookupEntry( 0x006393a0, 00001, "", "" ), + new TSymLookupEntry( 0x006393c8, 00001, "", "" ), + new TSymLookupEntry( 0x006393f0, 00001, "", "" ), + new TSymLookupEntry( 0x00639418, 00001, "", "" ), + new TSymLookupEntry( 0x00639628, 00001, "", "" ), + new TSymLookupEntry( 0x00639650, 00001, "", "" ), + new TSymLookupEntry( 0x00639678, 00001, "", "" ), + new TSymLookupEntry( 0x006396a0, 00001, "", "" ), + new TSymLookupEntry( 0x006396c8, 00001, "", "" ), + new TSymLookupEntry( 0x006396f0, 00001, "", "" ), + new TSymLookupEntry( 0x00639900, 00001, "", "" ), + new TSymLookupEntry( 0x00639928, 00001, "", "" ), + new TSymLookupEntry( 0x00639950, 00001, "", "" ), + new TSymLookupEntry( 0x00639978, 00001, "", "" ), + new TSymLookupEntry( 0x006399a0, 00001, "", "" ), + new TSymLookupEntry( 0x00639bc8, 00001, "", "" ), + new TSymLookupEntry( 0x00639bf0, 00001, "", "" ), + new TSymLookupEntry( 0x00639c18, 00001, "", "" ), + new TSymLookupEntry( 0x00639c40, 00001, "", "" ), + new TSymLookupEntry( 0x00639c68, 00001, "", "" ), + new TSymLookupEntry( 0x00639e10, 00001, "", "" ), + new TSymLookupEntry( 0x00639f68, 00001, "", "" ), + new TSymLookupEntry( 0x00639f90, 00001, "", "" ), + new TSymLookupEntry( 0x00639fb8, 00001, "", "" ), + new TSymLookupEntry( 0x00639fe0, 00001, "", "" ), + new TSymLookupEntry( 0x0063a008, 00001, "", "" ), + new TSymLookupEntry( 0x0063a030, 00001, "", "" ), + new TSymLookupEntry( 0x0063a1a0, 00001, "", "" ), + new TSymLookupEntry( 0x0063a1c8, 00001, "", "" ), + new TSymLookupEntry( 0x0063a1f0, 00001, "", "" ), + new TSymLookupEntry( 0x0063a218, 00001, "", "" ), + new TSymLookupEntry( 0x0063a240, 00001, "", "" ), + new TSymLookupEntry( 0x0063a268, 00001, "", "" ), + new TSymLookupEntry( 0x0063a290, 00001, "", "" ), + new TSymLookupEntry( 0x0063a400, 00001, "", "" ), + new TSymLookupEntry( 0x0063a4c8, 00001, "", "" ), + new TSymLookupEntry( 0x0063a4f0, 00001, "", "" ), + new TSymLookupEntry( 0x0063a700, 00001, "", "" ), + new TSymLookupEntry( 0x0063a728, 00001, "", "" ), + new TSymLookupEntry( 0x0063a7f0, 00001, "", "" ), + new TSymLookupEntry( 0x0063a818, 00001, "", "" ), + new TSymLookupEntry( 0x0063ad98, 00001, "", "" ), + new TSymLookupEntry( 0x0063adc0, 00001, "", "" ), + new TSymLookupEntry( 0x0063ae88, 00001, "", "" ), + new TSymLookupEntry( 0x0063b0c8, 00001, "", "" ), + new TSymLookupEntry( 0x0063b3e0, 00001, "", "" ), + new TSymLookupEntry( 0x0063b408, 00001, "", "" ), + new TSymLookupEntry( 0x0063b430, 00001, "", "" ), + new TSymLookupEntry( 0x0063b458, 00001, "", "" ), + new TSymLookupEntry( 0x0063b480, 00001, "", "" ), + new TSymLookupEntry( 0x0063b4a8, 00001, "", "" ), + new TSymLookupEntry( 0x0063b618, 00001, "", "" ), + new TSymLookupEntry( 0x0063b640, 00001, "", "" ), + new TSymLookupEntry( 0x0063b668, 00001, "", "" ), + new TSymLookupEntry( 0x0063b690, 00001, "", "" ), + new TSymLookupEntry( 0x0063b6b8, 00001, "", "" ), + new TSymLookupEntry( 0x0063b6e0, 00001, "", "" ), + new TSymLookupEntry( 0x0063bcb8, 00001, "", "" ), + new TSymLookupEntry( 0x0063be00, 00001, "", "" ), + new TSymLookupEntry( 0x0063bfd0, 00001, "", "" ), + new TSymLookupEntry( 0x0063bff8, 00001, "", "" ), + new TSymLookupEntry( 0x0063c020, 00001, "", "" ), + new TSymLookupEntry( 0x0063c048, 00001, "", "" ), + new TSymLookupEntry( 0x0063c348, 00001, "", "" ), + new TSymLookupEntry( 0x0063c558, 00001, "", "" ), + new TSymLookupEntry( 0x0063c580, 00001, "", "" ), + new TSymLookupEntry( 0x0063c5a8, 00001, "", "" ), + new TSymLookupEntry( 0x0063c5d0, 00001, "", "" ), + new TSymLookupEntry( 0x0063c7b8, 00001, "", "" ), + new TSymLookupEntry( 0x0063c7e0, 00001, "", "" ), + new TSymLookupEntry( 0x0063c808, 00001, "", "" ), + new TSymLookupEntry( 0x0063c830, 00001, "", "" ), + new TSymLookupEntry( 0x0063c858, 00001, "", "" ), + new TSymLookupEntry( 0x0063c880, 00001, "", "" ), + new TSymLookupEntry( 0x0063c8a8, 00001, "", "" ), + new TSymLookupEntry( 0x0063cb30, 00001, "", "" ), + new TSymLookupEntry( 0x0063cbf8, 00001, "", "" ), + new TSymLookupEntry( 0x0063cc20, 00001, "", "" ), + new TSymLookupEntry( 0x0063cc48, 00001, "", "" ), + new TSymLookupEntry( 0x0063cc70, 00001, "", "" ), + new TSymLookupEntry( 0x0063cc98, 00001, "", "" ), + new TSymLookupEntry( 0x0063ccc0, 00001, "", "" ), + new TSymLookupEntry( 0x0063cce8, 00001, "", "" ), + new TSymLookupEntry( 0x0063cf98, 00002, "", "" ), + new TSymLookupEntry( 0x0063d050, 00001, "", "" ), + new TSymLookupEntry( 0x0063d078, 00001, "", "" ), + new TSymLookupEntry( 0x0063d0a0, 00001, "", "" ), + new TSymLookupEntry( 0x0063d0c8, 00001, "", "" ), + new TSymLookupEntry( 0x0063d0f0, 00001, "", "" ), + new TSymLookupEntry( 0x0063d118, 00001, "", "" ), + new TSymLookupEntry( 0x0063d140, 00001, "", "" ), + new TSymLookupEntry( 0x0063d168, 00001, "", "" ), + new TSymLookupEntry( 0x0063d190, 00001, "", "" ), + new TSymLookupEntry( 0x0063d1b8, 00001, "", "" ), + new TSymLookupEntry( 0x0063d1e0, 00001, "", "" ), + new TSymLookupEntry( 0x0063d280, 00001, "", "" ), + new TSymLookupEntry( 0x0063d2a8, 00001, "", "" ), + new TSymLookupEntry( 0x0063d2d0, 00001, "", "" ), + new TSymLookupEntry( 0x0063d2f8, 00001, "", "" ), + new TSymLookupEntry( 0x0063d320, 00001, "", "" ), + new TSymLookupEntry( 0x0063d4d8, 00001, "", "" ), + new TSymLookupEntry( 0x0063d500, 00001, "", "" ), + new TSymLookupEntry( 0x0063d528, 00001, "", "" ), + new TSymLookupEntry( 0x0063d550, 00001, "", "" ), + new TSymLookupEntry( 0x0063d578, 00001, "", "" ), + new TSymLookupEntry( 0x0063d5a0, 00001, "", "" ), + new TSymLookupEntry( 0x0063d5c8, 00001, "", "" ), + new TSymLookupEntry( 0x0063d710, 00001, "", "" ), + new TSymLookupEntry( 0x0063d738, 00001, "", "" ), + new TSymLookupEntry( 0x0063d760, 00001, "", "" ), + new TSymLookupEntry( 0x0063d788, 00001, "", "" ), + new TSymLookupEntry( 0x0063d7b0, 00001, "", "" ), + new TSymLookupEntry( 0x0063d7d8, 00001, "", "" ), + new TSymLookupEntry( 0x0063d9a8, 00001, "", "" ), + new TSymLookupEntry( 0x0063d9d0, 00001, "", "" ), + new TSymLookupEntry( 0x0063d9f8, 00001, "", "" ), + new TSymLookupEntry( 0x0063da20, 00001, "", "" ), + new TSymLookupEntry( 0x0063da48, 00001, "", "" ), + new TSymLookupEntry( 0x0063da70, 00001, "", "" ), + new TSymLookupEntry( 0x0063da98, 00001, "", "" ), + new TSymLookupEntry( 0x0063db68, 00001, "", "" ), + new TSymLookupEntry( 0x0063ddc0, 00001, "", "" ), + new TSymLookupEntry( 0x0063dde8, 00001, "", "" ), + new TSymLookupEntry( 0x0063de10, 00001, "", "" ), + new TSymLookupEntry( 0x0063de38, 00001, "", "" ), + new TSymLookupEntry( 0x0063de60, 00001, "", "" ), + new TSymLookupEntry( 0x0063de88, 00001, "", "" ), + new TSymLookupEntry( 0x0063deb0, 00001, "", "" ), + new TSymLookupEntry( 0x0063ded8, 00001, "", "" ), + new TSymLookupEntry( 0x0063df00, 00001, "", "" ), + new TSymLookupEntry( 0x0063df28, 00001, "", "" ), + new TSymLookupEntry( 0x0063e2f0, 00001, "", "" ), + new TSymLookupEntry( 0x0063e318, 00001, "", "" ), + new TSymLookupEntry( 0x0063e340, 00001, "", "" ), + new TSymLookupEntry( 0x0063e368, 00001, "", "" ), + new TSymLookupEntry( 0x0063e390, 00001, "", "" ), + new TSymLookupEntry( 0x0063e3b8, 00001, "", "" ), + new TSymLookupEntry( 0x0063e3e0, 00001, "", "" ), + new TSymLookupEntry( 0x0063e618, 00009, "", "" ), + new TSymLookupEntry( 0x0063e820, 00001, "", "" ), + new TSymLookupEntry( 0x0063e848, 00001, "", "" ), + new TSymLookupEntry( 0x0063e870, 00001, "", "" ), + new TSymLookupEntry( 0x0063e898, 00001, "", "" ), + new TSymLookupEntry( 0x0063e8c0, 00001, "", "" ), + new TSymLookupEntry( 0x0063e8e8, 00001, "", "" ), + new TSymLookupEntry( 0x0063e910, 00001, "", "" ), + new TSymLookupEntry( 0x0063e938, 00001, "", "" ), + new TSymLookupEntry( 0x0063ea00, 00001, "", "" ), + new TSymLookupEntry( 0x0063ea28, 00001, "", "" ), + new TSymLookupEntry( 0x0063ea50, 00001, "", "" ), + new TSymLookupEntry( 0x0063ec10, 00001, "", "" ), + new TSymLookupEntry( 0x0063ec88, 00003, "", "" ), + new TSymLookupEntry( 0x0063ed00, 00003, "", "" ), + new TSymLookupEntry( 0x0063ef20, 00001, "", "" ), + new TSymLookupEntry( 0x0063f0c8, 00001, "", "" ), + new TSymLookupEntry( 0x0063f140, 00001, "", "" ), + new TSymLookupEntry( 0x0063f408, 00001, "", "" ), + new TSymLookupEntry( 0x0063f430, 00001, "", "" ), + new TSymLookupEntry( 0x0063f458, 00001, "", "" ), + new TSymLookupEntry( 0x0063f480, 00001, "", "" ), + new TSymLookupEntry( 0x0063f4a8, 00001, "", "" ), + new TSymLookupEntry( 0x0063f4d0, 00001, "", "" ), + new TSymLookupEntry( 0x0063f4f8, 00001, "", "" ), + new TSymLookupEntry( 0x0063f5a0, 00002, "", "" ), + new TSymLookupEntry( 0x0063f988, 00001, "", "" ), + new TSymLookupEntry( 0x0063f9b0, 00001, "", "" ), + new TSymLookupEntry( 0x0063f9d8, 00001, "", "" ), + new TSymLookupEntry( 0x0063fa28, 00001, "", "" ), + new TSymLookupEntry( 0x0063fa78, 00001, "", "" ), + new TSymLookupEntry( 0x0063faa0, 00001, "", "" ), + new TSymLookupEntry( 0x0063fac8, 00001, "", "" ), + new TSymLookupEntry( 0x0063faf0, 00001, "", "" ), + new TSymLookupEntry( 0x0063fb18, 00001, "", "" ), + new TSymLookupEntry( 0x0063fb40, 00001, "", "" ), + new TSymLookupEntry( 0x0063fb68, 00001, "", "" ), + new TSymLookupEntry( 0x0063fb90, 00001, "", "" ), + new TSymLookupEntry( 0x0063fbb8, 00001, "", "" ), + new TSymLookupEntry( 0x0063fbe0, 00001, "", "" ), + new TSymLookupEntry( 0x0063fc08, 00001, "", "" ), + new TSymLookupEntry( 0x0063fc30, 00001, "", "" ), + new TSymLookupEntry( 0x0063fc58, 00001, "", "" ), + new TSymLookupEntry( 0x0063fc80, 00001, "", "" ), + new TSymLookupEntry( 0x0063fca8, 00001, "", "" ), + new TSymLookupEntry( 0x0063fcf8, 00001, "", "" ), + new TSymLookupEntry( 0x0063fe38, 00001, "", "" ), + new TSymLookupEntry( 0x00640020, 00002, "", "" ), + new TSymLookupEntry( 0x00640023, 00001, "", "" ), + new TSymLookupEntry( 0x00640030, 00001, "", "" ), + new TSymLookupEntry( 0x00640031, 00001, "", "" ), + new TSymLookupEntry( 0x0064003c, 00230, "", "" ), + new TSymLookupEntry( 0x0064005f, 00001, "", "" ), + new TSymLookupEntry( 0x00640061, 00007, "", "" ), + new TSymLookupEntry( 0x00640062, 00001, "", "" ), + new TSymLookupEntry( 0x00640064, 00002, "", "" ), + new TSymLookupEntry( 0x00640069, 00004, "", "" ), + new TSymLookupEntry( 0x0064006f, 00002, "", "" ), + new TSymLookupEntry( 0x00640074, 00001, "", "" ), + new TSymLookupEntry( 0x00640268, 00001, "", "" ), + new TSymLookupEntry( 0x00640290, 00001, "", "" ), + new TSymLookupEntry( 0x006402b8, 00001, "", "" ), + new TSymLookupEntry( 0x00640608, 00001, "", "" ), + new TSymLookupEntry( 0x00640630, 00001, "", "" ), + new TSymLookupEntry( 0x00640658, 00001, "", "" ), + new TSymLookupEntry( 0x00640890, 00001, "", "" ), + new TSymLookupEntry( 0x00640a78, 00001, "", "" ), + new TSymLookupEntry( 0x00640b40, 00001, "", "" ), + new TSymLookupEntry( 0x00640b68, 00001, "", "" ), + new TSymLookupEntry( 0x00640b90, 00001, "", "" ), + new TSymLookupEntry( 0x00640bb8, 00001, "", "" ), + new TSymLookupEntry( 0x00640be0, 00001, "", "" ), + new TSymLookupEntry( 0x00640c08, 00001, "", "" ), + new TSymLookupEntry( 0x00640c30, 00001, "", "" ), + new TSymLookupEntry( 0x00640e40, 00001, "", "" ), + new TSymLookupEntry( 0x00640f08, 00001, "", "" ), + new TSymLookupEntry( 0x006410c8, 00001, "", "" ), + new TSymLookupEntry( 0x006410f0, 00001, "", "" ), + new TSymLookupEntry( 0x00641118, 00001, "", "" ), + new TSymLookupEntry( 0x00641140, 00001, "", "" ), + new TSymLookupEntry( 0x00641168, 00001, "", "" ), + new TSymLookupEntry( 0x00641190, 00001, "", "" ), + new TSymLookupEntry( 0x006411b8, 00001, "", "" ), + new TSymLookupEntry( 0x006411e0, 00001, "", "" ), + new TSymLookupEntry( 0x00641208, 00001, "", "" ), + new TSymLookupEntry( 0x006412d0, 00001, "", "" ), + new TSymLookupEntry( 0x006412f8, 00001, "", "" ), + new TSymLookupEntry( 0x00641320, 00001, "", "" ), + new TSymLookupEntry( 0x00641348, 00001, "", "" ), + new TSymLookupEntry( 0x00641370, 00001, "", "" ), + new TSymLookupEntry( 0x00641398, 00001, "", "" ), + new TSymLookupEntry( 0x006413c0, 00001, "", "" ), + new TSymLookupEntry( 0x00641580, 00001, "", "" ), + new TSymLookupEntry( 0x006415a8, 00001, "", "" ), + new TSymLookupEntry( 0x006415d0, 00001, "", "" ), + new TSymLookupEntry( 0x006415f8, 00001, "", "" ), + new TSymLookupEntry( 0x00641620, 00001, "", "" ), + new TSymLookupEntry( 0x00641648, 00001, "", "" ), + new TSymLookupEntry( 0x00641670, 00001, "", "" ), + new TSymLookupEntry( 0x00641698, 00001, "", "" ), + new TSymLookupEntry( 0x00641760, 00001, "", "" ), + new TSymLookupEntry( 0x00641788, 00001, "", "" ), + new TSymLookupEntry( 0x006417b0, 00001, "", "" ), + new TSymLookupEntry( 0x006417d8, 00001, "", "" ), + new TSymLookupEntry( 0x00641800, 00001, "", "" ), + new TSymLookupEntry( 0x00641828, 00001, "", "" ), + new TSymLookupEntry( 0x00641850, 00001, "", "" ), + new TSymLookupEntry( 0x006419c0, 00001, "", "" ), + new TSymLookupEntry( 0x006419e8, 00001, "", "" ), + new TSymLookupEntry( 0x00641a10, 00001, "", "" ), + new TSymLookupEntry( 0x00641a38, 00001, "", "" ), + new TSymLookupEntry( 0x00641f08, 00001, "", "" ), + new TSymLookupEntry( 0x00642050, 00001, "", "" ), + new TSymLookupEntry( 0x00642078, 00001, "", "" ), + new TSymLookupEntry( 0x006420a0, 00001, "", "" ), + new TSymLookupEntry( 0x006420c8, 00001, "", "" ), + new TSymLookupEntry( 0x006420f0, 00001, "", "" ), + new TSymLookupEntry( 0x00642118, 00001, "", "" ), + new TSymLookupEntry( 0x00642140, 00001, "", "" ), + new TSymLookupEntry( 0x00642168, 00001, "", "" ), + new TSymLookupEntry( 0x006423e8, 00001, "", "" ), + new TSymLookupEntry( 0x00642410, 00001, "", "" ), + new TSymLookupEntry( 0x00642438, 00001, "", "" ), + new TSymLookupEntry( 0x00642460, 00001, "", "" ), + new TSymLookupEntry( 0x00642488, 00001, "", "" ), + new TSymLookupEntry( 0x006424b0, 00001, "", "" ), + new TSymLookupEntry( 0x00642830, 00001, "", "" ), + new TSymLookupEntry( 0x006429a0, 00001, "", "" ), + new TSymLookupEntry( 0x006429c8, 00001, "", "" ), + new TSymLookupEntry( 0x00642b20, 00001, "", "" ), + new TSymLookupEntry( 0x00642d28, 00001, "", "" ), + new TSymLookupEntry( 0x00642d50, 00001, "", "" ), + new TSymLookupEntry( 0x00643280, 00001, "", "" ), + new TSymLookupEntry( 0x006432a8, 00001, "", "" ), + new TSymLookupEntry( 0x006432d0, 00001, "", "" ), + new TSymLookupEntry( 0x00643548, 00001, "", "" ), + new TSymLookupEntry( 0x00643570, 00001, "", "" ), + new TSymLookupEntry( 0x00643598, 00001, "", "" ), + new TSymLookupEntry( 0x006435c0, 00001, "", "" ), + new TSymLookupEntry( 0x006436b8, 00001, "", "" ), + new TSymLookupEntry( 0x006437d0, 00001, "", "" ), + new TSymLookupEntry( 0x00643a00, 00001, "", "" ), + new TSymLookupEntry( 0x00643a28, 00001, "", "" ), + new TSymLookupEntry( 0x00643a50, 00001, "", "" ), + new TSymLookupEntry( 0x00643b98, 00001, "", "" ), + new TSymLookupEntry( 0x00643cb0, 00001, "", "" ), + new TSymLookupEntry( 0x00643ee0, 00001, "", "" ), + new TSymLookupEntry( 0x00643f08, 00001, "", "" ), + new TSymLookupEntry( 0x00643f30, 00001, "", "" ), + new TSymLookupEntry( 0x00644378, 00001, "", "" ), + new TSymLookupEntry( 0x006443a0, 00001, "", "" ), + new TSymLookupEntry( 0x006443f0, 00001, "", "" ), + new TSymLookupEntry( 0x00644538, 00001, "", "" ), + new TSymLookupEntry( 0x00644560, 00001, "", "" ), + new TSymLookupEntry( 0x00644588, 00001, "", "" ), + new TSymLookupEntry( 0x00644718, 00001, "", "" ), + new TSymLookupEntry( 0x00644740, 00001, "", "" ), + new TSymLookupEntry( 0x00644768, 00001, "", "" ), + new TSymLookupEntry( 0x00644790, 00001, "", "" ), + new TSymLookupEntry( 0x006447b8, 00001, "", "" ), + new TSymLookupEntry( 0x00644888, 00001, "", "" ), + new TSymLookupEntry( 0x00644f28, 00001, "", "" ), + new TSymLookupEntry( 0x00644f78, 00001, "", "" ), + new TSymLookupEntry( 0x00645018, 00001, "", "" ), + new TSymLookupEntry( 0x00645068, 00001, "", "" ), + new TSymLookupEntry( 0x006450b8, 00001, "", "" ), + new TSymLookupEntry( 0x00645108, 00001, "", "" ), + new TSymLookupEntry( 0x00645158, 00001, "", "" ), + new TSymLookupEntry( 0x006451a8, 00001, "", "" ), + new TSymLookupEntry( 0x006451f8, 00001, "", "" ), + new TSymLookupEntry( 0x00645248, 00001, "", "" ), + new TSymLookupEntry( 0x006453a4, 00001, "", "" ), + new TSymLookupEntry( 0x00646150, 00004, "", "" ), + new TSymLookupEntry( 0x006467f8, 00001, "", "" ), + new TSymLookupEntry( 0x00646a58, 00001, "", "" ), + new TSymLookupEntry( 0x00646bf0, 00001, "", "" ), + new TSymLookupEntry( 0x00646c70, 00001, "", "" ), + new TSymLookupEntry( 0x00646d20, 00001, "", "" ), + new TSymLookupEntry( 0x00646d48, 00001, "", "" ), + new TSymLookupEntry( 0x00646dc0, 00001, "", "" ), + new TSymLookupEntry( 0x00646eb8, 00001, "", "" ), + new TSymLookupEntry( 0x006470a0, 00001, "", "" ), + new TSymLookupEntry( 0x00647168, 00001, "", "" ), + new TSymLookupEntry( 0x00647190, 00001, "", "" ), + new TSymLookupEntry( 0x006471b8, 00001, "", "" ), + new TSymLookupEntry( 0x00647208, 00001, "", "" ), + new TSymLookupEntry( 0x00647350, 00001, "", "" ), + new TSymLookupEntry( 0x00647478, 00001, "", "" ), + new TSymLookupEntry( 0x00647658, 00003, "", "" ), + new TSymLookupEntry( 0x006476e0, 00001, "", "" ), + new TSymLookupEntry( 0x00647a18, 00001, "", "" ), + new TSymLookupEntry( 0x00647b10, 00001, "", "" ), + new TSymLookupEntry( 0x00647bf8, 00001, "", "" ), + new TSymLookupEntry( 0x00647d18, 00001, "", "" ), + new TSymLookupEntry( 0x00647e40, 00001, "", "" ), + new TSymLookupEntry( 0x00647f68, 00001, "", "" ), + new TSymLookupEntry( 0x00648048, 00001, "", "" ), + new TSymLookupEntry( 0x00648070, 00001, "", "" ), + new TSymLookupEntry( 0x00648098, 00001, "", "" ), + new TSymLookupEntry( 0x006480c0, 00001, "", "" ), + new TSymLookupEntry( 0x006480e8, 00001, "", "" ), + new TSymLookupEntry( 0x00648110, 00001, "", "" ), + new TSymLookupEntry( 0x00648138, 00001, "", "" ), + new TSymLookupEntry( 0x00648250, 00001, "", "" ), + new TSymLookupEntry( 0x006483b8, 00001, "", "" ), + new TSymLookupEntry( 0x00648488, 00001, "", "" ), + new TSymLookupEntry( 0x00648540, 00001, "", "" ), + new TSymLookupEntry( 0x00648748, 00001, "", "" ), + new TSymLookupEntry( 0x00648770, 00001, "", "" ), + new TSymLookupEntry( 0x00648798, 00001, "", "" ), + new TSymLookupEntry( 0x006487c0, 00001, "", "" ), + new TSymLookupEntry( 0x006487e8, 00001, "", "" ), + new TSymLookupEntry( 0x00648810, 00001, "", "" ), + new TSymLookupEntry( 0x00648838, 00001, "", "" ), + new TSymLookupEntry( 0x00648860, 00001, "", "" ), + new TSymLookupEntry( 0x00648888, 00001, "", "" ), + new TSymLookupEntry( 0x006488b0, 00001, "", "" ), + new TSymLookupEntry( 0x00648950, 00001, "", "" ), + new TSymLookupEntry( 0x00648978, 00001, "", "" ), + new TSymLookupEntry( 0x006489a0, 00001, "", "" ), + new TSymLookupEntry( 0x006489c8, 00001, "", "" ), + new TSymLookupEntry( 0x006489f0, 00001, "", "" ), + new TSymLookupEntry( 0x00648a18, 00001, "", "" ), + new TSymLookupEntry( 0x00648a40, 00001, "", "" ), + new TSymLookupEntry( 0x00648a68, 00001, "", "" ), + new TSymLookupEntry( 0x00648a90, 00001, "", "" ), + new TSymLookupEntry( 0x00648ab8, 00001, "", "" ), + new TSymLookupEntry( 0x00648ae0, 00001, "", "" ), + new TSymLookupEntry( 0x00648b08, 00001, "", "" ), + new TSymLookupEntry( 0x00648ca8, 00001, "", "" ), + new TSymLookupEntry( 0x00648cd0, 00001, "", "" ), + new TSymLookupEntry( 0x00648cf8, 00001, "", "" ), + new TSymLookupEntry( 0x00648d20, 00001, "", "" ), + new TSymLookupEntry( 0x00648d48, 00001, "", "" ), + new TSymLookupEntry( 0x00648d70, 00001, "", "" ), + new TSymLookupEntry( 0x00648d98, 00001, "", "" ), + new TSymLookupEntry( 0x00648dc0, 00001, "", "" ), + new TSymLookupEntry( 0x00648de8, 00001, "", "" ), + new TSymLookupEntry( 0x00648e10, 00001, "", "" ), + new TSymLookupEntry( 0x00648e38, 00001, "", "" ), + new TSymLookupEntry( 0x00648e60, 00001, "", "" ), + new TSymLookupEntry( 0x00648ed8, 00001, "", "" ), + new TSymLookupEntry( 0x00648f78, 00001, "", "" ), + new TSymLookupEntry( 0x006490c0, 00001, "", "" ), + new TSymLookupEntry( 0x006490e8, 00001, "", "" ), + new TSymLookupEntry( 0x00649110, 00001, "", "" ), + new TSymLookupEntry( 0x00649138, 00001, "", "" ), + new TSymLookupEntry( 0x00649160, 00001, "", "" ), + new TSymLookupEntry( 0x0064944c, 00001, "", "" ), + new TSymLookupEntry( 0x0064bcf0, 00001, "", "" ), + new TSymLookupEntry( 0x0064bd90, 00001, "", "" ), + new TSymLookupEntry( 0x00650044, 00001, "", "" ), + new TSymLookupEntry( 0x00650048, 00003, "", "" ), + new TSymLookupEntry( 0x0065004c, 00004, "", "" ), + new TSymLookupEntry( 0x0065004d, 00001, "", "" ), + new TSymLookupEntry( 0x00650050, 00004, "", "" ), + new TSymLookupEntry( 0x00650052, 00005, "", "" ), + new TSymLookupEntry( 0x00650053, 00003, "", "" ), + new TSymLookupEntry( 0x00650056, 00001, "", "" ), + new TSymLookupEntry( 0x00650057, 00001, "", "" ), + new TSymLookupEntry( 0x00650059, 00003, "", "" ), + new TSymLookupEntry( 0x00650062, 00009, "", "" ), + new TSymLookupEntry( 0x00650063, 00008, "", "" ), + new TSymLookupEntry( 0x00650064, 00016, "", "" ), + new TSymLookupEntry( 0x00650067, 00025, "", "" ), + new TSymLookupEntry( 0x00650068, 00020, "", "" ), + new TSymLookupEntry( 0x0065006b, 00008, "", "" ), + new TSymLookupEntry( 0x0065006c, 00008, "", "" ), + new TSymLookupEntry( 0x0065006d, 00009, "", "" ), + new TSymLookupEntry( 0x0065006e, 00007, "", "" ), + new TSymLookupEntry( 0x00650070, 00001, "", "" ), + new TSymLookupEntry( 0x00650072, 00059, "", "" ), + new TSymLookupEntry( 0x00650073, 00036, "", "" ), + new TSymLookupEntry( 0x00650074, 00035, "", "" ), + new TSymLookupEntry( 0x00650076, 00002, "", "" ), + new TSymLookupEntry( 0x00650077, 00020, "", "" ), + new TSymLookupEntry( 0x00650079, 00002, "", "" ), + new TSymLookupEntry( 0x00654fe8, 00001, "", "" ), + new TSymLookupEntry( 0x0065bee0, 00001, "", "" ), + new TSymLookupEntry( 0x0065bf80, 00001, "", "" ), + new TSymLookupEntry( 0x0065c0b0, 00001, "", "" ), + new TSymLookupEntry( 0x0065c538, 00001, "", "" ), + new TSymLookupEntry( 0x0065c5e8, 00006, "", "" ), + new TSymLookupEntry( 0x0065c8a8, 00001, "", "" ), + new TSymLookupEntry( 0x0065cb00, 00001, "", "" ), + new TSymLookupEntry( 0x0065cb80, 00001, "", "" ), + new TSymLookupEntry( 0x0065cd18, 00001, "", "" ), + new TSymLookupEntry( 0x0065cda0, 00001, "", "" ), + new TSymLookupEntry( 0x0065ce20, 00001, "", "" ), + new TSymLookupEntry( 0x0065cea0, 00001, "", "" ), + new TSymLookupEntry( 0x0065cf20, 00001, "", "" ), + new TSymLookupEntry( 0x0065cfa0, 00001, "", "" ), + new TSymLookupEntry( 0x0065d028, 00001, "", "" ), + new TSymLookupEntry( 0x0065d4f0, 00001, "", "" ), + new TSymLookupEntry( 0x0065d570, 00001, "", "" ), + new TSymLookupEntry( 0x0065e9c8, 00001, "", "" ), + new TSymLookupEntry( 0x0065ed88, 00001, "", "" ), + new TSymLookupEntry( 0x0065ee08, 00001, "", "" ), + new TSymLookupEntry( 0x0065fdac, 00001, "", "" ), + new TSymLookupEntry( 0x0066003c, 00002, "", "" ), + new TSymLookupEntry( 0x0066003f, 00001, "", "" ), + new TSymLookupEntry( 0x00660041, 00002, "", "" ), + new TSymLookupEntry( 0x00660049, 00001, "", "" ), + new TSymLookupEntry( 0x0066004f, 00001, "", "" ), + new TSymLookupEntry( 0x00660050, 00001, "", "" ), + new TSymLookupEntry( 0x00660061, 00003, "", "" ), + new TSymLookupEntry( 0x00660064, 00001, "", "" ), + new TSymLookupEntry( 0x00660069, 00003, "", "" ), + new TSymLookupEntry( 0x0066006d, 00001, "", "" ), + new TSymLookupEntry( 0x0066006e, 00001, "", "" ), + new TSymLookupEntry( 0x0066006f, 00011, "", "" ), + new TSymLookupEntry( 0x00660072, 00001, "", "" ), + new TSymLookupEntry( 0x00660074, 00001, "", "" ), + new TSymLookupEntry( 0x00660d50, 00001, "", "" ), + new TSymLookupEntry( 0x00661480, 00001, "", "" ), + new TSymLookupEntry( 0x006614b8, 00001, "", "" ), + new TSymLookupEntry( 0x00661530, 00001, "", "" ), + new TSymLookupEntry( 0x006615e0, 00001, "", "" ), + new TSymLookupEntry( 0x00661960, 00001, "", "" ), + new TSymLookupEntry( 0x00661a40, 00001, "", "" ), + new TSymLookupEntry( 0x00661a90, 00001, "", "" ), + new TSymLookupEntry( 0x00661c68, 00001, "", "" ), + new TSymLookupEntry( 0x00661c90, 00002, "", "" ), + new TSymLookupEntry( 0x00662770, 00001, "", "" ), + new TSymLookupEntry( 0x00662e58, 00001, "", "" ), + new TSymLookupEntry( 0x00662ecc, 00001, "", "" ), + new TSymLookupEntry( 0x00663360, 00001, "", "" ), + new TSymLookupEntry( 0x0066397c, 00001, "", "" ), + new TSymLookupEntry( 0x00663b5c, 00001, "", "" ), + new TSymLookupEntry( 0x00666340, 00001, "", "" ), + new TSymLookupEntry( 0x006663e0, 00001, "", "" ), + new TSymLookupEntry( 0x00666498, 00001, "", "" ), + new TSymLookupEntry( 0x00666510, 00001, "", "" ), + new TSymLookupEntry( 0x00666630, 00001, "", "" ), + new TSymLookupEntry( 0x00666970, 00007, "", "" ), + new TSymLookupEntry( 0x00666fd8, 00001, "", "" ), + new TSymLookupEntry( 0x00667000, 00003, "", "" ), + new TSymLookupEntry( 0x00667078, 00001, "", "" ), + new TSymLookupEntry( 0x00669cd8, 00001, "", "" ), + new TSymLookupEntry( 0x00669f58, 00001, "", "" ), + new TSymLookupEntry( 0x0066a4a8, 00001, "", "" ), + new TSymLookupEntry( 0x0066a5fc, 00001, "", "" ), + new TSymLookupEntry( 0x0066a9f8, 00001, "", "" ), + new TSymLookupEntry( 0x0066aac8, 00003, "", "" ), + new TSymLookupEntry( 0x0066b318, 00001, "", "" ), + new TSymLookupEntry( 0x0066c1e0, 00001, "", "" ), + new TSymLookupEntry( 0x0066de28, 00001, "", "" ), + new TSymLookupEntry( 0x0066e148, 00001, "", "" ), + new TSymLookupEntry( 0x0066e8f0, 00001, "", "" ), + new TSymLookupEntry( 0x0066eb70, 00001, "", "" ), + new TSymLookupEntry( 0x0066f4a0, 00001, "", "" ), + new TSymLookupEntry( 0x0066f4f0, 00001, "", "" ), + new TSymLookupEntry( 0x0066f540, 00001, "", "" ), + new TSymLookupEntry( 0x0066f600, 00001, "", "" ), + new TSymLookupEntry( 0x0066f6b8, 00001, "", "" ), + new TSymLookupEntry( 0x0066f700, 00001, "", "" ), + new TSymLookupEntry( 0x0066f778, 00001, "", "" ), + new TSymLookupEntry( 0x0066f7d8, 00001, "", "" ), + new TSymLookupEntry( 0x00670024, 00001, "", "" ), + new TSymLookupEntry( 0x00670062, 00003, "", "" ), + new TSymLookupEntry( 0x00670068, 00001, "", "" ), + new TSymLookupEntry( 0x00670069, 00003, "", "" ), + new TSymLookupEntry( 0x006703e0, 00001, "", "" ), + new TSymLookupEntry( 0x00670440, 00010, "", "" ), + new TSymLookupEntry( 0x00670570, 00001, "", "" ), + new TSymLookupEntry( 0x00670858, 00001, "", "" ), + new TSymLookupEntry( 0x00670d00, 00007, "", "" ), + new TSymLookupEntry( 0x00671f08, 00001, "", "" ), + new TSymLookupEntry( 0x00671fd0, 00001, "", "" ), + new TSymLookupEntry( 0x00672140, 00007, "", "" ), + new TSymLookupEntry( 0x00672190, 00001, "", "" ), + new TSymLookupEntry( 0x006721e0, 00001, "", "" ), + new TSymLookupEntry( 0x00672208, 00003, "", "" ), + new TSymLookupEntry( 0x00672280, 00001, "", "" ), + new TSymLookupEntry( 0x00672a08, 00001, "", "" ), + new TSymLookupEntry( 0x00672a58, 00001, "", "" ), + new TSymLookupEntry( 0x00672aa8, 00001, "", "" ), + new TSymLookupEntry( 0x00672af8, 00001, "", "" ), + new TSymLookupEntry( 0x00672b48, 00001, "", "" ), + new TSymLookupEntry( 0x00672b98, 00001, "", "" ), + new TSymLookupEntry( 0x00672bc8, 00001, "", "" ), + new TSymLookupEntry( 0x00672d80, 00001, "", "" ), + new TSymLookupEntry( 0x006732e0, 00001, "", "" ), + new TSymLookupEntry( 0x00673e78, 00001, "", "" ), + new TSymLookupEntry( 0x00673ef8, 00001, "", "" ), + new TSymLookupEntry( 0x00673ff8, 00001, "", "" ), + new TSymLookupEntry( 0x00674058, 00001, "", "" ), + new TSymLookupEntry( 0x006740f8, 00001, "", "" ), + new TSymLookupEntry( 0x006742d8, 00001, "", "" ), + new TSymLookupEntry( 0x00674328, 00001, "", "" ), + new TSymLookupEntry( 0x00674378, 00001, "", "" ), + new TSymLookupEntry( 0x006743c8, 00001, "", "" ), + new TSymLookupEntry( 0x00674418, 00001, "", "" ), + new TSymLookupEntry( 0x00674468, 00001, "", "" ), + new TSymLookupEntry( 0x006744b8, 00001, "", "" ), + new TSymLookupEntry( 0x00674508, 00001, "", "" ), + new TSymLookupEntry( 0x00674558, 00001, "", "" ), + new TSymLookupEntry( 0x006745a8, 00001, "", "" ), + new TSymLookupEntry( 0x006745f8, 00001, "", "" ), + new TSymLookupEntry( 0x00674648, 00001, "", "" ), + new TSymLookupEntry( 0x006746c0, 00001, "", "" ), + new TSymLookupEntry( 0x00674710, 00001, "", "" ), + new TSymLookupEntry( 0x00674760, 00001, "", "" ), + new TSymLookupEntry( 0x00674800, 00001, "", "" ), + new TSymLookupEntry( 0x00674868, 00001, "", "" ), + new TSymLookupEntry( 0x00676b40, 00002, "", "" ), + new TSymLookupEntry( 0x0067bf20, 00001, "", "" ), + new TSymLookupEntry( 0x0067bf70, 00001, "", "" ), + new TSymLookupEntry( 0x0067bfc0, 00001, "", "" ), + new TSymLookupEntry( 0x0067c010, 00001, "", "" ), + new TSymLookupEntry( 0x0067c060, 00001, "", "" ), + new TSymLookupEntry( 0x0067c0b0, 00001, "", "" ), + new TSymLookupEntry( 0x0067c128, 00001, "", "" ), + new TSymLookupEntry( 0x0067c1a0, 00001, "", "" ), + new TSymLookupEntry( 0x0067c218, 00001, "", "" ), + new TSymLookupEntry( 0x0067c298, 00001, "", "" ), + new TSymLookupEntry( 0x0067c310, 00001, "", "" ), + new TSymLookupEntry( 0x0067c808, 00001, "", "" ), + new TSymLookupEntry( 0x0067c858, 00001, "", "" ), + new TSymLookupEntry( 0x0067c920, 00001, "", "" ), + new TSymLookupEntry( 0x0067c970, 00001, "", "" ), + new TSymLookupEntry( 0x0067c9c0, 00001, "", "" ), + new TSymLookupEntry( 0x0067cad8, 00001, "", "" ), + new TSymLookupEntry( 0x0067cd08, 00001, "", "" ), + new TSymLookupEntry( 0x0067ce18, 00003, "", "" ), + new TSymLookupEntry( 0x0067ceb8, 00001, "", "" ), + new TSymLookupEntry( 0x0067cf08, 00002, "", "" ), + new TSymLookupEntry( 0x0067cf30, 00001, "", "" ), + new TSymLookupEntry( 0x0067d030, 00001, "", "" ), + new TSymLookupEntry( 0x0067d0c8, 00001, "", "" ), + new TSymLookupEntry( 0x0067d208, 00010, "", "" ), + new TSymLookupEntry( 0x0067d3e0, 00002, "", "" ), + new TSymLookupEntry( 0x0067d488, 00001, "", "" ), + new TSymLookupEntry( 0x0067d738, 00001, "", "" ), + new TSymLookupEntry( 0x0067d788, 00039, "", "" ), + new TSymLookupEntry( 0x0067d8a0, 00003, "", "" ), + new TSymLookupEntry( 0x0067d948, 00002, "", "" ), + new TSymLookupEntry( 0x0067daf8, 00001, "", "" ), + new TSymLookupEntry( 0x0067db40, 00002, "", "" ), + new TSymLookupEntry( 0x0067dc98, 00001, "", "" ), + new TSymLookupEntry( 0x0067de80, 00001, "", "" ), + new TSymLookupEntry( 0x0067e018, 00001, "", "" ), + new TSymLookupEntry( 0x0067e130, 00001, "", "" ), + new TSymLookupEntry( 0x0067e760, 00005, "", "" ), + new TSymLookupEntry( 0x0067e8d8, 00001, "", "" ), + new TSymLookupEntry( 0x0067ebc8, 00005, "", "" ), + new TSymLookupEntry( 0x0067ee20, 00015, "", "" ), + new TSymLookupEntry( 0x0067f098, 00001, "", "" ), + new TSymLookupEntry( 0x0067f6a0, 00001, "", "" ), + new TSymLookupEntry( 0x00680031, 00001, "", "" ), + new TSymLookupEntry( 0x0068003a, 00003, "", "" ), + new TSymLookupEntry( 0x0068003c, 00001, "", "" ), + new TSymLookupEntry( 0x00680043, 00009, "", "" ), + new TSymLookupEntry( 0x00680054, 00001, "", "" ), + new TSymLookupEntry( 0x00680063, 00032, "", "" ), + new TSymLookupEntry( 0x00680067, 00001, "", "" ), + new TSymLookupEntry( 0x00680068, 00001, "", "" ), + new TSymLookupEntry( 0x00680069, 00001, "", "" ), + new TSymLookupEntry( 0x0068006d, 00001, "", "" ), + new TSymLookupEntry( 0x0068006f, 00001, "", "" ), + new TSymLookupEntry( 0x00680073, 00022, "", "" ), + new TSymLookupEntry( 0x00680074, 00003, "", "" ), + new TSymLookupEntry( 0x00680077, 00001, "", "" ), + new TSymLookupEntry( 0x00680078, 00002, "", "" ), + new TSymLookupEntry( 0x006806c8, 00001, "", "" ), + new TSymLookupEntry( 0x00680788, 00001, "", "" ), + new TSymLookupEntry( 0x00680810, 00001, "", "" ), + new TSymLookupEntry( 0x006808d8, 00001, "", "" ), + new TSymLookupEntry( 0x00680a38, 00002, "", "" ), + new TSymLookupEntry( 0x00685f70, 00001, "", "" ), + new TSymLookupEntry( 0x00686030, 00001, "", "" ), + new TSymLookupEntry( 0x00686058, 00001, "", "" ), + new TSymLookupEntry( 0x00686350, 00001, "", "" ), + new TSymLookupEntry( 0x00686378, 00001, "", "" ), + new TSymLookupEntry( 0x006865b0, 00001, "", "" ), + new TSymLookupEntry( 0x006865d8, 00001, "", "" ), + new TSymLookupEntry( 0x00686600, 00001, "", "" ), + new TSymLookupEntry( 0x00686628, 00001, "", "" ), + new TSymLookupEntry( 0x00686650, 00001, "", "" ), + new TSymLookupEntry( 0x00686678, 00001, "", "" ), + new TSymLookupEntry( 0x006866a0, 00001, "", "" ), + new TSymLookupEntry( 0x00686888, 00001, "", "" ), + new TSymLookupEntry( 0x006868b0, 00001, "", "" ), + new TSymLookupEntry( 0x006868d8, 00001, "", "" ), + new TSymLookupEntry( 0x00686900, 00001, "", "" ), + new TSymLookupEntry( 0x00686928, 00001, "", "" ), + new TSymLookupEntry( 0x00686ae8, 00001, "", "" ), + new TSymLookupEntry( 0x00686b10, 00001, "", "" ), + new TSymLookupEntry( 0x00686b38, 00001, "", "" ), + new TSymLookupEntry( 0x00686b60, 00001, "", "" ), + new TSymLookupEntry( 0x00686b88, 00001, "", "" ), + new TSymLookupEntry( 0x00686bb0, 00001, "", "" ), + new TSymLookupEntry( 0x00686bd8, 00001, "", "" ), + new TSymLookupEntry( 0x00686f38, 00001, "", "" ), + new TSymLookupEntry( 0x00686f60, 00001, "", "" ), + new TSymLookupEntry( 0x00686f88, 00001, "", "" ), + new TSymLookupEntry( 0x00687050, 00001, "", "" ), + new TSymLookupEntry( 0x00687078, 00001, "", "" ), + new TSymLookupEntry( 0x006871e0, 00001, "", "" ), + new TSymLookupEntry( 0x00687208, 00001, "", "" ), + new TSymLookupEntry( 0x00687230, 00001, "", "" ), + new TSymLookupEntry( 0x00687258, 00001, "", "" ), + new TSymLookupEntry( 0x00687280, 00001, "", "" ), + new TSymLookupEntry( 0x006872a8, 00001, "", "" ), + new TSymLookupEntry( 0x006872d0, 00001, "", "" ), + new TSymLookupEntry( 0x00687558, 00001, "", "" ), + new TSymLookupEntry( 0x00687580, 00001, "", "" ), + new TSymLookupEntry( 0x006875a8, 00001, "", "" ), + new TSymLookupEntry( 0x006875d0, 00001, "", "" ), + new TSymLookupEntry( 0x00687698, 00001, "", "" ), + new TSymLookupEntry( 0x006876c0, 00001, "", "" ), + new TSymLookupEntry( 0x006876e8, 00001, "", "" ), + new TSymLookupEntry( 0x00687710, 00001, "", "" ), + new TSymLookupEntry( 0x00687738, 00001, "", "" ), + new TSymLookupEntry( 0x00687760, 00001, "", "" ), + new TSymLookupEntry( 0x00687788, 00001, "", "" ), + new TSymLookupEntry( 0x00687a88, 00001, "", "" ), + new TSymLookupEntry( 0x00687ae8, 00001, "", "" ), + new TSymLookupEntry( 0x00687b28, 00001, "", "" ), + new TSymLookupEntry( 0x00687b50, 00001, "", "" ), + new TSymLookupEntry( 0x00687b78, 00001, "", "" ), + new TSymLookupEntry( 0x00687ba0, 00001, "", "" ), + new TSymLookupEntry( 0x00687bc8, 00001, "", "" ), + new TSymLookupEntry( 0x00687bf0, 00001, "", "" ), + new TSymLookupEntry( 0x00687c18, 00001, "", "" ), + new TSymLookupEntry( 0x00687c40, 00001, "", "" ), + new TSymLookupEntry( 0x00687c68, 00001, "", "" ), + new TSymLookupEntry( 0x00687d30, 00001, "", "" ), + new TSymLookupEntry( 0x00687ef8, 00001, "", "" ), + new TSymLookupEntry( 0x00688088, 00001, "", "" ), + new TSymLookupEntry( 0x00688218, 00001, "", "" ), + new TSymLookupEntry( 0x00688240, 00001, "", "" ), + new TSymLookupEntry( 0x00688268, 00001, "", "" ), + new TSymLookupEntry( 0x006884c8, 00001, "", "" ), + new TSymLookupEntry( 0x006884f0, 00001, "", "" ), + new TSymLookupEntry( 0x00688518, 00001, "", "" ), + new TSymLookupEntry( 0x00688540, 00001, "", "" ), + new TSymLookupEntry( 0x006887d8, 00001, "", "" ), + new TSymLookupEntry( 0x00688800, 00001, "", "" ), + new TSymLookupEntry( 0x00688c48, 00001, "", "" ), + new TSymLookupEntry( 0x00688c70, 00001, "", "" ), + new TSymLookupEntry( 0x00688fc0, 00001, "", "" ), + new TSymLookupEntry( 0x00688fe8, 00001, "", "" ), + new TSymLookupEntry( 0x00689408, 00001, "", "" ), + new TSymLookupEntry( 0x00689430, 00001, "", "" ), + new TSymLookupEntry( 0x00689458, 00001, "", "" ), + new TSymLookupEntry( 0x006895c8, 00001, "", "" ), + new TSymLookupEntry( 0x00689630, 00001, "", "" ), + new TSymLookupEntry( 0x00689658, 00001, "", "" ), + new TSymLookupEntry( 0x00689680, 00001, "", "" ), + new TSymLookupEntry( 0x006896a8, 00001, "", "" ), + new TSymLookupEntry( 0x006896d0, 00001, "", "" ), + new TSymLookupEntry( 0x00689b48, 00001, "", "" ), + new TSymLookupEntry( 0x00689b70, 00001, "", "" ), + new TSymLookupEntry( 0x00689b98, 00001, "", "" ), + new TSymLookupEntry( 0x00689bc0, 00001, "", "" ), + new TSymLookupEntry( 0x00689d08, 00001, "", "" ), + new TSymLookupEntry( 0x00689d30, 00001, "", "" ), + new TSymLookupEntry( 0x00689df8, 00001, "", "" ), + new TSymLookupEntry( 0x00689e20, 00001, "", "" ), + new TSymLookupEntry( 0x00689e48, 00001, "", "" ), + new TSymLookupEntry( 0x00689e70, 00001, "", "" ), + new TSymLookupEntry( 0x00689e98, 00001, "", "" ), + new TSymLookupEntry( 0x00689ec0, 00001, "", "" ), + new TSymLookupEntry( 0x00689ee8, 00001, "", "" ), + new TSymLookupEntry( 0x00689f10, 00001, "", "" ), + new TSymLookupEntry( 0x00689f38, 00001, "", "" ), + new TSymLookupEntry( 0x00689f60, 00001, "", "" ), + new TSymLookupEntry( 0x00689f88, 00001, "", "" ), + new TSymLookupEntry( 0x00689fb0, 00001, "", "" ), + new TSymLookupEntry( 0x00689fd8, 00001, "", "" ), + new TSymLookupEntry( 0x0068a000, 00001, "", "" ), + new TSymLookupEntry( 0x0068a028, 00001, "", "" ), + new TSymLookupEntry( 0x0068a050, 00001, "", "" ), + new TSymLookupEntry( 0x0068a078, 00001, "", "" ), + new TSymLookupEntry( 0x0068a140, 00001, "", "" ), + new TSymLookupEntry( 0x0068a168, 00001, "", "" ), + new TSymLookupEntry( 0x0068a190, 00001, "", "" ), + new TSymLookupEntry( 0x0068a1b8, 00001, "", "" ), + new TSymLookupEntry( 0x0068a1e0, 00001, "", "" ), + new TSymLookupEntry( 0x0068a208, 00001, "", "" ), + new TSymLookupEntry( 0x0068a230, 00001, "", "" ), + new TSymLookupEntry( 0x0068a588, 00001, "", "" ), + new TSymLookupEntry( 0x0068a5b0, 00001, "", "" ), + new TSymLookupEntry( 0x0068a5d8, 00001, "", "" ), + new TSymLookupEntry( 0x0068a600, 00001, "", "" ), + new TSymLookupEntry( 0x0068a6c8, 00001, "", "" ), + new TSymLookupEntry( 0x0068a790, 00001, "", "" ), + new TSymLookupEntry( 0x0068a7b8, 00001, "", "" ), + new TSymLookupEntry( 0x0068a7e0, 00001, "", "" ), + new TSymLookupEntry( 0x0068a808, 00001, "", "" ), + new TSymLookupEntry( 0x0068a830, 00001, "", "" ), + new TSymLookupEntry( 0x0068a858, 00001, "", "" ), + new TSymLookupEntry( 0x0068a880, 00001, "", "" ), + new TSymLookupEntry( 0x0068ab38, 00001, "", "" ), + new TSymLookupEntry( 0x0068ab60, 00001, "", "" ), + new TSymLookupEntry( 0x0068ab88, 00001, "", "" ), + new TSymLookupEntry( 0x0068aea0, 00013, "", "" ), + new TSymLookupEntry( 0x0068b078, 00002, "", "" ), + new TSymLookupEntry( 0x0068b2e0, 00001, "", "" ), + new TSymLookupEntry( 0x0068b608, 00001, "", "" ), + new TSymLookupEntry( 0x0068b820, 00001, "", "" ), + new TSymLookupEntry( 0x0068bc58, 00005, "", "" ), + new TSymLookupEntry( 0x0068bec8, 00004, "", "" ), + new TSymLookupEntry( 0x0068c000, 00003, "", "" ), + new TSymLookupEntry( 0x0068c0a0, 00001, "", "" ), + new TSymLookupEntry( 0x0068c258, 00001, "", "" ), + new TSymLookupEntry( 0x0068c468, 00001, "", "" ), + new TSymLookupEntry( 0x0068c650, 00001, "", "" ), + new TSymLookupEntry( 0x0068c678, 00001, "", "" ), + new TSymLookupEntry( 0x0068ca30, 00001, "", "" ), + new TSymLookupEntry( 0x0068cc90, 00002, "", "" ), + new TSymLookupEntry( 0x0068cd38, 00001, "", "" ), + new TSymLookupEntry( 0x0068cde0, 00001, "", "" ), + new TSymLookupEntry( 0x0068ce78, 00003, "", "" ), + new TSymLookupEntry( 0x0068cf90, 00002, "", "" ), + new TSymLookupEntry( 0x0068d050, 00001, "", "" ), + new TSymLookupEntry( 0x0068d118, 00001, "", "" ), + new TSymLookupEntry( 0x0068d300, 00001, "", "" ), + new TSymLookupEntry( 0x0068d4f8, 00001, "", "" ), + new TSymLookupEntry( 0x0068d620, 00001, "", "" ), + new TSymLookupEntry( 0x0068d760, 00001, "", "" ), + new TSymLookupEntry( 0x0068d850, 00001, "", "" ), + new TSymLookupEntry( 0x0068d8f8, 00001, "", "" ), + new TSymLookupEntry( 0x0068d9b8, 00001, "", "" ), + new TSymLookupEntry( 0x0068da18, 00001, "", "" ), + new TSymLookupEntry( 0x0068dc20, 00001, "", "" ), + new TSymLookupEntry( 0x0068dca8, 00001, "", "" ), + new TSymLookupEntry( 0x0068dd20, 00004, "", "" ), + new TSymLookupEntry( 0x0068ddc8, 00008, "", "" ), + new TSymLookupEntry( 0x0068e200, 00001, "", "" ), + new TSymLookupEntry( 0x0068e270, 00001, "", "" ), + new TSymLookupEntry( 0x0068e2e8, 00001, "", "" ), + new TSymLookupEntry( 0x0068e338, 00013, "", "" ), + new TSymLookupEntry( 0x0068e880, 00001, "", "" ), + new TSymLookupEntry( 0x0068f0c0, 00004, "", "" ), + new TSymLookupEntry( 0x0068f4d0, 00001, "", "" ), + new TSymLookupEntry( 0x0068f658, 00001, "", "" ), + new TSymLookupEntry( 0x0068fb10, 00009, "", "" ), + new TSymLookupEntry( 0x0068fcc0, 00001, "", "" ), + new TSymLookupEntry( 0x0069002a, 00002, "", "" ), + new TSymLookupEntry( 0x0069002e, 00004, "", "" ), + new TSymLookupEntry( 0x0069003c, 00001, "", "" ), + new TSymLookupEntry( 0x00690046, 00002, "", "" ), + new TSymLookupEntry( 0x00690048, 00002, "", "" ), + new TSymLookupEntry( 0x0069004d, 00001, "", "" ), + new TSymLookupEntry( 0x00690052, 00002, "", "" ), + new TSymLookupEntry( 0x00690053, 00002, "", "" ), + new TSymLookupEntry( 0x00690056, 00003, "", "" ), + new TSymLookupEntry( 0x00690057, 00007, "", "" ), + new TSymLookupEntry( 0x0069005e, 00001, "", "" ), + new TSymLookupEntry( 0x00690062, 00008, "", "" ), + new TSymLookupEntry( 0x00690063, 00001, "", "" ), + new TSymLookupEntry( 0x00690064, 00033, "", "" ), + new TSymLookupEntry( 0x00690066, 00109, "", "" ), + new TSymLookupEntry( 0x00690068, 00020, "", "" ), + new TSymLookupEntry( 0x0069006c, 00013, "", "" ), + new TSymLookupEntry( 0x0069006d, 00019, "", "" ), + new TSymLookupEntry( 0x0069006e, 00001, "", "" ), + new TSymLookupEntry( 0x0069006f, 00001, "", "" ), + new TSymLookupEntry( 0x00690070, 00001, "", "" ), + new TSymLookupEntry( 0x00690072, 00001, "", "" ), + new TSymLookupEntry( 0x00690073, 00004, "", "" ), + new TSymLookupEntry( 0x00690074, 00015, "", "" ), + new TSymLookupEntry( 0x00690076, 00011, "", "" ), + new TSymLookupEntry( 0x00690077, 00015, "", "" ), + new TSymLookupEntry( 0x00690078, 00002, "", "" ), + new TSymLookupEntry( 0x00690079, 00001, "", "" ), + new TSymLookupEntry( 0x0069007a, 00001, "", "" ), + new TSymLookupEntry( 0x006904f0, 00001, "", "" ), + new TSymLookupEntry( 0x006906f8, 00001, "", "" ), + new TSymLookupEntry( 0x00690ba0, 00025, "", "" ), + new TSymLookupEntry( 0x00691260, 00004, "", "" ), + new TSymLookupEntry( 0x00691810, 00004, "", "" ), + new TSymLookupEntry( 0x00692048, 00001, "", "" ), + new TSymLookupEntry( 0x00692110, 00003, "", "" ), + new TSymLookupEntry( 0x006922d8, 00001, "", "" ), + new TSymLookupEntry( 0x00692478, 00004, "", "" ), + new TSymLookupEntry( 0x00692b40, 00007, "", "" ), + new TSymLookupEntry( 0x00692e30, 00003, "", "" ), + new TSymLookupEntry( 0x00693510, 00001, "", "" ), + new TSymLookupEntry( 0x00693710, 00004, "", "" ), + new TSymLookupEntry( 0x006937d8, 00004, "", "" ), + new TSymLookupEntry( 0x00693be0, 00004, "", "" ), + new TSymLookupEntry( 0x00693ca8, 00004, "", "" ), + new TSymLookupEntry( 0x00693da0, 00001, "", "" ), + new TSymLookupEntry( 0x006947b8, 00001, "", "" ), + new TSymLookupEntry( 0x006947e0, 00001, "", "" ), + new TSymLookupEntry( 0x00694808, 00001, "", "" ), + new TSymLookupEntry( 0x00694830, 00001, "", "" ), + new TSymLookupEntry( 0x00694858, 00001, "", "" ), + new TSymLookupEntry( 0x00694880, 00001, "", "" ), + new TSymLookupEntry( 0x006948a8, 00001, "", "" ), + new TSymLookupEntry( 0x006948d0, 00001, "", "" ), + new TSymLookupEntry( 0x00694a70, 00001, "", "" ), + new TSymLookupEntry( 0x00695448, 00001, "", "" ), + new TSymLookupEntry( 0x00695c08, 00001, "", "" ), + new TSymLookupEntry( 0x006960f0, 00001, "", "" ), + new TSymLookupEntry( 0x006962d0, 00001, "", "" ), + new TSymLookupEntry( 0x006968e0, 00001, "", "" ), + new TSymLookupEntry( 0x00697110, 00002, "", "" ), + new TSymLookupEntry( 0x00697768, 00001, "", "" ), + new TSymLookupEntry( 0x00697790, 00001, "", "" ), + new TSymLookupEntry( 0x006977b8, 00001, "", "" ), + new TSymLookupEntry( 0x006977e0, 00001, "", "" ), + new TSymLookupEntry( 0x00697830, 00001, "", "" ), + new TSymLookupEntry( 0x006978a8, 00001, "", "" ), + new TSymLookupEntry( 0x006978f8, 00001, "", "" ), + new TSymLookupEntry( 0x00697ae8, 00001, "", "" ), + new TSymLookupEntry( 0x0069a130, 00001, "", "" ), + new TSymLookupEntry( 0x0069a1d0, 00001, "", "" ), + new TSymLookupEntry( 0x0069a580, 00003, "", "" ), + new TSymLookupEntry( 0x0069a888, 00001, "", "" ), + new TSymLookupEntry( 0x0069aa70, 00015, "", "" ), + new TSymLookupEntry( 0x0069aac8, 00001, "", "" ), + new TSymLookupEntry( 0x0069cb28, 00001, "", "" ), + new TSymLookupEntry( 0x0069cc78, 00001, "", "" ), + new TSymLookupEntry( 0x0069cca0, 00001, "", "" ), + new TSymLookupEntry( 0x0069ccc8, 00001, "", "" ), + new TSymLookupEntry( 0x0069ccf0, 00001, "", "" ), + new TSymLookupEntry( 0x0069cd18, 00001, "", "" ), + new TSymLookupEntry( 0x0069cd40, 00001, "", "" ), + new TSymLookupEntry( 0x0069cd68, 00001, "", "" ), + new TSymLookupEntry( 0x0069ce88, 00001, "", "" ), + new TSymLookupEntry( 0x0069ceb0, 00001, "", "" ), + new TSymLookupEntry( 0x0069ced8, 00001, "", "" ), + new TSymLookupEntry( 0x0069cf00, 00001, "", "" ), + new TSymLookupEntry( 0x0069cf28, 00001, "", "" ), + new TSymLookupEntry( 0x0069cf50, 00001, "", "" ), + new TSymLookupEntry( 0x0069cf78, 00001, "", "" ), + new TSymLookupEntry( 0x0069cfa0, 00001, "", "" ), + new TSymLookupEntry( 0x0069d2b8, 00001, "", "" ), + new TSymLookupEntry( 0x0069d380, 00001, "", "" ), + new TSymLookupEntry( 0x0069d568, 00001, "", "" ), + new TSymLookupEntry( 0x0069d630, 00001, "", "" ), + new TSymLookupEntry( 0x0069d818, 00001, "", "" ), + new TSymLookupEntry( 0x0069d8e0, 00001, "", "" ), + new TSymLookupEntry( 0x0069d908, 00001, "", "" ), + new TSymLookupEntry( 0x0069d930, 00001, "", "" ), + new TSymLookupEntry( 0x0069d958, 00001, "", "" ), + new TSymLookupEntry( 0x0069d980, 00001, "", "" ), + new TSymLookupEntry( 0x0069d9a8, 00001, "", "" ), + new TSymLookupEntry( 0x0069d9d0, 00001, "", "" ), + new TSymLookupEntry( 0x0069de60, 00001, "", "" ), + new TSymLookupEntry( 0x0069de88, 00001, "", "" ), + new TSymLookupEntry( 0x0069deb0, 00001, "", "" ), + new TSymLookupEntry( 0x0069ded8, 00001, "", "" ), + new TSymLookupEntry( 0x0069df00, 00001, "", "" ), + new TSymLookupEntry( 0x0069df28, 00001, "", "" ), + new TSymLookupEntry( 0x0069df50, 00001, "", "" ), + new TSymLookupEntry( 0x0069df78, 00001, "", "" ), + new TSymLookupEntry( 0x0069dfa0, 00001, "", "" ), + new TSymLookupEntry( 0x0069dfc8, 00001, "", "" ), + new TSymLookupEntry( 0x0069e000, 00001, "", "" ), + new TSymLookupEntry( 0x0069e028, 00001, "", "" ), + new TSymLookupEntry( 0x0069e050, 00001, "", "" ), + new TSymLookupEntry( 0x0069e0f0, 00001, "", "" ), + new TSymLookupEntry( 0x0069e118, 00001, "", "" ), + new TSymLookupEntry( 0x0069e140, 00001, "", "" ), + new TSymLookupEntry( 0x0069e2d8, 00001, "", "" ), + new TSymLookupEntry( 0x0069e300, 00001, "", "" ), + new TSymLookupEntry( 0x0069e328, 00001, "", "" ), + new TSymLookupEntry( 0x0069e350, 00001, "", "" ), + new TSymLookupEntry( 0x0069e378, 00001, "", "" ), + new TSymLookupEntry( 0x0069e3a0, 00001, "", "" ), + new TSymLookupEntry( 0x0069e3c8, 00001, "", "" ), + new TSymLookupEntry( 0x0069e690, 00001, "", "" ), + new TSymLookupEntry( 0x0069e6b8, 00001, "", "" ), + new TSymLookupEntry( 0x0069e6e0, 00001, "", "" ), + new TSymLookupEntry( 0x0069e7d0, 00001, "", "" ), + new TSymLookupEntry( 0x0069e7f8, 00001, "", "" ), + new TSymLookupEntry( 0x0069e8c0, 00001, "", "" ), + new TSymLookupEntry( 0x0069e8e8, 00001, "", "" ), + new TSymLookupEntry( 0x0069eb70, 00001, "", "" ), + new TSymLookupEntry( 0x0069eb98, 00001, "", "" ), + new TSymLookupEntry( 0x0069ebc0, 00001, "", "" ), + new TSymLookupEntry( 0x0069ebe8, 00001, "", "" ), + new TSymLookupEntry( 0x0069ee98, 00001, "", "" ), + new TSymLookupEntry( 0x0069eec0, 00001, "", "" ), + new TSymLookupEntry( 0x0069eee8, 00001, "", "" ), + new TSymLookupEntry( 0x0069f188, 00001, "", "" ), + new TSymLookupEntry( 0x0069f1b0, 00001, "", "" ), + new TSymLookupEntry( 0x0069f1d8, 00001, "", "" ), + new TSymLookupEntry( 0x0069f200, 00001, "", "" ), + new TSymLookupEntry( 0x0069f438, 00001, "", "" ), + new TSymLookupEntry( 0x0069f460, 00001, "", "" ), + new TSymLookupEntry( 0x0069f488, 00001, "", "" ), + new TSymLookupEntry( 0x0069f4b0, 00001, "", "" ), + new TSymLookupEntry( 0x0069f670, 00001, "", "" ), + new TSymLookupEntry( 0x0069f698, 00001, "", "" ), + new TSymLookupEntry( 0x0069f6c0, 00001, "", "" ), + new TSymLookupEntry( 0x0069f6e8, 00001, "", "" ), + new TSymLookupEntry( 0x0069f710, 00001, "", "" ), + new TSymLookupEntry( 0x0069f738, 00001, "", "" ), + new TSymLookupEntry( 0x0069f760, 00001, "", "" ), + new TSymLookupEntry( 0x0069f7e0, 00001, "", "" ), + new TSymLookupEntry( 0x0069fa60, 00001, "", "" ), + new TSymLookupEntry( 0x0069fa88, 00001, "", "" ), + new TSymLookupEntry( 0x0069fab0, 00001, "", "" ), + new TSymLookupEntry( 0x0069fad8, 00001, "", "" ), + new TSymLookupEntry( 0x0069fe90, 00001, "", "" ), + new TSymLookupEntry( 0x0069ff58, 00001, "", "" ), + new TSymLookupEntry( 0x0069ff80, 00001, "", "" ), + new TSymLookupEntry( 0x0069ffa8, 00001, "", "" ), + new TSymLookupEntry( 0x0069ffd0, 00001, "", "" ), + new TSymLookupEntry( 0x0069fff8, 00001, "", "" ), + new TSymLookupEntry( 0x006a0001, 00004, "", "" ), + new TSymLookupEntry( 0x006a0020, 00001, "", "" ), + new TSymLookupEntry( 0x006a0048, 00001, "", "" ), + new TSymLookupEntry( 0x006a005f, 00001, "", "" ), + new TSymLookupEntry( 0x006a0061, 00013, "", "" ), + new TSymLookupEntry( 0x006a0470, 00001, "", "" ), + new TSymLookupEntry( 0x006a0498, 00001, "", "" ), + new TSymLookupEntry( 0x006a04e8, 00001, "", "" ), + new TSymLookupEntry( 0x006a0510, 00001, "", "" ), + new TSymLookupEntry( 0x006a0538, 00001, "", "" ), + new TSymLookupEntry( 0x006a06b0, 00001, "", "" ), + new TSymLookupEntry( 0x006a06d8, 00001, "", "" ), + new TSymLookupEntry( 0x006a0700, 00001, "", "" ), + new TSymLookupEntry( 0x006a0728, 00001, "", "" ), + new TSymLookupEntry( 0x006a0750, 00001, "", "" ), + new TSymLookupEntry( 0x006a0778, 00001, "", "" ), + new TSymLookupEntry( 0x006a07a0, 00001, "", "" ), + new TSymLookupEntry( 0x006a09d8, 00001, "", "" ), + new TSymLookupEntry( 0x006a0a00, 00001, "", "" ), + new TSymLookupEntry( 0x006a0a50, 00001, "", "" ), + new TSymLookupEntry( 0x006a0a78, 00001, "", "" ), + new TSymLookupEntry( 0x006a0c18, 00001, "", "" ), + new TSymLookupEntry( 0x006a0c40, 00001, "", "" ), + new TSymLookupEntry( 0x006a0c68, 00001, "", "" ), + new TSymLookupEntry( 0x006a0c90, 00001, "", "" ), + new TSymLookupEntry( 0x006a0cb8, 00001, "", "" ), + new TSymLookupEntry( 0x006a0ce0, 00001, "", "" ), + new TSymLookupEntry( 0x006a0da8, 00001, "", "" ), + new TSymLookupEntry( 0x006a0dd0, 00001, "", "" ), + new TSymLookupEntry( 0x006a0df8, 00001, "", "" ), + new TSymLookupEntry( 0x006a0e20, 00001, "", "" ), + new TSymLookupEntry( 0x006a0e48, 00001, "", "" ), + new TSymLookupEntry( 0x006a0e70, 00001, "", "" ), + new TSymLookupEntry( 0x006a0e98, 00001, "", "" ), + new TSymLookupEntry( 0x006a11b8, 00001, "", "" ), + new TSymLookupEntry( 0x006a11e0, 00001, "", "" ), + new TSymLookupEntry( 0x006a1208, 00001, "", "" ), + new TSymLookupEntry( 0x006a1388, 00001, "", "" ), + new TSymLookupEntry( 0x006a13b0, 00001, "", "" ), + new TSymLookupEntry( 0x006a13d8, 00001, "", "" ), + new TSymLookupEntry( 0x006a1400, 00001, "", "" ), + new TSymLookupEntry( 0x006a1428, 00001, "", "" ), + new TSymLookupEntry( 0x006a1450, 00001, "", "" ), + new TSymLookupEntry( 0x006a1478, 00001, "", "" ), + new TSymLookupEntry( 0x006a1700, 00001, "", "" ), + new TSymLookupEntry( 0x006a1728, 00001, "", "" ), + new TSymLookupEntry( 0x006a1750, 00001, "", "" ), + new TSymLookupEntry( 0x006a1830, 00001, "", "" ), + new TSymLookupEntry( 0x006a18f8, 00001, "", "" ), + new TSymLookupEntry( 0x006a1920, 00001, "", "" ), + new TSymLookupEntry( 0x006a1948, 00001, "", "" ), + new TSymLookupEntry( 0x006a1970, 00001, "", "" ), + new TSymLookupEntry( 0x006a1998, 00001, "", "" ), + new TSymLookupEntry( 0x006a19c0, 00001, "", "" ), + new TSymLookupEntry( 0x006a19e8, 00001, "", "" ), + new TSymLookupEntry( 0x006a1c70, 00001, "", "" ), + new TSymLookupEntry( 0x006a1c98, 00001, "", "" ), + new TSymLookupEntry( 0x006a1cc0, 00001, "", "" ), + new TSymLookupEntry( 0x006a1da0, 00001, "", "" ), + new TSymLookupEntry( 0x006a1e68, 00001, "", "" ), + new TSymLookupEntry( 0x006a1e90, 00001, "", "" ), + new TSymLookupEntry( 0x006a1eb8, 00001, "", "" ), + new TSymLookupEntry( 0x006a1ee0, 00001, "", "" ), + new TSymLookupEntry( 0x006a1f08, 00001, "", "" ), + new TSymLookupEntry( 0x006a1f30, 00001, "", "" ), + new TSymLookupEntry( 0x006a2050, 00001, "", "" ), + new TSymLookupEntry( 0x006a2078, 00001, "", "" ), + new TSymLookupEntry( 0x006a20a0, 00001, "", "" ), + new TSymLookupEntry( 0x006a20c8, 00001, "", "" ), + new TSymLookupEntry( 0x006a20f0, 00001, "", "" ), + new TSymLookupEntry( 0x006a2118, 00001, "", "" ), + new TSymLookupEntry( 0x006a2140, 00001, "", "" ), + new TSymLookupEntry( 0x006a2468, 00001, "", "" ), + new TSymLookupEntry( 0x006a2490, 00001, "", "" ), + new TSymLookupEntry( 0x006a24b8, 00001, "", "" ), + new TSymLookupEntry( 0x006a2638, 00001, "", "" ), + new TSymLookupEntry( 0x006a29d8, 00001, "", "" ), + new TSymLookupEntry( 0x006a2a00, 00001, "", "" ), + new TSymLookupEntry( 0x006a2a28, 00001, "", "" ), + new TSymLookupEntry( 0x006a2b08, 00001, "", "" ), + new TSymLookupEntry( 0x006a2b30, 00001, "", "" ), + new TSymLookupEntry( 0x006a2b58, 00001, "", "" ), + new TSymLookupEntry( 0x006a2d80, 00001, "", "" ), + new TSymLookupEntry( 0x006a2da8, 00001, "", "" ), + new TSymLookupEntry( 0x006a2dd0, 00001, "", "" ), + new TSymLookupEntry( 0x006a2df8, 00001, "", "" ), + new TSymLookupEntry( 0x006a2e20, 00001, "", "" ), + new TSymLookupEntry( 0x006a2e48, 00001, "", "" ), + new TSymLookupEntry( 0x006a2e70, 00001, "", "" ), + new TSymLookupEntry( 0x006a2ff0, 00001, "", "" ), + new TSymLookupEntry( 0x006a3018, 00001, "", "" ), + new TSymLookupEntry( 0x006a30f8, 00001, "", "" ), + new TSymLookupEntry( 0x006a3120, 00001, "", "" ), + new TSymLookupEntry( 0x006a31e8, 00001, "", "" ), + new TSymLookupEntry( 0x006a3210, 00001, "", "" ), + new TSymLookupEntry( 0x006a3498, 00001, "", "" ), + new TSymLookupEntry( 0x006a34c0, 00001, "", "" ), + new TSymLookupEntry( 0x006a34e8, 00001, "", "" ), + new TSymLookupEntry( 0x006a3510, 00001, "", "" ), + new TSymLookupEntry( 0x006a3538, 00001, "", "" ), + new TSymLookupEntry( 0x006a3560, 00001, "", "" ), + new TSymLookupEntry( 0x006a36d0, 00001, "", "" ), + new TSymLookupEntry( 0x006a36f8, 00001, "", "" ), + new TSymLookupEntry( 0x006a3720, 00001, "", "" ), + new TSymLookupEntry( 0x006a3748, 00001, "", "" ), + new TSymLookupEntry( 0x006a3770, 00001, "", "" ), + new TSymLookupEntry( 0x006a3798, 00001, "", "" ), + new TSymLookupEntry( 0x006a37c0, 00001, "", "" ), + new TSymLookupEntry( 0x006a3b70, 00001, "", "" ), + new TSymLookupEntry( 0x006a3b98, 00001, "", "" ), + new TSymLookupEntry( 0x006a3be8, 00001, "", "" ), + new TSymLookupEntry( 0x006a3c10, 00001, "", "" ), + new TSymLookupEntry( 0x006a3c38, 00001, "", "" ), + new TSymLookupEntry( 0x006a3db0, 00001, "", "" ), + new TSymLookupEntry( 0x006a3dd8, 00001, "", "" ), + new TSymLookupEntry( 0x006a3e00, 00001, "", "" ), + new TSymLookupEntry( 0x006a3e28, 00001, "", "" ), + new TSymLookupEntry( 0x006a3e50, 00001, "", "" ), + new TSymLookupEntry( 0x006a3e78, 00001, "", "" ), + new TSymLookupEntry( 0x006a3ea0, 00001, "", "" ), + new TSymLookupEntry( 0x006a4330, 00001, "", "" ), + new TSymLookupEntry( 0x006a4358, 00001, "", "" ), + new TSymLookupEntry( 0x006a43c0, 00001, "", "" ), + new TSymLookupEntry( 0x006a43e8, 00001, "", "" ), + new TSymLookupEntry( 0x006a4410, 00001, "", "" ), + new TSymLookupEntry( 0x006a4588, 00001, "", "" ), + new TSymLookupEntry( 0x006a45b0, 00001, "", "" ), + new TSymLookupEntry( 0x006a45d8, 00001, "", "" ), + new TSymLookupEntry( 0x006a4600, 00001, "", "" ), + new TSymLookupEntry( 0x006a4628, 00001, "", "" ), + new TSymLookupEntry( 0x006a4650, 00001, "", "" ), + new TSymLookupEntry( 0x006a4678, 00001, "", "" ), + new TSymLookupEntry( 0x006a49c8, 00001, "", "" ), + new TSymLookupEntry( 0x006a49f0, 00001, "", "" ), + new TSymLookupEntry( 0x006a4a18, 00001, "", "" ), + new TSymLookupEntry( 0x006a4a40, 00001, "", "" ), + new TSymLookupEntry( 0x006a4a68, 00001, "", "" ), + new TSymLookupEntry( 0x006a4a90, 00001, "", "" ), + new TSymLookupEntry( 0x006a4ab8, 00001, "", "" ), + new TSymLookupEntry( 0x006a4d50, 00001, "", "" ), + new TSymLookupEntry( 0x006a4d78, 00001, "", "" ), + new TSymLookupEntry( 0x006a4dc8, 00001, "", "" ), + new TSymLookupEntry( 0x006a4f90, 00001, "", "" ), + new TSymLookupEntry( 0x006a4fb8, 00001, "", "" ), + new TSymLookupEntry( 0x006a4fe0, 00001, "", "" ), + new TSymLookupEntry( 0x006a5008, 00001, "", "" ), + new TSymLookupEntry( 0x006a5030, 00001, "", "" ), + new TSymLookupEntry( 0x006a5058, 00001, "", "" ), + new TSymLookupEntry( 0x006a5080, 00001, "", "" ), + new TSymLookupEntry( 0x006a5528, 00001, "", "" ), + new TSymLookupEntry( 0x006a5590, 00001, "", "" ), + new TSymLookupEntry( 0x006a55b8, 00001, "", "" ), + new TSymLookupEntry( 0x006a55e0, 00001, "", "" ), + new TSymLookupEntry( 0x006a5608, 00001, "", "" ), + new TSymLookupEntry( 0x006a5780, 00001, "", "" ), + new TSymLookupEntry( 0x006a6b30, 00001, "", "" ), + new TSymLookupEntry( 0x006a6b58, 00001, "", "" ), + new TSymLookupEntry( 0x006a6b80, 00001, "", "" ), + new TSymLookupEntry( 0x006a6ba8, 00001, "", "" ), + new TSymLookupEntry( 0x006a6bd0, 00001, "", "" ), + new TSymLookupEntry( 0x006a6bf8, 00001, "", "" ), + new TSymLookupEntry( 0x006a6c20, 00001, "", "" ), + new TSymLookupEntry( 0x006a6d40, 00001, "", "" ), + new TSymLookupEntry( 0x006a6d68, 00001, "", "" ), + new TSymLookupEntry( 0x006a6dc0, 00001, "", "" ), + new TSymLookupEntry( 0x006a6de8, 00001, "", "" ), + new TSymLookupEntry( 0x006a6f88, 00001, "", "" ), + new TSymLookupEntry( 0x006a6fb0, 00001, "", "" ), + new TSymLookupEntry( 0x006a6fd8, 00001, "", "" ), + new TSymLookupEntry( 0x006a7000, 00001, "", "" ), + new TSymLookupEntry( 0x006a7028, 00001, "", "" ), + new TSymLookupEntry( 0x006a7050, 00001, "", "" ), + new TSymLookupEntry( 0x006a7078, 00001, "", "" ), + new TSymLookupEntry( 0x006a74d0, 00001, "", "" ), + new TSymLookupEntry( 0x006a74f8, 00001, "", "" ), + new TSymLookupEntry( 0x006a7550, 00001, "", "" ), + new TSymLookupEntry( 0x006a7578, 00001, "", "" ), + new TSymLookupEntry( 0x006a7718, 00001, "", "" ), + new TSymLookupEntry( 0x006a7740, 00001, "", "" ), + new TSymLookupEntry( 0x006a7768, 00001, "", "" ), + new TSymLookupEntry( 0x006a7790, 00001, "", "" ), + new TSymLookupEntry( 0x006a77b8, 00001, "", "" ), + new TSymLookupEntry( 0x006a77e0, 00001, "", "" ), + new TSymLookupEntry( 0x006a7b48, 00001, "", "" ), + new TSymLookupEntry( 0x006a7b70, 00001, "", "" ), + new TSymLookupEntry( 0x006a7b98, 00001, "", "" ), + new TSymLookupEntry( 0x006a7bc0, 00001, "", "" ), + new TSymLookupEntry( 0x006a7be8, 00001, "", "" ), + new TSymLookupEntry( 0x006a7c10, 00001, "", "" ), + new TSymLookupEntry( 0x006a7c38, 00001, "", "" ), + new TSymLookupEntry( 0x006a7e98, 00001, "", "" ), + new TSymLookupEntry( 0x006a7ec0, 00001, "", "" ), + new TSymLookupEntry( 0x006a7f10, 00001, "", "" ), + new TSymLookupEntry( 0x006a8000, 00001, "", "" ), + new TSymLookupEntry( 0x006a80d8, 00001, "", "" ), + new TSymLookupEntry( 0x006a8100, 00001, "", "" ), + new TSymLookupEntry( 0x006a8128, 00001, "", "" ), + new TSymLookupEntry( 0x006a8150, 00001, "", "" ), + new TSymLookupEntry( 0x006a8178, 00001, "", "" ), + new TSymLookupEntry( 0x006a81a0, 00001, "", "" ), + new TSymLookupEntry( 0x006a81c8, 00001, "", "" ), + new TSymLookupEntry( 0x006a8670, 00001, "", "" ), + new TSymLookupEntry( 0x006a86d8, 00001, "", "" ), + new TSymLookupEntry( 0x006a8700, 00001, "", "" ), + new TSymLookupEntry( 0x006a8728, 00001, "", "" ), + new TSymLookupEntry( 0x006a8750, 00001, "", "" ), + new TSymLookupEntry( 0x006a88c8, 00001, "", "" ), + new TSymLookupEntry( 0x006a88f0, 00001, "", "" ), + new TSymLookupEntry( 0x006a8918, 00001, "", "" ), + new TSymLookupEntry( 0x006a8940, 00001, "", "" ), + new TSymLookupEntry( 0x006a8968, 00001, "", "" ), + new TSymLookupEntry( 0x006a8990, 00001, "", "" ), + new TSymLookupEntry( 0x006a89b8, 00001, "", "" ), + new TSymLookupEntry( 0x006a8e48, 00001, "", "" ), + new TSymLookupEntry( 0x006a8e70, 00001, "", "" ), + new TSymLookupEntry( 0x006a8ed8, 00001, "", "" ), + new TSymLookupEntry( 0x006a8f00, 00001, "", "" ), + new TSymLookupEntry( 0x006a8f28, 00001, "", "" ), + new TSymLookupEntry( 0x006a9118, 00001, "", "" ), + new TSymLookupEntry( 0x006a9140, 00001, "", "" ), + new TSymLookupEntry( 0x006a9168, 00001, "", "" ), + new TSymLookupEntry( 0x006a9190, 00001, "", "" ), + new TSymLookupEntry( 0x006a91b8, 00001, "", "" ), + new TSymLookupEntry( 0x006a91e0, 00001, "", "" ), + new TSymLookupEntry( 0x006a9208, 00001, "", "" ), + new TSymLookupEntry( 0x006a9a50, 00001, "", "" ), + new TSymLookupEntry( 0x006a9a78, 00001, "", "" ), + new TSymLookupEntry( 0x006a9aa0, 00001, "", "" ), + new TSymLookupEntry( 0x006a9ac8, 00001, "", "" ), + new TSymLookupEntry( 0x006a9af0, 00001, "", "" ), + new TSymLookupEntry( 0x006a9b18, 00001, "", "" ), + new TSymLookupEntry( 0x006a9b40, 00001, "", "" ), + new TSymLookupEntry( 0x006a9b68, 00001, "", "" ), + new TSymLookupEntry( 0x006a9b90, 00001, "", "" ), + new TSymLookupEntry( 0x006a9bb8, 00001, "", "" ), + new TSymLookupEntry( 0x006a9be0, 00001, "", "" ), + new TSymLookupEntry( 0x006a9c08, 00001, "", "" ), + new TSymLookupEntry( 0x006aa100, 00001, "", "" ), + new TSymLookupEntry( 0x006aa340, 00001, "", "" ), + new TSymLookupEntry( 0x006ac388, 00001, "", "" ), + new TSymLookupEntry( 0x006aced0, 00001, "", "" ), + new TSymLookupEntry( 0x006ad040, 00001, "", "" ), + new TSymLookupEntry( 0x006ad1b0, 00001, "", "" ), + new TSymLookupEntry( 0x006ad998, 00001, "", "" ), + new TSymLookupEntry( 0x006ae610, 00001, "", "" ), + new TSymLookupEntry( 0x006aefb0, 00001, "", "" ), + new TSymLookupEntry( 0x006af230, 00001, "", "" ), + new TSymLookupEntry( 0x006af9e0, 00001, "", "" ), + new TSymLookupEntry( 0x006aff50, 00001, "", "" ), + new TSymLookupEntry( 0x006b002d, 00001, "", "" ), + new TSymLookupEntry( 0x006b0062, 00001, "", "" ), + new TSymLookupEntry( 0x006b006b, 00001, "", "" ), + new TSymLookupEntry( 0x006b0075, 00001, "", "" ), + new TSymLookupEntry( 0x006b0076, 00001, "", "" ), + new TSymLookupEntry( 0x006b0078, 00002, "", "" ), + new TSymLookupEntry( 0x006b0b48, 00001, "", "" ), + new TSymLookupEntry( 0x006b1030, 00001, "", "" ), + new TSymLookupEntry( 0x006b1430, 00001, "", "" ), + new TSymLookupEntry( 0x006b2030, 00001, "", "" ), + new TSymLookupEntry( 0x006b2f68, 00001, "", "" ), + new TSymLookupEntry( 0x006b4090, 00001, "", "" ), + new TSymLookupEntry( 0x006b4788, 00001, "", "" ), + new TSymLookupEntry( 0x006b4c40, 00001, "", "" ), + new TSymLookupEntry( 0x006b55e0, 00001, "", "" ), + new TSymLookupEntry( 0x006b5e50, 00001, "", "" ), + new TSymLookupEntry( 0x006b6558, 00001, "", "" ), + new TSymLookupEntry( 0x006b7120, 00001, "", "" ), + new TSymLookupEntry( 0x006b7398, 00001, "", "" ), + new TSymLookupEntry( 0x006b81d8, 00001, "", "" ), + new TSymLookupEntry( 0x006b8d18, 00001, "", "" ), + new TSymLookupEntry( 0x006b8d68, 00001, "", "" ), + new TSymLookupEntry( 0x006b9758, 00001, "", "" ), + new TSymLookupEntry( 0x006b9e90, 00001, "", "" ), + new TSymLookupEntry( 0x006bae90, 00001, "", "" ), + new TSymLookupEntry( 0x006bc438, 00001, "", "" ), + new TSymLookupEntry( 0x006bcd20, 00001, "", "" ), + new TSymLookupEntry( 0x006bd0c0, 00001, "", "" ), + new TSymLookupEntry( 0x006bdf98, 00001, "", "" ), + new TSymLookupEntry( 0x006be940, 00001, "", "" ), + new TSymLookupEntry( 0x006c0026, 00001, "", "" ), + new TSymLookupEntry( 0x006c0031, 00001, "", "" ), + new TSymLookupEntry( 0x006c0032, 00001, "", "" ), + new TSymLookupEntry( 0x006c0033, 00001, "", "" ), + new TSymLookupEntry( 0x006c0034, 00001, "", "" ), + new TSymLookupEntry( 0x006c0035, 00001, "", "" ), + new TSymLookupEntry( 0x006c003c, 00001, "", "" ), + new TSymLookupEntry( 0x006c0041, 00002, "", "" ), + new TSymLookupEntry( 0x006c0042, 00003, "", "" ), + new TSymLookupEntry( 0x006c0050, 00002, "", "" ), + new TSymLookupEntry( 0x006c005f, 00001, "", "" ), + new TSymLookupEntry( 0x006c0061, 00008, "", "" ), + new TSymLookupEntry( 0x006c0062, 00010, "", "" ), + new TSymLookupEntry( 0x006c0063, 00034, "", "" ), + new TSymLookupEntry( 0x006c0064, 00001, "", "" ), + new TSymLookupEntry( 0x006c0065, 00004, "", "" ), + new TSymLookupEntry( 0x006c0066, 00005, "", "" ), + new TSymLookupEntry( 0x006c0067, 00002, "", "" ), + new TSymLookupEntry( 0x006c006f, 00008, "", "" ), + new TSymLookupEntry( 0x006c0070, 00007, "", "" ), + new TSymLookupEntry( 0x006c0072, 00001, "", "" ), + new TSymLookupEntry( 0x006c0073, 00005, "", "" ), + new TSymLookupEntry( 0x006c0074, 00001, "", "" ), + new TSymLookupEntry( 0x006c0075, 00001, "", "" ), + new TSymLookupEntry( 0x006c0076, 00001, "", "" ), + new TSymLookupEntry( 0x006c00b8, 00001, "", "" ), + new TSymLookupEntry( 0x006c0778, 00001, "", "" ), + new TSymLookupEntry( 0x006c0830, 00001, "", "" ), + new TSymLookupEntry( 0x006c0a18, 00001, "", "" ), + new TSymLookupEntry( 0x006c0af0, 00001, "", "" ), + new TSymLookupEntry( 0x006c0e58, 00001, "", "" ), + new TSymLookupEntry( 0x006c1468, 00001, "", "" ), + new TSymLookupEntry( 0x006c14f4, 00001, "", "" ), + new TSymLookupEntry( 0x006c1760, 00001, "", "" ), + new TSymLookupEntry( 0x006c18d0, 00001, "", "" ), + new TSymLookupEntry( 0x006c1a18, 00001, "", "" ), + new TSymLookupEntry( 0x006c1b60, 00001, "", "" ), + new TSymLookupEntry( 0x006c1d08, 00001, "", "" ), + new TSymLookupEntry( 0x006c1e78, 00001, "", "" ), + new TSymLookupEntry( 0x006c1fc0, 00001, "", "" ), + new TSymLookupEntry( 0x006c2108, 00001, "", "" ), + new TSymLookupEntry( 0x006c2278, 00001, "", "" ), + new TSymLookupEntry( 0x006c2478, 00001, "", "" ), + new TSymLookupEntry( 0x006c2660, 00001, "", "" ), + new TSymLookupEntry( 0x006c27a8, 00001, "", "" ), + new TSymLookupEntry( 0x006c2968, 00001, "", "" ), + new TSymLookupEntry( 0x006c2c68, 00001, "", "" ), + new TSymLookupEntry( 0x006c2e08, 00001, "", "" ), + new TSymLookupEntry( 0x006c2e80, 00001, "", "" ), + new TSymLookupEntry( 0x006c3110, 00001, "", "" ), + new TSymLookupEntry( 0x006c32e0, 00001, "", "" ), + new TSymLookupEntry( 0x006c3428, 00001, "", "" ), + new TSymLookupEntry( 0x006c3570, 00001, "", "" ), + new TSymLookupEntry( 0x006c3718, 00001, "", "" ), + new TSymLookupEntry( 0x006c3900, 00001, "", "" ), + new TSymLookupEntry( 0x006c3a88, 00001, "", "" ), + new TSymLookupEntry( 0x006c3c20, 00001, "", "" ), + new TSymLookupEntry( 0x006c3ea8, 00001, "", "" ), + new TSymLookupEntry( 0x006c4040, 00001, "", "" ), + new TSymLookupEntry( 0x006c4328, 00001, "", "" ), + new TSymLookupEntry( 0x006c4560, 00001, "", "" ), + new TSymLookupEntry( 0x006c4798, 00001, "", "" ), + new TSymLookupEntry( 0x006c49f8, 00001, "", "" ), + new TSymLookupEntry( 0x006c4be0, 00001, "", "" ), + new TSymLookupEntry( 0x006c4f58, 00001, "", "" ), + new TSymLookupEntry( 0x006c50f8, 00001, "", "" ), + new TSymLookupEntry( 0x006c5358, 00001, "", "" ), + new TSymLookupEntry( 0x006c55b8, 00001, "", "" ), + new TSymLookupEntry( 0x006c5980, 00001, "", "" ), + new TSymLookupEntry( 0x006c5af0, 00001, "", "" ), + new TSymLookupEntry( 0x006c5c38, 00001, "", "" ), + new TSymLookupEntry( 0x006c5d80, 00001, "", "" ), + new TSymLookupEntry( 0x006c5fd8, 00001, "", "" ), + new TSymLookupEntry( 0x006c6208, 00001, "", "" ), + new TSymLookupEntry( 0x006c6378, 00001, "", "" ), + new TSymLookupEntry( 0x006c6508, 00001, "", "" ), + new TSymLookupEntry( 0x006c6650, 00001, "", "" ), + new TSymLookupEntry( 0x006c67f8, 00001, "", "" ), + new TSymLookupEntry( 0x006c6968, 00001, "", "" ), + new TSymLookupEntry( 0x006c6ab0, 00001, "", "" ), + new TSymLookupEntry( 0x006c6c50, 00001, "", "" ), + new TSymLookupEntry( 0x006c6e48, 00001, "", "" ), + new TSymLookupEntry( 0x006c6ff0, 00001, "", "" ), + new TSymLookupEntry( 0x006c7173, 00002, "", "" ), + new TSymLookupEntry( 0x006c71e8, 00001, "", "" ), + new TSymLookupEntry( 0x006c7275, 00002, "", "" ), + new TSymLookupEntry( 0x006c7570, 00001, "", "" ), + new TSymLookupEntry( 0x006c76e0, 00001, "", "" ), + new TSymLookupEntry( 0x006c7ab8, 00001, "", "" ), + new TSymLookupEntry( 0x006c7dd0, 00001, "", "" ), + new TSymLookupEntry( 0x006c8580, 00001, "", "" ), + new TSymLookupEntry( 0x006c8bf0, 00001, "", "" ), + new TSymLookupEntry( 0x006c8e70, 00001, "", "" ), + new TSymLookupEntry( 0x006c9258, 00004, "", "" ), + new TSymLookupEntry( 0x006c9288, 00001, "", "" ), + new TSymLookupEntry( 0x006c9d98, 00001, "", "" ), + new TSymLookupEntry( 0x006caa28, 00001, "", "" ), + new TSymLookupEntry( 0x006cc158, 00001, "", "" ), + new TSymLookupEntry( 0x006ccb38, 00001, "", "" ), + new TSymLookupEntry( 0x006ccfa0, 00001, "", "" ), + new TSymLookupEntry( 0x006ce190, 00001, "", "" ), + new TSymLookupEntry( 0x006ceca0, 00001, "", "" ), + new TSymLookupEntry( 0x006cf3d8, 00001, "", "" ), + new TSymLookupEntry( 0x006cf8c8, 00003, "", "" ), + new TSymLookupEntry( 0x006d0023, 00004, "", "" ), + new TSymLookupEntry( 0x006d0026, 00001, "", "" ), + new TSymLookupEntry( 0x006d0041, 00001, "", "" ), + new TSymLookupEntry( 0x006d0065, 00005, "", "" ), + new TSymLookupEntry( 0x006d0069, 00077, "", "" ), + new TSymLookupEntry( 0x006d006d, 00001, "", "" ), + new TSymLookupEntry( 0x006d0073, 00002, "", "" ), + new TSymLookupEntry( 0x006d0074, 00001, "", "" ), + new TSymLookupEntry( 0x006d0077, 00001, "", "" ), + new TSymLookupEntry( 0x006d0078, 00006, "", "" ), + new TSymLookupEntry( 0x006d0360, 00001, "", "" ), + new TSymLookupEntry( 0x006d1018, 00001, "", "" ), + new TSymLookupEntry( 0x006d2d48, 00001, "", "" ), + new TSymLookupEntry( 0x006d30c0, 00002, "", "" ), + new TSymLookupEntry( 0x006d3a50, 00001, "", "" ), + new TSymLookupEntry( 0x006d3e98, 00001, "", "" ), + new TSymLookupEntry( 0x006d4538, 00001, "", "" ), + new TSymLookupEntry( 0x006d4950, 00001, "", "" ), + new TSymLookupEntry( 0x006d4f20, 00001, "", "" ), + new TSymLookupEntry( 0x006d51d0, 00002, "", "" ), + new TSymLookupEntry( 0x006d5368, 00001, "", "" ), + new TSymLookupEntry( 0x006d5b40, 00006, "", "" ), + new TSymLookupEntry( 0x006d61e0, 00001, "", "" ), + new TSymLookupEntry( 0x006d6af8, 00001, "", "" ), + new TSymLookupEntry( 0x006d6e90, 00001, "", "" ), + new TSymLookupEntry( 0x006d7578, 00001, "", "" ), + new TSymLookupEntry( 0x006d8000, 00001, "", "" ), + new TSymLookupEntry( 0x006d8c90, 00001, "", "" ), + new TSymLookupEntry( 0x006d8e78, 00001, "", "" ), + new TSymLookupEntry( 0x006d9a08, 00001, "", "" ), + new TSymLookupEntry( 0x006da410, 00001, "", "" ), + new TSymLookupEntry( 0x006db0b8, 00001, "", "" ), + new TSymLookupEntry( 0x006db938, 00001, "", "" ), + new TSymLookupEntry( 0x006dc420, 00001, "", "" ), + new TSymLookupEntry( 0x006dd2d8, 00001, "", "" ), + new TSymLookupEntry( 0x006de120, 00001, "", "" ), + new TSymLookupEntry( 0x006df7e8, 00001, "", "" ), + new TSymLookupEntry( 0x006dfd60, 00001, "", "" ), + new TSymLookupEntry( 0x006dff40, 00002, "", "" ), + new TSymLookupEntry( 0x006e000a, 00001, "", "" ), + new TSymLookupEntry( 0x006e0023, 00002, "", "" ), + new TSymLookupEntry( 0x006e0026, 00001, "", "" ), + new TSymLookupEntry( 0x006e002e, 00002, "", "" ), + new TSymLookupEntry( 0x006e002f, 00003, "", "" ), + new TSymLookupEntry( 0x006e0030, 00001, "", "" ), + new TSymLookupEntry( 0x006e0032, 00003, "", "" ), + new TSymLookupEntry( 0x006e003d, 00001, "", "" ), + new TSymLookupEntry( 0x006e0041, 00002, "", "" ), + new TSymLookupEntry( 0x006e0049, 00001, "", "" ), + new TSymLookupEntry( 0x006e0055, 00001, "", "" ), + new TSymLookupEntry( 0x006e005c, 00001, "", "" ), + new TSymLookupEntry( 0x006e0061, 00006, "", "" ), + new TSymLookupEntry( 0x006e0062, 00001, "", "" ), + new TSymLookupEntry( 0x006e0063, 00001, "", "" ), + new TSymLookupEntry( 0x006e0064, 00001, "", "" ), + new TSymLookupEntry( 0x006e0065, 00008, "", "" ), + new TSymLookupEntry( 0x006e0066, 00004, "", "" ), + new TSymLookupEntry( 0x006e0069, 00024, "", "" ), + new TSymLookupEntry( 0x006e006d, 00002, "", "" ), + new TSymLookupEntry( 0x006e006f, 00061, "", "" ), + new TSymLookupEntry( 0x006e0075, 00011, "", "" ), + new TSymLookupEntry( 0x006e0079, 00001, "", "" ), + new TSymLookupEntry( 0x006e007b, 00001, "", "" ), + new TSymLookupEntry( 0x006e0610, 00001, "", "" ), + new TSymLookupEntry( 0x006e0a28, 00001, "", "" ), + new TSymLookupEntry( 0x006e1408, 00001, "", "" ), + new TSymLookupEntry( 0x006e2130, 00001, "", "" ), + new TSymLookupEntry( 0x006e35d8, 00001, "", "" ), + new TSymLookupEntry( 0x006e54b8, 00001, "", "" ), + new TSymLookupEntry( 0x006e60b0, 00005, "", "" ), + new TSymLookupEntry( 0x006e8000, 00001, "", "" ), + new TSymLookupEntry( 0x006e9050, 00001, "", "" ), + new TSymLookupEntry( 0x006e9e00, 00001, "", "" ), + new TSymLookupEntry( 0x006ea8fc, 00001, "", "" ), + new TSymLookupEntry( 0x006eaa78, 00001, "", "" ), + new TSymLookupEntry( 0x006eae58, 00001, "", "" ), + new TSymLookupEntry( 0x006eb2c8, 00001, "", "" ), + new TSymLookupEntry( 0x006ec210, 00001, "", "" ), + new TSymLookupEntry( 0x006ec488, 00001, "", "" ), + new TSymLookupEntry( 0x006ed8e0, 00001, "", "" ), + new TSymLookupEntry( 0x006ee0d8, 00001, "", "" ), + new TSymLookupEntry( 0x006ee338, 00001, "", "" ), + new TSymLookupEntry( 0x006ee6d0, 00001, "", "" ), + new TSymLookupEntry( 0x006ee720, 00001, "", "" ), + new TSymLookupEntry( 0x006ef9f8, 00001, "", "" ), + new TSymLookupEntry( 0x006efa98, 00007, "", "" ), + new TSymLookupEntry( 0x006f0000, 00001, "", "" ), + new TSymLookupEntry( 0x006f0021, 00001, "", "" ), + new TSymLookupEntry( 0x006f0032, 00001, "", "" ), + new TSymLookupEntry( 0x006f003c, 00003, "", "" ), + new TSymLookupEntry( 0x006f0042, 00003, "", "" ), + new TSymLookupEntry( 0x006f0043, 00020, "", "" ), + new TSymLookupEntry( 0x006f0044, 00004, "", "" ), + new TSymLookupEntry( 0x006f0048, 00002, "", "" ), + new TSymLookupEntry( 0x006f004a, 00002, "", "" ), + new TSymLookupEntry( 0x006f004b, 00001, "", "" ), + new TSymLookupEntry( 0x006f004c, 00002, "", "" ), + new TSymLookupEntry( 0x006f004d, 00006, "", "" ), + new TSymLookupEntry( 0x006f004e, 00015, "", "" ), + new TSymLookupEntry( 0x006f0050, 00027, "", "" ), + new TSymLookupEntry( 0x006f0052, 00001, "", "" ), + new TSymLookupEntry( 0x006f0053, 00008, "", "" ), + new TSymLookupEntry( 0x006f0054, 00011, "", "" ), + new TSymLookupEntry( 0x006f0057, 00002, "", "" ), + new TSymLookupEntry( 0x006f0062, 00045, "", "" ), + new TSymLookupEntry( 0x006f0063, 00057, "", "" ), + new TSymLookupEntry( 0x006f0064, 00007, "", "" ), + new TSymLookupEntry( 0x006f0066, 00012, "", "" ), + new TSymLookupEntry( 0x006f0067, 00003, "", "" ), + new TSymLookupEntry( 0x006f0068, 00007, "", "" ), + new TSymLookupEntry( 0x006f006a, 00003, "", "" ), + new TSymLookupEntry( 0x006f006c, 00027, "", "" ), + new TSymLookupEntry( 0x006f006d, 00026, "", "" ), + new TSymLookupEntry( 0x006f006e, 00263, "", "" ), + new TSymLookupEntry( 0x006f0070, 00039, "", "" ), + new TSymLookupEntry( 0x006f0072, 00007, "", "" ), + new TSymLookupEntry( 0x006f0073, 00005, "", "" ), + new TSymLookupEntry( 0x006f0074, 00028, "", "" ), + new TSymLookupEntry( 0x006f0076, 00001, "", "" ), + new TSymLookupEntry( 0x006f007a, 00002, "", "" ), + new TSymLookupEntry( 0x006f19a8, 00001, "", "" ), + new TSymLookupEntry( 0x006f31f0, 00001, "", "" ), + new TSymLookupEntry( 0x006f3c50, 00001, "", "" ), + new TSymLookupEntry( 0x006f83b8, 00001, "", "" ), + new TSymLookupEntry( 0x006fa690, 00001, "", "" ), + new TSymLookupEntry( 0x006fba98, 00001, "", "" ), + new TSymLookupEntry( 0x006fc190, 00001, "", "" ), + new TSymLookupEntry( 0x006fc3a0, 00002, "", "" ), + new TSymLookupEntry( 0x006fc448, 00001, "", "" ), + new TSymLookupEntry( 0x006fd038, 00002, "", "" ), + new TSymLookupEntry( 0x006fd200, 00001, "", "" ), + new TSymLookupEntry( 0x006fd2a8, 00001, "", "" ), + new TSymLookupEntry( 0x006fdbd0, 00001, "", "" ), + new TSymLookupEntry( 0x006fe060, 00001, "", "" ), + new TSymLookupEntry( 0x006fe130, 00001, "", "" ), + new TSymLookupEntry( 0x006fe6d8, 00001, "", "" ), + new TSymLookupEntry( 0x006ff0f8, 00001, "", "" ), + new TSymLookupEntry( 0x006ff288, 00001, "", "" ), + new TSymLookupEntry( 0x00700000, 00001, "", "" ), + new TSymLookupEntry( 0x00700023, 00001, "", "" ), + new TSymLookupEntry( 0x00700026, 00002, "", "" ), + new TSymLookupEntry( 0x0070002d, 00011, "", "" ), + new TSymLookupEntry( 0x0070002e, 00001, "", "" ), + new TSymLookupEntry( 0x0070002f, 00003, "", "" ), + new TSymLookupEntry( 0x00700030, 00002, "", "" ), + new TSymLookupEntry( 0x00700031, 00001, "", "" ), + new TSymLookupEntry( 0x0070003a, 00001, "", "" ), + new TSymLookupEntry( 0x0070004f, 00004, "", "" ), + new TSymLookupEntry( 0x0070005a, 00001, "", "" ), + new TSymLookupEntry( 0x00700061, 00059, "", "" ), + new TSymLookupEntry( 0x00700067, 00001, "", "" ), + new TSymLookupEntry( 0x00700069, 00001, "", "" ), + new TSymLookupEntry( 0x0070006f, 00020, "", "" ), + new TSymLookupEntry( 0x00700073, 00008, "", "" ), + new TSymLookupEntry( 0x00700074, 00006, "", "" ), + new TSymLookupEntry( 0x00700075, 00002, "", "" ), + new TSymLookupEntry( 0x0070007b, 00001, "", "" ), + new TSymLookupEntry( 0x00700164, 00001, "", "" ), + new TSymLookupEntry( 0x00700390, 00001, "", "" ), + new TSymLookupEntry( 0x007003b8, 00001, "", "" ), + new TSymLookupEntry( 0x00700c38, 00001, "", "" ), + new TSymLookupEntry( 0x00701b80, 00002, "", "" ), + new TSymLookupEntry( 0x007038c0, 00001, "", "" ), + new TSymLookupEntry( 0x007039d8, 00001, "", "" ), + new TSymLookupEntry( 0x00703a28, 00001, "", "" ), + new TSymLookupEntry( 0x00704158, 00002, "", "" ), + new TSymLookupEntry( 0x007043d8, 00001, "", "" ), + new TSymLookupEntry( 0x007046f8, 00001, "", "" ), + new TSymLookupEntry( 0x007047e8, 00001, "", "" ), + new TSymLookupEntry( 0x00704a30, 00001, "", "" ), + new TSymLookupEntry( 0x00704b20, 00001, "", "" ), + new TSymLookupEntry( 0x00704da0, 00001, "", "" ), + new TSymLookupEntry( 0x007050c0, 00001, "", "" ), + new TSymLookupEntry( 0x00705ae8, 00001, "", "" ), + new TSymLookupEntry( 0x00707054, 00001, "", "" ), + new TSymLookupEntry( 0x00707098, 00001, "", "" ), + new TSymLookupEntry( 0x00707bd4, 00001, "", "" ), + new TSymLookupEntry( 0x00707cb0, 00001, "", "" ), + new TSymLookupEntry( 0x00707ef8, 00001, "", "" ), + new TSymLookupEntry( 0x007081b0, 00001, "", "" ), + new TSymLookupEntry( 0x007086a0, 00001, "", "" ), + new TSymLookupEntry( 0x00708d50, 00001, "", "" ), + new TSymLookupEntry( 0x00708f70, 00001, "", "" ), + new TSymLookupEntry( 0x00709118, 00001, "", "" ), + new TSymLookupEntry( 0x007091c0, 00001, "", "" ), + new TSymLookupEntry( 0x00709348, 00001, "", "" ), + new TSymLookupEntry( 0x00709420, 00001, "", "" ), + new TSymLookupEntry( 0x0070aeb8, 00001, "", "" ), + new TSymLookupEntry( 0x0070c248, 00001, "", "" ), + new TSymLookupEntry( 0x0070d2bc, 00001, "", "" ), + new TSymLookupEntry( 0x0070d898, 00001, "", "" ), + new TSymLookupEntry( 0x0070ee80, 00001, "", "" ), + new TSymLookupEntry( 0x0070f6c8, 00001, "", "" ), + new TSymLookupEntry( 0x0070fab0, 00001, "", "" ), + new TSymLookupEntry( 0x00710020, 00002, "", "" ), + new TSymLookupEntry( 0x00710021, 00001, "", "" ), + new TSymLookupEntry( 0x00710027, 00001, "", "" ), + new TSymLookupEntry( 0x00710028, 00001, "", "" ), + new TSymLookupEntry( 0x00710029, 00001, "", "" ), + new TSymLookupEntry( 0x0071002a, 00001, "", "" ), + new TSymLookupEntry( 0x0071002c, 00002, "", "" ), + new TSymLookupEntry( 0x0071002d, 00002, "", "" ), + new TSymLookupEntry( 0x0071002e, 00002, "", "" ), + new TSymLookupEntry( 0x00710030, 00004, "", "" ), + new TSymLookupEntry( 0x00710033, 00001, "", "" ), + new TSymLookupEntry( 0x0071003a, 00001, "", "" ), + new TSymLookupEntry( 0x0071003d, 00001, "", "" ), + new TSymLookupEntry( 0x0071003f, 00002, "", "" ), + new TSymLookupEntry( 0x00710054, 00001, "", "" ), + new TSymLookupEntry( 0x00710065, 00001, "", "" ), + new TSymLookupEntry( 0x00710067, 00003, "", "" ), + new TSymLookupEntry( 0x0071006a, 00002, "", "" ), + new TSymLookupEntry( 0x0071006d, 00001, "", "" ), + new TSymLookupEntry( 0x00710530, 00003, "", "" ), + new TSymLookupEntry( 0x00711108, 00001, "", "" ), + new TSymLookupEntry( 0x007112b0, 00001, "", "" ), + new TSymLookupEntry( 0x007117f0, 00001, "", "" ), + new TSymLookupEntry( 0x00712130, 00001, "", "" ), + new TSymLookupEntry( 0x007127a8, 00001, "", "" ), + new TSymLookupEntry( 0x00712cf0, 00001, "", "" ), + new TSymLookupEntry( 0x00712df8, 00001, "", "" ), + new TSymLookupEntry( 0x00712f00, 00001, "", "" ), + new TSymLookupEntry( 0x007141b8, 00001, "", "" ), + new TSymLookupEntry( 0x007142bc, 00001, "", "" ), + new TSymLookupEntry( 0x00714950, 00001, "", "" ), + new TSymLookupEntry( 0x00715440, 00001, "", "" ), + new TSymLookupEntry( 0x007163a8, 00001, "", "" ), + new TSymLookupEntry( 0x00716573, 00001, "", "" ), + new TSymLookupEntry( 0x00716950, 00001, "", "" ), + new TSymLookupEntry( 0x00716e98, 00001, "", "" ), + new TSymLookupEntry( 0x00717104, 00001, "", "" ), + new TSymLookupEntry( 0x00717828, 00001, "", "" ), + new TSymLookupEntry( 0x00718230, 00002, "", "" ), + new TSymLookupEntry( 0x007182d8, 00001, "", "" ), + new TSymLookupEntry( 0x00719954, 00001, "", "" ), + new TSymLookupEntry( 0x00719bc8, 00001, "", "" ), + new TSymLookupEntry( 0x0071cb88, 00001, "", "" ), + new TSymLookupEntry( 0x0071d550, 00001, "", "" ), + new TSymLookupEntry( 0x0071f9d0, 00001, "", "" ), + new TSymLookupEntry( 0x0071fe98, 00001, "", "" ), + new TSymLookupEntry( 0x00720026, 00002, "", "" ), + new TSymLookupEntry( 0x00720041, 00003, "", "" ), + new TSymLookupEntry( 0x00720045, 00002, "", "" ), + new TSymLookupEntry( 0x00720046, 00004, "", "" ), + new TSymLookupEntry( 0x00720047, 00001, "", "" ), + new TSymLookupEntry( 0x0072004e, 00001, "", "" ), + new TSymLookupEntry( 0x0072005c, 00001, "", "" ), + new TSymLookupEntry( 0x00720061, 00005, "", "" ), + new TSymLookupEntry( 0x00720062, 00004, "", "" ), + new TSymLookupEntry( 0x00720063, 00003, "", "" ), + new TSymLookupEntry( 0x00720064, 00007, "", "" ), + new TSymLookupEntry( 0x00720065, 00003, "", "" ), + new TSymLookupEntry( 0x00720066, 00012, "", "" ), + new TSymLookupEntry( 0x00720067, 00003, "", "" ), + new TSymLookupEntry( 0x00720068, 00006, "", "" ), + new TSymLookupEntry( 0x0072006f, 00003, "", "" ), + new TSymLookupEntry( 0x00720070, 00029, "", "" ), + new TSymLookupEntry( 0x00720073, 00005, "", "" ), + new TSymLookupEntry( 0x00720074, 00010, "", "" ), + new TSymLookupEntry( 0x00720075, 00002, "", "" ), + new TSymLookupEntry( 0x00720077, 00005, "", "" ), + new TSymLookupEntry( 0x00720380, 00001, "", "" ), + new TSymLookupEntry( 0x00720d28, 00002, "", "" ), + new TSymLookupEntry( 0x00721318, 00001, "", "" ), + new TSymLookupEntry( 0x00721938, 00001, "", "" ), + new TSymLookupEntry( 0x00722800, 00001, "", "" ), + new TSymLookupEntry( 0x00722990, 00001, "", "" ), + new TSymLookupEntry( 0x00722d30, 00001, "", "" ), + new TSymLookupEntry( 0x00723708, 00001, "", "" ), + new TSymLookupEntry( 0x00724d40, 00008, "", "" ), + new TSymLookupEntry( 0x007253a8, 00001, "", "" ), + new TSymLookupEntry( 0x00725590, 00001, "", "" ), + new TSymLookupEntry( 0x007256f8, 00001, "", "" ), + new TSymLookupEntry( 0x00725a60, 00001, "", "" ), + new TSymLookupEntry( 0x00725fd8, 00001, "", "" ), + new TSymLookupEntry( 0x00726770, 00001, "", "" ), + new TSymLookupEntry( 0x00726dd0, 00001, "", "" ), + new TSymLookupEntry( 0x00726f38, 00001, "", "" ), + new TSymLookupEntry( 0x00727348, 00001, "", "" ), + new TSymLookupEntry( 0x00727580, 00001, "", "" ), + new TSymLookupEntry( 0x00728990, 00001, "", "" ), + new TSymLookupEntry( 0x00728c68, 00001, "", "" ), + new TSymLookupEntry( 0x00728ee8, 00001, "", "" ), + new TSymLookupEntry( 0x00729dd0, 00001, "", "" ), + new TSymLookupEntry( 0x0072c210, 00001, "", "" ), + new TSymLookupEntry( 0x0072fd38, 00001, "", "" ), + new TSymLookupEntry( 0x0073003c, 00083, "", "" ), + new TSymLookupEntry( 0x00730055, 00003, "", "" ), + new TSymLookupEntry( 0x0073005c, 00005, "", "" ), + new TSymLookupEntry( 0x00730061, 00002, "", "" ), + new TSymLookupEntry( 0x00730063, 00004, "", "" ), + new TSymLookupEntry( 0x00730065, 00001, "", "" ), + new TSymLookupEntry( 0x00730067, 00001, "", "" ), + new TSymLookupEntry( 0x00730068, 00001, "", "" ), + new TSymLookupEntry( 0x00730069, 00015, "", "" ), + new TSymLookupEntry( 0x0073006a, 00012, "", "" ), + new TSymLookupEntry( 0x0073006c, 00001, "", "" ), + new TSymLookupEntry( 0x0073006d, 00003, "", "" ), + new TSymLookupEntry( 0x0073006e, 00001, "", "" ), + new TSymLookupEntry( 0x00730072, 00001, "", "" ), + new TSymLookupEntry( 0x00730073, 00001, "", "" ), + new TSymLookupEntry( 0x00730074, 00001, "", "" ), + new TSymLookupEntry( 0x00730075, 00013, "", "" ), + new TSymLookupEntry( 0x00730076, 00001, "", "" ), + new TSymLookupEntry( 0x00730280, 00001, "", "" ), + new TSymLookupEntry( 0x00730dec, 00001, "", "" ), + new TSymLookupEntry( 0x00731104, 00001, "", "" ), + new TSymLookupEntry( 0x00731384, 00001, "", "" ), + new TSymLookupEntry( 0x00731c50, 00001, "", "" ), + new TSymLookupEntry( 0x00732160, 00001, "", "" ), + new TSymLookupEntry( 0x007322ac, 00001, "", "" ), + new TSymLookupEntry( 0x00732790, 00001, "", "" ), + new TSymLookupEntry( 0x007328d8, 00003, "", "" ), + new TSymLookupEntry( 0x00732cdc, 00001, "", "" ), + new TSymLookupEntry( 0x007330fc, 00001, "", "" ), + new TSymLookupEntry( 0x00733d84, 00001, "", "" ), + new TSymLookupEntry( 0x00733f1c, 00001, "", "" ), + new TSymLookupEntry( 0x00734994, 00001, "", "" ), + new TSymLookupEntry( 0x00735794, 00001, "", "" ), + new TSymLookupEntry( 0x00735fa4, 00001, "", "" ), + new TSymLookupEntry( 0x00736324, 00001, "", "" ), + new TSymLookupEntry( 0x007364b4, 00001, "", "" ), + new TSymLookupEntry( 0x007368f4, 00001, "", "" ), + new TSymLookupEntry( 0x00736b74, 00001, "", "" ), + new TSymLookupEntry( 0x007371b8, 00001, "", "" ), + new TSymLookupEntry( 0x00737354, 00001, "", "" ), + new TSymLookupEntry( 0x0073779c, 00001, "", "" ), + new TSymLookupEntry( 0x00737d08, 00001, "", "" ), + new TSymLookupEntry( 0x00737e80, 00001, "", "" ), + new TSymLookupEntry( 0x00738184, 00001, "", "" ), + new TSymLookupEntry( 0x007384c4, 00001, "", "" ), + new TSymLookupEntry( 0x00739104, 00001, "", "" ), + new TSymLookupEntry( 0x007397cc, 00001, "", "" ), + new TSymLookupEntry( 0x00739b60, 00036, "", "" ), + new TSymLookupEntry( 0x00739f5c, 00001, "", "" ), + new TSymLookupEntry( 0x0073a018, 00001, "", "" ), + new TSymLookupEntry( 0x0073a61c, 00001, "", "" ), + new TSymLookupEntry( 0x0073a8e8, 00001, "", "" ), + new TSymLookupEntry( 0x0073aebc, 00001, "", "" ), + new TSymLookupEntry( 0x0073b494, 00001, "", "" ), + new TSymLookupEntry( 0x0073b5f8, 00001, "", "" ), + new TSymLookupEntry( 0x0073b790, 00001, "", "" ), + new TSymLookupEntry( 0x0073b7e0, 00001, "", "" ), + new TSymLookupEntry( 0x0073bf0c, 00001, "", "" ), + new TSymLookupEntry( 0x0073c930, 00001, "", "" ), + new TSymLookupEntry( 0x0073c9b0, 00001, "", "" ), + new TSymLookupEntry( 0x0073ca00, 00001, "", "" ), + new TSymLookupEntry( 0x0073cd30, 00001, "", "" ), + new TSymLookupEntry( 0x0073cdd0, 00001, "", "" ), + new TSymLookupEntry( 0x0073d388, 00001, "", "" ), + new TSymLookupEntry( 0x0073d9c4, 00001, "", "" ), + new TSymLookupEntry( 0x0073e21c, 00001, "", "" ), + new TSymLookupEntry( 0x0073e850, 00001, "", "" ), + new TSymLookupEntry( 0x0073ea08, 00001, "", "" ), + new TSymLookupEntry( 0x0073eaf8, 00001, "", "" ), + new TSymLookupEntry( 0x0073eea0, 00001, "", "" ), + new TSymLookupEntry( 0x0073eef0, 00001, "", "" ), + new TSymLookupEntry( 0x0073ef40, 00001, "", "" ), + new TSymLookupEntry( 0x0073f1ec, 00001, "", "" ), + new TSymLookupEntry( 0x0073f370, 00001, "", "" ), + new TSymLookupEntry( 0x0073f3c0, 00001, "", "" ), + new TSymLookupEntry( 0x0073f488, 00001, "", "" ), + new TSymLookupEntry( 0x0073f800, 00001, "", "" ), + new TSymLookupEntry( 0x0073f850, 00001, "", "" ), + new TSymLookupEntry( 0x0073f970, 00001, "", "" ), + new TSymLookupEntry( 0x0073fba8, 00001, "", "" ), + new TSymLookupEntry( 0x0073fdb0, 00001, "", "" ), + new TSymLookupEntry( 0x0073fef0, 00001, "", "" ), + new TSymLookupEntry( 0x00740020, 00001, "", "" ), + new TSymLookupEntry( 0x00740023, 00001, "", "" ), + new TSymLookupEntry( 0x00740028, 00001, "", "" ), + new TSymLookupEntry( 0x0074002f, 00002, "", "" ), + new TSymLookupEntry( 0x0074003c, 00012, "", "" ), + new TSymLookupEntry( 0x00740053, 00005, "", "" ), + new TSymLookupEntry( 0x0074005e, 00001, "", "" ), + new TSymLookupEntry( 0x0074005f, 00001, "", "" ), + new TSymLookupEntry( 0x00740061, 00004, "", "" ), + new TSymLookupEntry( 0x00740063, 00003, "", "" ), + new TSymLookupEntry( 0x00740064, 00001, "", "" ), + new TSymLookupEntry( 0x00740067, 00002, "", "" ), + new TSymLookupEntry( 0x00740068, 00169, "", "" ), + new TSymLookupEntry( 0x00740069, 00014, "", "" ), + new TSymLookupEntry( 0x0074006c, 00001, "", "" ), + new TSymLookupEntry( 0x0074006d, 00001, "", "" ), + new TSymLookupEntry( 0x0074006e, 00002, "", "" ), + new TSymLookupEntry( 0x0074006f, 00001, "", "" ), + new TSymLookupEntry( 0x00740073, 00039, "", "" ), + new TSymLookupEntry( 0x00740074, 00001, "", "" ), + new TSymLookupEntry( 0x00740075, 00002, "", "" ), + new TSymLookupEntry( 0x00740168, 00001, "", "" ), + new TSymLookupEntry( 0x007405ac, 00001, "", "" ), + new TSymLookupEntry( 0x00740f68, 00001, "", "" ), + new TSymLookupEntry( 0x007411c8, 00001, "", "" ), + new TSymLookupEntry( 0x00741308, 00001, "", "" ), + new TSymLookupEntry( 0x007416b0, 00001, "", "" ), + new TSymLookupEntry( 0x00741ecc, 00001, "", "" ), + new TSymLookupEntry( 0x007420d0, 00001, "", "" ), + new TSymLookupEntry( 0x00742218, 00001, "", "" ), + new TSymLookupEntry( 0x00742310, 00001, "", "" ), + new TSymLookupEntry( 0x00742478, 00001, "", "" ), + new TSymLookupEntry( 0x007424c8, 00001, "", "" ), + new TSymLookupEntry( 0x007426f8, 00001, "", "" ), + new TSymLookupEntry( 0x00742b50, 00001, "", "" ), + new TSymLookupEntry( 0x00743108, 00001, "", "" ), + new TSymLookupEntry( 0x007431d8, 00001, "", "" ), + new TSymLookupEntry( 0x00743370, 00001, "", "" ), + new TSymLookupEntry( 0x00743578, 00001, "", "" ), + new TSymLookupEntry( 0x00743688, 00001, "", "" ), + new TSymLookupEntry( 0x00743818, 00001, "", "" ), + new TSymLookupEntry( 0x00743980, 00001, "", "" ), + new TSymLookupEntry( 0x00743b38, 00001, "", "" ), + new TSymLookupEntry( 0x00743cc8, 00001, "", "" ), + new TSymLookupEntry( 0x00743de0, 00001, "", "" ), + new TSymLookupEntry( 0x00744310, 00001, "", "" ), + new TSymLookupEntry( 0x00744698, 00001, "", "" ), + new TSymLookupEntry( 0x00744768, 00001, "", "" ), + new TSymLookupEntry( 0x007447e0, 00001, "", "" ), + new TSymLookupEntry( 0x00744b38, 00001, "", "" ), + new TSymLookupEntry( 0x007452e0, 00001, "", "" ), + new TSymLookupEntry( 0x00745428, 00001, "", "" ), + new TSymLookupEntry( 0x00745598, 00001, "", "" ), + new TSymLookupEntry( 0x00745780, 00001, "", "" ), + new TSymLookupEntry( 0x00745c68, 00001, "", "" ), + new TSymLookupEntry( 0x00745e00, 00001, "", "" ), + new TSymLookupEntry( 0x00745e50, 00001, "", "" ), + new TSymLookupEntry( 0x00746218, 00001, "", "" ), + new TSymLookupEntry( 0x007465e0, 00001, "", "" ), + new TSymLookupEntry( 0x00746630, 00001, "", "" ), + new TSymLookupEntry( 0x007467e8, 00001, "", "" ), + new TSymLookupEntry( 0x007468d8, 00001, "", "" ), + new TSymLookupEntry( 0x00746950, 00001, "", "" ), + new TSymLookupEntry( 0x007469f0, 00001, "", "" ), + new TSymLookupEntry( 0x00746c50, 00001, "", "" ), + new TSymLookupEntry( 0x00746fa0, 00001, "", "" ), + new TSymLookupEntry( 0x00747250, 00001, "", "" ), + new TSymLookupEntry( 0x007474a8, 00001, "", "" ), + new TSymLookupEntry( 0x007475e8, 00001, "", "" ), + new TSymLookupEntry( 0x00747660, 00001, "", "" ), + new TSymLookupEntry( 0x00747898, 00001, "", "" ), + new TSymLookupEntry( 0x00747c70, 00001, "", "" ), + new TSymLookupEntry( 0x00747e78, 00001, "", "" ), + new TSymLookupEntry( 0x00747f18, 00001, "", "" ), + new TSymLookupEntry( 0x00748000, 00001, "", "" ), + new TSymLookupEntry( 0x00748170, 00001, "", "" ), + new TSymLookupEntry( 0x0074a878, 00001, "", "" ), + new TSymLookupEntry( 0x0074cac0, 00001, "", "" ), + new TSymLookupEntry( 0x0074cb60, 00001, "", "" ), + new TSymLookupEntry( 0x0074ce90, 00001, "", "" ), + new TSymLookupEntry( 0x0074d078, 00001, "", "" ), + new TSymLookupEntry( 0x0074d320, 00001, "", "" ), + new TSymLookupEntry( 0x0074d460, 00001, "", "" ), + new TSymLookupEntry( 0x0074d928, 00001, "", "" ), + new TSymLookupEntry( 0x0074d978, 00001, "", "" ), + new TSymLookupEntry( 0x0074dda0, 00001, "", "" ), + new TSymLookupEntry( 0x0074e028, 00001, "", "" ), + new TSymLookupEntry( 0x0074e3f0, 00001, "", "" ), + new TSymLookupEntry( 0x0074e5d0, 00001, "", "" ), + new TSymLookupEntry( 0x0074e790, 00001, "", "" ), + new TSymLookupEntry( 0x0074e9c8, 00001, "", "" ), + new TSymLookupEntry( 0x0074eb58, 00001, "", "" ), + new TSymLookupEntry( 0x0074eef8, 00001, "", "" ), + new TSymLookupEntry( 0x0074f210, 00001, "", "" ), + new TSymLookupEntry( 0x0074f698, 00001, "", "" ), + new TSymLookupEntry( 0x0074f830, 00001, "", "" ), + new TSymLookupEntry( 0x0074f950, 00001, "", "" ), + new TSymLookupEntry( 0x0074fb08, 00001, "", "" ), + new TSymLookupEntry( 0x0074fed0, 00001, "", "" ), + new TSymLookupEntry( 0x00750026, 00001, "", "" ), + new TSymLookupEntry( 0x0075002f, 00005, "", "" ), + new TSymLookupEntry( 0x00750043, 00004, "", "" ), + new TSymLookupEntry( 0x00750046, 00001, "", "" ), + new TSymLookupEntry( 0x0075004b, 00001, "", "" ), + new TSymLookupEntry( 0x0075004c, 00001, "", "" ), + new TSymLookupEntry( 0x0075004e, 00002, "", "" ), + new TSymLookupEntry( 0x00750050, 00005, "", "" ), + new TSymLookupEntry( 0x00750052, 00005, "", "" ), + new TSymLookupEntry( 0x00750053, 00001, "", "" ), + new TSymLookupEntry( 0x00750054, 00031, "", "" ), + new TSymLookupEntry( 0x00750061, 00003, "", "" ), + new TSymLookupEntry( 0x00750062, 00025, "", "" ), + new TSymLookupEntry( 0x00750063, 00012, "", "" ), + new TSymLookupEntry( 0x00750064, 00001, "", "" ), + new TSymLookupEntry( 0x00750066, 00006, "", "" ), + new TSymLookupEntry( 0x00750067, 00001, "", "" ), + new TSymLookupEntry( 0x0075006a, 00004, "", "" ), + new TSymLookupEntry( 0x0075006d, 00005, "", "" ), + new TSymLookupEntry( 0x0075006e, 00005, "", "" ), + new TSymLookupEntry( 0x0075006f, 00005, "", "" ), + new TSymLookupEntry( 0x00750070, 00025, "", "" ), + new TSymLookupEntry( 0x00750071, 00008, "", "" ), + new TSymLookupEntry( 0x00750072, 00003, "", "" ), + new TSymLookupEntry( 0x00750073, 00015, "", "" ), + new TSymLookupEntry( 0x00750075, 00001, "", "" ), + new TSymLookupEntry( 0x00750077, 00001, "", "" ), + new TSymLookupEntry( 0x0075007b, 00001, "", "" ), + new TSymLookupEntry( 0x00750120, 00001, "", "" ), + new TSymLookupEntry( 0x00750ac0, 00001, "", "" ), + new TSymLookupEntry( 0x00750f08, 00001, "", "" ), + new TSymLookupEntry( 0x00751230, 00001, "", "" ), + new TSymLookupEntry( 0x007518d0, 00001, "", "" ), + new TSymLookupEntry( 0x00751b28, 00001, "", "" ), + new TSymLookupEntry( 0x00751b78, 00002, "", "" ), + new TSymLookupEntry( 0x00751bd0, 00001, "", "" ), + new TSymLookupEntry( 0x00751ce8, 00001, "", "" ), + new TSymLookupEntry( 0x00751f68, 00001, "", "" ), + new TSymLookupEntry( 0x00752098, 00001, "", "" ), + new TSymLookupEntry( 0x007521b8, 00001, "", "" ), + new TSymLookupEntry( 0x00752410, 00001, "", "" ), + new TSymLookupEntry( 0x00752d20, 00001, "", "" ), + new TSymLookupEntry( 0x00752d98, 00001, "", "" ), + new TSymLookupEntry( 0x00753138, 00001, "", "" ), + new TSymLookupEntry( 0x00755028, 00001, "", "" ), + new TSymLookupEntry( 0x00757b38, 00001, "", "" ), + new TSymLookupEntry( 0x00759ab8, 00001, "", "" ), + new TSymLookupEntry( 0x0075ab98, 00001, "", "" ), + new TSymLookupEntry( 0x0075af60, 00001, "", "" ), + new TSymLookupEntry( 0x0075b078, 00001, "", "" ), + new TSymLookupEntry( 0x0075b118, 00001, "", "" ), + new TSymLookupEntry( 0x0075b900, 00001, "", "" ), + new TSymLookupEntry( 0x0075bae8, 00001, "", "" ), + new TSymLookupEntry( 0x0075bcf0, 00001, "", "" ), + new TSymLookupEntry( 0x0075bd40, 00001, "", "" ), + new TSymLookupEntry( 0x0075bd90, 00001, "", "" ), + new TSymLookupEntry( 0x0075bea8, 00001, "", "" ), + new TSymLookupEntry( 0x0075c120, 00001, "", "" ), + new TSymLookupEntry( 0x0075c1c8, 00001, "", "" ), + new TSymLookupEntry( 0x0075c290, 00001, "", "" ), + new TSymLookupEntry( 0x0075c5b0, 00001, "", "" ), + new TSymLookupEntry( 0x0075c600, 00001, "", "" ), + new TSymLookupEntry( 0x0075c650, 00001, "", "" ), + new TSymLookupEntry( 0x0075c6f0, 00001, "", "" ), + new TSymLookupEntry( 0x0075cd00, 00001, "", "" ), + new TSymLookupEntry( 0x0075cda0, 00001, "", "" ), + new TSymLookupEntry( 0x0075d818, 00001, "", "" ), + new TSymLookupEntry( 0x0075dde8, 00001, "", "" ), + new TSymLookupEntry( 0x0075de88, 00001, "", "" ), + new TSymLookupEntry( 0x0075e320, 00001, "", "" ), + new TSymLookupEntry( 0x0075e3c0, 00001, "", "" ), + new TSymLookupEntry( 0x0075e5a0, 00001, "", "" ), + new TSymLookupEntry( 0x0075ed88, 00001, "", "" ), + new TSymLookupEntry( 0x0075f230, 00001, "", "" ), + new TSymLookupEntry( 0x0075f378, 00001, "", "" ), + new TSymLookupEntry( 0x0075fbf8, 00001, "", "" ), + new TSymLookupEntry( 0x0075fc98, 00001, "", "" ), + new TSymLookupEntry( 0x0075fd10, 00001, "", "" ), + new TSymLookupEntry( 0x0075fd88, 00001, "", "" ), + new TSymLookupEntry( 0x00760026, 00001, "", "" ), + new TSymLookupEntry( 0x0076002a, 00001, "", "" ), + new TSymLookupEntry( 0x0076003a, 00002, "", "" ), + new TSymLookupEntry( 0x0076003c, 00001, "", "" ), + new TSymLookupEntry( 0x00760045, 00002, "", "" ), + new TSymLookupEntry( 0x0076005b, 00002, "", "" ), + new TSymLookupEntry( 0x0076005d, 00001, "", "" ), + new TSymLookupEntry( 0x00760061, 00004, "", "" ), + new TSymLookupEntry( 0x00760065, 00015, "", "" ), + new TSymLookupEntry( 0x00760067, 00001, "", "" ), + new TSymLookupEntry( 0x00760069, 00003, "", "" ), + new TSymLookupEntry( 0x0076006a, 00001, "", "" ), + new TSymLookupEntry( 0x0076006d, 00003, "", "" ), + new TSymLookupEntry( 0x0076006e, 00001, "", "" ), + new TSymLookupEntry( 0x0076006f, 00005, "", "" ), + new TSymLookupEntry( 0x00760270, 00001, "", "" ), + new TSymLookupEntry( 0x007602c0, 00001, "", "" ), + new TSymLookupEntry( 0x00760590, 00001, "", "" ), + new TSymLookupEntry( 0x007605e0, 00002, "", "" ), + new TSymLookupEntry( 0x00760a00, 00001, "", "" ), + new TSymLookupEntry( 0x00760b90, 00001, "", "" ), + new TSymLookupEntry( 0x00760be0, 00001, "", "" ), + new TSymLookupEntry( 0x00760e68, 00001, "", "" ), + new TSymLookupEntry( 0x00760ee0, 00001, "", "" ), + new TSymLookupEntry( 0x00760f30, 00001, "", "" ), + new TSymLookupEntry( 0x007618a8, 00001, "", "" ), + new TSymLookupEntry( 0x007618f8, 00001, "", "" ), + new TSymLookupEntry( 0x00761998, 00001, "", "" ), + new TSymLookupEntry( 0x00761a88, 00001, "", "" ), + new TSymLookupEntry( 0x00762210, 00001, "", "" ), + new TSymLookupEntry( 0x00762418, 00001, "", "" ), + new TSymLookupEntry( 0x00762490, 00001, "", "" ), + new TSymLookupEntry( 0x00762620, 00001, "", "" ), + new TSymLookupEntry( 0x007626c0, 00001, "", "" ), + new TSymLookupEntry( 0x00762808, 00001, "", "" ), + new TSymLookupEntry( 0x00762970, 00001, "", "" ), + new TSymLookupEntry( 0x00762a10, 00001, "", "" ), + new TSymLookupEntry( 0x00762db8, 00001, "", "" ), + new TSymLookupEntry( 0x00762f50, 00001, "", "" ), + new TSymLookupEntry( 0x00763000, 00001, "", "" ), + new TSymLookupEntry( 0x007630a8, 00001, "", "" ), + new TSymLookupEntry( 0x007631e8, 00001, "", "" ), + new TSymLookupEntry( 0x007633a0, 00001, "", "" ), + new TSymLookupEntry( 0x007636f8, 00001, "", "" ), + new TSymLookupEntry( 0x007638b0, 00001, "", "" ), + new TSymLookupEntry( 0x00763958, 00001, "", "" ), + new TSymLookupEntry( 0x007639a8, 00001, "", "" ), + new TSymLookupEntry( 0x00763a50, 00001, "", "" ), + new TSymLookupEntry( 0x00763aa0, 00001, "", "" ), + new TSymLookupEntry( 0x00763b18, 00001, "", "" ), + new TSymLookupEntry( 0x00763c30, 00001, "", "" ), + new TSymLookupEntry( 0x00763cb0, 00001, "", "" ), + new TSymLookupEntry( 0x00763fc0, 00001, "", "" ), + new TSymLookupEntry( 0x00764450, 00001, "", "" ), + new TSymLookupEntry( 0x007644a0, 00001, "", "" ), + new TSymLookupEntry( 0x007644f0, 00001, "", "" ), + new TSymLookupEntry( 0x00764950, 00001, "", "" ), + new TSymLookupEntry( 0x007650d0, 00001, "", "" ), + new TSymLookupEntry( 0x00765700, 00001, "", "" ), + new TSymLookupEntry( 0x00765ab0, 00001, "", "" ), + new TSymLookupEntry( 0x00765bf8, 00001, "", "" ), + new TSymLookupEntry( 0x007662b0, 00001, "", "" ), + new TSymLookupEntry( 0x00767120, 00001, "", "" ), + new TSymLookupEntry( 0x00768b90, 00001, "", "" ), + new TSymLookupEntry( 0x00769218, 00001, "", "" ), + new TSymLookupEntry( 0x00769400, 00001, "", "" ), + new TSymLookupEntry( 0x00769478, 00001, "", "" ), + new TSymLookupEntry( 0x00769dd0, 00001, "", "" ), + new TSymLookupEntry( 0x0076ab28, 00001, "", "" ), + new TSymLookupEntry( 0x0076b540, 00001, "", "" ), + new TSymLookupEntry( 0x0076bd38, 00009, "", "" ), + new TSymLookupEntry( 0x0076bf80, 00001, "", "" ), + new TSymLookupEntry( 0x0076e430, 00001, "", "" ), + new TSymLookupEntry( 0x0076e690, 00001, "", "" ), + new TSymLookupEntry( 0x0076fcb0, 00002, "", "" ), + new TSymLookupEntry( 0x00770023, 00001, "", "" ), + new TSymLookupEntry( 0x0077002d, 00012, "", "" ), + new TSymLookupEntry( 0x00770030, 00001, "", "" ), + new TSymLookupEntry( 0x00770067, 00001, "", "" ), + new TSymLookupEntry( 0x0077006d, 00001, "", "" ), + new TSymLookupEntry( 0x0077006e, 00002, "", "" ), + new TSymLookupEntry( 0x0077006f, 00001, "", "" ), + new TSymLookupEntry( 0x00770073, 00003, "", "" ), + new TSymLookupEntry( 0x00770a88, 00001, "", "" ), + new TSymLookupEntry( 0x007740c8, 00001, "", "" ), + new TSymLookupEntry( 0x00774f08, 00001, "", "" ), + new TSymLookupEntry( 0x007752d0, 00001, "", "" ), + new TSymLookupEntry( 0x00775710, 00004, "", "" ), + new TSymLookupEntry( 0x00776990, 00001, "", "" ), + new TSymLookupEntry( 0x00776a58, 00001, "", "" ), + new TSymLookupEntry( 0x00776be8, 00001, "", "" ), + new TSymLookupEntry( 0x007772e0, 00001, "", "" ), + new TSymLookupEntry( 0x007783c0, 00001, "", "" ), + new TSymLookupEntry( 0x00778ad0, 00001, "", "" ), + new TSymLookupEntry( 0x00779950, 00001, "", "" ), + new TSymLookupEntry( 0x007799d0, 00001, "", "" ), + new TSymLookupEntry( 0x00779d00, 00001, "", "" ), + new TSymLookupEntry( 0x0077a410, 00001, "", "" ), + new TSymLookupEntry( 0x0077a530, 00001, "", "" ), + new TSymLookupEntry( 0x0077a648, 00002, "", "" ), + new TSymLookupEntry( 0x0077a6c0, 00001, "", "" ), + new TSymLookupEntry( 0x0077add0, 00001, "", "" ), + new TSymLookupEntry( 0x0077b0a0, 00001, "", "" ), + new TSymLookupEntry( 0x0077b708, 00001, "", "" ), + new TSymLookupEntry( 0x0077b758, 00001, "", "" ), + new TSymLookupEntry( 0x0077c308, 00001, "", "" ), + new TSymLookupEntry( 0x0077e930, 00001, "", "" ), + new TSymLookupEntry( 0x0077ea70, 00001, "", "" ), + new TSymLookupEntry( 0x0077ede0, 00001, "", "" ), + new TSymLookupEntry( 0x0077ef98, 00001, "", "" ), + new TSymLookupEntry( 0x0077f298, 00001, "", "" ), + new TSymLookupEntry( 0x0077fc60, 00001, "", "" ), + new TSymLookupEntry( 0x00780023, 00001, "", "" ), + new TSymLookupEntry( 0x0078002e, 00001, "", "" ), + new TSymLookupEntry( 0x0078003a, 00001, "", "" ), + new TSymLookupEntry( 0x00780045, 00002, "", "" ), + new TSymLookupEntry( 0x0078005b, 00001, "", "" ), + new TSymLookupEntry( 0x00780061, 00002, "", "" ), + new TSymLookupEntry( 0x00780065, 00009, "", "" ), + new TSymLookupEntry( 0x00780066, 00004, "", "" ), + new TSymLookupEntry( 0x00780067, 00001, "", "" ), + new TSymLookupEntry( 0x00780070, 00009, "", "" ), + new TSymLookupEntry( 0x007806f0, 00002, "", "" ), + new TSymLookupEntry( 0x007814e0, 00001, "", "" ), + new TSymLookupEntry( 0x00782418, 00001, "", "" ), + new TSymLookupEntry( 0x00783f00, 00001, "", "" ), + new TSymLookupEntry( 0x00784320, 00001, "", "" ), + new TSymLookupEntry( 0x007844d8, 00001, "", "" ), + new TSymLookupEntry( 0x00784730, 00002, "", "" ), + new TSymLookupEntry( 0x00784878, 00001, "", "" ), + new TSymLookupEntry( 0x00784940, 00001, "", "" ), + new TSymLookupEntry( 0x00784e30, 00001, "", "" ), + new TSymLookupEntry( 0x00785498, 00001, "", "" ), + new TSymLookupEntry( 0x00785a90, 00001, "", "" ), + new TSymLookupEntry( 0x00785f48, 00001, "", "" ), + new TSymLookupEntry( 0x00785fc0, 00001, "", "" ), + new TSymLookupEntry( 0x007864c0, 00001, "", "" ), + new TSymLookupEntry( 0x00786858, 00001, "", "" ), + new TSymLookupEntry( 0x00787080, 00001, "", "" ), + new TSymLookupEntry( 0x00789bf8, 00001, "", "" ), + new TSymLookupEntry( 0x0078a960, 00001, "", "" ), + new TSymLookupEntry( 0x0078b840, 00001, "", "" ), + new TSymLookupEntry( 0x0078bc28, 00001, "", "" ), + new TSymLookupEntry( 0x0078c690, 00001, "", "" ), + new TSymLookupEntry( 0x0078d3f8, 00001, "", "" ), + new TSymLookupEntry( 0x0078d6c8, 00001, "", "" ), + new TSymLookupEntry( 0x0078d7c0, 00001, "", "" ), + new TSymLookupEntry( 0x0078ddb0, 00001, "", "" ), + new TSymLookupEntry( 0x0078dfe0, 00001, "", "" ), + new TSymLookupEntry( 0x0078e5a8, 00001, "", "" ), + new TSymLookupEntry( 0x0078e990, 00001, "", "" ), + new TSymLookupEntry( 0x0078eee8, 00001, "", "" ), + new TSymLookupEntry( 0x0078f3c0, 00001, "", "" ), + new TSymLookupEntry( 0x0078f6b8, 00001, "", "" ), + new TSymLookupEntry( 0x0078f910, 00001, "", "" ), + new TSymLookupEntry( 0x00790021, 00001, "", "" ), + new TSymLookupEntry( 0x0079002a, 00001, "", "" ), + new TSymLookupEntry( 0x00790030, 00002, "", "" ), + new TSymLookupEntry( 0x00790053, 00002, "", "" ), + new TSymLookupEntry( 0x00790054, 00002, "", "" ), + new TSymLookupEntry( 0x00790063, 00001, "", "" ), + new TSymLookupEntry( 0x00790074, 00005, "", "" ), + new TSymLookupEntry( 0x00790079, 00001, "", "" ), + new TSymLookupEntry( 0x007901b8, 00001, "", "" ), + new TSymLookupEntry( 0x00791d50, 00001, "", "" ), + new TSymLookupEntry( 0x00791da0, 00001, "", "" ), + new TSymLookupEntry( 0x00791f38, 00001, "", "" ), + new TSymLookupEntry( 0x00791f88, 00001, "", "" ), + new TSymLookupEntry( 0x00792140, 00001, "", "" ), + new TSymLookupEntry( 0x00793790, 00001, "", "" ), + new TSymLookupEntry( 0x00793d88, 00001, "", "" ), + new TSymLookupEntry( 0x007948a8, 00001, "", "" ), + new TSymLookupEntry( 0x00794b30, 00001, "", "" ), + new TSymLookupEntry( 0x00794c80, 00001, "", "" ), + new TSymLookupEntry( 0x00794ff8, 00001, "", "" ), + new TSymLookupEntry( 0x00795080, 00001, "", "" ), + new TSymLookupEntry( 0x00795210, 00001, "", "" ), + new TSymLookupEntry( 0x00795420, 00001, "", "" ), + new TSymLookupEntry( 0x00795868, 00001, "", "" ), + new TSymLookupEntry( 0x00795b40, 00001, "", "" ), + new TSymLookupEntry( 0x00795c30, 00001, "", "" ), + new TSymLookupEntry( 0x00796148, 00001, "", "" ), + new TSymLookupEntry( 0x0079656b, 00001, "", "" ), + new TSymLookupEntry( 0x00796650, 00001, "", "" ), + new TSymLookupEntry( 0x007968f8, 00001, "", "" ), + new TSymLookupEntry( 0x00796a10, 00001, "", "" ), + new TSymLookupEntry( 0x00796ba0, 00001, "", "" ), + new TSymLookupEntry( 0x00796e70, 00001, "", "" ), + new TSymLookupEntry( 0x007973a0, 00001, "", "" ), + new TSymLookupEntry( 0x00798288, 00001, "", "" ), + new TSymLookupEntry( 0x00798468, 00001, "", "" ), + new TSymLookupEntry( 0x00798828, 00001, "", "" ), + new TSymLookupEntry( 0x00798ce8, 00001, "", "" ), + new TSymLookupEntry( 0x007995a8, 00001, "", "" ), + new TSymLookupEntry( 0x00799698, 00001, "", "" ), + new TSymLookupEntry( 0x007999f0, 00001, "", "" ), + new TSymLookupEntry( 0x0079a438, 00001, "", "" ), + new TSymLookupEntry( 0x0079a680, 00001, "", "" ), + new TSymLookupEntry( 0x0079ab08, 00001, "", "" ), + new TSymLookupEntry( 0x0079ad90, 00001, "", "" ), + new TSymLookupEntry( 0x0079b080, 00001, "", "" ), + new TSymLookupEntry( 0x0079b560, 00001, "", "" ), + new TSymLookupEntry( 0x0079bb00, 00001, "", "" ), + new TSymLookupEntry( 0x0079bd08, 00001, "", "" ), + new TSymLookupEntry( 0x0079c238, 00001, "", "" ), + new TSymLookupEntry( 0x0079c3f0, 00001, "", "" ), + new TSymLookupEntry( 0x0079c6e8, 00001, "", "" ), + new TSymLookupEntry( 0x0079d050, 00001, "", "" ), + new TSymLookupEntry( 0x0079d258, 00001, "", "" ), + new TSymLookupEntry( 0x0079d2a8, 00002, "", "" ), + new TSymLookupEntry( 0x0079d640, 00001, "", "" ), + new TSymLookupEntry( 0x0079dd20, 00001, "", "" ), + new TSymLookupEntry( 0x0079dd70, 00001, "", "" ), + new TSymLookupEntry( 0x0079e508, 00001, "", "" ), + new TSymLookupEntry( 0x0079e800, 00001, "", "" ), + new TSymLookupEntry( 0x0079eba0, 00001, "", "" ), + new TSymLookupEntry( 0x0079ec68, 00001, "", "" ), + new TSymLookupEntry( 0x0079edb0, 00001, "", "" ), + new TSymLookupEntry( 0x0079f058, 00001, "", "" ), + new TSymLookupEntry( 0x0079f160, 00001, "", "" ), + new TSymLookupEntry( 0x0079f468, 00001, "", "" ), + new TSymLookupEntry( 0x0079f7b8, 00001, "", "" ), + new TSymLookupEntry( 0x0079f858, 00001, "", "" ), + new TSymLookupEntry( 0x0079f9f0, 00001, "", "" ), + new TSymLookupEntry( 0x0079fb38, 00001, "", "" ), + new TSymLookupEntry( 0x0079fb88, 00001, "", "" ), + new TSymLookupEntry( 0x0079fcd8, 00001, "", "" ), + new TSymLookupEntry( 0x0079fef0, 00001, "", "" ), + new TSymLookupEntry( 0x0079ffe0, 00002, "", "" ), + new TSymLookupEntry( 0x007a0020, 00001, "", "" ), + new TSymLookupEntry( 0x007a0030, 00001, "", "" ), + new TSymLookupEntry( 0x007a06a0, 00001, "", "" ), + new TSymLookupEntry( 0x007a09e8, 00001, "", "" ), + new TSymLookupEntry( 0x007a0a60, 00001, "", "" ), + new TSymLookupEntry( 0x007a1080, 00001, "", "" ), + new TSymLookupEntry( 0x007a14a0, 00001, "", "" ), + new TSymLookupEntry( 0x007a1eb8, 00001, "", "" ), + new TSymLookupEntry( 0x007a2168, 00001, "", "" ), + new TSymLookupEntry( 0x007a26a8, 00001, "", "" ), + new TSymLookupEntry( 0x007a2928, 00001, "", "" ), + new TSymLookupEntry( 0x007a3448, 00001, "", "" ), + new TSymLookupEntry( 0x007a45c8, 00001, "", "" ), + new TSymLookupEntry( 0x007a4970, 00001, "", "" ), + new TSymLookupEntry( 0x007a4ad8, 00001, "", "" ), + new TSymLookupEntry( 0x007a4e80, 00001, "", "" ), + new TSymLookupEntry( 0x007a53a0, 00001, "", "" ), + new TSymLookupEntry( 0x007a54e0, 00001, "", "" ), + new TSymLookupEntry( 0x007a5710, 00001, "", "" ), + new TSymLookupEntry( 0x007a5b58, 00001, "", "" ), + new TSymLookupEntry( 0x007a5e08, 00001, "", "" ), + new TSymLookupEntry( 0x007a6148, 00001, "", "" ), + new TSymLookupEntry( 0x007a6530, 00001, "", "" ), + new TSymLookupEntry( 0x007a6b88, 00001, "", "" ), + new TSymLookupEntry( 0x007a732c, 00001, "", "" ), + new TSymLookupEntry( 0x007a7b38, 00001, "", "" ), + new TSymLookupEntry( 0x007a7c08, 00001, "", "" ), + new TSymLookupEntry( 0x007a7de8, 00001, "", "" ), + new TSymLookupEntry( 0x007a7e38, 00001, "", "" ), + new TSymLookupEntry( 0x007a7f78, 00001, "", "" ), + new TSymLookupEntry( 0x007a87a8, 00001, "", "" ), + new TSymLookupEntry( 0x007a89d8, 00001, "", "" ), + new TSymLookupEntry( 0x007a9470, 00001, "", "" ), + new TSymLookupEntry( 0x007a9728, 00001, "", "" ), + new TSymLookupEntry( 0x007a9778, 00001, "", "" ), + new TSymLookupEntry( 0x007a9868, 00001, "", "" ), + new TSymLookupEntry( 0x007a9aa0, 00001, "", "" ), + new TSymLookupEntry( 0x007a9b90, 00001, "", "" ), + new TSymLookupEntry( 0x007a9d70, 00001, "", "" ), + new TSymLookupEntry( 0x007a9fd8, 00001, "", "" ), + new TSymLookupEntry( 0x007aa300, 00001, "", "" ), + new TSymLookupEntry( 0x007aa510, 00001, "", "" ), + new TSymLookupEntry( 0x007aa7c0, 00001, "", "" ), + new TSymLookupEntry( 0x007aabd8, 00001, "", "" ), + new TSymLookupEntry( 0x007ab358, 00001, "", "" ), + new TSymLookupEntry( 0x007ab448, 00001, "", "" ), + new TSymLookupEntry( 0x007ab748, 00001, "", "" ), + new TSymLookupEntry( 0x007abac0, 00001, "", "" ), + new TSymLookupEntry( 0x007ac690, 00001, "", "" ), + new TSymLookupEntry( 0x007ad618, 00001, "", "" ), + new TSymLookupEntry( 0x007adc80, 00001, "", "" ), + new TSymLookupEntry( 0x007adde8, 00001, "", "" ), + new TSymLookupEntry( 0x007ae260, 00001, "", "" ), + new TSymLookupEntry( 0x007ae8a8, 00001, "", "" ), + new TSymLookupEntry( 0x007aea60, 00001, "", "" ), + new TSymLookupEntry( 0x007aeda8, 00001, "", "" ), + new TSymLookupEntry( 0x007af1e0, 00001, "", "" ), + new TSymLookupEntry( 0x007af990, 00001, "", "" ), + new TSymLookupEntry( 0x007afc10, 00001, "", "" ), + new TSymLookupEntry( 0x007b0030, 00002, "", "" ), + new TSymLookupEntry( 0x007b0067, 00001, "", "" ), + new TSymLookupEntry( 0x007b0069, 00002, "", "" ), + new TSymLookupEntry( 0x007b0120, 00001, "", "" ), + new TSymLookupEntry( 0x007b0b50, 00001, "", "" ), + new TSymLookupEntry( 0x007b0f7c, 00001, "", "" ), + new TSymLookupEntry( 0x007b0f80, 00001, "", "" ), + new TSymLookupEntry( 0x007b22e8, 00001, "", "" ), + new TSymLookupEntry( 0x007b26c0, 00001, "", "" ), + new TSymLookupEntry( 0x007b3078, 00001, "", "" ), + new TSymLookupEntry( 0x007b30c8, 00001, "", "" ), + new TSymLookupEntry( 0x007b31b8, 00001, "", "" ), + new TSymLookupEntry( 0x007b3258, 00001, "", "" ), + new TSymLookupEntry( 0x007b35a8, 00001, "", "" ), + new TSymLookupEntry( 0x007b3bf0, 00001, "", "" ), + new TSymLookupEntry( 0x007b3f48, 00001, "", "" ), + new TSymLookupEntry( 0x007b42d8, 00001, "", "" ), + new TSymLookupEntry( 0x007b46c8, 00001, "", "" ), + new TSymLookupEntry( 0x007b5000, 00001, "", "" ), + new TSymLookupEntry( 0x007b5958, 00001, "", "" ), + new TSymLookupEntry( 0x007b5a20, 00001, "", "" ), + new TSymLookupEntry( 0x007b5ce8, 00001, "", "" ), + new TSymLookupEntry( 0x007b5d38, 00001, "", "" ), + new TSymLookupEntry( 0x007b5ef0, 00001, "", "" ), + new TSymLookupEntry( 0x007b60f0, 00001, "", "" ), + new TSymLookupEntry( 0x007b6580, 00001, "", "" ), + new TSymLookupEntry( 0x007b6838, 00001, "", "" ), + new TSymLookupEntry( 0x007b6df8, 00001, "", "" ), + new TSymLookupEntry( 0x007b6fb0, 00001, "", "" ), + new TSymLookupEntry( 0x007b70f0, 00001, "", "" ), + new TSymLookupEntry( 0x007b7848, 00001, "", "" ), + new TSymLookupEntry( 0x007b7a28, 00001, "", "" ), + new TSymLookupEntry( 0x007b9370, 00001, "", "" ), + new TSymLookupEntry( 0x007b9b28, 00001, "", "" ), + new TSymLookupEntry( 0x007ba2e0, 00001, "", "" ), + new TSymLookupEntry( 0x007ba7e8, 00001, "", "" ), + new TSymLookupEntry( 0x007bae50, 00001, "", "" ), + new TSymLookupEntry( 0x007bb928, 00001, "", "" ), + new TSymLookupEntry( 0x007bc9a8, 00001, "", "" ), + new TSymLookupEntry( 0x007bcca0, 00001, "", "" ), + new TSymLookupEntry( 0x007bce60, 00001, "", "" ), + new TSymLookupEntry( 0x007bd108, 00001, "", "" ), + new TSymLookupEntry( 0x007bd758, 00001, "", "" ), + new TSymLookupEntry( 0x007bd848, 00001, "", "" ), + new TSymLookupEntry( 0x007bda00, 00001, "", "" ), + new TSymLookupEntry( 0x007bdf08, 00001, "", "" ), + new TSymLookupEntry( 0x007be648, 00001, "", "" ), + new TSymLookupEntry( 0x007bedd0, 00001, "", "" ), + new TSymLookupEntry( 0x007bf000, 00001, "", "" ), + new TSymLookupEntry( 0x007bf5d0, 00001, "", "" ), + new TSymLookupEntry( 0x007bf948, 00001, "", "" ), + new TSymLookupEntry( 0x007bfbc8, 00001, "", "" ), + new TSymLookupEntry( 0x007bfd10, 00001, "", "" ), + new TSymLookupEntry( 0x007bfe78, 00001, "", "" ), + new TSymLookupEntry( 0x007c0026, 00002, "", "" ), + new TSymLookupEntry( 0x007c003f, 00002, "", "" ), + new TSymLookupEntry( 0x007c0210, 00001, "", "" ), + new TSymLookupEntry( 0x007c0830, 00001, "", "" ), + new TSymLookupEntry( 0x007c0cf8, 00001, "", "" ), + new TSymLookupEntry( 0x007c0f30, 00001, "", "" ), + new TSymLookupEntry( 0x007c1208, 00001, "", "" ), + new TSymLookupEntry( 0x007c1580, 00001, "", "" ), + new TSymLookupEntry( 0x007c1be0, 00001, "", "" ), + new TSymLookupEntry( 0x007c23f0, 00001, "", "" ), + new TSymLookupEntry( 0x007c26d8, 00001, "", "" ), + new TSymLookupEntry( 0x007c2928, 00001, "", "" ), + new TSymLookupEntry( 0x007c2978, 00001, "", "" ), + new TSymLookupEntry( 0x007c2c60, 00001, "", "" ), + new TSymLookupEntry( 0x007c2cb0, 00001, "", "" ), + new TSymLookupEntry( 0x007c3050, 00001, "", "" ), + new TSymLookupEntry( 0x007c3210, 00005, "", "" ), + new TSymLookupEntry( 0x007c33a8, 00001, "", "" ), + new TSymLookupEntry( 0x007c3628, 00001, "", "" ), + new TSymLookupEntry( 0x007c3b58, 00001, "", "" ), + new TSymLookupEntry( 0x007c3c48, 00001, "", "" ), + new TSymLookupEntry( 0x007c3ea0, 00001, "", "" ), + new TSymLookupEntry( 0x007c4050, 00001, "", "" ), + new TSymLookupEntry( 0x007c4d28, 00001, "", "" ), + new TSymLookupEntry( 0x007c5050, 00001, "", "" ), + new TSymLookupEntry( 0x007c52d0, 00001, "", "" ), + new TSymLookupEntry( 0x007c5620, 00001, "", "" ), + new TSymLookupEntry( 0x007c5bac, 00001, "", "" ), + new TSymLookupEntry( 0x007c5dc0, 00001, "", "" ), + new TSymLookupEntry( 0x007c6cf0, 00001, "", "" ), + new TSymLookupEntry( 0x007c7148, 00001, "", "" ), + new TSymLookupEntry( 0x007c73c8, 00001, "", "" ), + new TSymLookupEntry( 0x007c7710, 00001, "", "" ), + new TSymLookupEntry( 0x007c8230, 00001, "", "" ), + new TSymLookupEntry( 0x007c8470, 00001, "", "" ), + new TSymLookupEntry( 0x007c88f8, 00001, "", "" ), + new TSymLookupEntry( 0x007c9200, 00001, "", "" ), + new TSymLookupEntry( 0x007c92a0, 00001, "", "" ), + new TSymLookupEntry( 0x007c9ba8, 00001, "", "" ), + new TSymLookupEntry( 0x007cb5d0, 00001, "", "" ), + new TSymLookupEntry( 0x007cbce8, 00001, "", "" ), + new TSymLookupEntry( 0x007cbd48, 00001, "", "" ), + new TSymLookupEntry( 0x007cf338, 00001, "", "" ), + new TSymLookupEntry( 0x007cf848, 00001, "", "" ), + new TSymLookupEntry( 0x007cfa58, 00001, "", "" ), + new TSymLookupEntry( 0x007d0031, 00001, "", "" ), + new TSymLookupEntry( 0x007d003b, 00001, "", "" ), + new TSymLookupEntry( 0x007d0210, 00001, "", "" ), + new TSymLookupEntry( 0x007d06f0, 00003, "", "" ), + new TSymLookupEntry( 0x007d0868, 00001, "", "" ), + new TSymLookupEntry( 0x007d0c60, 00001, "", "" ), + new TSymLookupEntry( 0x007d0f60, 00001, "", "" ), + new TSymLookupEntry( 0x007d1280, 00001, "", "" ), + new TSymLookupEntry( 0x007d1978, 00001, "", "" ), + new TSymLookupEntry( 0x007d1bdc, 00001, "", "" ), + new TSymLookupEntry( 0x007d2514, 00001, "", "" ), + new TSymLookupEntry( 0x007d29f0, 00001, "", "" ), + new TSymLookupEntry( 0x007d2a98, 00001, "", "" ), + new TSymLookupEntry( 0x007d2d40, 00001, "", "" ), + new TSymLookupEntry( 0x007d2d90, 00001, "", "" ), + new TSymLookupEntry( 0x007d3168, 00001, "", "" ), + new TSymLookupEntry( 0x007d3648, 00001, "", "" ), + new TSymLookupEntry( 0x007d38d0, 00001, "", "" ), + new TSymLookupEntry( 0x007d3e88, 00001, "", "" ), + new TSymLookupEntry( 0x007d4120, 00001, "", "" ), + new TSymLookupEntry( 0x007d44f0, 00001, "", "" ), + new TSymLookupEntry( 0x007d4cc0, 00001, "", "" ), + new TSymLookupEntry( 0x007d5900, 00001, "", "" ), + new TSymLookupEntry( 0x007d5a68, 00001, "", "" ), + new TSymLookupEntry( 0x007d5ab8, 00001, "", "" ), + new TSymLookupEntry( 0x007d5c28, 00001, "", "" ), + new TSymLookupEntry( 0x007d5d68, 00001, "", "" ), + new TSymLookupEntry( 0x007d61f0, 00001, "", "" ), + new TSymLookupEntry( 0x007d64c0, 00001, "", "" ), + new TSymLookupEntry( 0x007d6950, 00001, "", "" ), + new TSymLookupEntry( 0x007d6cc8, 00001, "", "" ), + new TSymLookupEntry( 0x007d6de0, 00001, "", "" ), + new TSymLookupEntry( 0x007d7450, 00001, "", "" ), + new TSymLookupEntry( 0x007d7658, 00001, "", "" ), + new TSymLookupEntry( 0x007d8bd8, 00001, "", "" ), + new TSymLookupEntry( 0x007d8ec8, 00001, "", "" ), + new TSymLookupEntry( 0x007d8f20, 00001, "", "" ), + new TSymLookupEntry( 0x007d8f70, 00002, "", "" ), + new TSymLookupEntry( 0x007d9360, 00001, "", "" ), + new TSymLookupEntry( 0x007d9428, 00001, "", "" ), + new TSymLookupEntry( 0x007d97c0, 00001, "", "" ), + new TSymLookupEntry( 0x007d9cd8, 00001, "", "" ), + new TSymLookupEntry( 0x007da500, 00001, "", "" ), + new TSymLookupEntry( 0x007da740, 00001, "", "" ), + new TSymLookupEntry( 0x007daa48, 00001, "", "" ), + new TSymLookupEntry( 0x007dac28, 00001, "", "" ), + new TSymLookupEntry( 0x007dae80, 00001, "", "" ), + new TSymLookupEntry( 0x007db280, 00001, "", "" ), + new TSymLookupEntry( 0x007db3a0, 00001, "", "" ), + new TSymLookupEntry( 0x007dbc58, 00001, "", "" ), + new TSymLookupEntry( 0x007dbed8, 00001, "", "" ), + new TSymLookupEntry( 0x007dc418, 00001, "", "" ), + new TSymLookupEntry( 0x007dc838, 00001, "", "" ), + new TSymLookupEntry( 0x007dc980, 00001, "", "" ), + new TSymLookupEntry( 0x007dd0a0, 00001, "", "" ), + new TSymLookupEntry( 0x007ddbf0, 00001, "", "" ), + new TSymLookupEntry( 0x007de260, 00001, "", "" ), + new TSymLookupEntry( 0x007de768, 00001, "", "" ), + new TSymLookupEntry( 0x007df1b8, 00001, "", "" ), + new TSymLookupEntry( 0x007e0026, 00001, "", "" ), + new TSymLookupEntry( 0x007e002b, 00001, "", "" ), + new TSymLookupEntry( 0x007e0030, 00001, "", "" ), + new TSymLookupEntry( 0x007e0067, 00001, "", "" ), + new TSymLookupEntry( 0x007e2910, 00001, "", "" ), + new TSymLookupEntry( 0x007e38e0, 00001, "", "" ), + new TSymLookupEntry( 0x007e3bbc, 00001, "", "" ), + new TSymLookupEntry( 0x007e3f08, 00001, "", "" ), + new TSymLookupEntry( 0x007e5670, 00001, "", "" ), + new TSymLookupEntry( 0x007e69a8, 00001, "", "" ), + new TSymLookupEntry( 0x007e6a20, 00001, "", "" ), + new TSymLookupEntry( 0x007e70a0, 00001, "", "" ), + new TSymLookupEntry( 0x007e7538, 00001, "", "" ), + new TSymLookupEntry( 0x007e7680, 00001, "", "" ), + new TSymLookupEntry( 0x007e7fa0, 00001, "", "" ), + new TSymLookupEntry( 0x007e8240, 00001, "", "" ), + new TSymLookupEntry( 0x007e9358, 00001, "", "" ), + new TSymLookupEntry( 0x007e9408, 00001, "", "" ), + new TSymLookupEntry( 0x007e97d0, 00001, "", "" ), + new TSymLookupEntry( 0x007e9878, 00001, "", "" ), + new TSymLookupEntry( 0x007e9b28, 00001, "", "" ), + new TSymLookupEntry( 0x007e9ba0, 00001, "", "" ), + new TSymLookupEntry( 0x007ea120, 00001, "", "" ), + new TSymLookupEntry( 0x007ea448, 00001, "", "" ), + new TSymLookupEntry( 0x007ea978, 00001, "", "" ), + new TSymLookupEntry( 0x007eac30, 00001, "", "" ), + new TSymLookupEntry( 0x007ead20, 00001, "", "" ), + new TSymLookupEntry( 0x007eb000, 00001, "", "" ), + new TSymLookupEntry( 0x007eb148, 00001, "", "" ), + new TSymLookupEntry( 0x007eb6a8, 00001, "", "" ), + new TSymLookupEntry( 0x007eb870, 00001, "", "" ), + new TSymLookupEntry( 0x007ebb20, 00001, "", "" ), + new TSymLookupEntry( 0x007ec190, 00001, "", "" ), + new TSymLookupEntry( 0x007ec808, 00001, "", "" ), + new TSymLookupEntry( 0x007ed5b8, 00001, "", "" ), + new TSymLookupEntry( 0x007ed928, 00001, "", "" ), + new TSymLookupEntry( 0x007ed978, 00004, "", "" ), + new TSymLookupEntry( 0x007eda48, 00001, "", "" ), + new TSymLookupEntry( 0x007ede48, 00001, "", "" ), + new TSymLookupEntry( 0x007edfb8, 00001, "", "" ), + new TSymLookupEntry( 0x007ee648, 00001, "", "" ), + new TSymLookupEntry( 0x007ee698, 00001, "", "" ), + new TSymLookupEntry( 0x007ee8f0, 00001, "", "" ), + new TSymLookupEntry( 0x007eeb78, 00001, "", "" ), + new TSymLookupEntry( 0x007eeea8, 00001, "", "" ), + new TSymLookupEntry( 0x007ef268, 00001, "", "" ), + new TSymLookupEntry( 0x007ef588, 00001, "", "" ), + new TSymLookupEntry( 0x007efac8, 00001, "", "" ), + new TSymLookupEntry( 0x007efe68, 00001, "", "" ), + new TSymLookupEntry( 0x007f0030, 00001, "", "" ), + new TSymLookupEntry( 0x007f0031, 00001, "", "" ), + new TSymLookupEntry( 0x007f0250, 00001, "", "" ), + new TSymLookupEntry( 0x007f0be4, 00001, "", "" ), + new TSymLookupEntry( 0x007f1758, 00001, "", "" ), + new TSymLookupEntry( 0x007f1c30, 00001, "", "" ), + new TSymLookupEntry( 0x007f1de8, 00001, "", "" ), + new TSymLookupEntry( 0x007f1f08, 00001, "", "" ), + new TSymLookupEntry( 0x007f21b8, 00001, "", "" ), + new TSymLookupEntry( 0x007f28e8, 00001, "", "" ), + new TSymLookupEntry( 0x007f2a78, 00001, "", "" ), + new TSymLookupEntry( 0x007f36e8, 00001, "", "" ), + new TSymLookupEntry( 0x007f39c8, 00001, "", "" ), + new TSymLookupEntry( 0x007f3a18, 00001, "", "" ), + new TSymLookupEntry( 0x007f3e80, 00001, "", "" ), + new TSymLookupEntry( 0x007f3ed0, 00001, "", "" ), + new TSymLookupEntry( 0x007f4528, 00001, "", "" ), + new TSymLookupEntry( 0x007f4ad0, 00001, "", "" ), + new TSymLookupEntry( 0x007f50f0, 00001, "", "" ), + new TSymLookupEntry( 0x007f5348, 00001, "", "" ), + new TSymLookupEntry( 0x007f5398, 00001, "", "" ), + new TSymLookupEntry( 0x007f5528, 00001, "", "" ), + new TSymLookupEntry( 0x007f5690, 00001, "", "" ), + new TSymLookupEntry( 0x007f5b98, 00001, "", "" ), + new TSymLookupEntry( 0x007f5cd8, 00001, "", "" ), + new TSymLookupEntry( 0x007f6078, 00001, "", "" ), + new TSymLookupEntry( 0x007f6258, 00001, "", "" ), + new TSymLookupEntry( 0x007f67e0, 00001, "", "" ), + new TSymLookupEntry( 0x007f7598, 00001, "", "" ), + new TSymLookupEntry( 0x007f78c0, 00001, "", "" ), + new TSymLookupEntry( 0x007f79b0, 00001, "", "" ), + new TSymLookupEntry( 0x007f7da8, 00001, "", "" ), + new TSymLookupEntry( 0x007f82d8, 00001, "", "" ), + new TSymLookupEntry( 0x007f8788, 00001, "", "" ), + new TSymLookupEntry( 0x007f8ba0, 00001, "", "" ), + new TSymLookupEntry( 0x007f9050, 00001, "", "" ), + new TSymLookupEntry( 0x007f9370, 00001, "", "" ), + new TSymLookupEntry( 0x007f9668, 00001, "", "" ), + new TSymLookupEntry( 0x007f9bb0, 00001, "", "" ), + new TSymLookupEntry( 0x007fa140, 00001, "", "" ), + new TSymLookupEntry( 0x007fa320, 00001, "", "" ), + new TSymLookupEntry( 0x007fa8ec, 00001, "", "" ), + new TSymLookupEntry( 0x007fac80, 00001, "", "" ), + new TSymLookupEntry( 0x007fc0c8, 00001, "", "" ), + new TSymLookupEntry( 0x007fc118, 00001, "", "" ), + new TSymLookupEntry( 0x007fc208, 00001, "", "" ), + new TSymLookupEntry( 0x007fc438, 00001, "", "" ), + new TSymLookupEntry( 0x007fc500, 00001, "", "" ), + new TSymLookupEntry( 0x007fcaa0, 00001, "", "" ), + new TSymLookupEntry( 0x007fd190, 00001, "", "" ), + new TSymLookupEntry( 0x007fd2d0, 00001, "", "" ), + new TSymLookupEntry( 0x007fda78, 00001, "", "" ), + new TSymLookupEntry( 0x007fdce0, 00001, "", "" ), + new TSymLookupEntry( 0x007fe5d0, 00001, "", "" ), + new TSymLookupEntry( 0x007febc8, 00001, "", "" ), + new TSymLookupEntry( 0x007feda8, 00001, "", "" ), + new TSymLookupEntry( 0x007feec0, 00001, "", "" ), + new TSymLookupEntry( 0x007fef38, 00001, "", "" ), + new TSymLookupEntry( 0x007ff460, 00001, "", "" ), + new TSymLookupEntry( 0x007ff578, 00001, "", "" ), + new TSymLookupEntry( 0x007ff8d8, 00001, "", "" ), + new TSymLookupEntry( 0x007ffde0, 00001, "", "" ), + new TSymLookupEntry( 0x007ffe30, 00001, "", "" ), + new TSymLookupEntry( 0x00800020, 00001, "", "" ), + new TSymLookupEntry( 0x00800030, 00001, "", "" ), + new TSymLookupEntry( 0x00800069, 00001, "", "" ), + new TSymLookupEntry( 0x00800110, 00001, "", "" ), + new TSymLookupEntry( 0x008008e8, 00001, "", "" ), + new TSymLookupEntry( 0x00800aa8, 00001, "", "" ), + new TSymLookupEntry( 0x00800c20, 00001, "", "" ), + new TSymLookupEntry( 0x00801078, 00001, "", "" ), + new TSymLookupEntry( 0x00801798, 00001, "", "" ), + new TSymLookupEntry( 0x00801c08, 00001, "", "" ), + new TSymLookupEntry( 0x00802618, 00001, "", "" ), + new TSymLookupEntry( 0x00803bd8, 00001, "", "" ), + new TSymLookupEntry( 0x00803c78, 00001, "", "" ), + new TSymLookupEntry( 0x00803db8, 00001, "", "" ), + new TSymLookupEntry( 0x00804320, 00001, "", "" ), + new TSymLookupEntry( 0x00804670, 00001, "", "" ), + new TSymLookupEntry( 0x00804830, 00001, "", "" ), + new TSymLookupEntry( 0x00804d18, 00001, "", "" ), + new TSymLookupEntry( 0x008054f8, 00001, "", "" ), + new TSymLookupEntry( 0x00805590, 00001, "", "" ), + new TSymLookupEntry( 0x008059c8, 00001, "", "" ), + new TSymLookupEntry( 0x00805e28, 00001, "", "" ), + new TSymLookupEntry( 0x008062a8, 00001, "", "" ), + new TSymLookupEntry( 0x00806644, 00001, "", "" ), + new TSymLookupEntry( 0x00806e64, 00001, "", "" ), + new TSymLookupEntry( 0x00808ec0, 00001, "", "" ), + new TSymLookupEntry( 0x00808f10, 00001, "", "" ), + new TSymLookupEntry( 0x008092b0, 00001, "", "" ), + new TSymLookupEntry( 0x008094e8, 00001, "", "" ), + new TSymLookupEntry( 0x00809d48, 00001, "", "" ), + new TSymLookupEntry( 0x0080a028, 00001, "", "" ), + new TSymLookupEntry( 0x0080a230, 00001, "", "" ), + new TSymLookupEntry( 0x0080a618, 00001, "", "" ), + new TSymLookupEntry( 0x0080b000, 00001, "", "" ), + new TSymLookupEntry( 0x0080b628, 00001, "", "" ), + new TSymLookupEntry( 0x0080c810, 00001, "", "" ), + new TSymLookupEntry( 0x0080cba8, 00001, "", "" ), + new TSymLookupEntry( 0x0080cce8, 00001, "", "" ), + new TSymLookupEntry( 0x0080d2d8, 00001, "", "" ), + new TSymLookupEntry( 0x0080d470, 00001, "", "" ), + new TSymLookupEntry( 0x0080d860, 00001, "", "" ), + new TSymLookupEntry( 0x0080d9c8, 00001, "", "" ), + new TSymLookupEntry( 0x0080db08, 00001, "", "" ), + new TSymLookupEntry( 0x0080e308, 00001, "", "" ), + new TSymLookupEntry( 0x0080e420, 00001, "", "" ), + new TSymLookupEntry( 0x0080eb18, 00001, "", "" ), + new TSymLookupEntry( 0x0080edf8, 00001, "", "" ), + new TSymLookupEntry( 0x0080f118, 00001, "", "" ), + new TSymLookupEntry( 0x00813ea8, 00001, "", "" ), + new TSymLookupEntry( 0x0081fdd0, 00001, "", "" ), + new TSymLookupEntry( 0x00820260, 00006, "", "" ), + new TSymLookupEntry( 0x008203dc, 00001, "", "" ), + new TSymLookupEntry( 0x008205ec, 00001, "", "" ), + new TSymLookupEntry( 0x00820b3c, 00001, "", "" ), + new TSymLookupEntry( 0x00820e14, 00001, "", "" ), + new TSymLookupEntry( 0x00821a18, 00001, "", "" ), + new TSymLookupEntry( 0x00822f88, 00001, "", "" ), + new TSymLookupEntry( 0x00823708, 00001, "", "" ), + new TSymLookupEntry( 0x00823d14, 00001, "", "" ), + new TSymLookupEntry( 0x00823fa0, 00001, "", "" ), + new TSymLookupEntry( 0x008242dc, 00001, "", "" ), + new TSymLookupEntry( 0x00824aa8, 00001, "", "" ), + new TSymLookupEntry( 0x00824fb4, 00001, "", "" ), + new TSymLookupEntry( 0x008259c0, 00001, "", "" ), + new TSymLookupEntry( 0x00826124, 00001, "", "" ), + new TSymLookupEntry( 0x00826730, 00001, "", "" ), + new TSymLookupEntry( 0x00827190, 00001, "", "" ), + new TSymLookupEntry( 0x008276a0, 00001, "", "" ), + new TSymLookupEntry( 0x008279dc, 00001, "", "" ), + new TSymLookupEntry( 0x00827c00, 00001, "", "" ), + new TSymLookupEntry( 0x008280dc, 00001, "", "" ), + new TSymLookupEntry( 0x008286e4, 00001, "", "" ), + new TSymLookupEntry( 0x008292f4, 00001, "", "" ), + new TSymLookupEntry( 0x0082aae8, 00001, "", "" ), + new TSymLookupEntry( 0x0082b950, 00001, "", "" ), + new TSymLookupEntry( 0x0082c984, 00001, "", "" ), + new TSymLookupEntry( 0x0082daa0, 00001, "", "" ), + new TSymLookupEntry( 0x0082dbec, 00001, "", "" ), + new TSymLookupEntry( 0x0082f40c, 00001, "", "" ), + new TSymLookupEntry( 0x00830001, 00001, "", "" ), + new TSymLookupEntry( 0x00830010, 00001, "", "" ), + new TSymLookupEntry( 0x00830c2c, 00001, "", "" ), + new TSymLookupEntry( 0x00833f1c, 00003, "", "" ), + new TSymLookupEntry( 0x00833f20, 00001, "", "" ), + new TSymLookupEntry( 0x0083ea04, 00001, "", "" ), + new TSymLookupEntry( 0x00840001, 00001, "", "" ), + new TSymLookupEntry( 0x008403e0, 00001, "", "" ), + new TSymLookupEntry( 0x00840fa0, 00001, "", "" ), + new TSymLookupEntry( 0x008414e4, 00002, "", "" ), + new TSymLookupEntry( 0x00841834, 00001, "", "" ), + new TSymLookupEntry( 0x008422e0, 00001, "", "" ), + new TSymLookupEntry( 0x008439f4, 00001, "", "" ), + new TSymLookupEntry( 0x00843eec, 00001, "", "" ), + new TSymLookupEntry( 0x00844ab4, 00001, "", "" ), + new TSymLookupEntry( 0x00846218, 00001, "", "" ), + new TSymLookupEntry( 0x00846498, 00001, "", "" ), + new TSymLookupEntry( 0x008465ec, 00001, "", "" ), + new TSymLookupEntry( 0x008574ec, 00001, "", "" ), + new TSymLookupEntry( 0x00857e1c, 00001, "", "" ), + new TSymLookupEntry( 0x0085a398, 00001, "", "" ), + new TSymLookupEntry( 0x0085a440, 00001, "", "" ), + new TSymLookupEntry( 0x0085a4d4, 00001, "", "" ), + new TSymLookupEntry( 0x0085a7d0, 00001, "", "" ), + new TSymLookupEntry( 0x0085bf34, 00001, "", "" ), + new TSymLookupEntry( 0x0085c058, 00001, "", "" ), + new TSymLookupEntry( 0x0085d14c, 00001, "", "" ), + new TSymLookupEntry( 0x0085d658, 00001, "", "" ), + new TSymLookupEntry( 0x0085de78, 00001, "", "" ), + new TSymLookupEntry( 0x0085f778, 00001, "", "" ), + new TSymLookupEntry( 0x0085f988, 00001, "", "" ), + new TSymLookupEntry( 0x008606ac, 00001, "", "" ), + new TSymLookupEntry( 0x00860f88, 00001, "", "" ), + new TSymLookupEntry( 0x008614d0, 00001, "", "" ), + new TSymLookupEntry( 0x00861b68, 00001, "", "" ), + new TSymLookupEntry( 0x00862f74, 00001, "", "" ), + new TSymLookupEntry( 0x00863c58, 00016, "", "" ), + new TSymLookupEntry( 0x00864a18, 00001, "", "" ), + new TSymLookupEntry( 0x0086513c, 00001, "", "" ), + new TSymLookupEntry( 0x00865ef8, 00001, "", "" ), + new TSymLookupEntry( 0x008682e8, 00001, "", "" ), + new TSymLookupEntry( 0x008685b0, 00001, "", "" ), + new TSymLookupEntry( 0x00868630, 00001, "", "" ), + new TSymLookupEntry( 0x00868800, 00002, "", "" ), + new TSymLookupEntry( 0x008688e8, 00001, "", "" ), + new TSymLookupEntry( 0x008694b8, 00001, "", "" ), + new TSymLookupEntry( 0x00869910, 00001, "", "" ), + new TSymLookupEntry( 0x0086a518, 00001, "", "" ), + new TSymLookupEntry( 0x0086aab8, 00001, "", "" ), + new TSymLookupEntry( 0x0086b318, 00001, "", "" ), + new TSymLookupEntry( 0x0086c268, 00001, "", "" ), + new TSymLookupEntry( 0x0086c3c0, 00001, "", "" ), + new TSymLookupEntry( 0x0086c6b0, 00001, "", "" ), + new TSymLookupEntry( 0x0086c868, 00001, "", "" ), + new TSymLookupEntry( 0x0086eff0, 00001, "", "" ), + new TSymLookupEntry( 0x0086f4e0, 00001, "", "" ), + new TSymLookupEntry( 0x0086fab8, 00001, "", "" ), + new TSymLookupEntry( 0x00870e80, 00001, "", "" ), + new TSymLookupEntry( 0x00872a78, 00001, "", "" ), + new TSymLookupEntry( 0x00873b34, 00001, "", "" ), + new TSymLookupEntry( 0x00873fd0, 00001, "", "" ), + new TSymLookupEntry( 0x00874548, 00001, "", "" ), + new TSymLookupEntry( 0x008745f0, 00001, "", "" ), + new TSymLookupEntry( 0x00879290, 00001, "", "" ), + new TSymLookupEntry( 0x008794ac, 00001, "", "" ), + new TSymLookupEntry( 0x00879750, 00001, "", "" ), + new TSymLookupEntry( 0x00879a70, 00001, "", "" ), + new TSymLookupEntry( 0x00879cdc, 00001, "", "" ), + new TSymLookupEntry( 0x0087a178, 00001, "", "" ), + new TSymLookupEntry( 0x0087b478, 00001, "", "" ), + new TSymLookupEntry( 0x0087b9d0, 00001, "", "" ), + new TSymLookupEntry( 0x0087c308, 00001, "", "" ), + new TSymLookupEntry( 0x0087ce10, 00001, "", "" ), + new TSymLookupEntry( 0x0087d828, 00001, "", "" ), + new TSymLookupEntry( 0x0087de40, 00001, "", "" ), + new TSymLookupEntry( 0x00880030, 00003, "", "" ), + new TSymLookupEntry( 0x008832f8, 00001, "", "" ), + new TSymLookupEntry( 0x00883c48, 00001, "", "" ), + new TSymLookupEntry( 0x00885e68, 00001, "", "" ), + new TSymLookupEntry( 0x00886568, 00001, "", "" ), + new TSymLookupEntry( 0x00890010, 00001, "", "" ), + new TSymLookupEntry( 0x00895c10, 00001, "", "" ), + new TSymLookupEntry( 0x0089cd40, 00001, "", "" ), + new TSymLookupEntry( 0x0089d3b0, 00001, "", "" ), + new TSymLookupEntry( 0x0089ef68, 00001, "", "" ), + new TSymLookupEntry( 0x0089fb20, 00001, "", "" ), + new TSymLookupEntry( 0x008a1d08, 00001, "", "" ), + new TSymLookupEntry( 0x008a1e10, 00001, "", "" ), + new TSymLookupEntry( 0x008a2370, 00001, "", "" ), + new TSymLookupEntry( 0x008a4440, 00001, "", "" ), + new TSymLookupEntry( 0x008a4a18, 00001, "", "" ), + new TSymLookupEntry( 0x008a6ae8, 00001, "", "" ), + new TSymLookupEntry( 0x008a7460, 00001, "", "" ), + new TSymLookupEntry( 0x008a80a4, 00001, "", "" ), + new TSymLookupEntry( 0x008a8a38, 00001, "", "" ), + new TSymLookupEntry( 0x008a99c8, 00001, "", "" ), + new TSymLookupEntry( 0x008bc000, 00001, "", "" ), + new TSymLookupEntry( 0x008bd3d0, 00001, "", "" ), + new TSymLookupEntry( 0x008bd420, 00001, "", "" ), + new TSymLookupEntry( 0x008bd448, 00001, "", "" ), + new TSymLookupEntry( 0x008bd58c, 00001, "", "" ), + new TSymLookupEntry( 0x008be188, 00001, "", "" ), + new TSymLookupEntry( 0x008be6f8, 00001, "", "" ), + new TSymLookupEntry( 0x008be770, 00001, "", "" ), + new TSymLookupEntry( 0x008bec8c, 00001, "", "" ), + new TSymLookupEntry( 0x008bf870, 00001, "", "" ), + new TSymLookupEntry( 0x008bf9b4, 00001, "", "" ), + new TSymLookupEntry( 0x008c0000, 00002, "", "" ), + new TSymLookupEntry( 0x008c05b0, 00001, "", "" ), + new TSymLookupEntry( 0x008c0700, 00001, "", "" ), + new TSymLookupEntry( 0x008c12f0, 00001, "", "" ), + new TSymLookupEntry( 0x008c1474, 00001, "", "" ), + new TSymLookupEntry( 0x008c2058, 00001, "", "" ), + new TSymLookupEntry( 0x008c226c, 00001, "", "" ), + new TSymLookupEntry( 0x008c2e68, 00001, "", "" ), + new TSymLookupEntry( 0x008c2fc0, 00001, "", "" ), + new TSymLookupEntry( 0x008c2fe8, 00001, "", "" ), + new TSymLookupEntry( 0x008c3010, 00001, "", "" ), + new TSymLookupEntry( 0x008c3060, 00001, "", "" ), + new TSymLookupEntry( 0x008c3088, 00001, "", "" ), + new TSymLookupEntry( 0x008c30d8, 00001, "", "" ), + new TSymLookupEntry( 0x008c3150, 00001, "", "" ), + new TSymLookupEntry( 0x008c41bc, 00001, "", "" ), + new TSymLookupEntry( 0x008c4da0, 00001, "", "" ), + new TSymLookupEntry( 0x008c4ee4, 00001, "", "" ), + new TSymLookupEntry( 0x008c5ae0, 00001, "", "" ), + new TSymLookupEntry( 0x008c5c30, 00001, "", "" ), + new TSymLookupEntry( 0x008c6820, 00001, "", "" ), + new TSymLookupEntry( 0x008c69a4, 00001, "", "" ), + new TSymLookupEntry( 0x008c7588, 00001, "", "" ), + new TSymLookupEntry( 0x008c76f4, 00001, "", "" ), + new TSymLookupEntry( 0x008c82f0, 00001, "", "" ), + new TSymLookupEntry( 0x008c8448, 00001, "", "" ), + new TSymLookupEntry( 0x008c8470, 00001, "", "" ), + new TSymLookupEntry( 0x008c8498, 00001, "", "" ), + new TSymLookupEntry( 0x008c84e8, 00001, "", "" ), + new TSymLookupEntry( 0x008c8510, 00001, "", "" ), + new TSymLookupEntry( 0x008c8560, 00001, "", "" ), + new TSymLookupEntry( 0x008c862c, 00001, "", "" ), + new TSymLookupEntry( 0x008c9210, 00001, "", "" ), + new TSymLookupEntry( 0x008c9354, 00001, "", "" ), + new TSymLookupEntry( 0x008c9f50, 00001, "", "" ), + new TSymLookupEntry( 0x008ca0a0, 00001, "", "" ), + new TSymLookupEntry( 0x008cac90, 00001, "", "" ), + new TSymLookupEntry( 0x008cae14, 00001, "", "" ), + new TSymLookupEntry( 0x008cb9f8, 00001, "", "" ), + new TSymLookupEntry( 0x008cbb64, 00001, "", "" ), + new TSymLookupEntry( 0x008cc760, 00001, "", "" ), + new TSymLookupEntry( 0x008cc8b8, 00001, "", "" ), + new TSymLookupEntry( 0x008cc8e0, 00001, "", "" ), + new TSymLookupEntry( 0x008cc908, 00001, "", "" ), + new TSymLookupEntry( 0x008cc958, 00001, "", "" ), + new TSymLookupEntry( 0x008cc980, 00001, "", "" ), + new TSymLookupEntry( 0x008cc9d0, 00001, "", "" ), + new TSymLookupEntry( 0x008cca9c, 00001, "", "" ), + new TSymLookupEntry( 0x008cd680, 00001, "", "" ), + new TSymLookupEntry( 0x008cd7c4, 00001, "", "" ), + new TSymLookupEntry( 0x008ce3c0, 00001, "", "" ), + new TSymLookupEntry( 0x008ce510, 00001, "", "" ), + new TSymLookupEntry( 0x008cf3a8, 00001, "", "" ), + new TSymLookupEntry( 0x008cf470, 00001, "", "" ), + new TSymLookupEntry( 0x008cf500, 00001, "", "" ), + new TSymLookupEntry( 0x008cf578, 00001, "", "" ), + new TSymLookupEntry( 0x008cf690, 00001, "", "" ), + new TSymLookupEntry( 0x008cf808, 00001, "", "" ), + new TSymLookupEntry( 0x008cf8c8, 00001, "", "" ), + new TSymLookupEntry( 0x008cf988, 00001, "", "" ), + new TSymLookupEntry( 0x008cfb68, 00001, "", "" ), + new TSymLookupEntry( 0x008cfc78, 00001, "", "" ), + new TSymLookupEntry( 0x008cfd60, 00001, "", "" ), + new TSymLookupEntry( 0x008cfe28, 00001, "", "" ), + new TSymLookupEntry( 0x008cff48, 00001, "", "" ), + new TSymLookupEntry( 0x008d0030, 00001, "", "" ), + new TSymLookupEntry( 0x008d0034, 00001, "", "" ), + new TSymLookupEntry( 0x008d0128, 00001, "", "" ), + new TSymLookupEntry( 0x008d0150, 00001, "", "" ), + new TSymLookupEntry( 0x008d0210, 00001, "", "" ), + new TSymLookupEntry( 0x008d0238, 00001, "", "" ), + new TSymLookupEntry( 0x008d0440, 00001, "", "" ), + new TSymLookupEntry( 0x008d0500, 00001, "", "" ), + new TSymLookupEntry( 0x008d0878, 00001, "", "" ), + new TSymLookupEntry( 0x008d08f0, 00001, "", "" ), + new TSymLookupEntry( 0x008d0918, 00001, "", "" ), + new TSymLookupEntry( 0x008d09d8, 00001, "", "" ), + new TSymLookupEntry( 0x008d0a00, 00001, "", "" ), + new TSymLookupEntry( 0x008d0ac0, 00001, "", "" ), + new TSymLookupEntry( 0x008d0b80, 00001, "", "" ), + new TSymLookupEntry( 0x008d0c68, 00001, "", "" ), + new TSymLookupEntry( 0x008d0d98, 00001, "", "" ), + new TSymLookupEntry( 0x008d0dc0, 00001, "", "" ), + new TSymLookupEntry( 0x008d0e80, 00001, "", "" ), + new TSymLookupEntry( 0x008d0f40, 00001, "", "" ), + new TSymLookupEntry( 0x008d11c8, 00001, "", "" ), + new TSymLookupEntry( 0x008d1288, 00001, "", "" ), + new TSymLookupEntry( 0x008d1348, 00001, "", "" ), + new TSymLookupEntry( 0x008d14d0, 00001, "", "" ), + new TSymLookupEntry( 0x008d1698, 00001, "", "" ), + new TSymLookupEntry( 0x008d1a70, 00001, "", "" ), + new TSymLookupEntry( 0x008d1b38, 00001, "", "" ), + new TSymLookupEntry( 0x008d1bc8, 00001, "", "" ), + new TSymLookupEntry( 0x008d1c40, 00001, "", "" ), + new TSymLookupEntry( 0x008d1d58, 00001, "", "" ), + new TSymLookupEntry( 0x008d1ed0, 00001, "", "" ), + new TSymLookupEntry( 0x008d1f90, 00001, "", "" ), + new TSymLookupEntry( 0x008d2070, 00001, "", "" ), + new TSymLookupEntry( 0x008d2250, 00001, "", "" ), + new TSymLookupEntry( 0x008d2360, 00001, "", "" ), + new TSymLookupEntry( 0x008d2538, 00001, "", "" ), + new TSymLookupEntry( 0x008d2600, 00001, "", "" ), + new TSymLookupEntry( 0x008d2e40, 00001, "", "" ), + new TSymLookupEntry( 0x008d3020, 00001, "", "" ), + new TSymLookupEntry( 0x008d3048, 00001, "", "" ), + new TSymLookupEntry( 0x008d3108, 00001, "", "" ), + new TSymLookupEntry( 0x008d3130, 00001, "", "" ), + new TSymLookupEntry( 0x008d31f0, 00001, "", "" ), + new TSymLookupEntry( 0x008d3968, 00001, "", "" ), + new TSymLookupEntry( 0x008d3a28, 00001, "", "" ), + new TSymLookupEntry( 0x008d4be8, 00001, "", "" ), + new TSymLookupEntry( 0x008d4c60, 00001, "", "" ), + new TSymLookupEntry( 0x008d4c88, 00001, "", "" ), + new TSymLookupEntry( 0x008d4d48, 00001, "", "" ), + new TSymLookupEntry( 0x008d4d70, 00001, "", "" ), + new TSymLookupEntry( 0x008d4e30, 00001, "", "" ), + new TSymLookupEntry( 0x008d4ef0, 00001, "", "" ), + new TSymLookupEntry( 0x008d4fd8, 00001, "", "" ), + new TSymLookupEntry( 0x008d5108, 00001, "", "" ), + new TSymLookupEntry( 0x008d5130, 00001, "", "" ), + new TSymLookupEntry( 0x008d51f0, 00001, "", "" ), + new TSymLookupEntry( 0x008d52b0, 00001, "", "" ), + new TSymLookupEntry( 0x008d55c8, 00001, "", "" ), + new TSymLookupEntry( 0x008d5688, 00001, "", "" ), + new TSymLookupEntry( 0x008d5748, 00001, "", "" ), + new TSymLookupEntry( 0x008d58d0, 00001, "", "" ), + new TSymLookupEntry( 0x008d5a98, 00001, "", "" ), + new TSymLookupEntry( 0x008d5e70, 00001, "", "" ), + new TSymLookupEntry( 0x008d5f38, 00001, "", "" ), + new TSymLookupEntry( 0x008d5fc8, 00001, "", "" ), + new TSymLookupEntry( 0x008d6040, 00001, "", "" ), + new TSymLookupEntry( 0x008d6158, 00001, "", "" ), + new TSymLookupEntry( 0x008d62d0, 00001, "", "" ), + new TSymLookupEntry( 0x008d6390, 00001, "", "" ), + new TSymLookupEntry( 0x008d6450, 00001, "", "" ), + new TSymLookupEntry( 0x008d6630, 00001, "", "" ), + new TSymLookupEntry( 0x008d6740, 00001, "", "" ), + new TSymLookupEntry( 0x008d6828, 00001, "", "" ), + new TSymLookupEntry( 0x008d68f0, 00001, "", "" ), + new TSymLookupEntry( 0x008d6a10, 00001, "", "" ), + new TSymLookupEntry( 0x008d6bf0, 00001, "", "" ), + new TSymLookupEntry( 0x008d6c18, 00001, "", "" ), + new TSymLookupEntry( 0x008d6cd8, 00001, "", "" ), + new TSymLookupEntry( 0x008d6d00, 00001, "", "" ), + new TSymLookupEntry( 0x008d6dc0, 00001, "", "" ), + new TSymLookupEntry( 0x008d7070, 00001, "", "" ), + new TSymLookupEntry( 0x008d7130, 00001, "", "" ), + new TSymLookupEntry( 0x008d74a8, 00001, "", "" ), + new TSymLookupEntry( 0x008d7520, 00001, "", "" ), + new TSymLookupEntry( 0x008d7548, 00001, "", "" ), + new TSymLookupEntry( 0x008d7608, 00001, "", "" ), + new TSymLookupEntry( 0x008d7630, 00001, "", "" ), + new TSymLookupEntry( 0x008d76f0, 00001, "", "" ), + new TSymLookupEntry( 0x008d77b0, 00001, "", "" ), + new TSymLookupEntry( 0x008d7898, 00001, "", "" ), + new TSymLookupEntry( 0x008d79c8, 00001, "", "" ), + new TSymLookupEntry( 0x008d79f0, 00001, "", "" ), + new TSymLookupEntry( 0x008d7ab0, 00001, "", "" ), + new TSymLookupEntry( 0x008d7b70, 00001, "", "" ), + new TSymLookupEntry( 0x008d7e10, 00001, "", "" ), + new TSymLookupEntry( 0x008d7ed0, 00001, "", "" ), + new TSymLookupEntry( 0x008d7f90, 00001, "", "" ), + new TSymLookupEntry( 0x008d8138, 00001, "", "" ), + new TSymLookupEntry( 0x008d8300, 00001, "", "" ), + new TSymLookupEntry( 0x008d86d8, 00001, "", "" ), + new TSymLookupEntry( 0x008d87a0, 00001, "", "" ), + new TSymLookupEntry( 0x008d8830, 00001, "", "" ), + new TSymLookupEntry( 0x008d88a8, 00001, "", "" ), + new TSymLookupEntry( 0x008d89c0, 00001, "", "" ), + new TSymLookupEntry( 0x008d8b38, 00001, "", "" ), + new TSymLookupEntry( 0x008d8bf8, 00001, "", "" ), + new TSymLookupEntry( 0x008d8cb8, 00001, "", "" ), + new TSymLookupEntry( 0x008d8e98, 00001, "", "" ), + new TSymLookupEntry( 0x008d8fa8, 00001, "", "" ), + new TSymLookupEntry( 0x008d9188, 00001, "", "" ), + new TSymLookupEntry( 0x008d9250, 00001, "", "" ), + new TSymLookupEntry( 0x008d9a90, 00001, "", "" ), + new TSymLookupEntry( 0x008d9c70, 00001, "", "" ), + new TSymLookupEntry( 0x008d9c98, 00001, "", "" ), + new TSymLookupEntry( 0x008d9d58, 00001, "", "" ), + new TSymLookupEntry( 0x008d9d80, 00001, "", "" ), + new TSymLookupEntry( 0x008d9e40, 00001, "", "" ), + new TSymLookupEntry( 0x008da5b8, 00001, "", "" ), + new TSymLookupEntry( 0x008da678, 00001, "", "" ), + new TSymLookupEntry( 0x008db298, 00001, "", "" ), + new TSymLookupEntry( 0x008db838, 00001, "", "" ), + new TSymLookupEntry( 0x008db8b0, 00001, "", "" ), + new TSymLookupEntry( 0x008db8d8, 00001, "", "" ), + new TSymLookupEntry( 0x008db998, 00001, "", "" ), + new TSymLookupEntry( 0x008db9c0, 00001, "", "" ), + new TSymLookupEntry( 0x008dba80, 00001, "", "" ), + new TSymLookupEntry( 0x008dbb40, 00001, "", "" ), + new TSymLookupEntry( 0x008dbc28, 00001, "", "" ), + new TSymLookupEntry( 0x008dbd58, 00001, "", "" ), + new TSymLookupEntry( 0x008dbd80, 00001, "", "" ), + new TSymLookupEntry( 0x008dbe40, 00001, "", "" ), + new TSymLookupEntry( 0x008dbf00, 00001, "", "" ), + new TSymLookupEntry( 0x008dc138, 00001, "", "" ), + new TSymLookupEntry( 0x008dc1f8, 00001, "", "" ), + new TSymLookupEntry( 0x008dc2b8, 00001, "", "" ), + new TSymLookupEntry( 0x008dc440, 00001, "", "" ), + new TSymLookupEntry( 0x008dc608, 00001, "", "" ), + new TSymLookupEntry( 0x008dc9e0, 00001, "", "" ), + new TSymLookupEntry( 0x008dcaa8, 00001, "", "" ), + new TSymLookupEntry( 0x008dcb38, 00001, "", "" ), + new TSymLookupEntry( 0x008dcbb0, 00001, "", "" ), + new TSymLookupEntry( 0x008dccc8, 00001, "", "" ), + new TSymLookupEntry( 0x008dce40, 00001, "", "" ), + new TSymLookupEntry( 0x008dcf00, 00001, "", "" ), + new TSymLookupEntry( 0x008dcfc0, 00001, "", "" ), + new TSymLookupEntry( 0x008dd1b8, 00001, "", "" ), + new TSymLookupEntry( 0x008dd2c8, 00001, "", "" ), + new TSymLookupEntry( 0x008dd3b0, 00001, "", "" ), + new TSymLookupEntry( 0x008dd478, 00001, "", "" ), + new TSymLookupEntry( 0x008dd598, 00001, "", "" ), + new TSymLookupEntry( 0x008dd778, 00001, "", "" ), + new TSymLookupEntry( 0x008dd7a0, 00001, "", "" ), + new TSymLookupEntry( 0x008dd860, 00001, "", "" ), + new TSymLookupEntry( 0x008dd888, 00001, "", "" ), + new TSymLookupEntry( 0x008dda90, 00001, "", "" ), + new TSymLookupEntry( 0x008ddb50, 00001, "", "" ), + new TSymLookupEntry( 0x008ddec8, 00001, "", "" ), + new TSymLookupEntry( 0x008ddf40, 00001, "", "" ), + new TSymLookupEntry( 0x008ddf68, 00001, "", "" ), + new TSymLookupEntry( 0x008de048, 00001, "", "" ), + new TSymLookupEntry( 0x008de070, 00001, "", "" ), + new TSymLookupEntry( 0x008de130, 00001, "", "" ), + new TSymLookupEntry( 0x008de1f0, 00001, "", "" ), + new TSymLookupEntry( 0x008de2d8, 00001, "", "" ), + new TSymLookupEntry( 0x008de408, 00001, "", "" ), + new TSymLookupEntry( 0x008de430, 00001, "", "" ), + new TSymLookupEntry( 0x008de4f0, 00001, "", "" ), + new TSymLookupEntry( 0x008de5b0, 00001, "", "" ), + new TSymLookupEntry( 0x008de848, 00001, "", "" ), + new TSymLookupEntry( 0x008de908, 00001, "", "" ), + new TSymLookupEntry( 0x008de9c8, 00001, "", "" ), + new TSymLookupEntry( 0x008deb50, 00001, "", "" ), + new TSymLookupEntry( 0x008ded18, 00001, "", "" ), + new TSymLookupEntry( 0x008df0f0, 00001, "", "" ), + new TSymLookupEntry( 0x008df1b8, 00001, "", "" ), + new TSymLookupEntry( 0x008df248, 00001, "", "" ), + new TSymLookupEntry( 0x008df2c0, 00001, "", "" ), + new TSymLookupEntry( 0x008df3d8, 00001, "", "" ), + new TSymLookupEntry( 0x008df550, 00001, "", "" ), + new TSymLookupEntry( 0x008df610, 00001, "", "" ), + new TSymLookupEntry( 0x008df6d0, 00001, "", "" ), + new TSymLookupEntry( 0x008df8b0, 00001, "", "" ), + new TSymLookupEntry( 0x008df9c0, 00001, "", "" ), + new TSymLookupEntry( 0x008dfb98, 00001, "", "" ), + new TSymLookupEntry( 0x008dfc60, 00001, "", "" ), + new TSymLookupEntry( 0x008e0030, 00002, "", "" ), + new TSymLookupEntry( 0x008e0033, 00001, "", "" ), + new TSymLookupEntry( 0x008e04a0, 00001, "", "" ), + new TSymLookupEntry( 0x008e0680, 00001, "", "" ), + new TSymLookupEntry( 0x008e06a8, 00001, "", "" ), + new TSymLookupEntry( 0x008e0768, 00001, "", "" ), + new TSymLookupEntry( 0x008e0790, 00001, "", "" ), + new TSymLookupEntry( 0x008e0850, 00001, "", "" ), + new TSymLookupEntry( 0x008e0fc8, 00001, "", "" ), + new TSymLookupEntry( 0x008e1088, 00001, "", "" ), + new TSymLookupEntry( 0x008e2248, 00001, "", "" ), + new TSymLookupEntry( 0x008e22c0, 00001, "", "" ), + new TSymLookupEntry( 0x008e22e8, 00001, "", "" ), + new TSymLookupEntry( 0x008e23a8, 00001, "", "" ), + new TSymLookupEntry( 0x008e23d0, 00001, "", "" ), + new TSymLookupEntry( 0x008e2490, 00001, "", "" ), + new TSymLookupEntry( 0x008e2550, 00001, "", "" ), + new TSymLookupEntry( 0x008e2638, 00001, "", "" ), + new TSymLookupEntry( 0x008e2768, 00001, "", "" ), + new TSymLookupEntry( 0x008e2790, 00001, "", "" ), + new TSymLookupEntry( 0x008e2850, 00001, "", "" ), + new TSymLookupEntry( 0x008e2910, 00001, "", "" ), + new TSymLookupEntry( 0x008e2b78, 00001, "", "" ), + new TSymLookupEntry( 0x008e2c38, 00001, "", "" ), + new TSymLookupEntry( 0x008e2cf8, 00001, "", "" ), + new TSymLookupEntry( 0x008e2e80, 00001, "", "" ), + new TSymLookupEntry( 0x008e3068, 00001, "", "" ), + new TSymLookupEntry( 0x008e3440, 00001, "", "" ), + new TSymLookupEntry( 0x008e3508, 00001, "", "" ), + new TSymLookupEntry( 0x008e3598, 00001, "", "" ), + new TSymLookupEntry( 0x008e3610, 00001, "", "" ), + new TSymLookupEntry( 0x008e3728, 00001, "", "" ), + new TSymLookupEntry( 0x008e38a0, 00001, "", "" ), + new TSymLookupEntry( 0x008e3960, 00001, "", "" ), + new TSymLookupEntry( 0x008e3a20, 00001, "", "" ), + new TSymLookupEntry( 0x008e3c00, 00001, "", "" ), + new TSymLookupEntry( 0x008e3d10, 00001, "", "" ), + new TSymLookupEntry( 0x008e3ee8, 00001, "", "" ), + new TSymLookupEntry( 0x008e3fb0, 00001, "", "" ), + new TSymLookupEntry( 0x008e47f0, 00001, "", "" ), + new TSymLookupEntry( 0x008e49d0, 00001, "", "" ), + new TSymLookupEntry( 0x008e49f8, 00001, "", "" ), + new TSymLookupEntry( 0x008e4ab8, 00001, "", "" ), + new TSymLookupEntry( 0x008e4ae0, 00001, "", "" ), + new TSymLookupEntry( 0x008e4ce8, 00001, "", "" ), + new TSymLookupEntry( 0x008e52a8, 00001, "", "" ), + new TSymLookupEntry( 0x008e5d90, 00001, "", "" ), + new TSymLookupEntry( 0x008e5ff8, 00001, "", "" ), + new TSymLookupEntry( 0x008e6508, 00001, "", "" ), + new TSymLookupEntry( 0x008e6530, 00001, "", "" ), + new TSymLookupEntry( 0x008e65f0, 00001, "", "" ), + new TSymLookupEntry( 0x008e6618, 00001, "", "" ), + new TSymLookupEntry( 0x008e66d8, 00001, "", "" ), + new TSymLookupEntry( 0x008e6798, 00001, "", "" ), + new TSymLookupEntry( 0x008e6880, 00001, "", "" ), + new TSymLookupEntry( 0x008e69b0, 00001, "", "" ), + new TSymLookupEntry( 0x008e69d8, 00001, "", "" ), + new TSymLookupEntry( 0x008e6a98, 00001, "", "" ), + new TSymLookupEntry( 0x008e6b58, 00001, "", "" ), + new TSymLookupEntry( 0x008e6e48, 00001, "", "" ), + new TSymLookupEntry( 0x008e6f08, 00001, "", "" ), + new TSymLookupEntry( 0x008e6fc8, 00001, "", "" ), + new TSymLookupEntry( 0x008e7160, 00001, "", "" ), + new TSymLookupEntry( 0x008e7328, 00001, "", "" ), + new TSymLookupEntry( 0x008e7700, 00001, "", "" ), + new TSymLookupEntry( 0x008e77c8, 00001, "", "" ), + new TSymLookupEntry( 0x008e7858, 00001, "", "" ), + new TSymLookupEntry( 0x008e78d0, 00001, "", "" ), + new TSymLookupEntry( 0x008e79e8, 00001, "", "" ), + new TSymLookupEntry( 0x008e7b60, 00001, "", "" ), + new TSymLookupEntry( 0x008e7c20, 00001, "", "" ), + new TSymLookupEntry( 0x008e7ce0, 00001, "", "" ), + new TSymLookupEntry( 0x008e7ec0, 00001, "", "" ), + new TSymLookupEntry( 0x008e7fd0, 00001, "", "" ), + new TSymLookupEntry( 0x008e81b0, 00001, "", "" ), + new TSymLookupEntry( 0x008e8278, 00001, "", "" ), + new TSymLookupEntry( 0x008e8ab8, 00001, "", "" ), + new TSymLookupEntry( 0x008e8c98, 00001, "", "" ), + new TSymLookupEntry( 0x008e8cc0, 00001, "", "" ), + new TSymLookupEntry( 0x008e8d80, 00001, "", "" ), + new TSymLookupEntry( 0x008e8da8, 00001, "", "" ), + new TSymLookupEntry( 0x008e8e68, 00001, "", "" ), + new TSymLookupEntry( 0x008e95e0, 00001, "", "" ), + new TSymLookupEntry( 0x008e96a0, 00001, "", "" ), + new TSymLookupEntry( 0x008ea138, 00001, "", "" ), + new TSymLookupEntry( 0x008ea2c0, 00001, "", "" ), + new TSymLookupEntry( 0x008ea860, 00001, "", "" ), + new TSymLookupEntry( 0x008ea8d8, 00001, "", "" ), + new TSymLookupEntry( 0x008ea900, 00001, "", "" ), + new TSymLookupEntry( 0x008ea9c0, 00001, "", "" ), + new TSymLookupEntry( 0x008ea9e8, 00001, "", "" ), + new TSymLookupEntry( 0x008eaaa8, 00001, "", "" ), + new TSymLookupEntry( 0x008eab68, 00001, "", "" ), + new TSymLookupEntry( 0x008eac50, 00001, "", "" ), + new TSymLookupEntry( 0x008ead80, 00001, "", "" ), + new TSymLookupEntry( 0x008eada8, 00001, "", "" ), + new TSymLookupEntry( 0x008eae68, 00001, "", "" ), + new TSymLookupEntry( 0x008eaf28, 00001, "", "" ), + new TSymLookupEntry( 0x008eb198, 00001, "", "" ), + new TSymLookupEntry( 0x008eb258, 00001, "", "" ), + new TSymLookupEntry( 0x008eb318, 00001, "", "" ), + new TSymLookupEntry( 0x008eb4a0, 00001, "", "" ), + new TSymLookupEntry( 0x008eb668, 00001, "", "" ), + new TSymLookupEntry( 0x008eba40, 00001, "", "" ), + new TSymLookupEntry( 0x008ebb08, 00001, "", "" ), + new TSymLookupEntry( 0x008ebb98, 00001, "", "" ), + new TSymLookupEntry( 0x008ebc10, 00001, "", "" ), + new TSymLookupEntry( 0x008ebd28, 00001, "", "" ), + new TSymLookupEntry( 0x008ebea0, 00001, "", "" ), + new TSymLookupEntry( 0x008ebf60, 00001, "", "" ), + new TSymLookupEntry( 0x008ec020, 00001, "", "" ), + new TSymLookupEntry( 0x008ec5f0, 00001, "", "" ), + new TSymLookupEntry( 0x008ee210, 00001, "", "" ), + new TSymLookupEntry( 0x008eef88, 00001, "", "" ), + new TSymLookupEntry( 0x008f000a, 00002, "", "" ), + new TSymLookupEntry( 0x008f12a8, 00001, "", "" ), + new TSymLookupEntry( 0x008f1c58, 00001, "", "" ), + new TSymLookupEntry( 0x008f2054, 00001, "", "" ), + new TSymLookupEntry( 0x008f2be0, 00001, "", "" ), + new TSymLookupEntry( 0x008f2eb4, 00003, "", "" ), + new TSymLookupEntry( 0x008f3888, 00001, "", "" ), + new TSymLookupEntry( 0x008f4308, 00001, "", "" ), + new TSymLookupEntry( 0x008f4b9c, 00001, "", "" ), + new TSymLookupEntry( 0x008f4f98, 00001, "", "" ), + new TSymLookupEntry( 0x008f5e60, 00001, "", "" ), + new TSymLookupEntry( 0x008f5fe0, 00004, "", "" ), + new TSymLookupEntry( 0x008f6c2c, 00001, "", "" ), + new TSymLookupEntry( 0x008f7618, 00001, "", "" ), + new TSymLookupEntry( 0x008f7fc8, 00001, "", "" ), + new TSymLookupEntry( 0x008f83c4, 00001, "", "" ), + new TSymLookupEntry( 0x008f8f50, 00001, "", "" ), + new TSymLookupEntry( 0x008f9224, 00003, "", "" ), + new TSymLookupEntry( 0x008f9bf8, 00001, "", "" ), + new TSymLookupEntry( 0x008fa678, 00001, "", "" ), + new TSymLookupEntry( 0x008faf0c, 00001, "", "" ), + new TSymLookupEntry( 0x008fb308, 00001, "", "" ), + new TSymLookupEntry( 0x008fc718, 00001, "", "" ), + new TSymLookupEntry( 0x008fc898, 00003, "", "" ), + new TSymLookupEntry( 0x008fd4e4, 00001, "", "" ), + new TSymLookupEntry( 0x008fdb78, 00001, "", "" ), + new TSymLookupEntry( 0x008fea70, 00001, "", "" ), + new TSymLookupEntry( 0x008ff4e8, 00001, "", "" ), + new TSymLookupEntry( 0x008ff824, 00001, "", "" ), + new TSymLookupEntry( 0x008ffcf8, 00003, "", "" ), + new TSymLookupEntry( 0x00900a40, 00001, "", "" ), + new TSymLookupEntry( 0x00900ef4, 00001, "", "" ), + new TSymLookupEntry( 0x00902778, 00001, "", "" ), + new TSymLookupEntry( 0x00902e38, 00001, "", "" ), + new TSymLookupEntry( 0x00903234, 00001, "", "" ), + new TSymLookupEntry( 0x00903f70, 00001, "", "" ), + new TSymLookupEntry( 0x00903f80, 00003, "", "" ), + new TSymLookupEntry( 0x00904bcc, 00001, "", "" ), + new TSymLookupEntry( 0x009056a8, 00001, "", "" ), + new TSymLookupEntry( 0x009064bc, 00001, "", "" ), + new TSymLookupEntry( 0x00906f50, 00001, "", "" ), + new TSymLookupEntry( 0x00907170, 00001, "", "" ), + new TSymLookupEntry( 0x00907644, 00003, "", "" ), + new TSymLookupEntry( 0x00908598, 00001, "", "" ), + new TSymLookupEntry( 0x00908664, 00001, "", "" ), + new TSymLookupEntry( 0x00909228, 00001, "", "" ), + new TSymLookupEntry( 0x0090a0d8, 00001, "", "" ), + new TSymLookupEntry( 0x0090a16c, 00001, "", "" ), + new TSymLookupEntry( 0x0090a640, 00003, "", "" ), + new TSymLookupEntry( 0x0090b014, 00001, "", "" ), + new TSymLookupEntry( 0x0090b828, 00001, "", "" ), + new TSymLookupEntry( 0x0090c32c, 00001, "", "" ), + new TSymLookupEntry( 0x0090c728, 00001, "", "" ), + new TSymLookupEntry( 0x0090d150, 00001, "", "" ), + new TSymLookupEntry( 0x0090d564, 00003, "", "" ), + new TSymLookupEntry( 0x0090e0a8, 00001, "", "" ), + new TSymLookupEntry( 0x0090e720, 00001, "", "" ), + new TSymLookupEntry( 0x0090f25c, 00001, "", "" ), + new TSymLookupEntry( 0x0090f658, 00001, "", "" ), + new TSymLookupEntry( 0x00910150, 00001, "", "" ), + new TSymLookupEntry( 0x00910564, 00003, "", "" ), + new TSymLookupEntry( 0x009110a8, 00001, "", "" ), + new TSymLookupEntry( 0x00911818, 00001, "", "" ), + new TSymLookupEntry( 0x00912394, 00001, "", "" ), + new TSymLookupEntry( 0x00912790, 00001, "", "" ), + new TSymLookupEntry( 0x009132e0, 00001, "", "" ), + new TSymLookupEntry( 0x009133f8, 00002, "", "" ), + new TSymLookupEntry( 0x00913468, 00001, "", "" ), + new TSymLookupEntry( 0x00913558, 00001, "", "" ), + new TSymLookupEntry( 0x00913710, 00002, "", "" ), + new TSymLookupEntry( 0x00913760, 00001, "", "" ), + new TSymLookupEntry( 0x00913850, 00001, "", "" ), + new TSymLookupEntry( 0x00913a10, 00002, "", "" ), + new TSymLookupEntry( 0x00913a88, 00001, "", "" ), + new TSymLookupEntry( 0x00913bf8, 00001, "", "" ), + new TSymLookupEntry( 0x009140a8, 00001, "", "" ), + new TSymLookupEntry( 0x00914640, 00002, "", "" ), + new TSymLookupEntry( 0x00914690, 00001, "", "" ), + new TSymLookupEntry( 0x00914c28, 00002, "", "" ), + new TSymLookupEntry( 0x00914c78, 00001, "", "" ), + new TSymLookupEntry( 0x00914f28, 00002, "", "" ), + new TSymLookupEntry( 0x00914f78, 00001, "", "" ), + new TSymLookupEntry( 0x00915208, 00001, "", "" ), + new TSymLookupEntry( 0x00915278, 00001, "", "" ), + new TSymLookupEntry( 0x00915df8, 00001, "", "" ), + new TSymLookupEntry( 0x00916244, 00003, "", "" ), + new TSymLookupEntry( 0x00916b10, 00001, "", "" ), + new TSymLookupEntry( 0x009175c0, 00001, "", "" ), + new TSymLookupEntry( 0x00917eec, 00001, "", "" ), + new TSymLookupEntry( 0x009182e8, 00001, "", "" ), + new TSymLookupEntry( 0x00918ef8, 00001, "", "" ), + new TSymLookupEntry( 0x009190fc, 00003, "", "" ), + new TSymLookupEntry( 0x00919ad0, 00001, "", "" ), + new TSymLookupEntry( 0x0091b5b0, 00001, "", "" ), + new TSymLookupEntry( 0x0091bd88, 00001, "", "" ), + new TSymLookupEntry( 0x0091c184, 00001, "", "" ), + new TSymLookupEntry( 0x0091c7a0, 00001, "", "" ), + new TSymLookupEntry( 0x0091c850, 00003, "", "" ), + new TSymLookupEntry( 0x0091d224, 00001, "", "" ), + new TSymLookupEntry( 0x0091e0e0, 00001, "", "" ), + new TSymLookupEntry( 0x0091e764, 00001, "", "" ), + new TSymLookupEntry( 0x0091eb60, 00001, "", "" ), + new TSymLookupEntry( 0x0091f034, 00003, "", "" ), + new TSymLookupEntry( 0x00920738, 00001, "", "" ), + new TSymLookupEntry( 0x00921098, 00001, "", "" ), + new TSymLookupEntry( 0x00921c88, 00001, "", "" ), + new TSymLookupEntry( 0x009221b8, 00001, "", "" ), + new TSymLookupEntry( 0x009225b4, 00001, "", "" ), + new TSymLookupEntry( 0x00922a88, 00003, "", "" ), + new TSymLookupEntry( 0x00923568, 00001, "", "" ), + new TSymLookupEntry( 0x00923c64, 00001, "", "" ), + new TSymLookupEntry( 0x00924e00, 00001, "", "" ), + new TSymLookupEntry( 0x0092510c, 00001, "", "" ), + new TSymLookupEntry( 0x00925508, 00001, "", "" ), + new TSymLookupEntry( 0x009259dc, 00003, "", "" ), + new TSymLookupEntry( 0x009265c8, 00001, "", "" ), + new TSymLookupEntry( 0x00926ba0, 00001, "", "" ), + new TSymLookupEntry( 0x00927f30, 00001, "", "" ), + new TSymLookupEntry( 0x00928118, 00001, "", "" ), + new TSymLookupEntry( 0x00928514, 00001, "", "" ), + new TSymLookupEntry( 0x009289e8, 00003, "", "" ), + new TSymLookupEntry( 0x00929640, 00001, "", "" ), + new TSymLookupEntry( 0x009299ec, 00001, "", "" ), + new TSymLookupEntry( 0x0092a5b0, 00001, "", "" ), + new TSymLookupEntry( 0x0092b0c0, 00001, "", "" ), + new TSymLookupEntry( 0x0092b434, 00001, "", "" ), + new TSymLookupEntry( 0x0092b908, 00003, "", "" ), + new TSymLookupEntry( 0x0092c000, 00016, "", "" ), + new TSymLookupEntry( 0x0092c730, 00001, "", "" ), + new TSymLookupEntry( 0x0092c950, 00001, "", "" ), + new TSymLookupEntry( 0x0092d514, 00001, "", "" ), + new TSymLookupEntry( 0x0092e2b0, 00001, "", "" ), + new TSymLookupEntry( 0x0092e498, 00001, "", "" ), + new TSymLookupEntry( 0x0092f358, 00001, "", "" ), + new TSymLookupEntry( 0x0092f48c, 00001, "", "" ), + new TSymLookupEntry( 0x00930070, 00001, "", "" ), + new TSymLookupEntry( 0x009301dc, 00001, "", "" ), + new TSymLookupEntry( 0x00930dd8, 00001, "", "" ), + new TSymLookupEntry( 0x00930f30, 00001, "", "" ), + new TSymLookupEntry( 0x00930f58, 00001, "", "" ), + new TSymLookupEntry( 0x00930f80, 00001, "", "" ), + new TSymLookupEntry( 0x00930fd0, 00001, "", "" ), + new TSymLookupEntry( 0x00931000, 00001, "", "" ), + new TSymLookupEntry( 0x00931050, 00001, "", "" ), + new TSymLookupEntry( 0x009310c8, 00001, "", "" ), + new TSymLookupEntry( 0x00932134, 00001, "", "" ), + new TSymLookupEntry( 0x00932d18, 00001, "", "" ), + new TSymLookupEntry( 0x00932e5c, 00001, "", "" ), + new TSymLookupEntry( 0x00933a58, 00001, "", "" ), + new TSymLookupEntry( 0x00933ba8, 00001, "", "" ), + new TSymLookupEntry( 0x00934798, 00001, "", "" ), + new TSymLookupEntry( 0x0093491c, 00001, "", "" ), + new TSymLookupEntry( 0x00935500, 00001, "", "" ), + new TSymLookupEntry( 0x0093566c, 00001, "", "" ), + new TSymLookupEntry( 0x00936268, 00001, "", "" ), + new TSymLookupEntry( 0x009363c0, 00001, "", "" ), + new TSymLookupEntry( 0x009363e8, 00001, "", "" ), + new TSymLookupEntry( 0x00936410, 00001, "", "" ), + new TSymLookupEntry( 0x00936460, 00001, "", "" ), + new TSymLookupEntry( 0x00936488, 00001, "", "" ), + new TSymLookupEntry( 0x009364d8, 00001, "", "" ), + new TSymLookupEntry( 0x009365a4, 00001, "", "" ), + new TSymLookupEntry( 0x00937188, 00001, "", "" ), + new TSymLookupEntry( 0x009372cc, 00001, "", "" ), + new TSymLookupEntry( 0x00937ec8, 00001, "", "" ), + new TSymLookupEntry( 0x00938020, 00001, "", "" ), + new TSymLookupEntry( 0x00938c10, 00001, "", "" ), + new TSymLookupEntry( 0x00938d94, 00001, "", "" ), + new TSymLookupEntry( 0x00939978, 00001, "", "" ), + new TSymLookupEntry( 0x00939ae4, 00001, "", "" ), + new TSymLookupEntry( 0x0093a6e0, 00001, "", "" ), + new TSymLookupEntry( 0x0093a838, 00001, "", "" ), + new TSymLookupEntry( 0x0093a860, 00001, "", "" ), + new TSymLookupEntry( 0x0093a888, 00001, "", "" ), + new TSymLookupEntry( 0x0093a8d8, 00001, "", "" ), + new TSymLookupEntry( 0x0093a900, 00001, "", "" ), + new TSymLookupEntry( 0x0093a950, 00001, "", "" ), + new TSymLookupEntry( 0x0093a9c8, 00001, "", "" ), + new TSymLookupEntry( 0x0093ba34, 00001, "", "" ), + new TSymLookupEntry( 0x0093c618, 00001, "", "" ), + new TSymLookupEntry( 0x0093c75c, 00001, "", "" ), + new TSymLookupEntry( 0x0093d358, 00001, "", "" ), + new TSymLookupEntry( 0x0093d4a8, 00001, "", "" ), + new TSymLookupEntry( 0x0093e098, 00001, "", "" ), + new TSymLookupEntry( 0x0093e21c, 00001, "", "" ), + new TSymLookupEntry( 0x0093ee00, 00001, "", "" ), + new TSymLookupEntry( 0x0093ef6c, 00001, "", "" ), + new TSymLookupEntry( 0x0093fb68, 00001, "", "" ), + new TSymLookupEntry( 0x0093fcc0, 00001, "", "" ), + new TSymLookupEntry( 0x0093fce8, 00001, "", "" ), + new TSymLookupEntry( 0x0093fd10, 00001, "", "" ), + new TSymLookupEntry( 0x0093fd60, 00001, "", "" ), + new TSymLookupEntry( 0x0093fd88, 00001, "", "" ), + new TSymLookupEntry( 0x0093fdd8, 00001, "", "" ), + new TSymLookupEntry( 0x0093fea4, 00001, "", "" ), + new TSymLookupEntry( 0x00940a88, 00001, "", "" ), + new TSymLookupEntry( 0x00940bcc, 00001, "", "" ), + new TSymLookupEntry( 0x009417c8, 00001, "", "" ), + new TSymLookupEntry( 0x00941918, 00001, "", "" ), + new TSymLookupEntry( 0x00942508, 00001, "", "" ), + new TSymLookupEntry( 0x00942638, 00001, "", "" ), + new TSymLookupEntry( 0x009436a4, 00001, "", "" ), + new TSymLookupEntry( 0x00944288, 00001, "", "" ), + new TSymLookupEntry( 0x009443f4, 00001, "", "" ), + new TSymLookupEntry( 0x00945000, 00001, "", "" ), + new TSymLookupEntry( 0x00945158, 00001, "", "" ), + new TSymLookupEntry( 0x00945180, 00001, "", "" ), + new TSymLookupEntry( 0x009451a8, 00001, "", "" ), + new TSymLookupEntry( 0x009451f8, 00001, "", "" ), + new TSymLookupEntry( 0x00945220, 00001, "", "" ), + new TSymLookupEntry( 0x00945270, 00001, "", "" ), + new TSymLookupEntry( 0x0094533c, 00001, "", "" ), + new TSymLookupEntry( 0x00945f20, 00001, "", "" ), + new TSymLookupEntry( 0x00946064, 00001, "", "" ), + new TSymLookupEntry( 0x00946c60, 00001, "", "" ), + new TSymLookupEntry( 0x00946db0, 00001, "", "" ), + new TSymLookupEntry( 0x009479a0, 00001, "", "" ), + new TSymLookupEntry( 0x00947b24, 00001, "", "" ), + new TSymLookupEntry( 0x00948708, 00001, "", "" ), + new TSymLookupEntry( 0x00948874, 00001, "", "" ), + new TSymLookupEntry( 0x00949470, 00001, "", "" ), + new TSymLookupEntry( 0x009495c8, 00001, "", "" ), + new TSymLookupEntry( 0x009495f0, 00001, "", "" ), + new TSymLookupEntry( 0x00949618, 00001, "", "" ), + new TSymLookupEntry( 0x00949668, 00001, "", "" ), + new TSymLookupEntry( 0x00949690, 00001, "", "" ), + new TSymLookupEntry( 0x009496e0, 00001, "", "" ), + new TSymLookupEntry( 0x009497ac, 00001, "", "" ), + new TSymLookupEntry( 0x0094a390, 00001, "", "" ), + new TSymLookupEntry( 0x0094a4d4, 00001, "", "" ), + new TSymLookupEntry( 0x0094b0d0, 00001, "", "" ), + new TSymLookupEntry( 0x0094b220, 00001, "", "" ), + new TSymLookupEntry( 0x0094be10, 00001, "", "" ), + new TSymLookupEntry( 0x0094bf94, 00001, "", "" ), + new TSymLookupEntry( 0x0094cb78, 00001, "", "" ), + new TSymLookupEntry( 0x0094cce4, 00001, "", "" ), + new TSymLookupEntry( 0x0094d8e0, 00001, "", "" ), + new TSymLookupEntry( 0x0094da38, 00001, "", "" ), + new TSymLookupEntry( 0x0094da60, 00001, "", "" ), + new TSymLookupEntry( 0x0094da88, 00001, "", "" ), + new TSymLookupEntry( 0x0094dad8, 00001, "", "" ), + new TSymLookupEntry( 0x0094db00, 00001, "", "" ), + new TSymLookupEntry( 0x0094db50, 00001, "", "" ), + new TSymLookupEntry( 0x0094dba0, 00001, "", "" ), + new TSymLookupEntry( 0x0094ec34, 00001, "", "" ), + new TSymLookupEntry( 0x0094f818, 00001, "", "" ), + new TSymLookupEntry( 0x0094f95c, 00001, "", "" ), + new TSymLookupEntry( 0x00950558, 00001, "", "" ), + new TSymLookupEntry( 0x009506a8, 00001, "", "" ), + new TSymLookupEntry( 0x00951298, 00001, "", "" ), + new TSymLookupEntry( 0x0095141c, 00001, "", "" ), + new TSymLookupEntry( 0x00952000, 00001, "", "" ), + new TSymLookupEntry( 0x0095216c, 00001, "", "" ), + new TSymLookupEntry( 0x00952d68, 00001, "", "" ), + new TSymLookupEntry( 0x00952ec0, 00001, "", "" ), + new TSymLookupEntry( 0x00952ee8, 00001, "", "" ), + new TSymLookupEntry( 0x00952f10, 00001, "", "" ), + new TSymLookupEntry( 0x00952f60, 00001, "", "" ), + new TSymLookupEntry( 0x00952f88, 00001, "", "" ), + new TSymLookupEntry( 0x00952fd8, 00001, "", "" ), + new TSymLookupEntry( 0x009530a4, 00001, "", "" ), + new TSymLookupEntry( 0x00953c88, 00001, "", "" ), + new TSymLookupEntry( 0x00953dcc, 00001, "", "" ), + new TSymLookupEntry( 0x009549c8, 00001, "", "" ), + new TSymLookupEntry( 0x00954b18, 00001, "", "" ), + new TSymLookupEntry( 0x00955708, 00001, "", "" ), + new TSymLookupEntry( 0x009559bc, 00001, "", "" ), + new TSymLookupEntry( 0x009565a0, 00001, "", "" ), + new TSymLookupEntry( 0x0095670c, 00001, "", "" ), + new TSymLookupEntry( 0x00957308, 00001, "", "" ), + new TSymLookupEntry( 0x00957460, 00001, "", "" ), + new TSymLookupEntry( 0x00957488, 00001, "", "" ), + new TSymLookupEntry( 0x009574b0, 00001, "", "" ), + new TSymLookupEntry( 0x00957500, 00001, "", "" ), + new TSymLookupEntry( 0x00957528, 00001, "", "" ), + new TSymLookupEntry( 0x00957578, 00001, "", "" ), + new TSymLookupEntry( 0x00957644, 00001, "", "" ), + new TSymLookupEntry( 0x00958228, 00001, "", "" ), + new TSymLookupEntry( 0x0095836c, 00001, "", "" ), + new TSymLookupEntry( 0x00958f68, 00001, "", "" ), + new TSymLookupEntry( 0x009590b8, 00001, "", "" ), + new TSymLookupEntry( 0x00959ca8, 00001, "", "" ), + new TSymLookupEntry( 0x00959e2c, 00001, "", "" ), + new TSymLookupEntry( 0x0095aa10, 00001, "", "" ), + new TSymLookupEntry( 0x0095ab7c, 00001, "", "" ), + new TSymLookupEntry( 0x0095b778, 00001, "", "" ), + new TSymLookupEntry( 0x0095b8d0, 00001, "", "" ), + new TSymLookupEntry( 0x0095c8e8, 00001, "", "" ), + new TSymLookupEntry( 0x0095c910, 00001, "", "" ), + new TSymLookupEntry( 0x0095c938, 00001, "", "" ), + new TSymLookupEntry( 0x0095c988, 00001, "", "" ), + new TSymLookupEntry( 0x0095c9b0, 00001, "", "" ), + new TSymLookupEntry( 0x0095ca00, 00001, "", "" ), + new TSymLookupEntry( 0x0095cacc, 00001, "", "" ), + new TSymLookupEntry( 0x0095d6b0, 00001, "", "" ), + new TSymLookupEntry( 0x0095d7f4, 00001, "", "" ), + new TSymLookupEntry( 0x0095e3f0, 00001, "", "" ), + new TSymLookupEntry( 0x0095e540, 00001, "", "" ), + new TSymLookupEntry( 0x0095f130, 00001, "", "" ), + new TSymLookupEntry( 0x0095f2b4, 00001, "", "" ), + new TSymLookupEntry( 0x0095fe98, 00001, "", "" ), + new TSymLookupEntry( 0x00960014, 00001, "", "" ), + new TSymLookupEntry( 0x00960c10, 00001, "", "" ), + new TSymLookupEntry( 0x00960d68, 00001, "", "" ), + new TSymLookupEntry( 0x00960d90, 00001, "", "" ), + new TSymLookupEntry( 0x00960db8, 00001, "", "" ), + new TSymLookupEntry( 0x00960e08, 00001, "", "" ), + new TSymLookupEntry( 0x00960e30, 00001, "", "" ), + new TSymLookupEntry( 0x00960e80, 00001, "", "" ), + new TSymLookupEntry( 0x00960f4c, 00001, "", "" ), + new TSymLookupEntry( 0x00961b30, 00001, "", "" ), + new TSymLookupEntry( 0x00961c74, 00001, "", "" ), + new TSymLookupEntry( 0x00962870, 00001, "", "" ), + new TSymLookupEntry( 0x009629c0, 00001, "", "" ), + new TSymLookupEntry( 0x009635b0, 00001, "", "" ), + new TSymLookupEntry( 0x00963734, 00001, "", "" ), + new TSymLookupEntry( 0x00964318, 00001, "", "" ), + new TSymLookupEntry( 0x00964484, 00001, "", "" ), + new TSymLookupEntry( 0x00965080, 00001, "", "" ), + new TSymLookupEntry( 0x009651d8, 00001, "", "" ), + new TSymLookupEntry( 0x00965200, 00001, "", "" ), + new TSymLookupEntry( 0x00965228, 00001, "", "" ), + new TSymLookupEntry( 0x00965278, 00001, "", "" ), + new TSymLookupEntry( 0x009652a0, 00001, "", "" ), + new TSymLookupEntry( 0x009652f0, 00001, "", "" ), + new TSymLookupEntry( 0x009653bc, 00001, "", "" ), + new TSymLookupEntry( 0x00965fa0, 00001, "", "" ), + new TSymLookupEntry( 0x009660e4, 00001, "", "" ), + new TSymLookupEntry( 0x00966ce0, 00001, "", "" ), + new TSymLookupEntry( 0x00966e30, 00001, "", "" ), + new TSymLookupEntry( 0x00967a20, 00001, "", "" ), + new TSymLookupEntry( 0x00967ba4, 00001, "", "" ), + new TSymLookupEntry( 0x00968788, 00001, "", "" ), + new TSymLookupEntry( 0x009688f4, 00001, "", "" ), + new TSymLookupEntry( 0x009694f0, 00001, "", "" ), + new TSymLookupEntry( 0x00969648, 00001, "", "" ), + new TSymLookupEntry( 0x00969670, 00001, "", "" ), + new TSymLookupEntry( 0x00969698, 00001, "", "" ), + new TSymLookupEntry( 0x009696e8, 00001, "", "" ), + new TSymLookupEntry( 0x00969710, 00001, "", "" ), + new TSymLookupEntry( 0x00969760, 00001, "", "" ), + new TSymLookupEntry( 0x009697b0, 00001, "", "" ), + new TSymLookupEntry( 0x0096a844, 00001, "", "" ), + new TSymLookupEntry( 0x0096b428, 00001, "", "" ), + new TSymLookupEntry( 0x0096b56c, 00001, "", "" ), + new TSymLookupEntry( 0x0096c168, 00001, "", "" ), + new TSymLookupEntry( 0x0096c2b8, 00001, "", "" ), + new TSymLookupEntry( 0x0096cea8, 00001, "", "" ), + new TSymLookupEntry( 0x0096d014, 00001, "", "" ), + new TSymLookupEntry( 0x0096d02c, 00001, "", "" ), + new TSymLookupEntry( 0x0096dc10, 00001, "", "" ), + new TSymLookupEntry( 0x0096dd7c, 00001, "", "" ), + new TSymLookupEntry( 0x0096e978, 00001, "", "" ), + new TSymLookupEntry( 0x0096ead0, 00001, "", "" ), + new TSymLookupEntry( 0x0096eaf8, 00001, "", "" ), + new TSymLookupEntry( 0x0096eb20, 00001, "", "" ), + new TSymLookupEntry( 0x0096eb70, 00001, "", "" ), + new TSymLookupEntry( 0x0096eb98, 00001, "", "" ), + new TSymLookupEntry( 0x0096ebe8, 00001, "", "" ), + new TSymLookupEntry( 0x0096ecb4, 00001, "", "" ), + new TSymLookupEntry( 0x0096f898, 00001, "", "" ), + new TSymLookupEntry( 0x0096f9dc, 00001, "", "" ), + new TSymLookupEntry( 0x009705d8, 00001, "", "" ), + new TSymLookupEntry( 0x00970728, 00001, "", "" ), + new TSymLookupEntry( 0x00971318, 00001, "", "" ), + new TSymLookupEntry( 0x0097149c, 00001, "", "" ), + new TSymLookupEntry( 0x00972080, 00001, "", "" ), + new TSymLookupEntry( 0x009721ec, 00001, "", "" ), + new TSymLookupEntry( 0x00972de8, 00001, "", "" ), + new TSymLookupEntry( 0x00972f40, 00001, "", "" ), + new TSymLookupEntry( 0x00972f68, 00001, "", "" ), + new TSymLookupEntry( 0x00972f90, 00001, "", "" ), + new TSymLookupEntry( 0x00973000, 00001, "", "" ), + new TSymLookupEntry( 0x00973028, 00001, "", "" ), + new TSymLookupEntry( 0x00973078, 00001, "", "" ), + new TSymLookupEntry( 0x00973144, 00001, "", "" ), + new TSymLookupEntry( 0x00973d28, 00001, "", "" ), + new TSymLookupEntry( 0x00973e6c, 00001, "", "" ), + new TSymLookupEntry( 0x00974a68, 00001, "", "" ), + new TSymLookupEntry( 0x00974bb8, 00001, "", "" ), + new TSymLookupEntry( 0x009757a8, 00001, "", "" ), + new TSymLookupEntry( 0x0097592c, 00001, "", "" ), + new TSymLookupEntry( 0x00976510, 00001, "", "" ), + new TSymLookupEntry( 0x0097667c, 00001, "", "" ), + new TSymLookupEntry( 0x00977278, 00001, "", "" ), + new TSymLookupEntry( 0x009773d0, 00001, "", "" ), + new TSymLookupEntry( 0x009773f8, 00001, "", "" ), + new TSymLookupEntry( 0x00977420, 00001, "", "" ), + new TSymLookupEntry( 0x00977470, 00001, "", "" ), + new TSymLookupEntry( 0x00977498, 00001, "", "" ), + new TSymLookupEntry( 0x009774e8, 00001, "", "" ), + new TSymLookupEntry( 0x00977560, 00001, "", "" ), + new TSymLookupEntry( 0x00978000, 00001, "", "" ), + new TSymLookupEntry( 0x009785cc, 00001, "", "" ), + new TSymLookupEntry( 0x009791b0, 00001, "", "" ), + new TSymLookupEntry( 0x009792f4, 00001, "", "" ), + new TSymLookupEntry( 0x00979ef0, 00001, "", "" ), + new TSymLookupEntry( 0x0097a048, 00001, "", "" ), + new TSymLookupEntry( 0x0097ac38, 00001, "", "" ), + new TSymLookupEntry( 0x0097adbc, 00001, "", "" ), + new TSymLookupEntry( 0x0097b9a0, 00001, "", "" ), + new TSymLookupEntry( 0x0097bbe8, 00001, "", "" ), + new TSymLookupEntry( 0x0097bc68, 00001, "", "" ), + new TSymLookupEntry( 0x0097c388, 00001, "", "" ), + new TSymLookupEntry( 0x0097c478, 00001, "", "" ), + new TSymLookupEntry( 0x0097cb68, 00001, "", "" ), + new TSymLookupEntry( 0x0097cba0, 00001, "", "" ), + new TSymLookupEntry( 0x0097d830, 00001, "", "" ), + new TSymLookupEntry( 0x0098303b, 00001, "", "" ), + new TSymLookupEntry( 0x00983138, 00001, "", "" ), + new TSymLookupEntry( 0x009832ac, 00001, "", "" ), + new TSymLookupEntry( 0x00984960, 00001, "", "" ), + new TSymLookupEntry( 0x009854d4, 00001, "", "" ), + new TSymLookupEntry( 0x00986b88, 00001, "", "" ), + new TSymLookupEntry( 0x00986c74, 00001, "", "" ), + new TSymLookupEntry( 0x00987110, 00001, "", "" ), + new TSymLookupEntry( 0x00988e34, 00001, "", "" ), + new TSymLookupEntry( 0x009892d0, 00001, "", "" ), + new TSymLookupEntry( 0x0098afa4, 00001, "", "" ), + new TSymLookupEntry( 0x0098b440, 00001, "", "" ), + new TSymLookupEntry( 0x0098ba64, 00001, "", "" ), + new TSymLookupEntry( 0x0098d164, 00001, "", "" ), + new TSymLookupEntry( 0x0098d1dc, 00001, "", "" ), + new TSymLookupEntry( 0x0098d678, 00001, "", "" ), + new TSymLookupEntry( 0x0098dc9c, 00001, "", "" ), + new TSymLookupEntry( 0x0098f414, 00001, "", "" ), + new TSymLookupEntry( 0x0098f8b0, 00001, "", "" ), + new TSymLookupEntry( 0x0098fdb4, 00001, "", "" ), + new TSymLookupEntry( 0x0098fed4, 00001, "", "" ), + new TSymLookupEntry( 0x009b08d0, 00001, "", "" ), + new TSymLookupEntry( 0x009d08e0, 00001, "", "" ), + new TSymLookupEntry( 0x009f14db, 00001, "", "" ), + new TSymLookupEntry( 0x009f21ee, 00001, "", "" ), + new TSymLookupEntry( 0x009f3c19, 00001, "", "" ), + new TSymLookupEntry( 0x009f6422, 00001, "", "" ), + new TSymLookupEntry( 0x01010001, 00002, "", "" ), + new TSymLookupEntry( 0x01010002, 00002, "", "" ), + new TSymLookupEntry( 0x0101ffff, 00002, "", "" ), + new TSymLookupEntry( 0x013387e0, 00001, "", "" ), + new TSymLookupEntry( 0x0169007a, 00001, "", "" ), + new TSymLookupEntry( 0x01747468, 00001, "", "" ), + new TSymLookupEntry( 0x03000000, 00001, "", "" ), + new TSymLookupEntry( 0x04000000, 00002, "", "" ), + new TSymLookupEntry( 0x04018000, 00002, "", "" ), + new TSymLookupEntry( 0x04747468, 00002, "", "" ), + new TSymLookupEntry( 0x048e830c, 00001, "", "" ), + new TSymLookupEntry( 0x08cc0032, 00001, "", "" ), + new TSymLookupEntry( 0x0a1a0a0d, 00003, "", "" ), + new TSymLookupEntry( 0x0ff2ff31, 00003, "", "" ), + new TSymLookupEntry( 0x0fffffff, 00001, "", "" ), + new TSymLookupEntry( 0x10000000, 00003, "", "" ), + new TSymLookupEntry( 0x1000582c, 00001, "", "" ), + new TSymLookupEntry( 0x100059b9, 00001, "", "" ), + new TSymLookupEntry( 0x10005a26, 00008, "", "" ), + new TSymLookupEntry( 0x101f446f, 00001, "", "" ), + new TSymLookupEntry( 0x101f45c8, 00008, "", "" ), + new TSymLookupEntry( 0x101f4a6b, 00016, "", "" ), + new TSymLookupEntry( 0x101f86e3, 00001, "", "" ), + new TSymLookupEntry( 0x1020384e, 00001, "", "" ), + new TSymLookupEntry( 0x102071fd, 00001, "", "" ), + new TSymLookupEntry( 0x1028235b, 00001, "", "" ), + new TSymLookupEntry( 0x18a92000, 00001, "", "" ), + new TSymLookupEntry( 0x1fb55e5b, 00001, "", "" ), + new TSymLookupEntry( 0x1ffffff0, 00005, "", "" ), + new TSymLookupEntry( 0x20000000, 00006, "", "" ), + new TSymLookupEntry( 0x20544547, 00001, "", "" ), + new TSymLookupEntry( 0x215f6fcd, 00001, "", "" ), + new TSymLookupEntry( 0x2c657554, 00001, "", "" ), + new TSymLookupEntry( 0x2d305b5e, 00001, "", "" ), + new TSymLookupEntry( 0x2d6f7369, 00001, "", "" ), + new TSymLookupEntry( 0x2fffff01, 00002, "", "" ), + new TSymLookupEntry( 0x30000000, 00002, "", "" ), + new TSymLookupEntry( 0x30000004, 00001, "", "" ), + new TSymLookupEntry( 0x3000000f, 00001, "", "" ), + new TSymLookupEntry( 0x30000040, 00001, "", "" ), + new TSymLookupEntry( 0x30751891, 00001, "", "" ), + new TSymLookupEntry( 0x32390000, 00001, "", "" ), + new TSymLookupEntry( 0x38314b4f, 00001, "", "" ), + new TSymLookupEntry( 0x38464947, 00001, "", "" ), + new TSymLookupEntry( 0x39303032, 00001, "", "" ), + new TSymLookupEntry( 0x3ffc8120, 00002, "", "" ), + new TSymLookupEntry( 0x3ffdeda8, 00001, "", "" ), + new TSymLookupEntry( 0x40040001, 00001, "", "" ), + new TSymLookupEntry( 0x40060001, 00001, "", "" ), + new TSymLookupEntry( 0x40080003, 00001, "", "" ), + new TSymLookupEntry( 0x40088003, 00018, "", "" ), + new TSymLookupEntry( 0x4034001e, 00001, "", "" ), + new TSymLookupEntry( 0x40390022, 00001, "", "" ), + new TSymLookupEntry( 0x416d005c, 00001, "", "" ), + new TSymLookupEntry( 0x424f4c42, 00001, "", "" ), + new TSymLookupEntry( 0x45544e49, 00004, "", "" ), + new TSymLookupEntry( 0x474e5089, 00021, "", "" ), + new TSymLookupEntry( 0x4a1780da, 00001, "", "" ), + new TSymLookupEntry( 0x50435245, 00034, "", "" ), + new TSymLookupEntry( 0x509890be, 00001, "", "" ), + new TSymLookupEntry( 0x53a6befb, 00001, "", "" ), + new TSymLookupEntry( 0x54584554, 00004, "", "" ), + new TSymLookupEntry( 0x5f6c6274, 00002, "", "" ), + new TSymLookupEntry( 0x61746164, 00001, "", "" ), + new TSymLookupEntry( 0x6176612f, 00003, "", "" ), + new TSymLookupEntry( 0x65636341, 00001, "", "" ), + new TSymLookupEntry( 0x65676150, 00001, "", "" ), + new TSymLookupEntry( 0x656c6966, 00018, "", "" ), + new TSymLookupEntry( 0x656d616e, 00003, "", "" ), + new TSymLookupEntry( 0x65707974, 00002, "", "" ), + new TSymLookupEntry( 0x65746e69, 00002, "", "" ), + new TSymLookupEntry( 0x65747962, 00001, "", "" ), + new TSymLookupEntry( 0x67616d69, 00001, "", "" ), + new TSymLookupEntry( 0x69667657, 00001, "", "" ), + new TSymLookupEntry( 0x696c7173, 00003, "", "" ), + new TSymLookupEntry( 0x697a6f4d, 00001, "", "" ), + new TSymLookupEntry( 0x6d617473, 00001, "", "" ), + new TSymLookupEntry( 0x6d783f3c, 00002, "", "" ), + new TSymLookupEntry( 0x6e2f2f3a, 00001, "", "" ), + new TSymLookupEntry( 0x6e32ddf5, 00001, "", "" ), + new TSymLookupEntry( 0x6e696d23, 00002, "", "" ), + new TSymLookupEntry( 0x6e6f6349, 00003, "", "" ), + new TSymLookupEntry( 0x6e6f6369, 00003, "", "" ), + new TSymLookupEntry( 0x6f4e2d58, 00001, "", "" ), + new TSymLookupEntry( 0x70697a67, 00001, "", "" ), + new TSymLookupEntry( 0x70747468, 00019, "", "" ), + new TSymLookupEntry( 0x74617473, 00001, "", "" ), + new TSymLookupEntry( 0x746f6f72, 00002, "", "" ), + new TSymLookupEntry( 0x74786574, 00008, "", "" ), + new TSymLookupEntry( 0x756c6176, 00001, "", "" ), + new TSymLookupEntry( 0x7874cd4c, 00001, "vtable for CEikLafEnv", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874cdd4, 00001, "vtable for CEikProcess", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874ce9c, 00001, "vtable for CEikEnvExtra", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874cef8, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874cf0c, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874cf20, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874cf34, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874cf48, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874cf5c, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874cfe8, 00001, "vtable for CEikAppUiExtra", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874d060, 00001, "vtable for CEikErrorIdler", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874d080, 00001, "vtable for CEikInfoMsgWin", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874d1ac, 00001, "vtable for CEikResourceChange", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874d418, 00001, "vtable for CEikLogicalBorderProxy", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874d480, 00001, "vtable for CEikPictureFactoryResolver", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x7874d5cc, 00001, "vtable for CEikonEnv", @"\epoc32\release\ARMV5\urel\eikcore.dll" ), + new TSymLookupEntry( 0x78755ff8, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\uiklaf.dll" ), + new TSymLookupEntry( 0x78756040, 00001, "vtable for CAknInfoMsgWin", @"\epoc32\release\ARMV5\urel\uiklaf.dll" ), + new TSymLookupEntry( 0x78806348, 00001, "vtable for CExitWatch", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78806fc4, 00001, "vtable for CAknFadeStack", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78807014, 00008, "vtable for CAknIndicator", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78807554, 00001, "vtable for CAknSgcClient", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880758c, 00001, "vtable for CAknTitlePane", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880784c, 00003, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78807860, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788078ec, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78807900, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78807928, 00016, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880793c, 00003, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78807964, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78807978, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788079c8, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788079dc, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788079f0, 00001, "vtable for CCenRepListen", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78807be4, 00001, "vtable for CAknAppShutter", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78808270, 00001, "vtable for CAknSignalIcon", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78808340, 00001, "vtable for CAknSignalPane", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880865c, 00010, "vtable for CLafSystemFont", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78808758, 00001, "vtable for CAknBatteryIcon", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78808828, 00001, "vtable for CAknBatteryPane", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788088f8, 00001, "vtable for CAknContextPane", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78809284, 00001, "vtable for CAknSoundPlayer", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78809298, 00003, "vtable for CAknTextControl", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78809378, 00001, "vtable for CAknViewShutter", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788098fc, 00001, "vtable for CAknDigitalClock", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788099d0, 00001, "vtable for CAknEmptyControl", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78809aa4, 00001, "vtable for CAknFontRegistry", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78809f94, 00001, "vtable for CAknLayoutConfig", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78809fa8, 00001, "vtable for CAknPreviewPopUp", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880a2fc, 00001, "vtable for CAknSettingCache", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880a8d0, 00003, "vtable for CAknInfoPopupNote", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880ab50, 00001, "vtable for CAknSgcClientImpl", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880ab68, 00001, "vtable for CAknViewExtension", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880ad04, 00001, "vtable for CAknAppUiExtension", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880ada8, 00001, "vtable for CAknKeySoundSystem", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880b654, 00001, "vtable for CAknSignalStrength", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880b724, 00001, "vtable for CAknSkinnableClock", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880b838, 00001, "vtable for CAknTitlePaneLabel", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880b948, 00001, "vtable for CAknWsEventMonitor", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880bb3c, 00001, "vtable for CTransitionManager", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880bc50, 00001, "vtable for CAknBatteryStrength", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880c09c, 00001, "vtable for CAknDiallerLauncher", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880c2a8, 00001, "vtable for CAknIdleContextPane", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880d864, 00001, "vtable for CAknDrawSynchronizer", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880da6c, 00010, "vtable for CAknFontIdLayoutFont", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880ed88, 00001, "vtable for CAknAppUiBaseExtension", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880f078, 00003, "vtable for CAknIndicatorContainer", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880f160, 00008, "vtable for CAknIndicatorExtension", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7880ff40, 00001, "vtable for CAknSignalDataObserver", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788100c0, 00001, "vtable for CAknTitlePaneExtension", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788100e4, 00001, "vtable for CAknViewAppUiExtension", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788105c8, 00001, "vtable for CAknBatteryDataObserver", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78811084, 00002, "vtable for CAknNavigationDecorator", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788119dc, 00001, "vtable for CAknSignalPaneExtension", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78811a9c, 00001, "vtable for CAknContextPaneExtension", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78811cf0, 00001, "vtable for CAknPointerEventModifier", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78812268, 00001, "vtable for CAknIndicatorDataObserver", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78812f00, 00001, "vtable for CAknNaviForegroundObserver", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78813068, 00001, "vtable for CAknPreviewPopUpController", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7881321c, 00001, "vtable for CAknStatuspaneDigitalClock", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7881360c, 00003, "vtable for CAknInfoPopupNoteController", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788142f8, 00001, "vtable for CAknSignalIndicatorContainer", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788145f8, 00001, "vtable for CAknStatusPaneDataSubscriber", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78814618, 00001, "vtable for CAknStatusPaneSubscriberData", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78814710, 00001, "vtable for CAknBatteryIndicatorContainer", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788148b4, 00001, "vtable for CAknDigitalClockChangeHandler", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x7881503c, 00001, "vtable for CAknNavigationControlContainer", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78815810, 00003, "vtable for CAknIndicatorContainerExtension", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788159d4, 00001, "vtable for CAknSkinnableClockChangeHandler", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78815b00, 00001, "vtable for CAknUniversalIndicatorContainer", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78815dc0, 00002, "vtable for CAknNavigationDecoratorExtension", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78816804, 00001, "vtable for TSgcClientStatusPaneRedrawCoordinator", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78816bdc, 00001, "vtable for CAknNavigationControlContainerExtension", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78817280, 00001, "vtable for CAknEnv", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x788176d0, 00003, "vtable for CAknText", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78817ae4, 00001, "vtable for CAknStatusPaneDataSubscriber::TWsEventObserver", @"\epoc32\release\ARMV5\urel\avkon.dll" ), + new TSymLookupEntry( 0x78826abc, 00001, "vtable for CAknGlobalNote", @"\epoc32\release\ARMV5\urel\aknnotify.dll" ), + new TSymLookupEntry( 0x78826b20, 00002, "vtable for CAknSoftNotifier", @"\epoc32\release\ARMV5\urel\aknnotify.dll" ), + new TSymLookupEntry( 0x78826b84, 00002, "vtable for CAknSoftNotifierExt", @"\epoc32\release\ARMV5\urel\aknnotify.dll" ), + new TSymLookupEntry( 0x78826be8, 00002, "vtable for CWait", @"\epoc32\release\ARMV5\urel\aknnotify.dll" ), + new TSymLookupEntry( 0x78828c94, 00001, "vtable for CAknTransitionUtils", @"\epoc32\release\ARMV5\urel\akntransitionutils.dll" ), + new TSymLookupEntry( 0x788381ac, 00001, "vtable for CCdlEngine", @"\epoc32\release\ARMV5\urel\cdlengine.dll" ), + new TSymLookupEntry( 0x78838268, 00001, "vtable for CCdlEngineRef", @"\epoc32\release\ARMV5\urel\cdlengine.dll" ), + new TSymLookupEntry( 0x7883829c, 00001, "vtable for CCdlLibManager", @"\epoc32\release\ARMV5\urel\cdlengine.dll" ), + new TSymLookupEntry( 0x788382b0, 00013, "vtable for CCdlDllInstance", @"\epoc32\release\ARMV5\urel\cdlengine.dll" ), + new TSymLookupEntry( 0x788382d4, 00001, "vtable for CCdlChangeMonitor", @"\epoc32\release\ARMV5\urel\cdlengine.dll" ), + new TSymLookupEntry( 0x788382f4, 00013, "vtable for CCdlInstanceProxy", @"\epoc32\release\ARMV5\urel\cdlengine.dll" ), + new TSymLookupEntry( 0x78838318, 00001, "vtable for CCdlChangeObserver", @"\epoc32\release\ARMV5\urel\cdlengine.dll" ), + new TSymLookupEntry( 0x78838358, 00013, "vtable for CCdlCustomisationStack", @"\epoc32\release\ARMV5\urel\cdlengine.dll" ), + new TSymLookupEntry( 0x788461d7, 00001, "CEikCoCtlLibrary::CreateByTypeL(int)", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x788462d3, 00001, "CEikCoCtlLibrary::CreateButtonGroupByTypeL(int, EikButtonGroupFactory::TCreationData&, int&)", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888a348, 00003, "vtable for CAknButton", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888a428, 00001, "vtable for CAknToolbar", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888a6ac, 00001, "vtable for CEikMenuBar", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888a9e8, 00001, "vtable for CEikMenuPane", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888ac80, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888ac94, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888aca8, 00003, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888acd0, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888acf8, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888ad0c, 00003, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888ad5c, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888ad70, 00002, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888ad98, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888ade4, 00003, "vtable for CEikCbaButton", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888af8c, 00001, "vtable for CEikScrollBar", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888b0a0, 00001, "vtable for CAknEdwinState", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888b2f4, 00001, "vtable for CEikStatusPane", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888b450, 00003, "vtable for CAknButtonState", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888b58c, 00003, "vtable for CAknToolbarItem", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888baa0, 00001, "vtable for CEikAppUiFactory", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888bca0, 00001, "vtable for CEikCbaExtension", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888c3b4, 00001, "vtable for CEikStatusPaneTls", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888c630, 00005, "vtable for CEikLabelExtension", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888c7c8, 00003, "vtable for CAknButtonExtension", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888cae0, 00001, "vtable for CRedrawStoreHandler", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888cd44, 00001, "vtable for CEikButtonGroupStack", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888cd60, 00001, "vtable for CEikMenuBarExtension", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888cd8c, 00002, "vtable for CEikStatusPaneLayout", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888cfa0, 00001, "vtable for CEikCbaScrollBarFrame", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888d304, 00001, "vtable for CEikStatusPaneSetInit", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888d47c, 00001, "vtable for CEikAppStatusPaneModel", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888d590, 00001, "vtable for CEikScrollBarExtension", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888d8dc, 00009, "vtable for CEikStatusPaneContainer", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888da9c, 00003, "vtable for CAknButtonStateExtension", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888db98, 00001, "vtable for CEikButtonGroupContainer", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888dc94, 00010, "vtable for CEikStatusPaneLayoutTree", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888dcb8, 00001, "vtable for CEikAppUiFactoryExtension", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888e0a8, 00001, "vtable for CEikButtonGroupFactoryArray", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888e0c4, 00001, "vtable for CEikStatusPaneBaseExtension", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888e500, 00001, "vtable for CEikCba", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888e898, 00003, "vtable for CEikImage", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888e96c, 00004, "vtable for CEikLabel", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888ea5c, 00001, "vtable for CEikMenuBar::CTitleArray", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x7888eae8, 00002, "vtable for CEikStatusPaneModelBase::CIdLayoutPair", @"\epoc32\release\ARMV5\urel\eikcoctl.dll" ), + new TSymLookupEntry( 0x788a2c84, 00002, "vtable for CAknsEffectCommand", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a2cc0, 00002, "vtable for CAknsBitmapItemData", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a2d70, 00001, "vtable for CAknsAppSkinInstance", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a2e44, 00001, "vtable for CAknsAppUiParameters", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a2ea8, 00004, "vtable for CAknsEffectParameter", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a2ebc, 00009, "vtable for CAknsTemporaryBitmap", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a2fbc, 00003, "vtable for CAknsColorTableItemData", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a2fd0, 00006, "vtable for CAknsImageTableItemData", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a2ff8, 00007, "vtable for CAknsEffectQueueItemData", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a3048, 00066, "vtable for CAknsMaskedBitmapItemData", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a30d8, 00079, "vtable for CAknsAppSkinInstanceCacheEntry", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a30ec, 00002, "vtable for CAknsBasicBackgroundControlContext", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a3130, 00008, "vtable for CAknsFrameBackgroundControlContext", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a3204, 00001, "vtable for CAknsCombinedBackgroundControlContext", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788a3248, 00005, "vtable for CAknsMaskedLayerBackgroundControlContext", @"\epoc32\release\ARMV5\urel\aknskins.dll" ), + new TSymLookupEntry( 0x788ab7cc, 00150, "vtable for CAknBitmap", @"\epoc32\release\ARMV5\urel\AknIcon.dll" ), + new TSymLookupEntry( 0x788ab7e0, 00001, "vtable for CAknIconLoader", @"\epoc32\release\ARMV5\urel\AknIcon.dll" ), + new TSymLookupEntry( 0x788ab81c, 00076, "vtable for CAknIconManager", @"\epoc32\release\ARMV5\urel\AknIcon.dll" ), + new TSymLookupEntry( 0x788ab8a0, 00001, "vtable for CAknIconSrvTlsData", @"\epoc32\release\ARMV5\urel\AknIcon.dll" ), + new TSymLookupEntry( 0x788ab8c8, 00005, "vtable for CAknIconFileNameItem", @"\epoc32\release\ARMV5\urel\AknIcon.dll" ), + new TSymLookupEntry( 0x788ab8dc, 00005, "vtable for CAknIconLocationInfo", @"\epoc32\release\ARMV5\urel\AknIcon.dll" ), + new TSymLookupEntry( 0x788ab9e8, 00001, "vtable for CAknIconFileNameCache", @"\epoc32\release\ARMV5\urel\AknIcon.dll" ), + new TSymLookupEntry( 0x789ac178, 00001, "vtable for CAknsSrvChunkLookup", @"\epoc32\release\ARMV5\urel\aknskinsrv.dll" ), + new TSymLookupEntry( 0x789ac2f4, 00001, "vtable for CAknsSkinChangeHandler", @"\epoc32\release\ARMV5\urel\aknskinsrv.dll" ), + new TSymLookupEntry( 0x789c0638, 00002, "vtable for CTextResolver", @"\epoc32\release\ARMV5\urel\COMMONENGINE.DLL" ), + new TSymLookupEntry( 0x78a00a08, 00001, "vtable for CAknExtendedInputCapabilities", @"\epoc32\release\ARMV5\urel\eikctl.dll" ), + new TSymLookupEntry( 0x78a19cf0, 00001, "vtable for CTouchFeedbackImpl", @"\epoc32\release\ARMV5\urel\touchfeedback.dll" ), + new TSymLookupEntry( 0x78a19d94, 00001, "vtable for CTouchFeedbackClient", @"\epoc32\release\ARMV5\urel\touchfeedback.dll" ), + new TSymLookupEntry( 0x78a19da8, 00003, "vtable for CTouchFeedbackRegistry", @"\epoc32\release\ARMV5\urel\touchfeedback.dll" ), + new TSymLookupEntry( 0x78a19dbc, 00001, "vtable for CTouchFeedbackAdaptation", @"\epoc32\release\ARMV5\urel\touchfeedback.dll" ), + new TSymLookupEntry( 0x78a6e378, 00002, "vtable for CAknsRlScanlines", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e490, 00001, "vtable for CAknsRlMasterLayout", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e558, 00001, "vtable for CAknsRlDefaultRenderer", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e5d0, 00001, "vtable for CAknsRlEffectPluginNoise", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e62c, 00001, "vtable for CAknsRlEffectPluginInvert", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e688, 00001, "vtable for CAknsRlInternalEffectPool", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e6ec, 00001, "vtable for CAknsRlEffectPluginBumpMap", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e784, 00001, "vtable for CAknsRlEffectPluginApplyGfx", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e7e0, 00001, "vtable for CAknsRlEffectPluginContrast", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e83c, 00001, "vtable for CAknsRlEffectPluginSolarize", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e898, 00001, "vtable for CAknsRlEffectPluginGrayscale", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e8f4, 00001, "vtable for CAknsRlEffectPluginAlphaBlend", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e950, 00001, "vtable for CAknsRlEffectPluginApplyColor", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6e9ac, 00001, "vtable for CAknsRlEffectPluginBlackWhite", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6ea08, 00001, "vtable for CAknsRlEffectPluginSaturation", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6ea64, 00001, "vtable for CAknsRlEffectPluginConvolution", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6eac0, 00001, "vtable for CAknsRlEffectPluginChannelBlend", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6eb1c, 00001, "vtable for CAknsRlEffectPluginMovingLayers", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a6eb78, 00001, "vtable for CAknsRlEffectPluginAdjustChannels", @"\epoc32\release\ARMV5\urel\aknskinrenderlib.dll" ), + new TSymLookupEntry( 0x78a93774, 00001, "vtable for CPtiEngine", @"\epoc32\release\ARMV5\urel\ptiengine.dll" ), + new TSymLookupEntry( 0x78a93800, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\ptiengine.dll" ), + new TSymLookupEntry( 0x78a93814, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\ptiengine.dll" ), + new TSymLookupEntry( 0x78a93924, 00001, "vtable for CMultiTapTimer", @"\epoc32\release\ARMV5\urel\ptiengine.dll" ), + new TSymLookupEntry( 0x78a93944, 00001, "vtable for CPtiEngineImpl", @"\epoc32\release\ARMV5\urel\ptiengine.dll" ), + new TSymLookupEntry( 0x78a93ac0, 00001, "vtable for CPtiDefaultCore", @"\epoc32\release\ARMV5\urel\ptiengine.dll" ), + new TSymLookupEntry( 0x78a93c4c, 00002, "vtable for CPtiKeyMappings", @"\epoc32\release\ARMV5\urel\ptiengine.dll" ), + new TSymLookupEntry( 0x78a93cb0, 00006, "vtable for CPtiCoreLanguage", @"\epoc32\release\ARMV5\urel\ptiengine.dll" ), + new TSymLookupEntry( 0x78a93e40, 00001, "vtable for CPtiQwertyKeyMappings", @"\epoc32\release\ARMV5\urel\ptiengine.dll" ), + new TSymLookupEntry( 0x78a93ea0, 00001, "vtable for CPtiNumberModeDataImpl", @"\epoc32\release\ARMV5\urel\ptiengine.dll" ), + new TSymLookupEntry( 0x78a94010, 00001, "vtable for CPtiQwertyKeymappingsExtension", @"\epoc32\release\ARMV5\urel\ptiengine.dll" ), + new TSymLookupEntry( 0x78b1c6f4, 00002, "vtable for CDocumentHandler", @"\epoc32\release\ARMV5\urel\commonui.dll" ), + new TSymLookupEntry( 0x78b1ca40, 00002, "vtable for CErrorUI", @"\epoc32\release\ARMV5\urel\commonui.dll" ), + new TSymLookupEntry( 0x78ca9d30, 00001, "vtable for CActiveApDb", @"\epoc32\release\ARMV5\urel\ApEngine.dll" ), + new TSymLookupEntry( 0x78ca9d6c, 00001, "vtable for CApItemExtra", @"\epoc32\release\ARMV5\urel\ApEngine.dll" ), + new TSymLookupEntry( 0x78ca9d80, 00001, "vtable for CVpnApEngine", @"\epoc32\release\ARMV5\urel\ApEngine.dll" ), + new TSymLookupEntry( 0x78ca9de4, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\ApEngine.dll" ), + new TSymLookupEntry( 0x78ca9e0c, 00001, "vtable for CApDataHandler", @"\epoc32\release\ARMV5\urel\ApEngine.dll" ), + new TSymLookupEntry( 0x78ca9e48, 00001, "vtable for CApItemWlanData", @"\epoc32\release\ARMV5\urel\ApEngine.dll" ), + new TSymLookupEntry( 0x78ca9e84, 00001, "vtable for CApAccessPointItem", @"\epoc32\release\ARMV5\urel\ApEngine.dll" ), + new TSymLookupEntry( 0x78ca9ec0, 00001, "vtable for CActiveApDbNotifier", @"\epoc32\release\ARMV5\urel\ApEngine.dll" ), + new TSymLookupEntry( 0x78ca9ee0, 00001, "vtable for CApUtils", @"\epoc32\release\ARMV5\urel\ApEngine.dll" ), + new TSymLookupEntry( 0x78cbbe84, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\DownloadMgr.dll" ), + new TSymLookupEntry( 0x78cbbe98, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\DownloadMgr.dll" ), + new TSymLookupEntry( 0x78cbbeac, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\DownloadMgr.dll" ), + new TSymLookupEntry( 0x78cbbec0, 00001, "vtable for CDefaultAttrib", @"\epoc32\release\ARMV5\urel\DownloadMgr.dll" ), + new TSymLookupEntry( 0x78cbbfc0, 00001, "vtable for CDownloadMgrHandler", @"\epoc32\release\ARMV5\urel\DownloadMgr.dll" ), + new TSymLookupEntry( 0x78cbc0bc, 00001, "vtable for CRHttpDownloadMgrExtension", @"\epoc32\release\ARMV5\urel\DownloadMgr.dll" ), + new TSymLookupEntry( 0x78f30e3c, 00004, "vtable for CWidgetPropertyValue", @"\epoc32\release\ARMV5\urel\WidgetRegistryClient.dll" ), + new TSymLookupEntry( 0x79268568, 00001, "vtable for CAknDllInitializer", @"\epoc32\release\ARMV5\urel\akninit.dll" ), + new TSymLookupEntry( 0x7926df60, 00001, "vtable for CEikDebugKeys", @"\epoc32\release\ARMV5\urel\eikcdlg.dll" ), + new TSymLookupEntry( 0x7926e434, 00001, "vtable for CEikAlertNotifier", @"\epoc32\release\ARMV5\urel\eikcdlg.dll" ), + new TSymLookupEntry( 0x7926e61c, 00001, "vtable for CEikCDlgDialogFactory", @"\epoc32\release\ARMV5\urel\eikcdlg.dll" ), + new TSymLookupEntry( 0x7932deb0, 00001, "vtable for CAknFepPlugin", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932def4, 00001, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932df38, 00001, "vtable for CAknFepManager", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932e3b8, 00001, "vtable for CAknFepKeyCatcher", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932e4b8, 00001, "vtable for CAknFepCaseManager", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932e4cc, 00001, "vtable for CAknFepFnKeyManager", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932e4e0, 00001, "vtable for CAknFepPluginManager", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932e690, 00001, "vtable for CAknFepHashKeyManager", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932e6e0, 00001, "vtable for CAknFepLanguageManager", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932e6f4, 00002, "vtable for CAknFepThaiSCTSelector", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932e86c, 00001, "vtable for CAknFepUIManagerWestern", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932ebc4, 00001, "vtable for CAknFepPluginMenuManager", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932ec04, 00002, "vtable for CAknFepRepositoryWatcher", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932ef1c, 00001, "vtable for CAknFepInlineTextDecorator", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932ef30, 00001, "vtable for CAknFepSharedDataInterface", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7932ef80, 00001, "vtable for CAknFepVietnameseToneManager", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x79330f64, 00002, "vtable for CAknFepSharedDataInterface::CSubscriber", @"\epoc32\release\ARMV5\urel\avkonfep.dll" ), + new TSymLookupEntry( 0x7933e000, 00001, "vtable for CPeninputServerObserver", @"\epoc32\release\ARMV5\urel\peninputclient.dll" ), + new TSymLookupEntry( 0x7933e030, 00001, "vtable for CPenInputSingletonClient", @"\epoc32\release\ARMV5\urel\peninputclient.dll" ), + new TSymLookupEntry( 0x7934de00, 00001, "vtable for CAknFepUIAvkonImpl", @"\epoc32\release\ARMV5\urel\AknFepUiAvkonPlugin.dll" ), + new TSymLookupEntry( 0x7934dee4, 00001, "vtable for CAknFepIndicatorAvkon", @"\epoc32\release\ARMV5\urel\AknFepUiAvkonPlugin.dll" ), + new TSymLookupEntry( 0x7934e7c4, 00001, "vtable for CAknFepExactWordPopupContent", @"\epoc32\release\ARMV5\urel\AknFepUiAvkonPlugin.dll" ), + new TSymLookupEntry( 0x7937c970, 00001, "vtable for CPtiLangDataImplEnglish", @"\epoc32\release\ARMV5\urel\PtiKeymappings_01.dll" ), + new TSymLookupEntry( 0x7937ca3c, 00001, "vtable for CPtiVariant01DataFactory", @"\epoc32\release\ARMV5\urel\PtiKeymappings_01.dll" ), + new TSymLookupEntry( 0x79394ecc, 00001, "vtable for CPtiZiCore", @"\epoc32\release\ARMV5\urel\PtiZiCore.dll" ), + new TSymLookupEntry( 0x79395088, 00001, "vtable for CPtiZiUserDict", @"\epoc32\release\ARMV5\urel\PtiZiCore.dll" ), + new TSymLookupEntry( 0x793950f8, 00001, "vtable for CPtiZiAutoSubst", @"\epoc32\release\ARMV5\urel\PtiZiCore.dll" ), + new TSymLookupEntry( 0x7939510c, 00001, "vtable for CPtiZiSharedDataBlock", @"\epoc32\release\ARMV5\urel\PtiZiCore.dll" ), + new TSymLookupEntry( 0x793f21e0, 00001, "vtable for CWidgetUiApp", @"\epoc32\release\ARMV5\urel\WidgetUi.exe" ), + new TSymLookupEntry( 0x793f2230, 00001, "vtable for CCpsPublisher", @"\epoc32\release\ARMV5\urel\WidgetUi.exe" ), + new TSymLookupEntry( 0x793f2254, 00001, "vtable for CWidgetUiAppUi", @"\epoc32\release\ARMV5\urel\WidgetUi.exe" ), + new TSymLookupEntry( 0x793f23bc, 00001, "vtable for CWidgetUiWindow", @"\epoc32\release\ARMV5\urel\WidgetUi.exe" ), + new TSymLookupEntry( 0x793f24b4, 00001, "vtable for CWidgetUiDocument", @"\epoc32\release\ARMV5\urel\WidgetUi.exe" ), + new TSymLookupEntry( 0x793f2524, 00001, "vtable for CWidgetUiObserver", @"\epoc32\release\ARMV5\urel\WidgetUi.exe" ), + new TSymLookupEntry( 0x793f25e0, 00001, "vtable for CWidgetUiAsyncExit", @"\epoc32\release\ARMV5\urel\WidgetUi.exe" ), + new TSymLookupEntry( 0x793f2600, 00001, "vtable for CWidgetUiWindowView", @"\epoc32\release\ARMV5\urel\WidgetUi.exe" ), + new TSymLookupEntry( 0x793f271c, 00001, "vtable for CWidgetUiWindowManager", @"\epoc32\release\ARMV5\urel\WidgetUi.exe" ), + new TSymLookupEntry( 0x793f273c, 00001, "vtable for CWidgetUiWindowContainer", @"\epoc32\release\ARMV5\urel\WidgetUi.exe" ), + new TSymLookupEntry( 0x793f2820, 00001, "vtable for CWidgetUiDialogsProviderProxy", @"\epoc32\release\ARMV5\urel\WidgetUi.exe" ), + new TSymLookupEntry( 0x795bb97c, 00001, "vtable for CLiwBinding", @"\epoc32\release\ARMV5\urel\Liwservicehandler.dll" ), + new TSymLookupEntry( 0x795bb990, 00001, "vtable for CLiwTlsData", @"\epoc32\release\ARMV5\urel\Liwservicehandler.dll" ), + new TSymLookupEntry( 0x795bbac4, 00002, "vtable for CLiwEcomMonitor", @"\epoc32\release\ARMV5\urel\Liwservicehandler.dll" ), + new TSymLookupEntry( 0x795bbaf8, 00001, "vtable for CLiwServiceData", @"\epoc32\release\ARMV5\urel\Liwservicehandler.dll" ), + new TSymLookupEntry( 0x795bbb0c, 00001, "vtable for CLiwCriteriaItem", @"\epoc32\release\ARMV5\urel\Liwservicehandler.dll" ), + new TSymLookupEntry( 0x795bbc3c, 00002, "vtable for CLiwServiceHandler", @"\epoc32\release\ARMV5\urel\Liwservicehandler.dll" ), + new TSymLookupEntry( 0x795bbc5c, 00004, "vtable for CLiwGenericParamList", @"\epoc32\release\ARMV5\urel\Liwservicehandler.dll" ), + new TSymLookupEntry( 0x795bbc70, 00002, "vtable for CLiwServiceHandlerImpl", @"\epoc32\release\ARMV5\urel\Liwservicehandler.dll" ), + new TSymLookupEntry( 0x795ca594, 00001, "vtable for CRTSecMgrScriptSession", @"\epoc32\release\ARMV5\urel\RTSecMgrClient.dll" ), + new TSymLookupEntry( 0x795ca5c8, 00001, "vtable for CRTSecMgrSubSessionProxy", @"\epoc32\release\ARMV5\urel\RTSecMgrClient.dll" ), + new TSymLookupEntry( 0x795ccd78, 00003, "vtable for CPermission", @"\epoc32\release\ARMV5\urel\RTSecMgrUtil.dll" ), + new TSymLookupEntry( 0x795ccd8c, 00001, "vtable for CPermissionSet", @"\epoc32\release\ARMV5\urel\RTSecMgrUtil.dll" ), + new TSymLookupEntry( 0x795ccdb4, 00001, "vtable for CScript", @"\epoc32\release\ARMV5\urel\RTSecMgrUtil.dll" ), + new TSymLookupEntry( 0x79655558, 00001, "vtable for CPluginFepManagerItut", @"\epoc32\release\ARMV5\urel\peninputimepluginitut.dll" ), + new TSymLookupEntry( 0x79655638, 00001, "vtable for CPenInputImePluginItut", @"\epoc32\release\ARMV5\urel\peninputimepluginitut.dll" ), + new TSymLookupEntry( 0x796a96f4, 00001, "vtable for CCPClientService", @"\epoc32\release\ARMV5\urel\cpclient.dll" ), + new TSymLookupEntry( 0x796a9714, 00001, "vtable for CCPActiveNotifier", @"\epoc32\release\ARMV5\urel\cpclient.dll" ), + new TSymLookupEntry( 0x796a975c, 00001, "vtable for CDataSourceInterface", @"\epoc32\release\ARMV5\urel\cpclient.dll" ), + new TSymLookupEntry( 0x796a97bc, 00001, "vtable for CCPClient", @"\epoc32\release\ARMV5\urel\cpclient.dll" ), + new TSymLookupEntry( 0x796b0524, 00001, "vtable for CContentMap", @"\epoc32\release\ARMV5\urel\cputils.dll" ), + new TSymLookupEntry( 0x796c92cc, 00003, "vtable for CBrowserDialogsProvider", @"\epoc32\release\ARMV5\urel\BrowserDialogsProvider.dll" ), + new TSymLookupEntry( 0x798561ac, 00003, "vtable for RT_GestureHelper::CCallbackTimer", @"\epoc32\release\ARMV5\urel\rt_gesturehelper.dll" ), + new TSymLookupEntry( 0x798561cc, 00001, "vtable for RT_GestureHelper::CGestureHelper", @"\epoc32\release\ARMV5\urel\rt_gesturehelper.dll" ), + new TSymLookupEntry( 0x7985623c, 00001, "vtable for RT_GestureHelper::CPointerCapturer", @"\epoc32\release\ARMV5\urel\rt_gesturehelper.dll" ), + new TSymLookupEntry( 0x79856250, 00001, "vtable for RT_GestureHelper::CGestureHelperImpl", @"\epoc32\release\ARMV5\urel\rt_gesturehelper.dll" ), + new TSymLookupEntry( 0x79856264, 00001, "vtable for RT_GestureHelper::CGestureEventFilter", @"\epoc32\release\ARMV5\urel\rt_gesturehelper.dll" ), + new TSymLookupEntry( 0x798562d4, 00002, "vtable for RT_GestureHelper::CGesture", @"\epoc32\release\ARMV5\urel\rt_gesturehelper.dll" ), + new TSymLookupEntry( 0x79897150, 00002, "vtable for CHttpFilterDigestAuthentication", @"\epoc32\release\ARMV5\urel\httpfilterauthentication.dll" ), + new TSymLookupEntry( 0x7997d7bc, 00002, "vtable for CUserInteractionsUtils", @"\epoc32\release\ARMV5\urel\DownloadMgrUiLib.dll" ), + new TSymLookupEntry( 0x7997d7e8, 00002, "vtable for CAsyncEventHandlerArray", @"\epoc32\release\ARMV5\urel\DownloadMgrUiLib.dll" ), + new TSymLookupEntry( 0x7997d7fc, 00001, "vtable for CDownloadsListExtension", @"\epoc32\release\ARMV5\urel\DownloadMgrUiLib.dll" ), + new TSymLookupEntry( 0x7997d820, 00001, "vtable for CUiLibRegistryExtension", @"\epoc32\release\ARMV5\urel\DownloadMgrUiLib.dll" ), + new TSymLookupEntry( 0x7997d840, 00001, "vtable for CDownloadMgrUiLibRegistry", @"\epoc32\release\ARMV5\urel\DownloadMgrUiLib.dll" ), + new TSymLookupEntry( 0x7997d8ac, 00001, "vtable for CDownloadMgrUiDownloadMenu", @"\epoc32\release\ARMV5\urel\DownloadMgrUiLib.dll" ), + new TSymLookupEntry( 0x7997d8c0, 00001, "vtable for CUserInteractionsExtension", @"\epoc32\release\ARMV5\urel\DownloadMgrUiLib.dll" ), + new TSymLookupEntry( 0x7997d8e4, 00001, "vtable for CDownloadMgrUiDownloadsList", @"\epoc32\release\ARMV5\urel\DownloadMgrUiLib.dll" ), + new TSymLookupEntry( 0x7997d980, 00001, "vtable for CDownloadMgrUiUserInteractions", @"\epoc32\release\ARMV5\urel\DownloadMgrUiLib.dll" ), + new TSymLookupEntry( 0x79c36d94, 00001, "vtable for CConnManActiveConnector", @"\epoc32\release\ARMV5\urel\ConnectionManager.dll" ), + new TSymLookupEntry( 0x79c36db4, 00001, "vtable for CInternetConnectionManager", @"\epoc32\release\ARMV5\urel\ConnectionManager.dll" ), + new TSymLookupEntry( 0x79c36ed0, 00001, "vtable for CActiveConnectorSyncWrapper", @"\epoc32\release\ARMV5\urel\ConnectionManager.dll" ), + new TSymLookupEntry( 0x79c36ef0, 00001, "vtable for CConnectionStageNotifierWCB", @"\epoc32\release\ARMV5\urel\ConnectionManager.dll" ), + new TSymLookupEntry( 0x79c4ccb0, 00001, "vtable for CUserAgent", @"\epoc32\release\ARMV5\urel\WEBUTILS.dll" ), + new TSymLookupEntry( 0x79c51b00, 00001, "vtable for CHTTPFilterDRM", @"\epoc32\release\ARMV5\urel\HTTPFilterDRM.dll" ), + new TSymLookupEntry( 0x79c54eb8, 00001, "vtable for CHttpFilterProxy", @"\epoc32\release\ARMV5\urel\httpfilterproxy.dll" ), + new TSymLookupEntry( 0x79c5a3c8, 00001, "vtable for CPnpPaosXml", @"\epoc32\release\ARMV5\urel\PnpPaosFilter.dll" ), + new TSymLookupEntry( 0x79c5a47c, 00001, "vtable for CPnpPaosFilter", @"\epoc32\release\ARMV5\urel\PnpPaosFilter.dll" ), + new TSymLookupEntry( 0x79c60edc, 00001, "vtable for CHttpFilterCameseMcInfo", @"\epoc32\release\ARMV5\urel\httpfiltercamese.dll" ), + new TSymLookupEntry( 0x79c60ef0, 00001, "vtable for CHttpFilterCameseDrmHeader", @"\epoc32\release\ARMV5\urel\httpfiltercamese.dll" ), + new TSymLookupEntry( 0x79c66c00, 00001, "vtable for CCameseUiCommon", @"\epoc32\release\ARMV5\urel\cameseuicommon.dll" ), + new TSymLookupEntry( 0x79c66c38, 00001, "vtable for CCameseNoteManager", @"\epoc32\release\ARMV5\urel\cameseuicommon.dll" ), + new TSymLookupEntry( 0x79c70868, 00001, "vtable for CMusicShopHttpFilterMcInfo", @"\epoc32\release\ARMV5\urel\musicshophttpfilter.dll" ), + new TSymLookupEntry( 0x79c74cb4, 00001, "vtable for CHttpFilterConnHandler", @"\epoc32\release\ARMV5\urel\httpfilterconnhandler.dll" ), + new TSymLookupEntry( 0x79c74d00, 00001, "vtable for CHttpFilterConnHandlerObserver", @"\epoc32\release\ARMV5\urel\httpfilterconnhandler.dll" ), + new TSymLookupEntry( 0x79c80db0, 00001, "vtable for CHttpUAProfFilter", @"\epoc32\release\ARMV5\urel\uaproffilter.dll" ), + new TSymLookupEntry( 0x79dec340, 00001, "", "" ), + new TSymLookupEntry( 0x79def6d8, 00001, "vtable for HistoryController", @"\epoc32\release\ARMV5\urel\WebKitUtils.dll" ), + new TSymLookupEntry( 0x79e1aec8, 00001, "vtable for CStopScheduler", @"\epoc32\release\ARMV5\urel\MemMan.dll" ), + new TSymLookupEntry( 0x79e1af58, 00001, "vtable for CDefaultMemoryPool", @"\epoc32\release\ARMV5\urel\MemMan.dll" ), + new TSymLookupEntry( 0x79e1c860, 00001, "vtable for CHttpFilterIop", @"\epoc32\release\ARMV5\urel\httpfilterIop.dll" ), + new TSymLookupEntry( 0x79e797b0, 00028, "vtable for KJS::NegateNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e797e8, 00588, "vtable for KJS::NumberNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79820, 00076, "vtable for KJS::RegExpNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79858, 00314, "vtable for KJS::ReturnNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79898, 00941, "vtable for KJS::StringNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e798d0, 00001, "vtable for KJS::SwitchNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79910, 00061, "vtable for KJS::BitOperNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79948, 00116, "vtable for KJS::BooleanNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79980, 00004, "vtable for KJS::DoWhileNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e799c0, 00067, "vtable for KJS::ElementNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79b2c, 00021, "vtable for KJS::NewExprNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79b64, 00007, "vtable for KJS::ProgramNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79ba4, 03818, "vtable for KJS::ResolveNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79bdc, 00462, "vtable for KJS::VarDeclNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79c14, 00002, "vtable for KJS::ContinueNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79cd4, 00014, "vtable for KJS::FuncDeclNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79d14, 00313, "vtable for KJS::FuncExprNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79d4c, 00329, "vtable for KJS::PropertyNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79e84, 01216, "vtable for KJS::ArgumentsNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79f3c, 00274, "vtable for KJS::AssignDotNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e79f74, 00001, "vtable for KJS::CaseBlockNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7a2e8, 00403, "vtable for KJS::ParameterNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7a320, 00001, "vtable for KJS::PrefixDotNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7a420, 00001, "vtable for KJS::UnaryPlusNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7a5d8, 00408, "vtable for KJS::AssignExprNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7a610, 00001, "vtable for KJS::BitwiseNotNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7a648, 00003, "vtable for KJS::CaseClauseNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7a680, 00003, "vtable for KJS::ClauseListNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7a838, 00146, "vtable for KJS::LogicalNotNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7a970, 00005, "vtable for KJS::PostfixDotNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7a9a8, 00095, "vtable for KJS::RelationalNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7ab18, 00128, "vtable for KJS::ConditionalNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7ab88, 01403, "vtable for KJS::DotAccessorNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b2a8, 00003, "vtable for KJS::TypeOfValueNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b2e0, 00451, "vtable for KJS::VarDeclListNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b318, 01647, "vtable for KJS::ArgumentListNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b4d0, 00414, "vtable for KJS::FunctionBodyNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b5c8, 00329, "vtable for KJS::PropertyListNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b600, 00329, "vtable for KJS::PropertyNameNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b6b8, 00292, "vtable for KJS::VarStatementNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b6f8, 00068, "vtable for KJS::AssignBracketNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b730, 00308, "vtable for KJS::AssignResolveNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b768, 00432, "vtable for KJS::BinaryLogicalNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b820, 00009, "vtable for KJS::DeleteBracketNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7b890, 00994, "vtable for KJS::ExprStatementNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7ba50, 00103, "vtable for KJS::ObjectLiteralNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7bac0, 00006, "vtable for KJS::PrefixResolveNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7baf8, 00022, "vtable for KJS::TypeOfResolveNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7bb30, 00001, "vtable for KJS::EmptyStatementNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7bbf0, 00001, "vtable for KJS::PostfixBracketNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7bc28, 00047, "vtable for KJS::PostfixResolveNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7bc60, 01836, "vtable for KJS::SourceElementsNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7bca0, 00352, "vtable for KJS::BracketAccessorNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7bd64, 00961, "vtable for KJS::FunctionCallDotNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7bf1c, 00004, "vtable for KJS::FunctionCallValueNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7bfd4, 00016, "vtable for KJS::FunctionCallBracketNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c00c, 00215, "vtable for KJS::FunctionCallResolveNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c0ec, 00421, "vtable for KJS::IfNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c15c, 00386, "vtable for KJS::AddNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c194, 00044, "vtable for KJS::ForNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c1d4, 00012, "vtable for KJS::TryNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c3bc, 00051, "vtable for KJS::MultNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c3f4, 00058, "vtable for KJS::NullNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c42c, 00395, "vtable for KJS::ThisNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c49c, 00001, "vtable for KJS::WithNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c55c, 00066, "vtable for KJS::ArrayNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c594, 00280, "vtable for KJS::BlockNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c5d4, 00019, "vtable for KJS::BreakNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c64c, 00344, "vtable for KJS::EqualNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c684, 00019, "vtable for KJS::ForInNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c6c4, 00182, "vtable for KJS::GroupNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c7ec, 00045, "vtable for KJS::ShiftNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c854, 00002, "vtable for KJS::ThrowNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x79e7c894, 00017, "vtable for KJS::WhileNode", @"\epoc32\release\ARMV5\urel\JavascriptCore.dll" ), + new TSymLookupEntry( 0x7a035f80, 00003, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\BrowserCache.dll" ), + new TSymLookupEntry( 0x7a035f94, 00003, "vtable for CArrayPtrFlat", @"\epoc32\release\ARMV5\urel\BrowserCache.dll" ), + new TSymLookupEntry( 0x7a035fa8, 00003, "vtable for CArrayPtrFlat>", @"\epoc32\release\ARMV5\urel\BrowserCache.dll" ), + new TSymLookupEntry( 0x7a035fbc, 00015, "vtable for CHttpCacheEntry", @"\epoc32\release\ARMV5\urel\BrowserCache.dll" ), + new TSymLookupEntry( 0x7a035fd0, 00003, "vtable for CHttpCacheHandler", @"\epoc32\release\ARMV5\urel\BrowserCache.dll" ), + new TSymLookupEntry( 0x7a035fe4, 00001, "vtable for CHttpCacheManager", @"\epoc32\release\ARMV5\urel\BrowserCache.dll" ), + new TSymLookupEntry( 0x7a03601c, 00003, "vtable for CHttpCacheObserver", @"\epoc32\release\ARMV5\urel\BrowserCache.dll" ), + new TSymLookupEntry( 0x7a03603c, 00003, "vtable for CHttpCacheLookupTable", @"\epoc32\release\ARMV5\urel\BrowserCache.dll" ), + new TSymLookupEntry( 0x7a036064, 00003, "vtable for CHttpCacheStreamHandler", @"\epoc32\release\ARMV5\urel\BrowserCache.dll" ), + new TSymLookupEntry( 0x7a036078, 00003, "vtable for CHttpCacheEvictionHandler", @"\epoc32\release\ARMV5\urel\BrowserCache.dll" ), + new TSymLookupEntry( 0x7a0c3ae4, 00001, "DefaultHash::Des16(const TDesC16&)", @"\epoc32\release\ARMV5\urel\WidgetEngine.dll" ), + new TSymLookupEntry( 0x7a0c5150, 00001, "vtable for CMenuClient", @"\epoc32\release\ARMV5\urel\WidgetEngine.dll" ), + new TSymLookupEntry( 0x7a0c51dc, 00005, "vtable for PrefElement", @"\epoc32\release\ARMV5\urel\WidgetEngine.dll" ), + new TSymLookupEntry( 0x7a0c51f0, 00001, "vtable for CWidgetClient", @"\epoc32\release\ARMV5\urel\WidgetEngine.dll" ), + new TSymLookupEntry( 0x7a0c5264, 00001, "vtable for WidgetEngineBridge", @"\epoc32\release\ARMV5\urel\WidgetEngine.dll" ), + new TSymLookupEntry( 0x7a0c52a4, 00011, "vtable for CMenuItem", @"\epoc32\release\ARMV5\urel\WidgetEngine.dll" ), + new TSymLookupEntry( 0x7a0c53c8, 00001, "vtable for KJS::MenuPrivate", @"\epoc32\release\ARMV5\urel\WidgetEngine.dll" ), + new TSymLookupEntry( 0x7a0c54d8, 00001, "vtable for KJS::WidgetPrivate", @"\epoc32\release\ARMV5\urel\WidgetEngine.dll" ), + new TSymLookupEntry( 0x7a0c5568, 00010, "vtable for KJS::MenuItemPrivate", @"\epoc32\release\ARMV5\urel\WidgetEngine.dll" ), + new TSymLookupEntry( 0x7a0c5578, 00011, "vtable for KJS::WidgetEventHandler", @"\epoc32\release\ARMV5\urel\WidgetEngine.dll" ), + new TSymLookupEntry( 0x7a0c571c, 00001, "vtable for KJS::JSWidget", @"\epoc32\release\ARMV5\urel\WidgetEngine.dll" ), + new TSymLookupEntry( 0x7a15cfdc, 00001, "vtable for TDeviceBridge", @"\epoc32\release\ARMV5\urel\jsdevice.dll" ), + new TSymLookupEntry( 0x7a15d29c, 00001, "vtable for KJS::CDeviceLiwBinding", @"\epoc32\release\ARMV5\urel\jsdevice.dll" ), + new TSymLookupEntry( 0x7a20c778, 00001, "vtable for CCookieFilter", @"\epoc32\release\ARMV5\urel\CookieFilter.dll" ), + new TSymLookupEntry( 0x7a3003ec, 00001, "vtable for CPtiZiLanguage", @"\epoc32\release\ARMV5\urel\Zi8English.dll" ), + new TSymLookupEntry( 0x7a4bd624, 00001, "vtable for CDeflateFilter", @"\epoc32\release\ARMV5\urel\DeflateFilter.dll" ), + new TSymLookupEntry( 0x7a6d8790, 00007, "vtable for PluginInfo", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d87a4, 00001, "vtable for PluginSkin", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d88b4, 00001, "vtable for WebSurface", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d896c, 00001, "vtable for HttpDownload", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d8a90, 00001, "vtable for WebFrameView", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d8bc4, 00024, "vtable for CMaskedBitmap", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d8bd8, 00001, "vtable for CookieHandler", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d8c1c, 00001, "vtable for PluginHandler", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d8c30, 00001, "vtable for WebDragClient", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d8cc0, 00001, "vtable for HistoryHandler", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d8db8, 00001, "vtable for WebFrameBridge", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d8e2c, 00001, "vtable for WebCannedImages", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d8e40, 00001, "vtable for WebChromeClient", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d8ef8, 00001, "vtable for WebEditorClient", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d8fc8, 00001, "vtable for WebIconDatabase", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d9034, 00001, "vtable for CWidgetExtension", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d91e8, 00023, "vtable for CAnimationDecoder", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d9208, 00001, "vtable for CWebFepTextEditor", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d93f4, 00001, "vtable for WebDocumentLoader", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d95bc, 00001, "vtable for WebPageZoomHandler", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d95e8, 00001, "vtable for WebScrollbarDrawer", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d96dc, 00001, "vtable for WebContextMenuClient", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d970c, 00001, "vtable for WebFrameLoaderClient", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d98b4, 00001, "vtable for WebPageScrollHandler", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d9920, 00001, "vtable for WebCoreGraphicsContext", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d9934, 00001, "vtable for WebPointerEventHandler", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d9998, 00001, "vtable for HttpRequestHeaderManager", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d99ac, 00001, "vtable for WebPageFullScreenHandler", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d99d0, 00001, "vtable for WebScrollingDeceleratorGH", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d9a1c, 00001, "vtable for CBrCtl", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d9ba4, 00001, "vtable for WebView", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d9cec, 00001, "vtable for WebFrame", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6d9f40, 00001, "vtable for WebCursor", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6da2d4, 00001, "vtable for KJS::DOMWindowTimer", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6da368, 00001, "vtable for KJS::ScriptInterpreter", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dacb0, 00001, "vtable for WebCore::OOMHandler", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dbae8, 00001, "vtable for WebCore::AsyncCancel", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dbb38, 00024, "vtable for WebCore::BitmapImage", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dbbf4, 00022, "vtable for WebCore::CachedImage", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dbca0, 00001, "vtable for WebCore::EditingText", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dbf0c, 00345, "vtable for WebCore::HTMLElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dd0f4, 00001, "vtable for WebCore::ShadowValue", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dd470, 00237, "vtable for WebCore::CSSStyleRule", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dd4e0, 00019, "vtable for WebCore::CSSValueList", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dd7d0, 00001, "vtable for WebCore::DocumentType", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dd954, 00001, "vtable for WebCore::HTMLDocument", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6df7cc, 00034, "vtable for WebCore::CSSImageValue", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6df86c, 00001, "vtable for WebCore::CSSImportRule", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6df904, 00006, "vtable for WebCore::CSSStyleSheet", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6dfdac, 00023, "vtable for WebCore::HTMLBRElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e14a8, 00001, "vtable for WebCore::SymbianCursor", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e14fc, 00001, "vtable for WebCore::TypingCommand", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e1698, 00328, "vtable for WebCore::HTMLDivElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e3ea0, 00001, "vtable for WebCore::XMLHttpRequest", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e3f24, 00127, "vtable for WebCore::CSSInitialValue", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e43a4, 00004, "vtable for WebCore::FontFamilyValue", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e48b4, 00001, "vtable for WebCore::HTMLBodyElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e4d44, 00022, "vtable for WebCore::HTMLFormElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e4f8c, 00001, "vtable for WebCore::HTMLHeadElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e51d4, 00001, "vtable for WebCore::HTMLHtmlElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e5900, 00001, "vtable for WebCore::HTMLMetaElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e5dcc, 00003, "vtable for WebCore::JSEventListener", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e62f8, 01206, "vtable for WebCore::MappedAttribute", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e6d0c, 00002, "vtable for WebCore::TextCodecLatin1", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e719c, 00001, "vtable for WebCore::HTMLEmbedElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e7634, 00023, "vtable for WebCore::HTMLImageElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e787c, 00002, "vtable for WebCore::HTMLInputElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e7af0, 00002, "vtable for WebCore::HTMLLabelElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e8410, 00001, "vtable for WebCore::HTMLStyleElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e88cc, 00001, "vtable for WebCore::HTMLTitleElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e9d10, 00001, "vtable for WebCore::AppendNodeCommand", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e9db8, 00007, "vtable for WebCore::CSSInheritedValue", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e9e30, 00748, "vtable for WebCore::CSSPrimitiveValue", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e9ee0, 00001, "vtable for WebCore::DOMImplementation", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6e9ef0, 00034, "vtable for WebCore::HTMLAnchorElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6ea38c, 00022, "vtable for WebCore::HTMLButtonElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6eb1b8, 00007, "vtable for WebCore::HTMLOptionElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6eb674, 00005, "vtable for WebCore::HTMLScriptElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6eb8e4, 00002, "vtable for WebCore::HTMLSelectElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6ebb8c, 00014, "vtable for WebCore::InsertTextCommand", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6ec5d0, 00001, "vtable for WebCore::PictographSymbian", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6ec5f4, 00002, "vtable for WebCore::PlatformScrollbar", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6ed91c, 00001, "vtable for WebCore::IconDatabaseClient", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6ee590, 00817, "vtable for WebCore::NamedMappedAttrMap", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6eed14, 00001, "vtable for WebCore::WebInspectorClient", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6eeefc, 00001, "vtable for WebCore::CachedCSSStyleSheet", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6efd24, 00021, "vtable for WebCore::HTMLTextAreaElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f0840, 00060, "vtable for WebCore::JSLazyEventListener", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f1f7c, 00001, "vtable for WebCore::HTMLOptionsCollection", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f2aa4, 00001, "vtable for WebCore::CResourceHandleManager", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f2ab8, 00014, "vtable for WebCore::CSSQuirkPrimitiveValue", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f2b34, 00013, "vtable for WebCore::DeleteSelectionCommand", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f3790, 00001, "vtable for WebCore::StaticObjectsContainer", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f48a4, 00001, "vtable for WebCore::CharBreakIteratorSymbian", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f510c, 00013, "vtable for WebCore::DeleteFromTextNodeCommand", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f5380, 00022, "vtable for WebCore::InsertIntoTextNodeCommand", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f5cfc, 00287, "vtable for WebCore::CSSMutableStyleDeclaration", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f8864, 00006, "vtable for WebCore::CSSMappedAttributeDeclaration", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6f8900, 00002, "vtable for WebCore::HTMLTextFieldInnerTextElement", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6fcdc8, 00003, "vtable for WebCore::Pair", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6fcde8, 00373, "vtable for WebCore::Text", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6fd01c, 00001, "vtable for WebCore::Frame", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6fd414, 00001, "vtable for WebCore::Widget", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6fe15c, 00001, "vtable for WebCore::DOMWindow", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6fe1e4, 00001, "vtable for WebCore::FrameView", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x7a6fe660, 00002, "vtable for WebCore::MediaList", @"\epoc32\release\ARMV5\urel\BrowserEngine.dll" ), + new TSymLookupEntry( 0x802d3ba0, 00002, "vtable for CTrapCleanup", @"\epoc32\release\ARMV5\urel\_rapido_euser.dll" ), + new TSymLookupEntry( 0x802d3c2c, 00019, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\_rapido_euser.dll" ), + new TSymLookupEntry( 0x802d3d20, 00002, "vtable for CAsyncCallBack", @"\epoc32\release\ARMV5\urel\_rapido_euser.dll" ), + new TSymLookupEntry( 0x802d3e68, 00008, "vtable for CIdle", @"\epoc32\release\ARMV5\urel\_rapido_euser.dll" ), + new TSymLookupEntry( 0x802d3f08, 00052, "vtable for CBufSeg", @"\epoc32\release\ARMV5\urel\_rapido_euser.dll" ), + new TSymLookupEntry( 0x802d3f7c, 00102, "vtable for CBufFlat", @"\epoc32\release\ARMV5\urel\_rapido_euser.dll" ), + new TSymLookupEntry( 0x802d3fa4, 00002, "vtable for CCleanup", @"\epoc32\release\ARMV5\urel\_rapido_euser.dll" ), + new TSymLookupEntry( 0x802d4004, 00024, "vtable for CPeriodic", @"\epoc32\release\ARMV5\urel\_rapido_euser.dll" ), + new TSymLookupEntry( 0x803387e0, 00057, "vtable for CFbsBitmap", @"\epoc32\release\ARMV5\urel\fbscli.dll" ), + new TSymLookupEntry( 0x803387f4, 00001, "vtable for CFbsRalCache", @"\epoc32\release\ARMV5\urel\fbscli.dll" ), + new TSymLookupEntry( 0x80338830, 00001, "vtable for CFbsSessionHelper", @"\epoc32\release\ARMV5\urel\fbscli.dll" ), + new TSymLookupEntry( 0x80338850, 00003, "vtable for CFbsTypefaceStore", @"\epoc32\release\ARMV5\urel\fbscli.dll" ), + new TSymLookupEntry( 0x803388f0, 00013, "vtable for CFbsFont", @"\epoc32\release\ARMV5\urel\fbscli.dll" ), + new TSymLookupEntry( 0x8034a75c, 00002, "vtable for CFbsBitGcBitmap", @"\epoc32\release\ARMV5\urel\bitgdi.dll" ), + new TSymLookupEntry( 0x8034a770, 00002, "vtable for CFbsBitmapDevice", @"\epoc32\release\ARMV5\urel\bitgdi.dll" ), + new TSymLookupEntry( 0x8034a914, 00002, "vtable for CFbsBitGcExtraData", @"\epoc32\release\ARMV5\urel\bitgdi.dll" ), + new TSymLookupEntry( 0x8034a964, 00002, "vtable for CFbsBitGc", @"\epoc32\release\ARMV5\urel\bitgdi.dll" ), + new TSymLookupEntry( 0x8034cbcc, 00030, "vtable for CEComEntry", @"\epoc32\release\ARMV5\urel\ECOM.dll" ), + new TSymLookupEntry( 0x8034cbe0, 00001, "vtable for CGlobalData", @"\epoc32\release\ARMV5\urel\ECOM.dll" ), + new TSymLookupEntry( 0x8034cbf4, 00001, "vtable for CLoadManager", @"\epoc32\release\ARMV5\urel\ECOM.dll" ), + new TSymLookupEntry( 0x8034cc08, 00030, "vtable for CUnloadPolicy", @"\epoc32\release\ARMV5\urel\ECOM.dll" ), + new TSymLookupEntry( 0x8034cc1c, 00008, "vtable for CImplementationInformation", @"\epoc32\release\ARMV5\urel\ECOM.dll" ), + new TSymLookupEntry( 0x803580c8, 00001, "vtable for CCharsetCnvCache", @"\epoc32\release\ARMV5\urel\CHARCONV.DLL" ), + new TSymLookupEntry( 0x803580dc, 00001, "vtable for CCnvCharacterSetConverter", @"\epoc32\release\ARMV5\urel\CHARCONV.DLL" ), + new TSymLookupEntry( 0x80358104, 00001, "vtable for CDeepDestructingArrayOfCharactersSets", @"\epoc32\release\ARMV5\urel\CHARCONV.DLL" ), + new TSymLookupEntry( 0x80378824, 00003, "vtable for CFontCache", @"\epoc32\release\ARMV5\urel\gdi.dll" ), + new TSymLookupEntry( 0x803788b4, 00003, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\gdi.dll" ), + new TSymLookupEntry( 0x80386168, 00050, "vtable for CArrayFixSeg", @"\epoc32\release\ARMV5\urel\bafl.dll" ), + new TSymLookupEntry( 0x80386334, 00032, "vtable for CStringPoolNode", @"\epoc32\release\ARMV5\urel\bafl.dll" ), + new TSymLookupEntry( 0x80386374, 00006, "vtable for CDesC16ArrayFlat", @"\epoc32\release\ARMV5\urel\bafl.dll" ), + new TSymLookupEntry( 0x803864c4, 00003, "vtable for CStringPoolImplementation", @"\epoc32\release\ARMV5\urel\bafl.dll" ), + new TSymLookupEntry( 0x80388940, 00018, "vtable for CClientRepository", @"\epoc32\release\ARMV5\urel\centralrepository.dll" ), + new TSymLookupEntry( 0x803b1f8c, 00009, "vtable for CImageDecoderStraightRelay", @"\epoc32\release\ARMV5\urel\ImageConversion.dll" ), + new TSymLookupEntry( 0x80435690, 00002, "vtable for CMD5", @"\epoc32\release\ARMV5\urel\hash.dll" ), + new TSymLookupEntry( 0x80489aa0, 00003, "vtable for CPtrHolder", @"\epoc32\release\ARMV5\urel\etel.dll" ), + new TSymLookupEntry( 0x80496698, 00003, "vtable for CMobilePhonePtrHolder", @"\epoc32\release\ARMV5\urel\etelmm.dll" ), + new TSymLookupEntry( 0x8053ee6c, 00002, "vtable for CLocalSystemInterface", @"\epoc32\release\ARMV5\urel\estlib.dll" ), + new TSymLookupEntry( 0x8053f098, 00002, "vtable for CTtyDesc", @"\epoc32\release\ARMV5\urel\estlib.dll" ), + new TSymLookupEntry( 0x8061022c, 00001, "vtable for CWsScreenDevice", @"\epoc32\release\ARMV5\urel\ws32_2.dll" ), + new TSymLookupEntry( 0x80610324, 00001, "vtable for RAnimDll", @"\epoc32\release\ARMV5\urel\ws32_2.dll" ), + new TSymLookupEntry( 0x80610338, 00001, "vtable for CWindowGc", @"\epoc32\release\ARMV5\urel\ws32_2.dll" ), + new TSymLookupEntry( 0x80694d88, 00001, "vtable for CVwsSessionWrapper", @"\epoc32\release\ARMV5\urel\viewcli.dll" ), + new TSymLookupEntry( 0x80694d9c, 00001, "vtable for CVwsSessionEventHandler", @"\epoc32\release\ARMV5\urel\viewcli.dll" ), + new TSymLookupEntry( 0x806a2288, 00001, "vtable for CCoeControl", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a2358, 00001, "vtable for CCoeEnvExtra", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a236c, 00001, "vtable for CCoeRedrawer", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a238c, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a23a0, 00011, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a2460, 00001, "vtable for CCoeScheduler", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a2490, 00001, "vtable for CCoeFepTracker", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a2518, 00001, "vtable for CCoeDataStorage", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a2548, 00001, "vtable for CCoeViewManager", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a2598, 00001, "vtable for CCoeControlStack", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a25ac, 00001, "vtable for CCoeFontProvider", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a2720, 00001, "vtable for CCoePlainTextDrawer", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a27b0, 00001, "vtable for CCoeTextDrawerBaseExt", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a27f8, 00001, "vtable for CCoeBrushAndPenContext", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a28b0, 00001, "vtable for CCoeControlStaticSettings", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a29a0, 00001, "vtable for CCoeView", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a2a28, 00001, "vtable for CCoeEnvExtra::CHighPriorityActive", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a2a48, 00001, "vtable for CCoeDataStorage::COwner", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x806a2a64, 00001, "vtable for CCoeAppUi::CExtra", @"\epoc32\release\ARMV5\urel\cone.dll" ), + new TSymLookupEntry( 0x80745d60, 00001, "vtable for CPolicyHandler", @"\epoc32\release\ARMV5\urel\gfxtrans.dll" ), + new TSymLookupEntry( 0x80745d74, 00001, "vtable for CGfxTransEffect", @"\epoc32\release\ARMV5\urel\gfxtrans.dll" ), + new TSymLookupEntry( 0x80745df0, 00001, "vtable for CRegisteredControl", @"\epoc32\release\ARMV5\urel\gfxtrans.dll" ), + new TSymLookupEntry( 0x80747ed0, 00001, "vtable for CPsObserver", @"\epoc32\release\ARMV5\urel\gfxtransadapter.dll" ), + new TSymLookupEntry( 0x80747f40, 00001, "vtable for CGfxTransAdapterTfx", @"\epoc32\release\ARMV5\urel\gfxtransadapter.dll" ), + new TSymLookupEntry( 0x807622e8, 00001, "vtable for CGraphicsAcceleratorEColor64K", @"\epoc32\release\ARMV5\urel\accel2d.dll" ), + new TSymLookupEntry( 0x80762350, 00001, "vtable for CGraphicsAcceleratorEColor16MU", @"\epoc32\release\ARMV5\urel\accel2d.dll" ), + new TSymLookupEntry( 0x807623bc, 00002, "vtable for CGenericSoftwareGraphicsAccelerator", @"\epoc32\release\ARMV5\urel\accel2d.dll" ), + new TSymLookupEntry( 0x807b7b3c, 00001, "vtable for CDrawSixteenBppBitmap", @"\epoc32\release\ARMV5\urel\scdv.9401.dll" ), + new TSymLookupEntry( 0x807b8754, 00001, "vtable for CDrawUTwentyFourBppBitmap", @"\epoc32\release\ARMV5\urel\scdv.9401.dll" ), + new TSymLookupEntry( 0x80aa13c4, 00001, "vtable for CCommsDatabase", @"\epoc32\release\ARMV5\urel\commdb.dll" ), + new TSymLookupEntry( 0x80aa144c, 00001, "vtable for CCommsDatabaseImpl", @"\epoc32\release\ARMV5\urel\commdb.dll" ), + new TSymLookupEntry( 0x80aba704, 00001, "vtable for CommsDatInternal::CCDNotifier", @"\epoc32\release\ARMV5\urel\commsdat.dll" ), + new TSymLookupEntry( 0x80aba838, 00001, "vtable for CommsDat::CMDBSession", @"\epoc32\release\ARMV5\urel\commsdat.dll" ), + new TSymLookupEntry( 0x80abaf4c, 00001, "vtable for CommsDat::CMDBSessionImpl", @"\epoc32\release\ARMV5\urel\commsdat.dll" ), + new TSymLookupEntry( 0x80b9f114, 00001, "vtable for Xml::CCharSetConverter", @"\epoc32\release\ARMV5\urel\xmlframework.dll" ), + new TSymLookupEntry( 0x80b9f13c, 00001, "vtable for Xml::CParser", @"\epoc32\release\ARMV5\urel\xmlframework.dll" ), + new TSymLookupEntry( 0x80ba8e90, 00001, "vtable for CXmlParserPlugin", @"\epoc32\release\ARMV5\urel\xmlparserplugin.dll" ), + new TSymLookupEntry( 0x80ba8ee4, 00001, "vtable for CExpat", @"\epoc32\release\ARMV5\urel\xmlparserplugin.dll" ), + new TSymLookupEntry( 0x80c11bc4, 00005, "vtable for CCenRepNotifyHandler", @"\epoc32\release\ARMV5\urel\CENREPNOTIFHANDLER.DLL" ), + new TSymLookupEntry( 0x80c66480, 00001, "vtable for CFeatMgrTlsData", @"\epoc32\release\ARMV5\urel\FeatMgr.ivalo.DLL" ), + new TSymLookupEntry( 0x80d40754, 00001, "HTTP::Table", @"\epoc32\release\ARMV5\urel\Http.dll" ), + new TSymLookupEntry( 0x80d40b88, 00001, "vtable for CHTTPManager", @"\epoc32\release\ARMV5\urel\Http.dll" ), + new TSymLookupEntry( 0x80d40b9c, 00001, "vtable for CHTTPSession", @"\epoc32\release\ARMV5\urel\Http.dll" ), + new TSymLookupEntry( 0x80d40d1c, 00001, "vtable for CHeaderFieldPart", @"\epoc32\release\ARMV5\urel\Http.dll" ), + new TSymLookupEntry( 0x80d40dd4, 00009, "vtable for CHeaderFieldParam", @"\epoc32\release\ARMV5\urel\Http.dll" ), + new TSymLookupEntry( 0x80d40ea8, 00002, "vtable for CHeaders", @"\epoc32\release\ARMV5\urel\Http.dll" ), + new TSymLookupEntry( 0x80d453e8, 00003, "vtable for CSocketController", @"\epoc32\release\ARMV5\urel\httptransporthandler.dll" ), + new TSymLookupEntry( 0x80d45400, 00001, "vtable for CTcpTransportLayer", @"\epoc32\release\ARMV5\urel\httptransporthandler.dll" ), + new TSymLookupEntry( 0x80d485f4, 00001, "vtable for CRedirectFilter", @"\epoc32\release\ARMV5\urel\tfcorefilters.dll" ), + new TSymLookupEntry( 0x80d48640, 00001, "vtable for CValidationFilter", @"\epoc32\release\ARMV5\urel\tfcorefilters.dll" ), + new TSymLookupEntry( 0x80d4aed8, 00001, "vtable for CHttpClientHeaderCodec", @"\epoc32\release\ARMV5\urel\HttpClientCodec.dll" ), + new TSymLookupEntry( 0x80d4af04, 00001, "vtable for CHttpClientHeaderReader", @"\epoc32\release\ARMV5\urel\HttpClientCodec.dll" ), + new TSymLookupEntry( 0x80d4af24, 00001, "vtable for CHttpClientHeaderWriter", @"\epoc32\release\ARMV5\urel\HttpClientCodec.dll" ), + new TSymLookupEntry( 0x80d4af44, 00001, "vtable for CHttpDefaultHeaderCodec", @"\epoc32\release\ARMV5\urel\HttpClientCodec.dll" ), + new TSymLookupEntry( 0x80d4af70, 00001, "vtable for CHttpGeneralHeaderCodec", @"\epoc32\release\ARMV5\urel\HttpClientCodec.dll" ), + new TSymLookupEntry( 0x80d4af9c, 00001, "vtable for CHttpDefaultHeaderReader", @"\epoc32\release\ARMV5\urel\HttpClientCodec.dll" ), + new TSymLookupEntry( 0x80d4afbc, 00001, "vtable for CHttpDefaultHeaderWriter", @"\epoc32\release\ARMV5\urel\HttpClientCodec.dll" ), + new TSymLookupEntry( 0x80d4afdc, 00001, "vtable for CHttpGeneralHeaderReader", @"\epoc32\release\ARMV5\urel\HttpClientCodec.dll" ), + new TSymLookupEntry( 0x80d4affc, 00001, "vtable for CHttpGeneralHeaderWriter", @"\epoc32\release\ARMV5\urel\HttpClientCodec.dll" ), + new TSymLookupEntry( 0x80d51370, 00001, "vtable for CHttpClientFilter", @"\epoc32\release\ARMV5\urel\httpclient.dll" ), + new TSymLookupEntry( 0x80d513bc, 00001, "vtable for CHttpClientHandler", @"\epoc32\release\ARMV5\urel\httpclient.dll" ), + new TSymLookupEntry( 0x80d514c4, 00001, "vtable for CHttpConnectFilter", @"\epoc32\release\ARMV5\urel\httpclient.dll" ), + new TSymLookupEntry( 0x80d51530, 00007, "vtable for CHttpConnectionInfo", @"\epoc32\release\ARMV5\urel\httpclient.dll" ), + new TSymLookupEntry( 0x80d518d0, 00007, "vtable for CHttpConnectionManager", @"\epoc32\release\ARMV5\urel\httpclient.dll" ), + new TSymLookupEntry( 0x80d6d60c, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\apparc.dll" ), + new TSymLookupEntry( 0x80d6d620, 00001, "vtable for CArrayFixFlat", @"\epoc32\release\ARMV5\urel\apparc.dll" ), + new TSymLookupEntry( 0x80d6d7fc, 00001, "vtable for CApaExe", @"\epoc32\release\ARMV5\urel\apparc.dll" ), + new TSymLookupEntry( 0x80d7edf0, 00003, "vtable for RApaLsSession", @"\epoc32\release\ARMV5\urel\apgrfx.dll" ), + new TSymLookupEntry( 0x80d7ef64, 00001, "vtable for CApaWindowGroupName", @"\epoc32\release\ARMV5\urel\apgrfx.dll" ), + new TSymLookupEntry( 0x80d8d814, 00001, "vtable for COnStateTracker", @"\epoc32\release\ARMV5\urel\fepbase.dll" ), + new TSymLookupEntry( 0x80d8d868, 00001, "vtable for CFepSettingsTracker", @"\epoc32\release\ARMV5\urel\fepbase.dll" ), + new TSymLookupEntry( 0x80d8da54, 00001, "vtable for CCoeFep::CCoeFepExtra", @"\epoc32\release\ARMV5\urel\fepbase.dll" ), + new TSymLookupEntry( 0x80d8da68, 00001, "vtable for CCoeFep::CLowPriorityActive", @"\epoc32\release\ARMV5\urel\fepbase.dll" ), + new TSymLookupEntry( 0x80d8daa4, 00001, "vtable for CCoeFep::CHighPriorityActive::CFlagClearer", @"\epoc32\release\ARMV5\urel\fepbase.dll" ), + new TSymLookupEntry( 0x80d8dac4, 00001, "vtable for CCoeFep::CHighPriorityActive", @"\epoc32\release\ARMV5\urel\fepbase.dll" ), + new TSymLookupEntry( 0x80e4e44c, 00001, "vtable for RMessageWindow", @"\epoc32\release\ARMV5\urel\clock.dll" ), + new TSymLookupEntry( 0x80e624c8, 00001, "vtable for CColorList", @"\epoc32\release\ARMV5\urel\Egul.dll" ), + new TSymLookupEntry( 0xa563da8c, 00001, "", "" ), + new TSymLookupEntry( 0xb947fb82, 00001, "", "" ), + new TSymLookupEntry( 0xcc4ded9e, 00001, "", "" ), + new TSymLookupEntry( 0xfafdfcf9, 00001, "", "" ), + new TSymLookupEntry( 0xff95734d, 00001, "", "" ), + new TSymLookupEntry( 0xfff0fff1, 00001, "", "" ), + new TSymLookupEntry( 0xfffffd61, 00012, "", "" ), + new TSymLookupEntry( 0xfffffd93, 00005, "", "" ), + new TSymLookupEntry( 0xfffffddc, 00005, "", "" ), + new TSymLookupEntry( 0xfffffddd, 00005, "", "" ), + new TSymLookupEntry( 0xfffffddf, 00005, "", "" ), + new TSymLookupEntry( 0xfffffde1, 00005, "", "" ), + new TSymLookupEntry( 0xfffffde4, 00005, "", "" ), + new TSymLookupEntry( 0xfffffde5, 00005, "", "" ), + new TSymLookupEntry( 0xfffffe10, 00010, "", "" ), + new TSymLookupEntry( 0xfffffe38, 00005, "", "" ), + new TSymLookupEntry( 0xffffff10, 00003, "", "" ), + new TSymLookupEntry( 0xffffffde, 00076, "", "" ), + new TSymLookupEntry( 0xffffffe7, 00002, "", "" ), + new TSymLookupEntry( 0xfffffff0, 00039, "", "" ), + new TSymLookupEntry( 0xfffffffd, 00001, "", "" ), + new TSymLookupEntry( 0xffffffff, 00048, "", "" ), + }; + #endregion + + #region Data members + public readonly uint iAddress; + public readonly int iCount; + public readonly string iSymbol; + public readonly string iCollection; + #endregion + } + +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/TestCode.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbianSymbolLibTest/TestCode.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,972 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbols; + + +namespace SymbianSymbolLibTest +{ + class TestCode : DisposableObject, ITracer + { + #region Constructors + public TestCode() + { + iDebugEngine = new DbgEngine( this ); + iDebugEngine.UiMode = SymbianDebugLib.TDbgUiMode.EUiDisabled; + iDebugEngine.EntityPrimingStarted += new DbgEngine.EventHandler( DebugEngine_EntityPrimingStarted ); + iDebugEngine.EntityPrimingProgress += new DbgEngine.EventHandler( DebugEngine_EntityPrimingProgress ); + iDebugEngine.EntityPrimingComplete += new DbgEngine.EventHandler( DebugEngine_EntityPrimingComplete ); + } + #endregion + + #region API + public void Clear() + { + iDebugEngine.Clear(); + } + + public void RunTests() + { + TestUDACode(); + TestCodeSegmentResolutionOBY(); + TestOBY(); + TestBigMapFile(); + TestCodeSegmentResolutionROFS(); + TestMapRVCT(); + TestMapGCCE(); + TestBigDsoData(); + TestZipMapFiles(); + TestHeapCellSymbolLookup(); + TestRofsDllAtDifferentBaseAddresses(); + } + #endregion + + #region Tests + private void TestRofsDllAtDifferentBaseAddresses() + { + Clear(); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\CoreImage\RM505_widgetui_rheap_rnd_rofs1.symbol" ); + iDebugEngine.Prime( SymbianUtils.TSynchronicity.ESynchronous ); + + using ( DbgEngineView view1 = iDebugEngine.CreateView( "TestView" ) ) + { + SymbolCollection colPageScalerAt70000000 = view1.Symbols.ActivateAndGetCollection( new CodeSegDefinition( @"Z:\sys\bin\PageScaler.dll", 0x70000000, 0x7A000000 ) ); + System.Diagnostics.Debug.Assert( colPageScalerAt70000000 != null ); + SymbolCollection col1 = view1.Symbols.CollectionByAddress( 0x70000000 ); + System.Diagnostics.Debug.Assert( col1 != null ); + + // Make a second view + using ( DbgEngineView view2 = iDebugEngine.CreateView( "TestView" ) ) + { + SymbolCollection colPageScalerAt75000000 = view2.Symbols.ActivateAndGetCollection( new CodeSegDefinition( @"Z:\sys\bin\PageScaler.dll", 0x75000000, 0x7A000000 ) ); + System.Diagnostics.Debug.Assert( colPageScalerAt75000000 != null ); + SymbolCollection col2 = view2.Symbols.CollectionByAddress( 0x75000000 ); + System.Diagnostics.Debug.Assert( col2 != null ); + + // Check invalid requests + Symbol symTemp = null; + + symTemp = view1.Symbols[ 0x80240000 ]; + System.Diagnostics.Debug.Assert( symTemp == null ); + symTemp = view1.Symbols[ 0x74240000 ]; + System.Diagnostics.Debug.Assert( symTemp == null ); + symTemp = view1.Symbols[ 0x78240000 ]; + System.Diagnostics.Debug.Assert( symTemp == null ); + + symTemp = view2.Symbols[ 0x80240000 ]; + System.Diagnostics.Debug.Assert( symTemp == null ); + symTemp = view2.Symbols[ 0x74240000 ]; + System.Diagnostics.Debug.Assert( symTemp == null ); + symTemp = view2.Symbols[ 0x78240000 ]; + System.Diagnostics.Debug.Assert( symTemp == null ); + + // Check offsets are maintained + int count = col1.Count; + for( int i=0; i::RArray() 0x00009289 Thumb Code 10 accmonitor.in(t._ZN6RArrayImEC1Ev) + // RArray::RArray__sub_object() 0x00009289 Thumb Code 0 accmonitor.in(t._ZN6RArrayImEC1Ev) + sym = FindByName( "RArray::RArray__sub_object()", col ); + System.Diagnostics.Debug.Assert( sym == null ); + sym = FindByName( "RArray::RArray()", col ); + System.Diagnostics.Debug.Assert( sym != null && sym.Size == 10 ); + + // For the following sequence, ensure that the end of the first entry doesn't overlap with the start of the second. + // + // typeinfo name for CAccMonitorCapMapper 0x000094a8 Data 23 accmonitor.in(.constdata__ZTS20CAccMonitorCapMapper) + // typeinfo name for CAccMonitorContainer 0x000094bf Data 23 accmonitor.in(.constdata__ZTS20CAccMonitorContainer) + // + sym = FindByName( "typeinfo name for CAccMonitorCapMapper", col ); + System.Diagnostics.Debug.Assert( sym != null ); + sym2 = FindByName( "typeinfo name for CAccMonitorContainer", col ); + System.Diagnostics.Debug.Assert( sym2 != null ); + System.Diagnostics.Debug.Assert( sym.AddressRange.Max + 1 == sym2.Address ); + + // Check no overlap + CheckNoOverlaps( col ); + + // Second symbol + sym = symView.Lookup( 0x70000028, out col ); + System.Diagnostics.Debug.Assert( sym != null && col == activatedCol && sym.Name == "__cpp_initialize__aeabi_" ); + + // Deactivate an activated dll + deactivated = symView.Deactivate( new CodeSegDefinition( @"Z:\sys\bin\ACCMONITOR.DLL" ) ); + System.Diagnostics.Debug.Assert( deactivated == true ); + + // symbol shouldn't be available anymore + sym = symView.Lookup( 0x70000000, out col ); + System.Diagnostics.Debug.Assert( sym == null && col == null ); + } + } + + private void TestMapRVCT() + { + Clear(); + iDebugEngine.Add( @"C:\Tool Demo Files\2. Crash Data\File55\RVCT\alarmserver.exe.map" ); + iDebugEngine.Prime( SymbianUtils.TSynchronicity.ESynchronous ); + + using ( DbgEngineView view = iDebugEngine.CreateView( "TestView" ) ) + { + DbgViewSymbols symView = view.Symbols; + SymbolCollection col = null; + + // Should be possible to activate + col = symView.ActivateAndGetCollection( new CodeSegDefinition( @"Z:\sys\bin\alarmserver.exe", 0x70000000, 0x7FFFFFFF ) ); + System.Diagnostics.Debug.Assert( col != null ); + System.Diagnostics.Debug.WriteLine( col.ToString( "full", null ) ); + + // Check invalid address + col = view.Symbols.CollectionByAddress( 0x700090a5 ); + System.Diagnostics.Debug.Assert( col == null ); + + // Verify that the symbols were really read. + col = view.Symbols.CollectionByAddress( 0x700090a4 ); + System.Diagnostics.Debug.Assert( col != null ); + col = view.Symbols.CollectionByAddress( 0x70000000 ); + System.Diagnostics.Debug.Assert( col != null ); + col = view.Symbols.CollectionByAddress( 0x70000001 ); + System.Diagnostics.Debug.Assert( col != null ); + col = view.Symbols.CollectionByAddress( 0x70002001 ); + System.Diagnostics.Debug.Assert( col != null ); + + // Check for overlaps + CheckNoOverlaps( col ); + + // Perform some lookup tests + string text = string.Empty; + + text = view.Symbols.PlainText[ 0x70000000 ]; + System.Diagnostics.Debug.Assert( text == "_E32Startup" ); + text = view.Symbols.PlainText[ 0x70000001 ]; + System.Diagnostics.Debug.Assert( text == "_E32Startup" ); + text = view.Symbols.PlainText[ 0x7000006f ]; + System.Diagnostics.Debug.Assert( text == "_E32Startup" ); + text = view.Symbols.PlainText[ 0x70000070 ]; + System.Diagnostics.Debug.Assert( text == "__cpp_initialize__aeabi_" ); + text = view.Symbols.PlainText[ 0x700090a4 ]; + System.Diagnostics.Debug.Assert( text == ".ARM.exidx$$Limit" ); + } + } + + private void TestMapGCCE() + { + Clear(); + iDebugEngine.Add( @"C:\Tool Demo Files\2. Crash Data\File55\GCCE\alarmserver.exe.map" ); + iDebugEngine.Prime( SymbianUtils.TSynchronicity.ESynchronous ); + + using ( DbgEngineView view = iDebugEngine.CreateView( "TestView" ) ) + { + DbgViewSymbols symView = view.Symbols; + SymbolCollection col = null; + + // Should be possible to activate + col = symView.ActivateAndGetCollection( new CodeSegDefinition( @"Z:\sys\bin\alarmserver.exe", 0x70000000, 0x7FFFFFFF ) ); + System.Diagnostics.Debug.Assert( col != null ); + System.Diagnostics.Debug.WriteLine( col.ToString( "full", null ) ); + + // Check invalid address + col = view.Symbols.CollectionByAddress( 0x7000bcc8 ); + System.Diagnostics.Debug.Assert( col == null ); + + // Verify that the symbols were really read. + col = view.Symbols.CollectionByAddress( 0x7000bcc7 ); + System.Diagnostics.Debug.Assert( col != null ); + col = view.Symbols.CollectionByAddress( 0x70000000 ); + System.Diagnostics.Debug.Assert( col != null ); + col = view.Symbols.CollectionByAddress( 0x70000001 ); + System.Diagnostics.Debug.Assert( col != null ); + col = view.Symbols.CollectionByAddress( 0x70002001 ); + System.Diagnostics.Debug.Assert( col != null ); + + // Check for overlaps + CheckNoOverlaps( col ); + + // Perform some lookup tests + string text = string.Empty; + + text = view.Symbols.PlainText[ 0x70000000 ]; + System.Diagnostics.Debug.Assert( text == "_xxxx_call_user_invariant" ); + text = view.Symbols.PlainText[ 0x70000001 ]; + System.Diagnostics.Debug.Assert( text == "_xxxx_call_user_invariant" ); + text = view.Symbols.PlainText[ 0x70000007 ]; + System.Diagnostics.Debug.Assert( text == "_xxxx_call_user_invariant" ); + text = view.Symbols.PlainText[ 0x70000008 ]; + System.Diagnostics.Debug.Assert( text == "_xxxx_call_user_handle_exception" ); + text = view.Symbols.PlainText[ 0x7000000f ]; + System.Diagnostics.Debug.Assert( text == "_xxxx_call_user_handle_exception" ); + text = view.Symbols.PlainText[ 0x70000070 ]; + System.Diagnostics.Debug.Assert( text == "CASSrvServer::CASSrvServer()" ); + text = view.Symbols.PlainText[ 0x7000bcc7 ]; + System.Diagnostics.Debug.Assert( text == "typeinfo name for CASAltRequestQuietPeriodEnd" ); + } + } + + private void TestBigDsoData() + { + Clear(); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\CoreImage\RM505_widgetui_rheap_rnd_rofs1.symbol" ); + iDebugEngine.Prime( SymbianUtils.TSynchronicity.ESynchronous ); + + CodeSegDefinitionCollection codeSegs = new CodeSegDefinitionCollection(); + using ( StringReader reader = new StringReader( KTestBigDsoDataCodeSegList ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + CodeSegDefinition def = CodeSegDefinitionParser.ParseDefinition( line ); + if ( def != null ) + { + codeSegs.Add( def ); + } + line = reader.ReadLine(); + } + } + + using ( DbgEngineView view = iDebugEngine.CreateView( "TestView", codeSegs ) ) + { + // MemMan.dll contains a dodgy symbol: + // + // 000031b4 0000 Image$$ER_RO$$Limit anon$$obj.o(linker$$defined$$symbols) + // 003f8024 0004 __dso_handle ucppfini.o(.data) + SymbolCollection colMemManDll = view.Symbols.CollectionByAddress( 0x79E18000 ); + System.Diagnostics.Debug.Assert( colMemManDll != null ); + + // Verify it doesn't include the big dso object + Symbol bigDsoData = FindByName( "__dso_handle", colMemManDll ); + System.Diagnostics.Debug.Assert( bigDsoData == null ); + + // Widget engine would otherwise overlap with memman.dll + SymbolCollection colWidgetEngineDll = view.Symbols.CollectionByAddress( 0x7A0C0000 ); + System.Diagnostics.Debug.Assert( colMemManDll != null ); + + // Check no overlaps + CheckNoOverlaps( colMemManDll, colWidgetEngineDll ); + + } + } + + private void TestHeapCellSymbolLookup() + { + Clear(); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\CoreImage\RM505_widgetui_rheap_rnd_rom.symbol" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\CoreImage\RM505_widgetui_rheap_rnd_rofs1.symbol" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\Variant03\RM505_widgetui_rheap_rnd.V03.rofs2.symbol" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\Variant03\RM505_widgetui_rheap_rnd.V03.rofs3.symbol" ); + iDebugEngine.Prime( SymbianUtils.TSynchronicity.ESynchronous ); + + DoTestHeapCellSymbolLookup(); + } + + private void TestCodeSegmentResolutionROFS() + { + Clear(); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\CoreImage\RM505_widgetui_rheap_rnd_rom.symbol" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\CoreImage\RM505_widgetui_rheap_rnd_rofs1.symbol" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\Variant03\RM505_widgetui_rheap_rnd.V03.rofs2.symbol" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\Variant03\RM505_widgetui_rheap_rnd.V03.rofs3.symbol" ); + iDebugEngine.Prime( SymbianUtils.TSynchronicity.ESynchronous ); + + DoTestCodeSegmentResolution(); + } + + private void TestCodeSegmentResolutionOBY() + { + Clear(); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\CoreImage\RM505_widgetui_rheap_rnd_rofs1.oby" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\Variant03\RM505_widgetui_rheap_rnd.V03.rofs2.oby" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\Variant03\RM505_widgetui_rheap_rnd.V03.rofs3.oby" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\CoreImage\RM505_widgetui_rheap_rnd_rom.symbol" ); + iDebugEngine.Prime( SymbianUtils.TSynchronicity.ESynchronous ); + + DoTestCodeSegmentResolution(); + } + + private void TestOBY() + { + Clear(); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\CoreImage\RM505_widgetui_rheap_rnd_rofs1.oby" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\Variant03\RM505_widgetui_rheap_rnd.V03.rofs2.oby" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\Variant03\RM505_widgetui_rheap_rnd.V03.rofs3.oby" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\Rom_images_widgetui_rheap\ivalo\CoreImage\RM505_widgetui_rheap_rnd_rom.symbol" ); + iDebugEngine.Prime( SymbianUtils.TSynchronicity.ESynchronous ); + + DoTestHeapCellSymbolLookup(); + } + + private void TestBigMapFile() + { + Clear(); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\epoc32\release\armv5\urel\browserengine.dll.map" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\epoc32\release\armv5\urel\smart2go.exe.map" ); + iDebugEngine.Add( @"C:\Tool Demo Files\4. Heap Sample Data\11. Browser heap\epoc32\release\armv5\urel\avkon.dll.map" ); + iDebugEngine.Prime( SymbianUtils.TSynchronicity.ESynchronous ); + } + + private void TestUDACode() + { + Clear(); + iDebugEngine.Add( @"C:\Tool Demo Files\2. Crash Data\File62\Ivalo_RM-505\Wk12\DebugMetaData\RM-505_52.50.2009.12_rnd.rofs1.symbol" ); + iDebugEngine.Prime( SymbianUtils.TSynchronicity.ESynchronous ); + + CodeSegDefinition csOnC = new CodeSegDefinition( @"C:\sys\bin\btaccesshost.exe", 0x80ef3ae8, 0x80efa988 ); + + using ( DbgEngineView view = iDebugEngine.CreateView( "TestView" ) ) + { + DbgViewSymbols symView = view.Symbols; + SymbolCollection col = null; + + // This won't activate + col = symView.ActivateAndGetCollection( csOnC ); + System.Diagnostics.Debug.Assert( col == null ); + } + + // Now merge in the zip file containing lots of maps... + iDebugEngine.Add( @"C:\Tool Demo Files\2. Crash Data\File62\Ivalo_RM-505\Wk12\DebugMetaData\mapfiles.zip" ); + iDebugEngine.Prime( SymbianUtils.TSynchronicity.ESynchronous ); + + using ( DbgEngineView view = iDebugEngine.CreateView( "TestView" ) ) + { + DbgViewSymbols symView = view.Symbols; + SymbolCollection col = null; + + // This should activate now + col = symView.ActivateAndGetCollection( csOnC ); + System.Diagnostics.Debug.Assert( col != null ); + } + } + #endregion + + #region Constants + private const string KTestBigDsoDataCodeSegList = @"CodeSegs - 807C4268-807D3844 z:\Sys\Bin\audiopolicyserver.dll +CodeSegs - 809194C8-8091B458 z:\Sys\Bin\eapdsp.dll +CodeSegs - 80698D48-806A4248 Z:\sys\bin\Cone.dll +CodeSegs - 78750000-78750B08 Z:\sys\bin\EikSrvc.dll +CodeSegs - 80742D38-80746288 Z:\sys\bin\gfxtrans.dll +CodeSegs - 78828000-78828D98 Z:\sys\bin\akntransitionutils.dll +CodeSegs - 78824000-78826F90 Z:\sys\bin\aknnotify.dll +CodeSegs - 78820000-78821164 Z:\sys\bin\akncapserverclient.dll +CodeSegs - 78834000-78838A18 Z:\sys\bin\cdlengine.dll +CodeSegs - 78830000-7883060C Z:\sys\bin\FontUtils.dll +CodeSegs - 7882C000-7882E204 Z:\sys\bin\FontProvider.dll +CodeSegs - 80D8C168-80D8DFB4 Z:\sys\bin\FepBase.dll +CodeSegs - 78894000-78894294 Z:\sys\bin\AknPictograph.dll +CodeSegs - 7894C000-7895713C Z:\sys\bin\cXmlParser.dll +CodeSegs - 78944000-7894820C Z:\sys\bin\XMLInterface.dll +CodeSegs - 78724000-78741DC0 Z:\sys\bin\imcm.dll +CodeSegs - 78710000-78720060 Z:\sys\bin\imut.dll +CodeSegs - 80624CB8-8062D428 Z:\sys\bin\MediaClientAudio.dll +CodeSegs - 78958000-78991F6C Z:\sys\bin\libopenvg.dll +CodeSegs - 78994000-789955CC Z:\sys\bin\libopenvgu.dll +CodeSegs - 78998000-78998570 Z:\sys\bin\libvgi.dll +CodeSegs - 788B0000-78941128 Z:\sys\bin\SVGEngine.dll +CodeSegs - 789BC000-789C0A24 Z:\sys\bin\COMMONENGINE.DLL +CodeSegs - 789C4000-789C7904 Z:\sys\bin\DrmRights.DLL +CodeSegs - 789D4000-789D41A8 Z:\sys\bin\DrmKeyStorage.dll +CodeSegs - 789D0000-789D2230 Z:\sys\bin\DrmCrypto.DLL +CodeSegs - 789C8000-789CE30C Z:\sys\bin\DrmServerInterfaces.DLL +CodeSegs - 789D8000-789DB13C Z:\sys\bin\DRMCOMMON.DLL +CodeSegs - 78A08000-78A09ED0 Z:\sys\bin\AknLayout2scalable.dll +CodeSegs - 78A04000-78A04A0C Z:\sys\bin\AknLayout2.dll +CodeSegs - 78A0C000-78A10908 Z:\sys\bin\lbs.dll +CodeSegs - 78A14000-78A147F0 Z:\sys\bin\aknlistloadertfx.dll +CodeSegs - 78A18000-78A19FDC Z:\sys\bin\touchfeedback.dll +CodeSegs - 789EC000-78A01C88 Z:\sys\bin\eikctl.dll +CodeSegs - 78A1C000-78A1E838 Z:\sys\bin\MediatorClient.dll +CodeSegs - 789DC000-789EBE08 Z:\sys\bin\eikdlg.dll +CodeSegs - 78A20000-78A21C50 Z:\sys\bin\DcfRep.dll +CodeSegs - 78A24000-78A28E80 Z:\sys\bin\servicehandler.dll +CodeSegs - 78A48000-78A4ECA8 Z:\sys\bin\cmmanagerdatabase.dll +CodeSegs - 78A2C000-78A46364 Z:\sys\bin\cmmanager.dll +CodeSegs - 789B0000-789B99E0 Z:\sys\bin\DRMHelper.dll +CodeSegs - 78A50000-78A517EC Z:\sys\bin\disknotifyhandler.dll +CodeSegs - 7899C000-789AD374 Z:\sys\bin\aknskinsrv.dll +CodeSegs - 788A4000-788AC154 Z:\sys\bin\AknIcon.dll +CodeSegs - 78A54000-78A6F26C Z:\sys\bin\aknskinrenderlib.dll +CodeSegs - 80C79038-80C79D68 Z:\sys\bin\HWRMLightClient.dll +CodeSegs - 78898000-788A3D30 Z:\sys\bin\aknskins.dll +CodeSegs - 78A70000-78A709EC Z:\sys\bin\jplangutil.dll +CodeSegs - 78A74000-78A75BF0 Z:\sys\bin\numbergrouping.dll +CodeSegs - 78A78000-78A7AD40 Z:\sys\bin\EikCoCtlLaf.dll +CodeSegs - 7883C000-788925B4 Z:\sys\bin\eikcoctl.dll +CodeSegs - 78A7C000-78A80FE8 Z:\sys\bin\phoneclient.dll +CodeSegs - 78A84000-78A86000 Z:\sys\bin\oommonitor.dll +CodeSegs - 78A88000-78A94CA0 Z:\sys\bin\ptiengine.dll +CodeSegs - 78758000-7881FF20 Z:\sys\bin\avkon.dll +CodeSegs - 78754000-787562F8 Z:\sys\bin\UikLaf.dll +CodeSegs - 78744000-7874EA34 Z:\sys\bin\EikCore.dll +CodeSegs - 78CAC000-78CAEF64 Z:\sys\bin\WEPSecuritySettingsUI.dll +CodeSegs - 78CB0000-78CB2BC4 Z:\sys\bin\WPASecuritySettingsUI.dll +CodeSegs - 78C98000-78CAA7B8 Z:\sys\bin\ApEngine.dll +CodeSegs - 78B2C000-78B2C800 Z:\sys\bin\directorylocalizer.dll +CodeSegs - 78B30000-78B30460 Z:\sys\bin\AknMemoryCardUi.DLL +CodeSegs - 78B38000-78B38B54 Z:\sys\bin\rsfwmountstore.dll +CodeSegs - 78B3C000-78B3C858 Z:\sys\bin\rsfwmountutils.dll +CodeSegs - 78B40000-78B405CC Z:\sys\bin\rsfwcontrol.dll +CodeSegs - 78B34000-78B35488 Z:\sys\bin\rsfwmountman.dll +CodeSegs - 78B20000-78B2A5AC Z:\sys\bin\commondialogs.dll +CodeSegs - 78B44000-78B4BBAC Z:\sys\bin\FavouritesEngine.dll +CodeSegs - 78AC4000-78AC5B18 Z:\sys\bin\mtur.dll +CodeSegs - 78B4C000-78B4FA68 Z:\sys\bin\Sendui.dll +CodeSegs - 78B70000-78B71718 Z:\sys\bin\mdccommon.dll +CodeSegs - 78B60000-78B6C498 Z:\sys\bin\mdeclient.dll +CodeSegs - 78B74000-78B74F30 Z:\sys\bin\HarvesterClient.dll +CodeSegs - 78B58000-78B5DE0C Z:\sys\bin\ContentListingFramework.dll +CodeSegs - 78B78000-78B7840C Z:\sys\bin\MediaCollectionManager.dll +CodeSegs - 78B54000-78B56DA4 Z:\sys\bin\MGXUtils.dll +CodeSegs - 78B50000-78B50BD0 Z:\sys\bin\MGXMediaFileApi.dll +CodeSegs - 78B7C000-78B7CE98 Z:\sys\bin\SWInstCli.dll +CodeSegs - 78B80000-78B80B94 Z:\sys\bin\aiwdialdata.dll +CodeSegs - 78B10000-78B1D3D8 Z:\sys\bin\commonui.dll +CodeSegs - 78D90000-78D945BC Z:\sys\bin\ConnectionUiUtilities.dll +CodeSegs - 79C34000-79C37138 Z:\sys\bin\ConnectionManager.dll +CodeSegs - 79528000-79528528 Z:\sys\bin\MGFetch.dll +CodeSegs - 796C4000-796CA388 Z:\sys\bin\BrowserDialogsProvider.dll +CodeSegs - 78F30000-78F30F20 Z:\sys\bin\WidgetRegistryClient.dll +CodeSegs - 795C0000-795C73DC Z:\sys\bin\SenXml.dll +CodeSegs - 795CC000-795CCF28 Z:\sys\bin\RTSecMgrUtil.dll +CodeSegs - 795C8000-795CA7D4 Z:\sys\bin\RTSecMgrClient.dll +CodeSegs - 795B4000-795BC558 Z:\sys\bin\Liwservicehandler.dll +CodeSegs - 79E18000-79E1B1B4 Z:\sys\bin\MemMan.dll +CodeSegs - 79E28000-79E80828 Z:\sys\bin\JavascriptCore.dll +CodeSegs - 7965C000-7965CD28 Z:\sys\bin\RECENTURLSTORE.DLL +CodeSegs - 79DC4000-79DF1518 Z:\sys\bin\WebKitUtils.dll +CodeSegs - 78CD0000-78CD1184 Z:\sys\bin\httpfiltercommon.dll +CodeSegs - 7A030000-7A036554 Z:\sys\bin\BrowserCache.dll +CodeSegs - 79C4C000-79C4CD7C Z:\sys\bin\WEBUTILS.dll +CodeSegs - 796A0000-796A28D8 Z:\sys\bin\PageScaler.dll +CodeSegs - 78CD4000-78CD6298 Z:\sys\bin\fotaengine.dll +CodeSegs - 78CC0000-78CCC408 Z:\sys\bin\HttpDMServEng.dll +CodeSegs - 78D08000-78D0ED30 Z:\sys\bin\DrmParsers.DLL +CodeSegs - 78D10000-78D10614 Z:\sys\bin\drmroapwbxmlparser.dll +CodeSegs - 78CF4000-78D06A74 Z:\sys\bin\RoapHandler.DLL +CodeSegs - 78CE4000-78CF1644 Z:\sys\bin\CodEng.dll +CodeSegs - 78D14000-78D16470 Z:\sys\bin\MultipartParser.dll +CodeSegs - 78CDC000-78CE2218 Z:\sys\bin\CodUi.dll +CodeSegs - 78CD8000-78CD8414 Z:\sys\bin\CodDownload.dll +CodeSegs - 78CB4000-78CBC878 Z:\sys\bin\DownloadMgr.dll +CodeSegs - 78F2C000-78F2C4FC Z:\sys\bin\aknnotifyplugin.dll +CodeSegs - 79478000-7948D470 Z:\sys\bin\CONNMON.DLL +CodeSegs - 79974000-7997E04C Z:\sys\bin\DownloadMgrUiLib.dll +CodeSegs - 79B90000-79BA06D8 Z:\sys\bin\backend.dll +CodeSegs - 79BA4000-79BB4D54 Z:\sys\bin\libm.dll +CodeSegs - 79B6C000-79B8DB8C Z:\sys\bin\libc.dll +CodeSegs - 79BB8000-79BBA31C Z:\sys\bin\libpthread.dll +CodeSegs - 79B2C000-79B2C480 Z:\sys\bin\ftokenclient.dll +CodeSegs - 79B30000-79B30334 Z:\sys\bin\aknlayout2hierarchy.dll +CodeSegs - 79B10000-79B2AEB0 Z:\sys\bin\alfclient.dll +CodeSegs - 79854000-79856620 Z:\sys\bin\rt_gesturehelper.dll +CodeSegs - 7A4CC000-7A722330 Z:\sys\bin\BrowserEngine.dll +CodeSegs - 793EC000-793F2E54 Z:\sys\bin\WidgetUi.exe +CodeSegs - 790A4000-7921DA68 Z:\sys\bin\10283389.dll +CodeSegs - 79220000-7922FFE0 Z:\sys\bin\10285D7B.dll +CodeSegs - 79264000-79264410 Z:\sys\bin\AknLayout2adaptation.dll +CodeSegs - 79244000-79263FD0 Z:\sys\bin\101fe2aa.dll +CodeSegs - 7926C000-7926EAC4 Z:\sys\bin\eikcdlg.dll +CodeSegs - 79268000-792685DC Z:\sys\bin\akninit.dll +CodeSegs - 79274000-79276BB0 Z:\sys\bin\102827CF.dll +CodeSegs - 79334000-79334514 Z:\sys\bin\aknfepuiinterface.dll +CodeSegs - 79338000-79338544 Z:\sys\bin\aknjapanesereading.dll +CodeSegs - 7933C000-7933E2BC Z:\sys\bin\peninputclient.dll +CodeSegs - 792F8000-79332F68 Z:\sys\bin\avkonfep.dll +CodeSegs - 79340000-793504F0 Z:\sys\bin\AknFepUiAvkonPlugin.dll +CodeSegs - 7935C000-79362600 Z:\sys\bin\101f84b9.dll +CodeSegs - 7937C000-7937CA78 Z:\sys\bin\PtiKeymappings_01.dll +CodeSegs - 79894000-7989738C Z:\sys\bin\httpfilterauthentication.dll +CodeSegs - 79390000-79395438 Z:\sys\bin\PtiZiCore.dll +CodeSegs - 80D43098-80D45818 Z:\sys\bin\httptransporthandler.dll +CodeSegs - 79C80000-79C80EDC Z:\sys\bin\uaproffilter.dll +CodeSegs - 79654000-796557E0 Z:\sys\bin\peninputimepluginitut.dll +CodeSegs - 80B9F5C8-80BA92C0 Z:\sys\bin\xmlparserplugin.dll +CodeSegs - 796AC000-796B08A4 Z:\sys\bin\cputils.dll +CodeSegs - 796A8000-796A9970 Z:\sys\bin\cpclient.dll +CodeSegs - 79E1C000-79E1C920 Z:\sys\bin\httpfilterIop.dll +CodeSegs - 7A0C0000-7A0C5E44 Z:\sys\bin\WidgetEngine.dll +CodeSegs - 7A158000-7A15DB88 Z:\sys\bin\jsdevice.dll +CodeSegs - 80D4B2A8-80D51F28 Z:\sys\bin\httpclient.dll +CodeSegs - 80D48928-80D4B224 Z:\sys\bin\HttpClientCodec.dll +CodeSegs - 80D45ED8-80D488AC Z:\sys\bin\tfcorefilters.dll +CodeSegs - 79C50000-79C51D08 Z:\sys\bin\HTTPFilterDRM.dll +CodeSegs - 79C54000-79C54FB4 Z:\sys\bin\httpfilterproxy.dll +CodeSegs - 79C5C000-79C5DB6C Z:\sys\bin\PnP.dll +CodeSegs - 79C58000-79C5A63C Z:\sys\bin\PnpPaosFilter.dll +CodeSegs - 78ED0000-78ED0CB4 Z:\sys\bin\wmdrmpkclient.dll +CodeSegs - 78ECC000-78ECD2D0 Z:\sys\bin\drmasf.dll +CodeSegs - 79C6C000-79C6CA94 Z:\sys\bin\wmdrmota.dll +CodeSegs - 79C68000-79C6A884 Z:\sys\bin\CameseUtility.dll +CodeSegs - 78DC0000-78DCA618 Z:\sys\bin\mpxcommon.dll +CodeSegs - 79724000-79728994 Z:\sys\bin\mpxcollectionutility.dll +CodeSegs - 79720000-79722344 Z:\sys\bin\mpxplaybackutility.dll +CodeSegs - 79B00000-79B0058C Z:\sys\bin\mpxviewplugin.dll +CodeSegs - 79AFC000-79AFDBF4 Z:\sys\bin\mpxviewutility.dll +CodeSegs - 79C64000-79C6704C Z:\sys\bin\cameseuicommon.dll +CodeSegs - 79C60000-79C6103C Z:\sys\bin\httpfiltercamese.dll +CodeSegs - 79C70000-79C70924 Z:\sys\bin\musicshophttpfilter.dll +CodeSegs - 79C74000-79C74DFC Z:\sys\bin\httpfilterconnhandler.dll +CodeSegs - 7A20C000-7A20C854 Z:\sys\bin\CookieFilter.dll +CodeSegs - 7A4BC000-7A4BD844 Z:\sys\bin\DeflateFilter.dll +CodeSegs - 80A799D8-80A829A4 Z:\sys\bin\pngcodec.dll +CodeSegs - 7A2EC000-7A300468 Z:\sys\bin\Zi8English.dll"; + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + if ( System.Diagnostics.Debugger.IsAttached ) + { + System.Diagnostics.Debug.WriteLine( aMessage ); + } + else + { + System.Console.WriteLine( aMessage ); + } + // + CheckTrace( aMessage.ToUpper() ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + string t = string.Format( aFormat, aParams ); + Trace( t ); + } + #endregion + + #region Event handlers + private void DebugEngine_EntityPrimingStarted( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + iTimePrimingStarted = DateTime.Now; + Trace( "[Priming] Started : {0}, file: {1}", iTimePrimingStarted.ToString(), aEntity.FullName ); + } + + private void DebugEngine_EntityPrimingProgress( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + if ( aContext != null && aContext is int ) + { + int prog = (int) aContext; + if ( ( prog % 10 ) == 0 ) + { + DateTime time = DateTime.Now; + TimeSpan ts = time - iTimePrimingStarted; + int ms = (int) ts.TotalMilliseconds; + Trace( "[Priming] Progress: {0:d12}, file: {1}", ms, aEntity.FullName ); + } + } + } + + private void DebugEngine_EntityPrimingComplete( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + DateTime time = DateTime.Now; + TimeSpan ts = time - iTimePrimingStarted; + int ms = (int) ts.TotalMilliseconds; + Trace( "[Priming] Complete: {0:d12}, file: {1}", ms, aEntity.FullName ); + } + #endregion + + #region Internal methods + private void MultiThreadedLookup( object aState ) + { + AsyncData data = (AsyncData) aState; + Random rand = new Random( 666 ); + AddressRange colRange = data.iCollection.SubsumedPrimaryRange; + // + for ( int i = 0; i < data.iIterations; i++ ) + { + uint offset = (uint) rand.Next( (int) colRange.Size ); + uint address = colRange.Min + offset; + // + SymbolCollection col = null; + Symbol sym = data.iView.Lookup( address, out col ); + } + + data.iWaiter.Set(); + } + + private bool AreAllEntitiesPrimed + { + get + { + bool ret = true; + // + foreach ( DbgEntity entity in iDebugEngine ) + { + if ( !entity.IsPrimed ) + { + ret = false; + break; + } + } + // + return ret; + } + } + + private void CheckNoOverlaps( SymbolCollection aCollection ) + { + int count = aCollection.Count; + for ( int i = 0; i < count - 1; i++ ) + { + Symbol s1 = aCollection[ i + 0 ]; + Symbol s2 = aCollection[ i + 1 ]; + // + System.Diagnostics.Debug.WriteLine( "Comparing: " + s1 + " vs " + s2 ); + // + System.Diagnostics.Debug.Assert( s1.AddressRange.Min <= s1.AddressRange.Max ); + System.Diagnostics.Debug.Assert( s1.AddressRange.Min < s2.AddressRange.Min ); + System.Diagnostics.Debug.Assert( s1.AddressRange.Max < s2.AddressRange.Min ); + } + } + + private void CheckNoOverlaps( SymbolCollection aCollection1, SymbolCollection aCollection2 ) + { + // Check collection1 against collection2 + int count1 = aCollection1.Count; + for ( int i = 0; i < count1; i++ ) + { + Symbol s = aCollection1[ i ]; + + bool foundBase = aCollection2.Contains( s.Address ); + System.Diagnostics.Debug.Assert( foundBase == false ); + // + bool foundLimit = aCollection2.Contains( s.AddressRange.Max ); + System.Diagnostics.Debug.Assert( foundLimit == false ); + } + + // Check collection2 against collection1 + int count2 = aCollection2.Count; + for ( int i = 0; i < count2; i++ ) + { + Symbol s = aCollection2[ i ]; + + bool foundBase = aCollection1.Contains( s.Address ); + System.Diagnostics.Debug.Assert( foundBase == false ); + // + bool foundLimit = aCollection1.Contains( s.AddressRange.Max ); + System.Diagnostics.Debug.Assert( foundLimit == false ); + } + } + + private Symbol FindByName( string aName, SymbolCollection aCollection ) + { + Symbol ret = null; + // + foreach ( Symbol sym in aCollection ) + { + if ( sym.Name == aName ) + { + ret = sym; + break; + } + } + // + return ret; + } + + private void CheckTrace( string aTrace ) + { + bool overlap = aTrace.Contains( "OVERLAPS WITH EXISTING COLLECTION" ); + System.Diagnostics.Debug.Assert( overlap == false ); + } + + private void DoTestHeapCellSymbolLookup() + { + CodeSegDefinitionCollection codeSegs = new CodeSegDefinitionCollection(); + using ( StringReader reader = new StringReader( KTestBigDsoDataCodeSegList ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + CodeSegDefinition def = CodeSegDefinitionParser.ParseDefinition( line ); + if ( def != null ) + { + codeSegs.Add( def ); + } + line = reader.ReadLine(); + } + } + codeSegs.SortByAddress(); + + using ( DbgEngineView view = iDebugEngine.CreateView( "TestView", codeSegs ) ) + { + foreach ( TSymLookupEntry entry in TSymLookupEntry.KHeapSymbols ) + { + SymbolCollection col = null; + Symbol sym = view.Symbols.Lookup( entry.iAddress, out col ); + // + if ( sym != null ) + { + string name = sym.Name; + System.Diagnostics.Debug.Assert( entry.iSymbol == name ); + } + else + { + System.Diagnostics.Debug.Assert( entry.iSymbol == string.Empty ); + } + // + if ( col != null ) + { + string name = entry.iCollection.ToUpper(); + bool match = col.FileName.Contains( name ); + System.Diagnostics.Debug.Assert( match ); + } + else + { + System.Diagnostics.Debug.Assert( entry.iCollection == string.Empty ); + } + // + CodeSegDefinition def = codeSegs[ entry.iAddress ]; + if ( def != null ) + { + if ( entry.iSymbol == string.Empty ) + { + // The original SymbolLib didn't find a symbolic match. It's okay + // if we did (or didn't) find a match using SymbianSymbolLib. + } + else if ( entry.iSymbol != string.Empty ) + { + // SymbolLib found a match, SymbianSymbolLib must do too. + System.Diagnostics.Debug.Assert( sym != null ); + } + if ( col == null ) + { + // We didn't find a symbol collection for the specified address + // even though it falls within code segment range. Print a warning + // as this may be caused by dodgy symbol file content. + System.Diagnostics.Debug.WriteLine( string.Format( @"WARNING: couldn't find symbol for: 0x{0:x8}, offset: 0x{1:x8}, even though code seg match was found: {2}", + entry.iAddress, + entry.iAddress - def.Base, + def ) ); + } + } + } + } + } + + private void DoTestCodeSegmentResolution() + { + CodeSegDefinitionCollection codeSegs = new CodeSegDefinitionCollection(); + using ( StringReader reader = new StringReader( KTestBigDsoDataCodeSegList ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + CodeSegDefinition def = CodeSegDefinitionParser.ParseDefinition( line ); + if ( def != null ) + { + codeSegs.Add( def ); + } + line = reader.ReadLine(); + } + } + codeSegs.SortByAddress(); + + using ( DbgEngineView view = iDebugEngine.CreateView( "TestView", codeSegs ) ) + { + foreach ( CodeSegDefinition def in codeSegs ) + { + SymbolCollection col = null; + Symbol sym = view.Symbols.Lookup( def.Base, out col ); + System.Diagnostics.Debug.Assert( sym != null ); + } + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iDebugEngine.Dispose(); + } + } + #endregion + + #region Data members + private readonly DbgEngine iDebugEngine; + private DateTime iTimePrimingStarted; + private AutoResetEvent iWaiter1 = new AutoResetEvent( false ); + private AutoResetEvent iWaiter2 = new AutoResetEvent( false ); + private AutoResetEvent iWaiter3 = new AutoResetEvent( false ); + private AutoResetEvent iWaiter4 = new AutoResetEvent( false ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Form1.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Form1.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace SymbolTestGUI +{ + partial class Form1 + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.button1 = new System.Windows.Forms.Button(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point( 23, 12 ); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size( 75, 23 ); + this.button1.TabIndex = 0; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler( this.button1_Click ); + // + // progressBar1 + // + this.progressBar1.Location = new System.Drawing.Point( 23, 41 ); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size( 508, 23 ); + this.progressBar1.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.BackColor = System.Drawing.Color.Transparent; + this.label1.Font = new System.Drawing.Font( "Tahoma", 8.25F, System.Drawing.FontStyle.Bold ); + this.label1.ForeColor = System.Drawing.Color.Black; + this.label1.Location = new System.Drawing.Point( 260, 46 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 41, 13 ); + this.label1.TabIndex = 2; + this.label1.Text = "label1"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 896, 269 ); + this.Controls.Add( this.label1 ); + this.Controls.Add( this.progressBar1 ); + this.Controls.Add( this.button1 ); + this.Font = new System.Drawing.Font( "Tahoma", 8.25F ); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.ProgressBar progressBar1; + private System.Windows.Forms.Label label1; + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Form1.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Form1.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,368 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using SymbianUtils.Range; +using SymbianUtils.Tracer; +using SymbianStructuresLib.CodeSegments; +using SymbianStructuresLib.Debug.Symbols; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; +using SymbianDebugLib.PluginAPI; +using SymbianDebugLib.PluginAPI.Types; +using SymbianDebugLib.PluginAPI.Types.Symbols; + +namespace SymbolTestGUI +{ + public partial class Form1 : Form, ITracer + { + #region Constructors + public Form1() + { + InitializeComponent(); + + iDebugEngine = new DbgEngine( this ); + iDebugEngine.UiMode = SymbianDebugLib.TDbgUiMode.EUiDisabled; + iDebugEngine.EntityPrimingStarted += new DbgEngine.EventHandler( DebugEngine_EntityPrimingStarted ); + iDebugEngine.EntityPrimingProgress += new DbgEngine.EventHandler( DebugEngine_EntityPrimingProgress ); + iDebugEngine.EntityPrimingComplete += new DbgEngine.EventHandler( DebugEngine_EntityPrimingComplete ); + } + #endregion + + #region Event handlers + private void DebugEngine_EntityPrimingStarted( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + if ( this.InvokeRequired ) + { + DbgEngine.EventHandler observer = new DbgEngine.EventHandler( DebugEngine_EntityPrimingStarted ); + this.BeginInvoke( observer, new object[] { aEngine, aEntity, aContext } ); + } + else + { + label1.Text = "Reading..."; + progressBar1.Minimum = 0; + progressBar1.Maximum = 100; + progressBar1.Value = 0; + } + } + + private void DebugEngine_EntityPrimingProgress( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + if ( this.InvokeRequired ) + { + DbgEngine.EventHandler observer = new DbgEngine.EventHandler( DebugEngine_EntityPrimingProgress ); + this.BeginInvoke( observer, new object[] { aEngine, aEntity, aContext } ); + } + else + { + if ( aContext != null && aContext is int ) + { + progressBar1.Value = (int) aContext; + } + } + } + + private void DebugEngine_EntityPrimingComplete( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + if ( this.InvokeRequired ) + { + DbgEngine.EventHandler observer = new DbgEngine.EventHandler( DebugEngine_EntityPrimingComplete ); + this.BeginInvoke( observer, new object[] { aEngine, aEntity, aContext } ); + } + else + { + DateTime endTime = DateTime.Now; + TimeSpan span = endTime - iStartTime; + label1.Text = "Done - " + span.ToString(); + progressBar1.Value = progressBar1.Maximum; + + if ( AreAllEntitiesPrimed ) + { + RunTests(); + } + } + } + + private void button1_Click( object sender, EventArgs e ) + { + iDebugEngine.Add( @"Z:\epoc32\rom\S60_3_2_200846_RnD_merlin_emulator_hw.rom.symbol" ); + //iDebugEngine.Add( @"z:\epoc32\rom\S60_3_2_200846_RnD_merlin_emulator_hw.rofs1.oby" ); + //iDebugEngine.Add( @"C:\Tool Demo Files\2. Crash Data\File43\CoreImage\MemSpy.EXE.map" ); + iDebugEngine.Add( @"C:\Tool Demo Files\2. Crash Data\File44\Platform_wk49\Symbols\mapfiles.zip" ); + //iDebugEngine.Add( @"C:\Tool Demo Files\2. Crash Data\File55\alarmserver.exe.map" ); + + iStartTime = DateTime.Now; + iDebugEngine.Prime( SymbianUtils.TSynchronicity.EAsynchronous ); + } + #endregion + + #region Internal methods + private bool AreAllEntitiesPrimed + { + get + { + bool ret = true; + // + foreach ( DbgEntity entity in iDebugEngine ) + { + if ( !entity.IsPrimed ) + { + ret = false; + break; + } + } + // + return ret; + } + } + + private void RunTests() + { + //RunObyMapViewTest(); + RunZipMapFileTest(); + } + + private void RunObyMapViewTest() + { + CodeSegDefinitionCollection codeSegs = new CodeSegDefinitionCollection(); + // + codeSegs.Add( new CodeSegDefinition( @"Z:\sys\bin\WidgetLauncher.exe", 0x7A120000, 0x7A170000 ) ); + + using ( DbgEngineView view = iDebugEngine.CreateView( "TestView", codeSegs ) ) + { + } + } + + private void CheckNoOverlaps( SymbolCollection aCollection ) + { + int count = aCollection.Count; + for ( int i = 0; i < count - 1; i++ ) + { + Symbol s1 = aCollection[ i + 0 ]; + Symbol s2 = aCollection[ i + 1 ]; + // + System.Diagnostics.Debug.WriteLine( "Comparing: " + s1 + " vs " + s2 ); + // + System.Diagnostics.Debug.Assert( s1.AddressRange.Min <= s1.AddressRange.Max ); + System.Diagnostics.Debug.Assert( s1.AddressRange.Min < s2.AddressRange.Min ); + System.Diagnostics.Debug.Assert( s1.AddressRange.Max < s2.AddressRange.Min ); + } + } + + private Symbol FindByName( string aName, SymbolCollection aCollection ) + { + Symbol ret = null; + // + foreach ( Symbol sym in aCollection ) + { + if ( sym.Name == aName ) + { + ret = sym; + break; + } + } + // + return ret; + } + + private void RunZipMapFileTest() + { + // So we can spot it in the profiler... + //Thread.Sleep( 2000 ); + + using ( DbgEngineView view = iDebugEngine.CreateView( "TestView" ) ) + { + DbgViewSymbols symView = view.Symbols; + + // Should be possible to activate a file within a zip + SymbolCollection activatedCol = symView.ActivateAndGetCollection( new CodeSegDefinition( @"Z:\sys\bin\AcCmOnItOr.dll", 0x70000000, 0x7A000000 ) ); + System.Diagnostics.Debug.Assert( activatedCol != null ); + + // Verify that the symbols were really read. + SymbolCollection col = view.Symbols.CollectionByAddress( 0x70000000 ); + //System.Diagnostics.Debug.Assert( col.Count == 0xaa ); + System.Diagnostics.Debug.WriteLine( col.ToString( "full", null ) ); + + // Verify that the collections are the same + System.Diagnostics.Debug.Assert( activatedCol.Count == col.Count ); + System.Diagnostics.Debug.Assert( activatedCol.FileName == col.FileName ); + System.Diagnostics.Debug.Assert( activatedCol == col ); + + // Cannot activate the same dll twice + bool activated = symView.Activate( new CodeSegDefinition( @"Z:\sys\bin\AcCmOnItOr.dll", 0x80000000, 0x8A000000 ) ); + System.Diagnostics.Debug.Assert( activated == false ); + + // Cannot activate an overlapping area. + activated = symView.Activate( new CodeSegDefinition( @"Z:\sys\bin\AIFW.dll", 0x70000000, 0x70040000 ) ); + System.Diagnostics.Debug.Assert( activated == false ); + + // Cannot deactivate a non-activated dll + bool deactivated = symView.Deactivate( new CodeSegDefinition( @"Z:\sys\bin\AIUTILS.DLL" ) ); + System.Diagnostics.Debug.Assert( deactivated == false ); + + // Cannot deactivate a missing dll + deactivated = symView.Deactivate( new CodeSegDefinition( @"Z:\sys\bin\THIS_DOES_NOT_EXIST.EXE" ) ); + System.Diagnostics.Debug.Assert( deactivated == false ); + + // Look up first symbol + Symbol sym = null; + Symbol sym2 = null; + sym = symView.Lookup( 0x70000000, out col ); + System.Diagnostics.Debug.Assert( sym != null && col == activatedCol && sym.Name == "_E32Dll" ); + sym = symView.Lookup( 0x70000027, out col ); + System.Diagnostics.Debug.Assert( sym != null && col == activatedCol && sym.Name == "_E32Dll" ); + + // For the following sequence, ensure that we discard the CAccMonitor::~CAccMonitor__sub_object() + // line and keep the CAccMonitor::~CAccMonitor() line instead. Ensure that the size of the + // CAccMonitor::~CAccMonitor() entry has been calculated using the data from the sub_object entry which + // we threw away. + // + // CAccMonitor::~CAccMonitor__deallocating() 0x00009195 Thumb Code 16 accmonitor.in(i._ZN11CAccMonitorD0Ev) + // CAccMonitor::~CAccMonitor() 0x000091a5 Thumb Code 0 accmonitor.in(i._ZN11CAccMonitorD2Ev) + // CAccMonitor::~CAccMonitor__sub_object() 0x000091a5 Thumb Code 8 accmonitor.in(i._ZN11CAccMonitorD2Ev) + // CAccMonitorInfo::Reset() 0x000091ad Thumb Code 28 accmonitor.in(i._ZN15CAccMonitorInfo5ResetEv) + // + sym = FindByName( "CAccMonitor::~CAccMonitor__sub_object()", col ); + System.Diagnostics.Debug.Assert( sym == null ); + sym = FindByName( "CAccMonitor::~CAccMonitor()", col ); + System.Diagnostics.Debug.Assert( sym != null && sym.Size == 8 ); + + // For the following sequence, ensure that we discard the sub object and keep the destructor. + // + // RArray::RArray() 0x00009289 Thumb Code 10 accmonitor.in(t._ZN6RArrayImEC1Ev) + // RArray::RArray__sub_object() 0x00009289 Thumb Code 0 accmonitor.in(t._ZN6RArrayImEC1Ev) + sym = FindByName( "RArray::RArray__sub_object()", col ); + System.Diagnostics.Debug.Assert( sym == null ); + sym = FindByName( "RArray::RArray()", col ); + System.Diagnostics.Debug.Assert( sym != null && sym.Size == 10 ); + + // For the following sequence, ensure that the end of the first entry doesn't overlap with the start of the second. + // + // typeinfo name for CAccMonitorCapMapper 0x000094a8 Data 23 accmonitor.in(.constdata__ZTS20CAccMonitorCapMapper) + // typeinfo name for CAccMonitorContainer 0x000094bf Data 23 accmonitor.in(.constdata__ZTS20CAccMonitorContainer) + // + sym = FindByName( "typeinfo name for CAccMonitorCapMapper", col ); + System.Diagnostics.Debug.Assert( sym != null ); + sym2 = FindByName( "typeinfo name for CAccMonitorContainer", col ); + System.Diagnostics.Debug.Assert( sym2 != null ); + System.Diagnostics.Debug.Assert( sym.AddressRange.Max + 1 == sym2.Address ); + + // Check no overlap + CheckNoOverlaps( col ); + + // Second symbol + sym = symView.Lookup( 0x70000028, out col ); + System.Diagnostics.Debug.Assert( sym != null && col == activatedCol && sym.Name == "__cpp_initialize__aeabi_" ); + + // Multithreaded symbol lookup times + ThreadPool.QueueUserWorkItem( new WaitCallback( MultiThreadedLookup ), new AsyncData( symView, iWaiter1, col, 10000 ) ); + ThreadPool.QueueUserWorkItem( new WaitCallback( MultiThreadedLookup ), new AsyncData( symView, iWaiter2, col, 5000 ) ); + ThreadPool.QueueUserWorkItem( new WaitCallback( MultiThreadedLookup ), new AsyncData( symView, iWaiter3, col, 8000 ) ); + ThreadPool.QueueUserWorkItem( new WaitCallback( MultiThreadedLookup ), new AsyncData( symView, iWaiter4, col, 20000 ) ); + + // Wait + using( iWaiter4 ) + { + iWaiter4.WaitOne(); + } + using ( iWaiter3 ) + { + iWaiter3.WaitOne(); + } + using ( iWaiter2 ) + { + iWaiter2.WaitOne(); + } + using ( iWaiter1 ) + { + iWaiter1.WaitOne(); + } + + // Deactivate an activated dll + deactivated = symView.Deactivate( new CodeSegDefinition( @"Z:\sys\bin\ACCMONITOR.DLL" ) ); + System.Diagnostics.Debug.Assert( deactivated == true ); + + // symbol shouldn't be available anymore + sym = symView.Lookup( 0x70000000, out col ); + System.Diagnostics.Debug.Assert( sym == null && col == null ); + } + } + + #region Internal classes + private class AsyncData + { + public AsyncData( DbgViewSymbols aView, AutoResetEvent aWaiter, SymbolCollection aCollection, int aIterations ) + { + iView = aView; + iWaiter = aWaiter; + iCollection = aCollection; + iIterations = aIterations; + } + + public readonly DbgViewSymbols iView; + public readonly AutoResetEvent iWaiter; + public readonly SymbolCollection iCollection; + public readonly int iIterations; + } + #endregion + + private void MultiThreadedLookup( object aState ) + { + AsyncData data = (AsyncData) aState; + Random rand = new Random( 666 ); + AddressRange colRange = data.iCollection.SubsumedPrimaryRange; + // + for ( int i = 0; i < data.iIterations; i++ ) + { + uint offset = (uint) rand.Next( (int) colRange.Size ); + uint address = colRange.Min + offset; + // + SymbolCollection col = null; + Symbol sym = data.iView.Lookup( address, out col ); + } + + data.iWaiter.Set(); + } + #endregion + + #region ITracer Members + public void Trace( string aMessage ) + { + System.Diagnostics.Debug.WriteLine( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + string t = string.Format( aFormat, aParams ); + Trace( t ); + } + #endregion + + #region Data members + private DateTime iStartTime = new DateTime(); + private readonly DbgEngine iDebugEngine; + private AutoResetEvent iWaiter1 = new AutoResetEvent( false ); + private AutoResetEvent iWaiter2 = new AutoResetEvent( false ); + private AutoResetEvent iWaiter3 = new AutoResetEvent( false ); + private AutoResetEvent iWaiter4 = new AutoResetEvent( false ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Form1.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Form1.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Program.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Program.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace SymbolTestGUI +{ + static class Program + { + // + // The main entry point for the application. + // + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault( false ); + Application.Run( new Form1() ); + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "SymbolTestGUI" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia" )] +[assembly: AssemblyProduct( "SymbolTestGUI" )] +[assembly: AssemblyCopyright( "Copyright © Nokia 2009" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "9d0bb874-7881-413a-9555-3181a6355444" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Properties/Resources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Properties/Resources.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SymbolTestGUI.Properties +{ + + + // + // A strongly-typed resource class, for looking up localized strings, etc. + // + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0" )] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( "Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode" )] + internal Resources() + { + } + + // + // Returns the cached ResourceManager instance used by this class. + // + [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ( ( resourceMan == null ) ) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager( "SymbolTestGUI.Properties.Resources", typeof( Resources ).Assembly ); + resourceMan = temp; + } + return resourceMan; + } + } + + // + // Overrides the current thread's CurrentUICulture property for all + // resource lookups using this strongly typed resource class. + // + [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Properties/Resources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Properties/Resources.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Properties/Settings.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Properties/Settings.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.3053 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SymbolTestGUI.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0" )] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ( (Settings) ( global::System.Configuration.ApplicationSettingsBase.Synchronized( new Settings() ) ) ); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Properties/Settings.settings --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/Properties/Settings.settings Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,7 @@ + + + + + + + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/SymbolTestGUI.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/SymbolTestGUI.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,102 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025} + WinExe + Properties + SymbolTestGUI + SymbolTestGUI + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC} + SymbianSymbolLib + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/SymbolTestGUI.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Tests/SymbolTestGUI/SymbolTestGUI.sln Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,282 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbolTestGUI", "SymbolTestGUI.csproj", "{8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianSymbolLib", "..\..\SymbianSymbolLib.csproj", "{6054A36B-F8A9-406F-B6CE-B531CC2AEADC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStructuresLib", "..\..\..\SymbianStructuresLib\SymbianStructuresLib.csproj", "{D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianUtils", "..\..\..\SymbianUtils\SymbianUtils.csproj", "{F6F4CE69-E73A-4917-97ED-B114DE90C92E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianDebugLib", "..\..\..\SymbianDebugLib\SymbianDebugLib.csproj", "{796DD82D-9E7D-476D-B700-086CD9A893DA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginMap", "..\..\Plugins\SLPluginMap\SLPluginMap.csproj", "{2E619377-8639-49F9-9494-4FAD25CBC05E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginObey", "..\..\Plugins\SLPluginObey\SLPluginObey.csproj", "{4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginSymbol", "..\..\Plugins\SLPluginSymbol\SLPluginSymbol.csproj", "{E921F00D-5F82-454E-9CBE-59381C48781C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginZip", "..\..\Plugins\SLPluginZip\SLPluginZip.csproj", "{BDD4E602-AC36-473A-98D0-FE062213548A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianZipLib", "..\..\..\SymbianZipLib\SymbianZipLib.csproj", "{0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntSymbol", "..\..\..\SymbianDebugLib\Plugins\DbgEntSymbol\DbgEntSymbol.csproj", "{51C62A41-992E-4158-8A32-228ED49BF71D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntCode", "..\..\..\SymbianDebugLib\Plugins\DbgEntCode\DbgEntCode.csproj", "{E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NokiaArmDisassemblyEngine", "..\..\..\NokiaArmDisassembler\Dll\NokiaArmDisassemblerLib.vcproj", "{3C0CECE5-1C07-463F-A216-4E5D13750CC9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NokiaArmDisassembler", "..\..\..\NokiaArmDisassembler\Plugin\NokiaArmDisassembler.csproj", "{BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NokiaFlashUpdateLibrary", "..\..\..\NokiaFlashUpdateLib\NokiaFlashUpdateLib.vcproj", "{971A1AD8-4142-422F-A196-7E07DC73D60A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CLPluginNokiaFpsx", "..\..\..\NokiaFpsxCLPlugin\CLPluginNokiaFpsx.csproj", "{26A14AD0-F517-45DB-874F-C71A0A8D4D5C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CLPluginImg", "..\..\..\SymbianCodeLib\Plugins\CLPluginSymbianOS\CLPluginImg.csproj", "{3878E434-8B76-4127-BA89-68A90DA6E69A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianInstructionLib", "..\..\..\SymbianInstructionLib\SymbianInstructionLib.csproj", "{EB93FD74-17C6-44B2-8384-4D58DC210F77}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianImageLib", "..\..\..\SymbianImageLib\SymbianImageLib.csproj", "{A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SymbianNativeTools", "..\..\..\SymbianNativeTools\SymbianNativeTools.vcproj", "{34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianCodeLib", "..\..\..\SymbianCodeLib\SymbianCodeLib.csproj", "{A041EDFE-A120-4100-A0A6-FB1984D80815}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianSymbolLibTest", "..\SymbianSymbolLibTest\SymbianSymbolLibTest.csproj", "{CD291641-4350-4E6D-949D-F877CF08A295}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Debug|Win32.ActiveCfg = Debug|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Release|Any CPU.Build.0 = Release|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Release|Win32.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Win32.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Any CPU.Build.0 = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Win32.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Win32.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.Build.0 = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Win32.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.Build.0 = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Win32.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Win32.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Any CPU.Build.0 = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Win32.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Any CPU.Build.0 = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Win32.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Win32.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Any CPU.Build.0 = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Win32.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Any CPU.Build.0 = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Win32.ActiveCfg = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Win32.ActiveCfg = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Any CPU.Build.0 = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Win32.ActiveCfg = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Win32.ActiveCfg = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Any CPU.Build.0 = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Win32.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Win32.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Any CPU.Build.0 = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Win32.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Any CPU.Build.0 = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Win32.ActiveCfg = Release|Any CPU + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Win32.Build.0 = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Any CPU.ActiveCfg = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Mixed Platforms.Build.0 = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Win32.ActiveCfg = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Win32.Build.0 = Release|Win32 + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Win32.ActiveCfg = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Any CPU.Build.0 = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Win32.ActiveCfg = Release|Any CPU + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Win32.ActiveCfg = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Win32.Build.0 = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Any CPU.ActiveCfg = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Mixed Platforms.Build.0 = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Win32.ActiveCfg = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Win32.Build.0 = Release|Win32 + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Any CPU.Build.0 = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Win32.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Win32.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Any CPU.Build.0 = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Win32.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Win32.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Any CPU.Build.0 = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Win32.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Any CPU.Build.0 = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Win32.ActiveCfg = Release|Any CPU + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Win32.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Win32.Build.0 = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Any CPU.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Mixed Platforms.Build.0 = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Win32.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Win32.Build.0 = Release|Win32 + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Any CPU.Build.0 = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Win32.ActiveCfg = Release|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Debug|Win32.ActiveCfg = Debug|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Release|Any CPU.Build.0 = Release|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Release|Win32.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Utilities/Constants.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Utilities/Constants.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianSymbolLib +{ + public static class Constants + { + public static class Device + { + public const string KPathSysBin = @"\sys\bin\"; + public const string KPathSysBinROM = "z:" + KPathSysBin; + } + + public static class Host + { + public const string KPathEpoc32ReleaseArmv5Urel = @"\epoc32\release\armv5\urel\"; + public const string KPathEpoc32ReleaseArmv5Udeb = @"\epoc32\release\armv5\urel\"; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Workspace/SymbianSymbolLib.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianSymbolLib/Workspace/SymbianSymbolLib.sln Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,94 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianSymbolLib", "..\SymbianSymbolLib.csproj", "{6054A36B-F8A9-406F-B6CE-B531CC2AEADC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianUtils", "..\..\SymbianUtils\SymbianUtils.csproj", "{F6F4CE69-E73A-4917-97ED-B114DE90C92E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStructuresLib", "..\..\SymbianStructuresLib\SymbianStructuresLib.csproj", "{D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Symbol Lib Plugins", "Symbol Lib Plugins", "{D16A3C1B-5404-4EAD-A3D3-6CB7A9F76B4E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginObey", "..\Plugins\SLPluginObey\SLPluginObey.csproj", "{4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginMap", "..\Plugins\SLPluginMap\SLPluginMap.csproj", "{2E619377-8639-49F9-9494-4FAD25CBC05E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbolLib", "..\..\SymbolLib\SymbolLib.csproj", "{C657DF4B-FA67-47DD-89FC-A45583646184}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginSymbol", "..\Plugins\SLPluginSymbol\SLPluginSymbol.csproj", "{E921F00D-5F82-454E-9CBE-59381C48781C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbolTestGUI", "..\Tests\SymbolTestGUI\SymbolTestGUI.csproj", "{8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbolProgressUiLib", "..\..\..\UI\SymbolProgressUiLib\SymbolProgressUiLib.csproj", "{4235D183-5242-4DE1-9DEA-BB6AB03C42B3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianSymbolLibTest", "..\Tests\SymbianSymbolLibTest\SymbianSymbolLibTest.csproj", "{CD291641-4350-4E6D-949D-F877CF08A295}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginZip", "..\Plugins\SLPluginZip\SLPluginZip.csproj", "{BDD4E602-AC36-473A-98D0-FE062213548A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianZipLib", "..\..\SymbianZipLib\SymbianZipLib.csproj", "{0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Any CPU.Build.0 = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.Build.0 = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.Build.0 = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Any CPU.Build.0 = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Any CPU.Build.0 = Release|Any CPU + {C657DF4B-FA67-47DD-89FC-A45583646184}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C657DF4B-FA67-47DD-89FC-A45583646184}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C657DF4B-FA67-47DD-89FC-A45583646184}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C657DF4B-FA67-47DD-89FC-A45583646184}.Release|Any CPU.Build.0 = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Any CPU.Build.0 = Release|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8463DC4C-3E8C-4EE3-864C-E65CCC0FC025}.Release|Any CPU.Build.0 = Release|Any CPU + {4235D183-5242-4DE1-9DEA-BB6AB03C42B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4235D183-5242-4DE1-9DEA-BB6AB03C42B3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4235D183-5242-4DE1-9DEA-BB6AB03C42B3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4235D183-5242-4DE1-9DEA-BB6AB03C42B3}.Release|Any CPU.Build.0 = Release|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD291641-4350-4E6D-949D-F877CF08A295}.Release|Any CPU.Build.0 = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Any CPU.Build.0 = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8} = {D16A3C1B-5404-4EAD-A3D3-6CB7A9F76B4E} + {2E619377-8639-49F9-9494-4FAD25CBC05E} = {D16A3C1B-5404-4EAD-A3D3-6CB7A9F76B4E} + {E921F00D-5F82-454E-9CBE-59381C48781C} = {D16A3C1B-5404-4EAD-A3D3-6CB7A9F76B4E} + {BDD4E602-AC36-473A-98D0-FE062213548A} = {D16A3C1B-5404-4EAD-A3D3-6CB7A9F76B4E} + EndGlobalSection +EndGlobal diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/Document/SymDocument.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/Document/SymDocument.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; + +namespace SymbianTree +{ + public class SymDocument : SymNodeAddAsChild + { + #region Constructors + public SymDocument() + : this( Granularity ) + { + } + + public SymDocument( int aGranularity ) + : this( aGranularity, null ) + { + } + + public SymDocument( object aData ) + : this( Granularity, aData ) + { + } + + public SymDocument( int aGranularity, object aData ) + : base( aData ) + { + iCurrentNode = this; + CreateChildrenListNow( aGranularity ); + } + #endregion + + #region API + public void SerializeToXml( string aFileName ) + { + if ( File.Exists( aFileName ) ) + { + File.Delete( aFileName ); + } + + using ( XmlTextWriter writer = new XmlTextWriter( aFileName, System.Text.Encoding.UTF8 ) ) + { + writer.Formatting = Formatting.Indented; + // + try + { + base.Serialize( writer ); + } + catch ( XmlException ) + { + } + } + } + + public void MakeParentCurrent() + { + System.Diagnostics.Debug.Assert( CurrentNode.HasParent ); + CurrentNode = CurrentNode.Parent; + } + #endregion + + #region Properties + public SymNode CurrentNode + { + get { return iCurrentNode; } + set + { + iPreviousCurrentNode = iCurrentNode; + iCurrentNode = value; + } + } + + public SymNode PreviousCurrentNode + { + get { return iPreviousCurrentNode; } + } + #endregion + + #region Data members + private SymNode iCurrentNode; + private SymNode iPreviousCurrentNode; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/Nodes/SymNode.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/Nodes/SymNode.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,851 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Xml; +using System.Collections; +using System.Collections.Generic; + +namespace SymbianTree +{ + public abstract class SymNode : IEnumerable + { + #region Constructors + public SymNode() + { + } + + public SymNode( SymNode aParent ) + { + aParent.AppendChild( this ); + } + + public SymNode( object aData ) + { + iData = aData; + } + + public SymNode( object aData, SymNode aParent ) + { + iData = aData; + aParent.AppendChild( this ); + } + #endregion + + #region API - siblings + public void InsertBeforeMe( SymNode aNode ) + { + if ( aNode.HasParent ) + { + // Ensure that aNode is no longer registered with any existing parent. + aNode.Parent.RemoveChild( aNode ); + } + + if ( HasPrevious ) + { + // Need to link up my previous node with aNode and then + // link aNode with me + SymNode p = Previous; + p.Next = aNode; + aNode.Previous = p; + } + else + { + // I didn't have a previous node, so if I am inserting aNode + // before me, it won't have a previous node either. + aNode.Previous = null; + } + + // Now prepend. + aNode.Next = this; + Previous = aNode; + + // Ensure that my new brother is a child of my parent + if ( HasParent ) + { + // Must insert the child at the correct position within + // my parents children container. aNode should be + // inserted before me, i.e. after my *OLD* previous + // node which is now aNode's previous node (since it + // now sits in the middle). + Parent.InsertNodeAfterSpecificChild( aNode, aNode.Previous ); + } + aNode.Parent = Parent; + } + + public void AppendAfterMe( SymNode aNode ) + { + if ( aNode.HasParent ) + { + // Ensure that aNode is no longer registered with any existing parent. + aNode.Parent.RemoveChild( aNode ); + } + + if ( HasNext ) + { + // Need to link up my next node with aNode and then + // link aNode with me + SymNode n = Next; + n.Previous = aNode; + aNode.Next = n; + } + else + { + // I didn't have a next node, so if I am inserting aNode + // after me, it won't have a next node either. + aNode.Next = null; + } + + // Now prepend. + aNode.Previous = this; + Next = aNode; + + // Ensure that my new brother is a child of my parent + if ( HasParent ) + { + // Must insert the child at the correct position within + // my parents children container. aNode should be + // inserted after me. + Parent.InsertNodeAfterSpecificChild( aNode, this ); + } + aNode.Parent = Parent; + } + + public void AppendSibling( SymNode aNode ) + { + #region Example + // Find the last node in the current sibling branch, + // e.g. if we have nodes: + // + // [A] [B] [C] + // + // and this = [B] and aNode = [X] + // then we will create the resultant tree consisting of: + // + // [A] [B] [C] [X] + #endregion + SymNode insertionPoint = this; + while( insertionPoint.HasNext ) + { + insertionPoint = insertionPoint.Next; + } + + // Now append. + insertionPoint.Next = aNode; + aNode.Previous = insertionPoint; + aNode.Next = null; + + // Ensure that my new brother is a child of my parent + Parent.InsertChild( aNode, this ); + } + + public void PrependSibling( SymNode aNode ) + { + #region Example + // Find the first node in the current sibling branch, + // e.g. if we have nodes: + // + // [A] [B] [C] + // + // and this = [B] and aNode = [X] + // then we will create the resultant tree consisting of: + // + // [X] [A] [B] [C] + #endregion + SymNode insertionPoint = this; + while( insertionPoint.HasPrevious ) + { + insertionPoint = insertionPoint.Previous; + } + + // Now prepend. + insertionPoint.Previous = aNode; + aNode.Next = insertionPoint; + aNode.Previous = null; + + // Ensure that my new brother is a child of my parent + Parent.InsertChild( aNode, null ); + } + + public void InsertSibling( SymNode aNode, SymNode aAfterNode ) + { + if ( aAfterNode == null ) + { + PrependSibling( aNode ); + } + else + { + System.Diagnostics.Debug.Assert( aAfterNode.Parent == Parent ); + System.Diagnostics.Debug.Assert( HasNext || HasPrevious ); + System.Diagnostics.Debug.Assert( DbgCheckNodeIsASibling( aAfterNode ) ); + + #region Example + // Preconditions: + // ============== + // Siblings = [A] [B] [C] + // aAfterNode = [B] + // aNode = [X] + // + // Output: + // ======= + // Siblings = [A] [B] [X] [C] + #endregion + + // We need to ensure that the linkage for + // B -> X -> C is persisted after the operation. + // + // First, obtain [C] by looking at [B]'s next node. + SymNode nextNode = aAfterNode.Next; + + // Update [B]'s next node to point to [X] + aAfterNode.Next = aNode; + + // Update [X]'s next and previous nodes + aNode.Previous = aAfterNode; // [B] + aNode.Next = nextNode; // [C] + + // Update [C]'s previous node + nextNode.Previous = aNode; + + // Ensure that my new brother is a child of my parent + Parent.InsertChild( aNode, aAfterNode ); + } + } + + public bool SiblingExists( SymNode aNode ) + { + bool found = false; + SymNodeEnumeratorSiblings iterator = new SymNodeEnumeratorSiblings( FirstSibling ); + // + foreach( SymNode node in iterator ) + { + if ( node == aNode ) + { + found = true; + break; + } + } + // + return found; + } + + public bool SiblingTypeExists( System.Type aType ) + { + bool found = false; + SymNodeEnumeratorSiblings iterator = new SymNodeEnumeratorSiblings( FirstSibling ); + // + foreach( SymNode node in iterator ) + { + if ( node.GetType() == aType ) + { + found = true; + break; + } + } + // + return found; + } + #endregion + + #region API - children + public void AppendChild( SymNode aChild ) + { + if ( aChild.HasParent ) + { + // Ensure that aNode is no longer registered with any existing parent. + aChild.Parent.RemoveChild( aChild ); + } + + if ( HasChildren ) + { + SymNode originalLastChild = LastChild; + originalLastChild.Next = aChild; + aChild.Previous = originalLastChild; + } + // + aChild.Parent = this; + aChild.Next = null; + Children.Add( aChild ); + } + + public void PrependChild( SymNode aChild ) + { + if ( aChild.HasParent ) + { + // Ensure that aNode is no longer registered with any existing parent. + aChild.Parent.RemoveChild( aChild ); + } + + if ( HasChildren ) + { + SymNode originalFirstChild = FirstChild; + originalFirstChild.Previous = aChild; + aChild.Next = originalFirstChild; + } + // + aChild.Parent = this; + aChild.Previous = null; + Children.Insert( 0, aChild ); + } + + public void InsertChild( SymNode aNode, SymNode aAfterNode ) + { + if ( aAfterNode == null ) + { + PrependChild( aNode ); + } + else + { + System.Diagnostics.Debug.Assert( aAfterNode.Parent == this ); + System.Diagnostics.Debug.Assert( iChildren != null && iChildren.Count > 0 ); + System.Diagnostics.Debug.Assert( DbgCheckNodeIsAChild( aAfterNode ) ); + + if ( aNode.HasParent ) + { + // Ensure that aNode is no longer registered with any existing parent. + aNode.Parent.RemoveChild( aNode ); + } + + #region Example + // Input: + // ====== + // Children = [A] [B] [C] + // aAfterNode = [B] + // aNode = [X] + // + // Output: + // ======= + // Children = [A] [B] [X] [C] + #endregion + + // We need to ensure that the linkage for + // B -> X -> C is persisted after the operation. + // + // First, obtain [C] by looking at [B]'s next node. + SymNode nextNode = aAfterNode.Next; + + // Update [B]'s next node to point to [X] + aAfterNode.Next = aNode; + + // Update [X]'s next and previous nodes + aNode.Previous = aAfterNode; // [B] + aNode.Next = nextNode; // [C] + + // Update [C]'s previous node + if ( nextNode != null ) + { + nextNode.Previous = aNode; // [X] + } + + // Ensure child is added to children array at + // the correct position. + aNode.Parent = this; + InsertNodeAfterSpecificChild( aNode, aAfterNode ); + } + } + + public void RemoveChild( SymNode aChild ) + { + if ( IsChild( aChild ) ) + { + int index = ChildIndex( aChild ); + Children.RemoveAt( index ); + aChild.Parent = null; + } + } + + public bool IsChild( SymNode aNode ) + { + bool found = false; + // + if ( iChildren != null ) + { + found = ( ChildIndex( aNode ) >= 0 ); + } + // + return found; + } + + public int ChildIndex( SymNode aNode ) + { + int index = iChildren.IndexOf( aNode ); + return index; + } + + public bool ChildTypeExists( System.Type aType ) + { + bool found = false; + SymNodeEnumeratorChildren iterator = new SymNodeEnumeratorChildren( this ); + // + foreach( SymNode node in iterator ) + { + if ( node.GetType() == aType ) + { + found = true; + break; + } + } + // + return found; + } + + public object ChildByType( System.Type aType ) + { + object ret = null; + SymNodeEnumeratorChildren iterator = new SymNodeEnumeratorChildren( this ); + // + foreach( SymNode node in iterator ) + { + if ( node.GetType() == aType ) + { + ret = node; + break; + } + } + // + return ret; + } + + public object ChildByType( System.Type aType, ref int aStartIndex ) + { + object ret = null; + int count = iChildren.Count; + for(; aStartIndex Children + { + get + { + if ( iChildren == null ) + { + CreateChildrenListNow( Granularity ); + } + // + return iChildren; + } + } + + public SymNode FirstChild + { + get + { + SymNode ret = null; + // + if ( iChildren != null && iChildren.Count > 0 ) + { + ret = iChildren[ 0 ]; + } + // + return ret; + } + } + + public SymNode LastChild + { + get + { + SymNode ret = null; + // + if ( iChildren != null && iChildren.Count > 0 ) + { + ret = iChildren[ iChildren.Count - 1 ]; + } + // + return ret; + } + } + + public int ChildCount + { + get + { + int count = 0; + // + if ( iChildren != null ) + { + count = Children.Count; + } + // + return count; + } + } + + public SymNode this[ int aIndex ] + { + get + { + return iChildren[ aIndex ]; + } + } + #endregion + + #region Properties - siblings + public SymNode Next + { + get { return iNext; } + set { iNext = value; } + } + + public SymNode Previous + { + get { return iPrevious; } + set { iPrevious = value; } + } + + public SymNode FirstSibling + { + get + { + SymNode sibling = this; + while( sibling.HasPrevious ) + { + sibling = sibling.Previous; + } + // + return sibling; + } + } + + public SymNode LastSibling + { + get + { + SymNode sibling = this; + while( sibling.HasNext ) + { + sibling = sibling.Next; + } + // + return sibling; + } + } + + public int SiblingCount + { + get + { + int count = 1; + + // Work backwards first + SymNode node = this; + while( node.HasPrevious ) + { + node = node.Previous; + ++count; + } + + // Try all nodes after the current one + node = this; + while( node.HasNext ) + { + node = node.Next; + ++count; + } + + return count; + } + } + #endregion + + #region Properties - relationships + public bool IsRoot + { + get { return Parent == null; } + } + + public bool HasParent + { + get { return iParent != null; } + } + + public bool HasNext + { + get { return iNext != null; } + } + + public bool HasPrevious + { + get { return iPrevious != null; } + } + + public bool HasChildren + { + get { return ( iChildren != null && iChildren.Count > 0 ); } + } + #endregion + + #region Properties - misc + public static int Granularity + { + get { return iGranularity; } + set { iGranularity = value; } + } + #endregion + + #region IEnumerable Members + IEnumerator IEnumerable.GetEnumerator() + { + return new SymNodeEnumeratorChildren( this ); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return new SymNodeEnumeratorChildren( this ); + } + #endregion + + #region Internal constants + const int KSymNodeDefaultChildrenGranularity = 10; + #endregion + + #region Internal methods + protected void CreateChildrenListNow( int aGranularity ) + { + iChildren = new List( aGranularity ); + } + + private void InsertNodeAfterSpecificChild( SymNode aNode, SymNode aAfterNode ) + { + int index = 0; + // + if ( aAfterNode != null ) + { + System.Diagnostics.Debug.Assert( DbgCheckNodeIsAChild( aAfterNode ) ); + index = ChildIndex( aAfterNode ); + } + // + iChildren.Insert( index + 1, aNode ); + aNode.Parent = this; + } + #endregion + + #region Debug checks + private bool DbgCheckNodeIsAChild( SymNode aNode ) + { + System.Diagnostics.Debug.Assert( aNode != this ); + System.Diagnostics.Debug.Assert( iChildren != null && iChildren.Count > 0 ); + + int index = ChildIndex( aNode ); + if ( index < 0 || index >= ChildCount ) + { + System.Diagnostics.Debug.Assert( false, "The specified node is not a child of the current node" ); + } + return (index >= 0 && index < ChildCount ); + } + + private bool DbgCheckNodeIsASibling( SymNode aNode ) + { + System.Diagnostics.Debug.Assert( aNode != this ); + System.Diagnostics.Debug.Assert( HasNext || HasPrevious ); + + // Work backwards first + SymNode node = this; + while( node.HasPrevious ) + { + node = node.Previous; + if ( node == aNode ) + { + return true; + } + } + + // Try all nodes after the current one + node = this; + while( node.HasNext ) + { + node = node.Next; + if ( node == aNode ) + { + return true; + } + } + + System.Diagnostics.Debug.Assert( false, "The specified node is not a sibling of the current node" ); + return false; + } + #endregion + + #region Data members + private object iData; + private SymNode iParent; + private SymNode iNext; + private SymNode iPrevious; + private List iChildren; + private static int iGranularity = KSymNodeDefaultChildrenGranularity; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/Nodes/SymNodeAddAsChild.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/Nodes/SymNodeAddAsChild.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Xml; +using System.Collections; + +namespace SymbianTree +{ + public class SymNodeAddAsChild : SymNode + { + #region Constructors + public SymNodeAddAsChild() + { + } + + public SymNodeAddAsChild( SymNode aParent ) + : base( aParent ) + { + } + + public SymNodeAddAsChild( object aData ) + : base( aData ) + { + } + + public SymNodeAddAsChild( object aData, SymNode aParent ) + : base( aData, aParent ) + { + } + #endregion + + #region From SymNode + public override void Add( SymNode aNode ) + { + AppendChild( aNode ); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/Nodes/SymNodeAddAsSibling.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/Nodes/SymNodeAddAsSibling.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Xml; +using System.Collections; + +namespace SymbianTree +{ + public class SymNodeAddAsSibling : SymNode + { + #region Constructors + public SymNodeAddAsSibling() + { + } + + public SymNodeAddAsSibling( SymNode aParent ) + : base( aParent ) + { + } + + public SymNodeAddAsSibling( object aData ) + : base( aData ) + { + } + + public SymNodeAddAsSibling( object aData, SymNode aParent ) + : base( aData, aParent ) + { + } + #endregion + + #region From SymNode + public override void Add( SymNode aNode ) + { + AppendSibling( aNode ); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/Nodes/SymNodeEnumerators.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/Nodes/SymNodeEnumerators.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,378 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace SymbianTree +{ + #region SymNodeEnumeratorSiblings + public class SymNodeEnumeratorSiblings : IEnumerator, IEnumerable + { + #region Constructors + public SymNodeEnumeratorSiblings( SymNode aNodeToEnumerate ) + { + iNode = aNodeToEnumerate; + } + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + return this; + } + + IEnumerator IEnumerable.GetEnumerator() + { + return this; + } + #endregion + + #region IEnumerator Members + void IEnumerator.Reset() + { + iCurrentNode = null; + } + + object IEnumerator.Current + { + get + { + return iCurrentNode; + } + } + + bool IEnumerator.MoveNext() + { + if ( iCurrentNode == null ) + { + iCurrentNode = iNode; + } + else + { + iCurrentNode = iCurrentNode.Next; + } + + bool haveMoreNodes = ( iCurrentNode.Next != null ); + return haveMoreNodes; + } + #endregion + + #region From IEnumerator + SymNode IEnumerator.Current + { + get { return iCurrentNode; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly SymNode iNode; + private SymNode iCurrentNode = null; + #endregion + } + #endregion + + #region SymNodeEnumeratorChildren + public class SymNodeEnumeratorChildren : IEnumerator, IEnumerable + { + #region Constructors + public SymNodeEnumeratorChildren( SymNode aNodeToEnumerate ) + { + iNode = aNodeToEnumerate; + } + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + return this; + } + + IEnumerator IEnumerable.GetEnumerator() + { + return this; + } + #endregion + + #region IEnumerator Members + void IEnumerator.Reset() + { + iEnumeratorIndex = -1; + } + + object IEnumerator.Current + { + get + { + return iNode.Children[ iEnumeratorIndex ]; + } + } + + bool IEnumerator.MoveNext() + { + return ( ++iEnumeratorIndex < iNode.ChildCount ); + } + #endregion + + #region From IEnumerator + SymNode IEnumerator.Current + { + get { return iNode.Children[ iEnumeratorIndex ]; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly SymNode iNode; + private int iEnumeratorIndex = -1; + #endregion + } + #endregion + + #region SymNodeEnumeratorTreeChildrenFirst + public class SymNodeEnumeratorTreeChildrenFirst : IEnumerator, IEnumerable + { + #region Constructors + public SymNodeEnumeratorTreeChildrenFirst( SymNode aStartingNode ) + { + iStartingNode = aStartingNode; + } + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + return this; + } + + IEnumerator IEnumerable.GetEnumerator() + { + return this; + } + #endregion + + #region IEnumerator Members + void IEnumerator.Reset() + { + iCurrentNode = null; + } + + object IEnumerator.Current + { + get + { + return iCurrentNode; + } + } + + bool IEnumerator.MoveNext() + { + iCurrentNode = NextNode( iCurrentNode ); + + bool haveMoreNodes = ( NextNode( iCurrentNode ) != null ); + return haveMoreNodes; + } + #endregion + + #region From IEnumerator + SymNode IEnumerator.Current + { + get { return iCurrentNode; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Internal methods + private SymNode NextNode( SymNode aCurrentNode ) + { + SymNode nextNode = null; + // + if ( aCurrentNode == null ) + { + nextNode = iStartingNode; + } + else + { + #region Example + // + // [A] + // / + // / + // [B] + // / | \ + // / | \ + // [C] [E] [I] + // / / \ \ + // / / \ \ + // [D] [F] [H] [J] + // / + // / + // [G] + // + // Navigation plan: + // + // [A] -> [B] -> [C] -> [D] -> [E] -> [F] -> [G] -> [H] -> [I] -> [J] + // + #endregion + + if ( aCurrentNode.HasChildren ) + { + // Try to visit the node's children first. + nextNode = aCurrentNode.FirstChild; + } + else + { + // No children... + if ( aCurrentNode.HasNext ) + { + // Go to next sibling + nextNode = aCurrentNode.Next; + } + else + { + // No (more) siblings - go to parent's next sibling. + // For example, in the case of the current node being [G] + // we need to traverse seemlessly to [H]. Therefore + // we go from [G] -> [F] -> [H] + nextNode = aCurrentNode.Parent; // [F] + while( nextNode != null && nextNode.HasNext == false ) + { + nextNode = nextNode.Parent; + } + + // We'll now be at [F] + if ( nextNode != null ) + { + // Now we'll be at [H] + nextNode = nextNode.Next; + } + } + } + } + // + return nextNode; + } + #endregion + + #region Data members + private readonly SymNode iStartingNode; + private SymNode iCurrentNode = null; + #endregion + } + #endregion + + #region SymNodeEnumeratorUpTreeSiblingsFirst + public class SymNodeEnumeratorUpTreeSiblingsFirst : IEnumerator, IEnumerable + { + #region Constructors + public SymNodeEnumeratorUpTreeSiblingsFirst( SymNode aStartingNode ) + { + iStartingNode = aStartingNode.FirstSibling; + } + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + return this; + } + + IEnumerator IEnumerable.GetEnumerator() + { + return this; + } + #endregion + + #region IEnumerator Members + void IEnumerator.Reset() + { + iCurrentNode = null; + } + + object IEnumerator.Current + { + get + { + return iCurrentNode; + } + } + + bool IEnumerator.MoveNext() + { + if ( iCurrentNode == null ) + { + iCurrentNode = iStartingNode; + } + else + { + if ( iCurrentNode.HasNext ) + { + iCurrentNode = iCurrentNode.Next; + } + else + { + iCurrentNode = iCurrentNode.Parent.FirstSibling; + } + + System.Diagnostics.Debug.Assert( iCurrentNode != null ); + } + + bool haveMoreNodes = iCurrentNode.HasNext; + if ( haveMoreNodes == false ) + { + haveMoreNodes = iCurrentNode.HasParent; + } + return haveMoreNodes; + } + #endregion + + #region From IEnumerator + SymNode IEnumerator.Current + { + get { return iCurrentNode; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly SymNode iStartingNode; + private SymNode iCurrentNode = null; + #endregion + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/SymbianTree.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/SymbianTree.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,115 @@ + + + Local + 9.0.30729 + 2.0 + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8} + Debug + AnyCPU + + + + + SymbianTree + + + JScript + Grid + IE50 + false + Library + SymbianTree + OnBuildSuccess + + + + + + + 2.0 + + + bin\Debug\ + false + 285212672 + false + + + DEBUG;TRACE + + + true + 4096 + false + + + false + false + false + false + 4 + full + prompt + + + bin\Release\ + false + 285212672 + false + + + TRACE + + + false + 4096 + false + + + true + false + false + false + 4 + none + prompt + + + + System + + + System.Data + + + System.XML + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/SymbianTree.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianTree/SymbianTree.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ + + + 7.10.6030 + Debug + AnyCPU + + + + + + + 0 + ProjectFiles + 0 + + + false + false + false + false + false + + + Project + + + + + + + + + + + true + + + false + false + false + false + false + + + Project + + + + + + + + + + + true + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Assemblies/AssemblyHelper.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Assemblies/AssemblyHelper.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; +using System.Runtime.InteropServices; +using System.Reflection; + +namespace SymbianUtils.Assemblies +{ + public static class AssemblyHelper + { + #region API + public static bool IsCLRAssembly( string aFileName ) + { + bool ret = false; + // + try + { + Assembly anAssembly = Assembly.LoadFrom( aFileName ); + ret = true; + } + catch ( BadImageFormatException ) + { + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymAddress.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymAddress.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.BasicTypes +{ + public class SymAddress + { + #region Constructors + public SymAddress() + : this( 0 ) + { + } + + public SymAddress( uint aValue ) + { + iAddress = aValue; + } + #endregion + + #region API + #endregion + + #region Properties + public uint Address + { + get { return iAddress; } + set { iAddress = value; } + } + + public virtual string AddressBinary + { + get + { + string ret = SymBitUtils.BeautifyBits( iAddress, 32 ); + return ret; + } + } + + public virtual string AddressHex + { + get + { + string ret = this.Address.ToString( "x8" ); + return ret; + } + } + #endregion + + #region Operators + public static implicit operator uint( SymAddress aAddress ) + { + return aAddress.Address; + } + #endregion + + #region From System.Object + public override string ToString() + { + string ret = AddressHex; + return ret; + } + #endregion + + #region Data members + private uint iAddress = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymAddressWithKnownBits.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymAddressWithKnownBits.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.BasicTypes +{ + public class SymAddressWithKnownBits : SymAddress + { + #region Constructors + public SymAddressWithKnownBits() + : this( 0 ) + { + } + + public SymAddressWithKnownBits( uint aAddress ) + : base( aAddress ) + { + } + #endregion + + #region API + public void SetKnownAddressBits( uint aAddress, int aNumberOfValidBits ) + { + // First build a bit mask of all the bits which we want to keep + // from the currently maintained address. + uint mask = 0; + for ( int i = 31; i >= aNumberOfValidBits; i-- ) + { + mask |= (uint) ( 1u << i ); + } + + // aNumberOfValidBits = 0xe + // mask is 0xffffc000 + // base.Address is 0x802e20ac + + // 11111111 11111111 11000000 00000000 = mask + // 10000000 00101110 01100110 10101100 + // 10000000 00101110 01000000 00000000 + + // Next, we want to apply that mask to the current address + // in order to prepare for the new values. + // + // I.e. preserve any bits we know but aren't changing, and then + // clear all other bits that we're about to set below. + base.Address &= mask; + + // Now we can merge in the new bits + base.Address |= aAddress; + + // Save how many valid bits of the address we currently have for debugging + // purposes + iKnownBits = Math.Max( iKnownBits, aNumberOfValidBits ); + System.Diagnostics.Debug.Assert( iKnownBits >= 0 && iKnownBits <= 32 ); + } + #endregion + + #region Properties + public int KnownBits + { + get { return iKnownBits; } + set { iKnownBits = value; } + } + + public bool IsKnown + { + get { return iKnownBits == 32; } + } + + public bool IsPartial + { + get { return iKnownBits > 0; } + } + + public bool IsUnknown + { + get { return iKnownBits == 0; } + } + + public override string AddressBinary + { + get + { + string ret = SymBitUtils.BeautifyBits( base.Address, iKnownBits ); + return ret; + } + } + + public override string AddressHex + { + get + { + // Work out how many nibbles we have + int validNibbles = 0; + for ( ; validNibbles < iKnownBits; validNibbles += 4 ) + { + } + validNibbles /= 4; // Convert bits to nibbles + int invalidNibbles = 8 - validNibbles; + + StringBuilder text = new StringBuilder(); + text.Append( string.Empty.PadLeft( invalidNibbles, '?' ) ); + text.Append( base.Address.ToString( string.Format( "x{0}", validNibbles ) ) ); + text.Length = Math.Min( 8, text.Length ); + return text.ToString(); + } + } + #endregion + + #region Operators + public static implicit operator uint( SymAddressWithKnownBits aAddress ) + { + return aAddress.Address; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private int iKnownBits = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymBit.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymBit.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.BasicTypes +{ + public enum SymBit + { + ESet = 1, + EClear = 0 + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymBitUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymBitUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.BasicTypes +{ + public static class SymBitUtils + { + #region API + public static uint CreateMask( string aBinary ) + { + uint value; + return CreateMask( aBinary, out value ); + } + + public static uint CreateMask( string aBinary, out uint aExpectedValue ) + { + uint mask = 0; + aExpectedValue = 0; + + int bit = 0; + int count = aBinary.Length; + for ( int charIndex = count - 1; charIndex >= 0; charIndex-- ) + { + // Get a character from the string + char c = Char.ToLower( aBinary[ charIndex ] ); + // + if ( c == SymBitUtils.KBitIsSet ) + { + mask |= (uint) ( 1 << bit ); + aExpectedValue |= (uint) ( 1 << bit ); + } + else if ( c == SymBitUtils.KBitIsClear ) + { + mask |= (uint) ( 1 << bit ); + } + else if ( c == SymBitUtils.KBitIsNotApplicable1 || c == SymBitUtils.KBitIsNotApplicable2 ) + { + } + // + if ( c != SymBitUtils.KBitIsReadabilitySpacer ) + { + ++bit; + } + } + // + return mask; + } + + public static byte CreateMask( string aBinary, out byte aExpectedValue ) + { + uint value; + uint ret = CreateMask( aBinary, out value ); + // + if ( ret > 0xFF || value > 0xFF ) + { + throw new ArgumentException( "Binary sequence is too large to fit byte" ); + } + // + aExpectedValue = (byte) value; + return (byte) ret; + } + + public static SymByte CreateMask( string aBinary, out SymByte aExpectedValue ) + { + byte value = 0; + SymByte ret = CreateMask( aBinary, out value ); + aExpectedValue = value; + return ret; + } + + public static string GetBits( byte aByte ) + { + string ret = System.Convert.ToString( aByte, 2 ).PadLeft( 8, KBitIsClear ); + return ret; + } + + public static uint StringToUint( string aText ) + { + uint ret = 0; + // + int bit = 0; + int count = aText.Length; + for ( int charIndex = count - 1; charIndex >= 0; charIndex--, ++bit ) + { + char c = char.ToLower( aText[ charIndex ] ); + // + if ( c == KBitIsSet ) + { + uint mergeIn = (uint) ( 1 << bit ); + ret |= mergeIn; + } + } + // + return ret; + } + + public static string BeautifyBits( uint aAddress, int aNumberOfKnownBits ) + { + string binAddress = System.Convert.ToString( aAddress, 2 ); + // + binAddress = binAddress.PadLeft( 32, '0' ); + binAddress = binAddress.Substring( 32 - aNumberOfKnownBits, aNumberOfKnownBits ); + binAddress = binAddress.PadLeft( 32, 'x' ); + binAddress = BeautifyBits( binAddress ); + // + return binAddress; + } + + public static string BeautifyBits( string aBits ) + { + StringBuilder ret = new StringBuilder( aBits.PadLeft( 32, 'x' ) ); + ret.Insert( 24, ' ' ); + ret.Insert( 16, ' ' ); + ret.Insert( 08, ' ' ); + return ret.ToString(); + } + + public static uint RotateRight( uint aValue, int aCount ) + { + uint ret = aValue; + // + for ( int i = 0; i < aCount; i++ ) + { + bool bitZeroSet = ( ( ret & 0x1 ) == 0x1 ); + ret >>= 1; + // + if ( bitZeroSet ) + { + // Wrap the bit around by appling it at the top end + ret |= KTopBit; + } + } + // + return ret; + } + + public static SymBit GetBit( uint aValue, int aBitNumber ) + { + uint mask = 1u << aBitNumber; + uint value = aValue & mask; + SymBit ret = ( value != 0 ) ? SymBit.ESet : SymBit.EClear; + return ret; + } + #endregion + + #region Internal constants + internal const char KBitIsSet = '1'; + internal const char KBitIsClear = '0'; + internal const char KBitIsNotApplicable1 = '#'; + internal const char KBitIsNotApplicable2 = 'x'; + internal const char KBitIsReadabilitySpacer = ' '; + private const uint KTopBit = 0x80000000; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymByte.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymByte.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.BasicTypes +{ + public class SymByte + { + #region Constructors + public SymByte( byte aValue ) + { + iValue = aValue; + } + + public SymByte( string aBinary ) + { + iValue = (byte) SymBitUtils.CreateMask( aBinary ); + } + #endregion + + #region API + public bool IsMatch( string aBinary ) + { + SymByte value = 0; + SymByte mask = SymBitUtils.CreateMask( aBinary, out value ); + bool ret = ( mask & iValue ) == value; + return ret; + } + + public SymByte LowestBits( int aCount ) + { + // Make the mask + byte mask = 0; + for ( int i = 0; i < aCount; i++ ) + { + mask |= (byte) ( 0x1 << i ); + } + + // Apply it + byte ret = (byte) ( iValue & mask ); + return new SymByte( ret ); + } + + public SymByte HighestBitsShiftedRight( int aCount ) + { + // Make the mask + byte mask = 0; + for ( int i = 7; i >=0; i-- ) + { + mask |= (byte) ( 0x1 << i ); + } + + // Apply it + byte ret = (byte) ( iValue & mask ); + + // Shift + ret >>= aCount; + + return new SymByte( ret ); + } + + public void RShift( int aBits ) + { + iValue >>= aBits; + } + + public uint LShift( int aBits ) + { + uint ret = (uint) ( iValue << aBits ); + return ret; + } + #endregion + + #region Properties + public byte Value + { + get { return iValue; } + set { iValue = value; } + } + + public string Binary + { + get + { + StringBuilder ret = new StringBuilder(); + ret.Append( Convert.ToString( Value, 2 ).PadLeft( 8, '0' ) ); + return ret.ToString(); + } + } + + public bool this[ int aIndex ] + { + get + { + byte mask = (byte) ( 0x1 << aIndex ); + bool set = ( mask & Value ) == mask; + return set; + } + } + #endregion + + #region Operators + public static implicit operator byte( SymByte aByte ) + { + return aByte.Value; + } + + public static implicit operator SymByte( byte aByte ) + { + return new SymByte( aByte ); + } + + public static bool operator ==( SymByte aLeft, SymByte aRight ) + { + bool result = aLeft.Value == aRight.Value; + return result; + } + + public static bool operator !=( SymByte aLeft, SymByte aRight ) + { + bool result = !( aLeft == aRight ); + return result; + } + + public static SymByte operator &( SymByte aLeft, SymByte aRight ) + { + byte result = (byte) ( aLeft.Value & aRight.Value ); + return new SymByte( result ); + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "{0:x2} [{1}]", iValue, System.Convert.ToString( iValue, 2 ).PadLeft( 8, '0' ) ); + return ret.ToString(); + } + + public override bool Equals( object aObject ) + { + bool ret = false; + // + if ( aObject != null && aObject is SymByte ) + { + SymByte other = (SymByte) aObject; + ret = ( other.Value == this.Value ); + } + // + return ret; + } + + public override int GetHashCode() + { + return iValue.GetHashCode(); + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private byte iValue = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymMask.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymMask.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,123 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.BasicTypes +{ + public class SymMask + { + #region Enumerations + public enum TShiftDirection + { + ELeft = 0, + ERight + } + #endregion + + #region Constructors + public SymMask( string aBinary ) + { + iMaskingBits = SymBitUtils.CreateMask( aBinary, out iExpectedValueAfterMasking ); + } + + public SymMask( string aBinary, TShiftDirection aDirection, uint aCount ) + : this( aBinary ) + { + if ( aDirection == TShiftDirection.ELeft ) + { + iShift = -Convert.ToInt32( aCount ); + } + else + { + iShift = Convert.ToInt32( aCount ); + } + } + + public SymMask( uint aMask ) + : this( aMask, aMask, TShiftDirection.ELeft, 0 ) + { + } + + public SymMask( uint aMask, TShiftDirection aDirection, int aCount ) + : this( aMask, aMask, aDirection, aCount ) + { + } + + public SymMask( uint aMask, uint aValue, TShiftDirection aDirection, int aCount ) + { + iMaskingBits = aMask; + iExpectedValueAfterMasking = aValue; + if ( aDirection == TShiftDirection.ELeft ) + { + iShift = -Convert.ToInt32( aCount ); + } + else + { + iShift = Convert.ToInt32( aCount ); + } + } + #endregion + + #region API + public bool IsMatch( uint aValue ) + { + // 101 0 000000000000000000000000 + // 111 0 000000000000000000000000 + // 1110 010 1 100111110000000000111100 + bool ret = ( aValue & iMaskingBits ) == iExpectedValueAfterMasking; + return ret; + } + + public uint Apply( uint aValue ) + { + uint ret = ( iMaskingBits & aValue ); + if ( iShift != 0 ) + { + if ( iShift < 0 ) + { + ret <<= iShift; + } + else + { + ret >>= iShift; + } + } + return ret; + } + #endregion + + #region Properties + #endregion + + #region Operators + #endregion + + #region From System.Object + #endregion + + #region Internal methods + #endregion + + #region Data members + private int iShift = 0; + private uint iMaskingBits = 0; + private uint iExpectedValueAfterMasking = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymUInt.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/BasicTypes/SymUInt.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,415 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.BasicTypes +{ + public class SymUInt32 : SymUIntBase + { + #region Constructors + public SymUInt32( uint aValue ) + : base( aValue, 32 ) + { + } + + public SymUInt32( string aBinary ) + : base( aBinary, 32 ) + { + } + #endregion + + #region Operators + public static SymUInt32 operator &( SymUInt32 aLeft, SymUInt32 aRight ) + { + uint val = aLeft.RawValue & aRight.RawValue; + return new SymUInt32( val ); + } + + public static implicit operator SymUInt32( uint aBasicType ) + { + return new SymUInt32( aBasicType ); + } + #endregion + } + + public class SymUInt16 : SymUIntBase + { + #region Constructors + public SymUInt16( ushort aValue ) + : base( aValue, 16 ) + { + } + + public SymUInt16( string aBinary ) + : base( aBinary, 16 ) + { + } + #endregion + + #region Operators + public static SymUInt16 operator &( SymUInt16 aLeft, SymUInt16 aRight ) + { + ushort val = Convert.ToUInt16( aLeft.RawValue & aRight.RawValue ); + return new SymUInt16( val ); + } + public static implicit operator SymUInt16( ushort aBasicType ) + { + return new SymUInt16( aBasicType ); + } + #endregion + } + + public class SymUInt8 : SymUIntBase + { + #region Constructors + public SymUInt8( byte aValue ) + : base( aValue, 8 ) + { + } + + public SymUInt8( string aBinary ) + : base( aBinary, 8 ) + { + } + #endregion + + #region Operators + public static SymUInt8 operator &( SymUInt8 aLeft, SymUInt8 aRight ) + { + byte val = Convert.ToByte( aLeft.RawValue & aRight.RawValue ); + return new SymUInt8( val ); + } + + public static implicit operator SymUInt8( byte aBasicType ) + { + return new SymUInt8( aBasicType ); + } + #endregion + } + + public abstract class SymUIntBase : IFormattable + { + #region Constructors + protected SymUIntBase() + { + } + + protected SymUIntBase( string aBinary, int aNumberOfBits ) + { + iValue = SymBitUtils.CreateMask( aBinary ); + iNumberOfBits = aNumberOfBits; + } + + protected SymUIntBase( uint aValue, int aNumberOfBits ) + { + iValue = aValue; + iNumberOfBits = aNumberOfBits; + } + #endregion + + #region API + public bool IsMatch( string aBinary ) + { + uint value = 0; + uint mask = SymBitUtils.CreateMask( aBinary, out value ); + bool ret = ( mask & iValue ) == value; + return ret; + } + + public uint RShift( int aBits ) + { + uint v = iValue; + v >>= aBits; + this.RawValue = v; + return v; + } + + public uint LShift( int aBits ) + { + uint v = (uint) ( iValue << aBits ); + this.RawValue = v; + return v; + } + + public SymUInt32 RotateRight( int aCount ) + { + uint ret = iValue; + // + for ( int i = 0; i < aCount; i++ ) + { + bool bitZeroSet = ( ( ret & 0x1 ) == 0x1 ); + ret >>= 1; + // + if ( bitZeroSet ) + { + // Wrap the bit around by appling it at the top end + ret |= KTopBit; + } + } + // + return new SymUInt32( ret ); + } + + public uint ToUInt() + { + return iValue; + } + #endregion + + #region Properties + public int NumberOfBits + { + get { return iNumberOfBits; } + protected set + { + switch ( value ) + { + default: + throw new ArgumentException( "Number of bits must be 8, 16 or 32" ); + case 8: + case 16: + case 32: + iNumberOfBits = value; + break; + } + } + } + + public int NumberOfBytes + { + get { return NumberOfBits / 4; } + set + { + this.NumberOfBits = value * 8; + } + } + + public uint MaxValue + { + get + { + uint ret = uint.MaxValue; + if ( iNumberOfBits == 16 ) + { + ret = ushort.MaxValue; + } + else if ( iNumberOfBits == 8 ) + { + ret = byte.MaxValue; + } + return ret; + } + } + + public string Binary + { + get + { + string bits = SymBitUtils.BeautifyBits( iValue, iNumberOfBits ); + return bits; + } + } + + public string Hex + { + get + { + string hex = iValue.ToString( string.Format( "x{0}", this.NumberOfBytes * 2 ) ); + return hex; + } + } + + public SymBit this[ int aIndex ] + { + get + { + if ( aIndex < 0 || aIndex > iNumberOfBits ) + { + throw new ArgumentException( "Specified bit is out of bounds" ); + } + + uint mask = ( 1u << aIndex ); + SymBit ret = ( ( mask & iValue ) == mask ) ? SymBit.ESet : SymBit.EClear; + return ret; + } + } + + public SymUInt32 this[ int aHighBitIndex, int aLowBitIndex ] + { + get + { + if ( aHighBitIndex < aLowBitIndex ) + { + throw new ArgumentException( "High bit index must be less than low bit index" ); + } + + // Build mask + uint mask = 0; + for ( int i = aLowBitIndex; i <= aHighBitIndex; i++ ) + { + mask |= ( 1u << i ); + } + + uint ret = iValue & mask; + + // Shift + ret >>= aLowBitIndex; + + return new SymUInt32( ret ); + } + } + #endregion + + #region Operators + public static implicit operator uint( SymUIntBase aObject ) + { + return aObject.RawValue; + } + + public static implicit operator ushort( SymUIntBase aObject ) + { + ushort ret = Convert.ToUInt16( aObject.RawValue ); + return ret; + } + + public static implicit operator byte( SymUIntBase aObject ) + { + byte ret = Convert.ToByte( aObject.RawValue ); + return ret; + } + + public static bool operator ==( SymUIntBase aLeft, SymUIntBase aRight ) + { + // If both are null, or both are same instance, return true. + if ( System.Object.ReferenceEquals( aLeft, aRight ) ) + { + return true; + } + + // If one is null, but not both, return false. + if ( ( (object) aLeft == null ) || ( (object) aRight == null ) ) + { + return false; + } + + bool ret = aLeft.Equals( aRight ); + return ret; + } + + public static bool operator !=( SymUIntBase aLeft, SymUIntBase aRight ) + { + bool result = !( aLeft == aRight ); + return result; + } + + public static SymUInt32 operator &( SymUIntBase aLeft, SymUIntBase aRight ) + { + uint val = ( aLeft.RawValue & aRight.RawValue ); + return new SymUInt32( val ); + } + #endregion + + #region IFormattable Members + public string ToString( string aFormat, IFormatProvider aFormatProvider ) + { + if ( aFormatProvider != null ) + { + ICustomFormatter formatter = aFormatProvider.GetFormat( this.GetType() ) as ICustomFormatter; + if ( formatter != null ) + { + return formatter.Format( aFormat, this, aFormatProvider ); + } + } + + string ret = string.Empty; + string format = aFormat != null ? aFormat : "full"; + // + switch ( format ) + { + case "full": + ret = string.Format( "0x{0} [{1}]", Hex, Binary ); + break; + default: + ret = iValue.ToString( aFormat, aFormatProvider ); + break; + } + // + return ret; + } + #endregion + + #region From System.Object + public override string ToString() + { + return ToString( null ); + } + + public string ToString( string aFormat ) + { + return ToString( aFormat, null ); + } + + public override bool Equals( object aObject ) + { + bool ret = false; + // + if ( aObject != null && aObject is SymUIntBase ) + { + SymUIntBase other = (SymUIntBase) aObject; + // + if ( other.NumberOfBits == this.NumberOfBits ) + { + ret = ( other.RawValue == this.RawValue ); + } + } + // + return ret; + } + + public override int GetHashCode() + { + return iValue.GetHashCode(); + } + #endregion + + #region Internal properties & methods + protected uint RawValue + { + get { return iValue; } + set + { + if ( value > MaxValue ) + { + throw new ArgumentException( string.Format( "Specified value {0} exceeds bit range ({1})", value, this.NumberOfBits ) ); + } + iValue = value; + } + } + #endregion + + #region Internal constants + private const uint KTopBit = 0x80000000; + #endregion + + #region Data ember + private uint iValue = 0; + private int iNumberOfBits = 32; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Collections/SymbianSortedListByValue.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Collections/SymbianSortedListByValue.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,225 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; + +namespace SymbianUtils.Collections +{ + public class SymbianSortedListByValue where TValue : class + { + #region Constructors + public SymbianSortedListByValue( IComparer aComparer ) + : this( 10, aComparer ) + { + } + + public SymbianSortedListByValue( int aGranularity, IComparer aComparer ) + { + iList = new List>( aGranularity ); + iComparer = new SymbianSortedListByValueComparer( aComparer ); + } + + public SymbianSortedListByValue( SymbianSortedListByValue aCollection ) + { + int count = aCollection.Count; + // + iList = new List>( count + 1 ); + iComparer = new SymbianSortedListByValue.SymbianSortedListByValueComparer( aCollection.iComparer.Comparer ); + // + for ( int i = 0; i < count; i++ ) + { + KeyValuePair entry = aCollection.iList[ i ]; + Add( entry.Value, entry.Key ); + } + } + #endregion + + #region API + public bool Contains( TKey aKey ) + { + return iDictionary.ContainsKey( aKey ); + } + + public void Add( TKey aKey, TValue aValue ) + { + if ( aKey == null ) + { + throw new ArgumentNullException( "aKey cannot be null" ); + } + + // Add item to dictionary if required + if ( !iDictionary.ContainsKey( aKey ) ) + { + iDictionary.Add( aKey, aValue ); + } + + // Search for item in the list. If it's already present then + // this will return the index. Otherwise, it will return a negative + // number. + // If this index is greater than or equal to the size of the array, + // there are no elements larger than value in the array. + // + // Otherwise, it is the index of the first element that is larger than value. + KeyValuePair entry = new KeyValuePair( aValue, aKey ); + int index = iList.BinarySearch( entry, iComparer ); + if ( index < 0 ) + { + index = ~index; + } + iList.Insert( index, entry ); + } + + public void Remove( Predicate aValue ) + { + Predicate> matchPredicate = delegate( KeyValuePair aItem ) + { + bool remove = aValue.Invoke( aItem.Key ); + return remove; + }; + + RemoveAll( matchPredicate ); + } + + public void Remove( TValue aValue ) + { + Predicate> matchPredicate = delegate( KeyValuePair aItem ) + { + return ( aValue == aItem.Key ); + }; + + RemoveAll( matchPredicate ); + } + + public void Remove( TKey aKey ) + { + TValue v = null; + if ( iDictionary.TryGetValue( aKey, out v ) ) + { + iDictionary.Remove( aKey ); + Remove( v ); + } + } + + public void Clear() + { + iList.Clear(); + iDictionary.Clear(); + } + + public void RemoveRange( int aStartIndex, int aCount ) + { + List> items = iList.GetRange( aStartIndex, aCount ); + RemoveAll( items ); + } + + public void Sort( IComparer aComparer ) + { + SymbianSortedListByValueComparer comparer = new SymbianSortedListByValueComparer( aComparer ); + iList.Sort( comparer ); + iComparer = comparer; + } + #endregion + + #region Properties + public int Count + { + get { return iList.Count; } + } + + public TValue this[ int aIndex ] + { + get + { + KeyValuePair< TValue, TKey> ret = iList[ aIndex ]; + return ret.Key; + } + } + + public TValue this[ TKey aKey ] + { + get + { + TValue ret = null; + bool found = iDictionary.TryGetValue( aKey, out ret ); + return ret; + } + } + #endregion + + #region Internal methods + private void RemoveAll( Predicate> aPredicate ) + { + List> items = iList.FindAll( aPredicate ); + RemoveAll( items ); + } + + private void RemoveAll( List> aItems ) + { + foreach ( KeyValuePair item in aItems ) + { + // Remove from dictionary + TKey key = item.Value; + if ( iDictionary.ContainsKey( key ) ) + { + iDictionary.Remove( key ); + } + + // Remove from list + TValue value = item.Key; + iList.Remove( item ); + } + } + #endregion + + #region Internal classes + private class SymbianSortedListByValueComparer : IComparer< KeyValuePair > + { + #region Constructors + public SymbianSortedListByValueComparer( IComparer aComparer ) + { + iComparer = aComparer; + } + #endregion + + #region Properties + public IComparer Comparer + { + get { return iComparer; } + } + #endregion + + #region From IComparer> + public int Compare( KeyValuePair aLeft, KeyValuePair aRight ) + { + int ret = iComparer.Compare( aLeft.Key, aRight.Key ); + return ret; + } + #endregion + + #region Data members + private readonly IComparer iComparer; + #endregion + } + #endregion + + #region Data members + private List< KeyValuePair > iList = null; + private Dictionary iDictionary = new Dictionary(); + private SymbianSortedListByValueComparer iComparer = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Colour/ColourGenerationUtil.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Colour/ColourGenerationUtil.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,214 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections.Generic; +using System.Drawing; + +namespace SymbianUtils.Colour +{ + public class ColourGenerationUtil + { + #region Constructors + public ColourGenerationUtil() + { + iStandardColors = CreateStandardColors(); + iBannedColors = CreateBannedColors(); + } + #endregion + + #region API + public Color GenerateRandomColour( Random aRandomNumberGenerator ) + { + Color ret = Color.White; + // + bool blackListed = false; + do + { + int colItemIndex = aRandomNumberGenerator.Next( (int) KnownColor.Aqua, (int) KnownColor.YellowGreen ); + KnownColor col = (KnownColor) colItemIndex; + // + blackListed = BannedColors.Contains( col ); + ret = Color.FromKnownColor( col ); + } + while ( blackListed ); + // + return ret; + } + + public Color GenerateRandomColourAndRemoveFromList() + { + int count = iStandardColors.Count; + System.Random random = new Random(); + int colItemIndex = random.Next( 0, count ); + Color ret = Color.FromKnownColor( iStandardColors[ colItemIndex ] ); + iStandardColors.RemoveAt( colItemIndex ); + return ret; + } + + public void SuplimentStandardColoursWithAdditionalEntries( int aRequiredEntryCount ) + { + // Pick colours at random from the standard colours until we have used them all + System.Random random = new Random(); + + // How many objects do we have to colourise? + int iterations = 0; + int maxIterations = (int) KnownColor.MenuHighlight - iBannedColors.Count; + while ( iStandardColors.Count < aRequiredEntryCount && iterations < maxIterations ) + { + int colItemIndex = random.Next( (int) KnownColor.Aqua, (int) KnownColor.YellowGreen ); + KnownColor col = (KnownColor) colItemIndex; + // + bool alreadyExists = iStandardColors.Contains( col ); + bool isBanned = iBannedColors.Contains( col ); + if ( !alreadyExists && !isBanned ) + { + iStandardColors.Add( col ); + } + + ++iterations; + } + + // If we still dont' have enough colours at this point, then just duplicate some of the + // known colours + iterations = 0; + maxIterations = iStandardColors.Count; + while ( iStandardColors.Count < aRequiredEntryCount ) + { + KnownColor col = iStandardColors[ iterations ]; + iStandardColors.Add( col ); + // + if ( iterations >= maxIterations ) + { + iterations = 0; + } + } + } + + public List CreateStandardColors() + { + List list = new List(); + // + list.Add( KnownColor.Red ); + list.Add( KnownColor.IndianRed ); + list.Add( KnownColor.Tomato ); + list.Add( KnownColor.SandyBrown ); + list.Add( KnownColor.Moccasin ); + list.Add( KnownColor.Gold ); + list.Add( KnownColor.Yellow ); + list.Add( KnownColor.YellowGreen ); + list.Add( KnownColor.LawnGreen ); + list.Add( KnownColor.ForestGreen ); + list.Add( KnownColor.Aquamarine ); + list.Add( KnownColor.LightSeaGreen ); + list.Add( KnownColor.Cyan ); + list.Add( KnownColor.SkyBlue ); + list.Add( KnownColor.DodgerBlue ); + list.Add( KnownColor.LightSteelBlue ); + list.Add( KnownColor.SlateBlue ); + list.Add( KnownColor.DarkOrchid ); + list.Add( KnownColor.Fuchsia ); + list.Add( KnownColor.Pink ); + // + return list; + } + + public List CreateBannedColors() + { + List list = new List(); + // + list.Add( KnownColor.Black ); + list.Add( KnownColor.LightGray ); + list.Add( KnownColor.White ); + list.Add( KnownColor.Gray ); + list.Add( KnownColor.GrayText ); + list.Add( KnownColor.DarkGray ); + list.Add( KnownColor.DimGray ); + list.Add( KnownColor.Azure ); + list.Add( KnownColor.Silver ); + list.Add( KnownColor.GhostWhite ); + list.Add( KnownColor.DarkKhaki ); + list.Add( KnownColor.DarkOliveGreen ); + list.Add( KnownColor.NavajoWhite ); + list.Add( KnownColor.Ivory ); + list.Add( KnownColor.Cornsilk ); + list.Add( KnownColor.Honeydew ); + list.Add( KnownColor.AliceBlue ); + list.Add( KnownColor.Gainsboro ); + list.Add( KnownColor.Beige ); + list.Add( KnownColor.Lavender ); + list.Add( KnownColor.FloralWhite ); + // + list.Add( KnownColor.Desktop ); + list.Add( KnownColor.AppWorkspace ); + list.Add( KnownColor.Transparent ); + list.Add( KnownColor.Bisque ); + list.Add( KnownColor.Control ); + list.Add( KnownColor.ControlText ); + list.Add( KnownColor.ControlDark ); + list.Add( KnownColor.ControlDarkDark ); + list.Add( KnownColor.ControlLight ); + list.Add( KnownColor.ControlLightLight ); + list.Add( KnownColor.ButtonFace ); + list.Add( KnownColor.ButtonHighlight ); + list.Add( KnownColor.ButtonShadow ); + list.Add( KnownColor.GradientActiveCaption ); + list.Add( KnownColor.GradientInactiveCaption ); + list.Add( KnownColor.HotTrack ); + list.Add( KnownColor.Menu ); + list.Add( KnownColor.MenuBar ); + list.Add( KnownColor.MenuHighlight ); + list.Add( KnownColor.MenuText ); + list.Add( KnownColor.ActiveBorder ); + list.Add( KnownColor.ActiveCaption ); + list.Add( KnownColor.ActiveCaptionText ); + list.Add( KnownColor.InactiveBorder ); + list.Add( KnownColor.InactiveCaption ); + list.Add( KnownColor.InactiveCaptionText ); + list.Add( KnownColor.Highlight ); + list.Add( KnownColor.HighlightText ); + list.Add( KnownColor.BlanchedAlmond ); + list.Add( KnownColor.Info ); + list.Add( KnownColor.InfoText ); + list.Add( KnownColor.Window ); + list.Add( KnownColor.WindowText ); + list.Add( KnownColor.WindowFrame ); + list.Add( KnownColor.ScrollBar ); + list.Add( KnownColor.LightBlue ); + // + return list; + } + #endregion + + #region Properties + public List StandardColors + { + get { return iStandardColors; } + } + + public List BannedColors + { + get { return iBannedColors; } + } + #endregion + + #region Data members + private readonly List iStandardColors; + private readonly List iBannedColors; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Colour/ColourUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Colour/ColourUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Windows.Forms; + +namespace SymbianUtils.Colour +{ + public static class ColourUtils + { + public static Color Lighten( Color aColour ) + { + Color ret = ControlPaint.Light( aColour ); + return ret; + } + + public static Color LightenMore( Color aColour ) + { + Color ret = ControlPaint.LightLight( aColour ); + return ret; + } + + public static Color Darken( Color aColour ) + { + Color ret = ControlPaint.Dark( aColour ); + return ret; + } + + public static Color Lighten( Color aColour, float aPercentage ) + { + int r = aColour.R; + int g = aColour.G; + int b = aColour.B; + // + int amount = (int) ( 255.0f * aPercentage ); + // + r = Math.Min( r + amount, 255 ); + g = Math.Min( g + amount, 255 ); + b = Math.Min( b + amount, 255 ); + // + Color ret = Color.FromArgb( r, g, b ); + return ret; + } + + public static Color Darken( Color aColour, float aPercentage ) + { + int r = aColour.R; + int g = aColour.G; + int b = aColour.B; + // + int amount = (int) ( 255.0f * aPercentage ); + // + r = Math.Max( r - amount, 0 ); + g = Math.Max( g - amount, 0 ); + b = Math.Max( b - amount, 0 ); + // + Color ret = Color.FromArgb( r, g, b ); + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/DataBuffer/DataBuffer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/DataBuffer/DataBuffer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,316 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianUtils.DataBuffer.Entry; +using SymbianUtils.Range; + +namespace SymbianUtils.DataBuffer +{ + public class DataBuffer : IEnumerable + { + #region Constructors + public DataBuffer() + { + } + #endregion + + #region API + public void Add( byte aByte ) + { + uint address = 0; + // + if ( Count > 0 ) + { + address = ( Last.Address - AddressOffset ) + 1; + } + // + DataBufferByte entry = new DataBufferByte( aByte, address ); + Add( entry ); + } + + public void Add( IEnumerable aBytes ) + { + foreach ( byte b in aBytes ) + { + Add( b ); + } + } + + public void Add( uint aDWord ) + { + // Make 4 bytes + byte b0 = (byte) (( aDWord & 0x000000FF ) >> 00); + byte b1 = (byte) (( aDWord & 0x0000FF00 ) >> 08); + byte b2 = (byte) (( aDWord & 0x00FF0000 ) >> 16); + byte b3 = (byte) (( aDWord & 0xFF000000 ) >> 24); + // + Add( b0 ); + Add( b1 ); + Add( b2 ); + Add( b3 ); + } + + public void Add( DataBufferByte aEntry ) + { + aEntry.Buffer = this; + iData.Add( aEntry ); + } + + public void Set( DataBuffer aCopyFrom ) + { + iAddressOffset = aCopyFrom.AddressOffset; + iData = aCopyFrom.iData; + } + + public void Save( Stream aStream ) + { + byte[] bytes = this; + aStream.Write( bytes, 0, bytes.Length ); + } + + public void Read( Stream aStream ) + { + } + + public void Read( Stream aStream, int aOffset, int aLength ) + { + byte[] bytes = new byte[ aLength ]; + aStream.Seek( aOffset, SeekOrigin.Begin ); + aStream.Read( bytes, 0, bytes.Length ); + Add( bytes ); + } + + public void Clear() + { + iData.Clear(); + iAddressOffset = 0; + } + + public byte[] ToArray() + { + List ret = new List( iData.Count + 1 ); + // + int count = iData.Count; + for ( int i = 0; i < count; i++ ) + { + ret.Add( iData[ i ].Byte ); + } + // + return ret.ToArray(); + } + #endregion + + #region Properties + public int Count + { + get { return iData.Count; } + } + + public uint AddressOffset + { + get { return iAddressOffset; } + set { iAddressOffset = value; } + } + + public DataBufferByte First + { + get + { + DataBufferByte ret = new DataBufferByte( 0, 0 ); + // + if ( Count > 0 ) + { + ret = iData[ 0 ]; + } + // + return ret; + } + } + + public DataBufferByte Last + { + get + { + DataBufferByte ret = new DataBufferByte( 0, 0 ); + // + if ( Count > 0 ) + { + ret = iData[ Count - 1 ]; + } + // + return ret; + } + } + + public AddressRange Range + { + get + { + AddressRange ret = new AddressRange(); + if ( First != null ) + { + ret.Min = First.Address; + } + if ( Last != null ) + { + ret.Max = Last.Address; + } + return ret; + } + } + + public DataBufferUint this[ uint aAddress ] + { + get + { + DataBufferUint ret = new DataBufferUint( 0, aAddress ); + // + foreach ( DataBufferUint uintEntry in GetUintEnumerator() ) + { + if ( uintEntry.Address == aAddress ) + { + ret = uintEntry; + break; + } + } + // + return ret; + } + } + #endregion + + #region Enumerator API + public IEnumerable GetUintEnumerator() + { + // This iterator works from the bottom of the stack + // upwards, just like Symbian OS/ARM stack allocation + // + // + // Count = 12 + // + // [0123][4567][89AB] + // + int count = iData.Count; + // + for ( int i = count - 4; i >= 0; i -= 4 ) + { + DataBufferByte e0 = iData[ i + 0 ]; + DataBufferByte e1 = iData[ i + 1 ]; + DataBufferByte e2 = iData[ i + 2 ]; + DataBufferByte e3 = iData[ i + 3 ]; + // + uint value = Combine( e0, e1, e2, e3 ); + DataBufferUint ret = new DataBufferUint( value, e0.Address ); + yield return ret; + } + } + + public IEnumerable GetByteEnumerator() + { + int count = iData.Count; + for ( int i = count - 1; i >= 0; i-- ) + { + DataBufferByte entry = iData[ i ]; + yield return entry; + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( DataBufferByte b in iData ) + { + yield return b.Byte; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( DataBufferByte b in iData ) + { + yield return b.Byte; + } + } + #endregion + + #region Operators + public static implicit operator byte[]( DataBuffer aBuffer ) + { + byte[] ret = aBuffer.ToArray(); + return ret; + } + #endregion + + #region Internal methods + private List GetRawBytes() + { + List ret = new List( iData.Count + 1 ); + // + foreach ( DataBufferByte b in iData ) + { + ret.Add( b.Byte ); + } + // + return ret; + } + + private uint Combine( params DataBufferByte[] aItems ) + { + if ( aItems.Length != 4 ) + { + throw new ArgumentException( "Expected 4 items" ); + } + // + uint ret = + ( (uint) aItems[ 0 ].Byte ) + + ( (uint) aItems[ 1 ].Byte << 8 ) + + ( (uint) aItems[ 2 ].Byte << 16 ) + + ( (uint) aItems[ 3 ].Byte << 24 ) + ; + return ret; + } + #endregion + + #region From System.Object + public override string ToString() + { + string ret = string.Empty; + // + List rawBytes = GetRawBytes(); + if ( rawBytes.Count > 0 ) + { + DataBufferByte firstByte = First; + uint startingAddress = firstByte.Address; + // + ret = SymbianUtils.Utilities.RawByteUtility.ConvertDataToText( rawBytes, true, ref startingAddress ); + } + // + return ret; + } + #endregion + + #region Data members + private uint iAddressOffset = 0; + private List iData = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/DataBuffer/Entry/DataBufferByte.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/DataBuffer/Entry/DataBufferByte.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; + +namespace SymbianUtils.DataBuffer.Entry +{ + public class DataBufferByte + { + #region Constructors + internal DataBufferByte( byte aByte, uint aAddress ) + { + iAddress = aAddress; + iByte = aByte; + } + #endregion + + #region API + #endregion + + #region Properties + public uint Address + { + get + { + uint ret = iAddress; + // + if ( Buffer != null ) + { + ret += Buffer.AddressOffset; + } + // + return ret; + } + } + + public byte Byte + { + get { return iByte; } + } + #endregion + + #region Operators + public static implicit operator byte( DataBufferByte aEntry ) + { + return aEntry.Byte; + } + #endregion + + #region Internal properties + internal DataBuffer Buffer + { + get { return iBuffer; } + set { iBuffer = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly uint iAddress; + private readonly byte iByte; + private DataBuffer iBuffer = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/DataBuffer/Entry/DataBufferUint.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/DataBuffer/Entry/DataBufferUint.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; + +namespace SymbianUtils.DataBuffer.Entry +{ + public class DataBufferUint + { + #region Constructors + internal DataBufferUint( uint aUint, uint aAddress ) + { + iAddress = aAddress; + iUint = aUint; + } + #endregion + + #region API + #endregion + + #region Properties + public uint Address + { + get { return iAddress; } + } + + public uint Uint + { + get { return iUint; } + } + #endregion + + #region Operators + public static implicit operator uint( DataBufferUint aEntry ) + { + return aEntry.Uint; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly uint iAddress; + private readonly uint iUint; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/DataBuffer/Primer/DataBufferPrimer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/DataBuffer/Primer/DataBufferPrimer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,193 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; +using SymbianUtils.DataBuffer.Entry; + +namespace SymbianUtils.DataBuffer.Primer +{ + public class DataBufferPrimer + { + #region Delegates & Events + public delegate void DataBufferPrimerUnhandledLine( DataBufferPrimer aPrimer, DataBuffer aBuffer, string aLine ); + public event DataBufferPrimerUnhandledLine LineNotHandled; + + public delegate void DataBufferPrimerCompleteHandler( DataBufferPrimer aPrimer, DataBuffer aBuffer, uint aFirstByteAddress, uint aLastByteAddress ); + public event DataBufferPrimerCompleteHandler PrimerComplete; + #endregion + + #region Constructors + public DataBufferPrimer( DataBuffer aBuffer ) + { + iDataBuffer = aBuffer; + } + #endregion + + #region API + public void Prime( IEnumerable aLines ) + { + iDataBuffer.Clear(); + // + foreach ( string line in aLines ) + { + PrimeLine( line ); + } + + Primed = true; + } + + public void PrimeLine( string aLine ) + { + Match m = iRawDataRegEx.Match( aLine ); + // + if ( m.Success ) + { + uint startOfLineAddress = ExtractDataSourceEntryFromMatch( m ); + + // If the data buffer has never had an address applied to it, then set it now + if ( iHaveSetFirstAddress == false ) + { + iDataBuffer.AddressOffset = startOfLineAddress; + iHaveSetFirstAddress = true; + } + } + else if ( LineNotHandled != null ) + { + LineNotHandled( this, iDataBuffer, aLine ); + } + } + + public void Prime( string aBinaryFileName ) + { + Prime( aBinaryFileName, 0 ); + } + + public void Prime( string aBinaryFileName, uint aAddressOfFirstByte ) + { + FileInfo info = new FileInfo( aBinaryFileName ); + if ( info.Exists ) + { + int length = (int) info.Length; + // + byte[] bytes = new byte[ length ]; + using ( FileStream stream = new FileStream( aBinaryFileName, FileMode.Open, FileAccess.Read, FileShare.Read ) ) + { + stream.Read( bytes, 0, length ); + } + // + Prime( bytes, aAddressOfFirstByte ); + } + } + + public void Prime( IEnumerable aBytes, uint aAddressOfFirstByte ) + { + iDataBuffer.Clear(); + + // Set the starting address + iDataBuffer.AddressOffset = aAddressOfFirstByte; + + // Read bytes + uint offset = 0; + foreach ( byte b in aBytes ) + { + DataBufferByte entry = new DataBufferByte( b, offset++ ); + iDataBuffer.Add( entry ); + } + + Primed = true; + } + + public void Prime( DataBuffer aBuffer ) + { + iDataBuffer.Clear(); + iDataBuffer.Set( aBuffer ); + Primed = true; + } + #endregion + + #region Properties + public bool Primed + { + get { return iPrimed; } + private set + { + iPrimed = value; + if ( Primed ) + { + uint firstByte = ( iDataBuffer.Count > 0 ) ? iDataBuffer.First.Address : 0; + uint lastByte = ( iDataBuffer.Count > 0 ) ? iDataBuffer.Last.Address : 0; + // + if ( PrimerComplete != null ) + { + PrimerComplete( this, iDataBuffer, firstByte, lastByte ); + } + } + } + } + #endregion + + #region Internal methods + private uint ExtractDataSourceEntryFromMatch( Match aMatch ) + { + System.Diagnostics.Debug.Assert( aMatch.Success ); + + uint address = 0; + uint nextExpectedAddress = 0; + if ( iDataBuffer.Count > 0 ) + { + nextExpectedAddress = iDataBuffer.Last.Address + 1; + } + // + GroupCollection groups = aMatch.Groups; + CaptureCollection data = groups[ "Data" ].Captures; + + if ( data.Count > 0 ) + { + address = System.Convert.ToUInt32( groups[ "Address" ].Value, 16 ); + + // Validate the address + if ( nextExpectedAddress != 0 && address != nextExpectedAddress ) + { + throw new Exception( string.Format( "Data is corrupt - expected: 0x{0:x8}, actual: 0x{1:x8}", nextExpectedAddress, address ) ); + } + else + { + foreach ( Capture capture in data ) + { + string val = capture.Value.Trim(); + byte b = System.Convert.ToByte( val, 16 ); + DataBufferByte entry = new DataBufferByte( b, (uint) iDataBuffer.Count ); + iDataBuffer.Add( entry ); + } + } + } + + return address; + } + #endregion + + #region Data members + private static readonly Regex iRawDataRegEx = new Regex( "(?:.*)\r\n(?
[a-fA-F0-9]{8})\r\n\\:\\s{1}\r\n(?(?:[a-fA-F0-9]{2})\\s{1}){1,16}\r\n(?:.*)", RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled ); + private readonly DataBuffer iDataBuffer; + private bool iPrimed = false; + private bool iHaveSetFirstAddress = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Debug/SymDebugger.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Debug/SymDebugger.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; + +namespace SymbianUtils.SymDebug +{ + public static class SymDebugger + { + public static void Assert( bool aAssertionResult ) + { + if ( !aAssertionResult ) + { + System.Diagnostics.Debug.WriteLine( "ASSERTION FAILED" ); + System.Diagnostics.Debug.WriteLine( "================" ); + // + string trace = System.Environment.StackTrace; + System.Diagnostics.Debug.WriteLine( trace ); + // + Break(); + } + } + + public static void Break() + { + if ( System.Diagnostics.Debugger.IsAttached ) + { + Debugger.Break(); + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Enum/EnumUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Enum/EnumUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; +using System.Reflection; + +namespace SymbianUtils.Enum +{ + public static class EnumUtils + { + public static string ToString( System.Enum aValue ) + { + string ret = aValue.ToString(); + + Type type = aValue.GetType(); + MemberInfo[] memInfo = type.GetMember( aValue.ToString() ); + if ( memInfo != null && memInfo.Length > 0 ) + { + object[] attrs = memInfo[ 0 ].GetCustomAttributes( typeof( DescriptionAttribute ), false ); + + if ( attrs != null && attrs.Length > 0 ) + { + ret = ( (DescriptionAttribute) attrs[ 0 ] ).Description; + } + } + + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Environment/EnvEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Environment/EnvEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.IO; +using System.Text; + +namespace SymbianUtils.Environment +{ + public class EnvEntry : EnvEntryBase + { + #region Constructors + internal EnvEntry( DriveInfo aDriveInfo, out bool aIsValid ) + : base( aDriveInfo ) + { + aIsValid = false; + + // Check whether drive contains Symbian OS environment + try + { + bool gotSymbianVersion = BuildSymbianOSVersion(); + bool gotS60Version = BuildS60Version(); + + // Check whether we have a valid Symbian OS version string. + // If we do, then we don't care if the S60 version is missing + if ( gotSymbianVersion ) + { + aIsValid = true; + } + else + { + // Not valid - we didn't get a Symbian OS version + } + } + catch + { + // Not valid + } + } + #endregion + + #region Internal methods + private bool BuildSymbianOSVersion() + { + string ver = string.Empty; + string fileName = Path.Combine( DriveName, KSymbianBuildInfoFileAndPath ); + + try + { + if ( File.Exists( fileName ) ) + { + // + using ( StreamReader reader = new StreamReader( fileName ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + if ( line.IndexOf( KSymbianBuildInfoMarkerText ) >= 0 ) + { + ver = line.Replace( KSymbianBuildInfoMarkerText, "" ).Trim(); + break; + } + line = reader.ReadLine(); + } + } + } + else + { + // Try to use a variant file instead. + string variantPath = Path.Combine( DriveName, KSymbianVariantPath ); + DirectoryInfo dir = new DirectoryInfo( variantPath ); + if ( dir.Exists ) + { + FileInfo[] files = dir.GetFiles(); + + // Find the most recent file + FileInfo newest = null; + foreach ( FileInfo file in files ) + { + if ( newest == null || file.LastWriteTimeUtc > newest.LastWriteTimeUtc ) + { + newest = file; + } + } + + if ( newest != null ) + { + ver = Path.GetFileNameWithoutExtension( newest.FullName ); + } + } + } + } + catch + { + } + + // Update version + bool valid = string.IsNullOrEmpty( ver ) == false; + if ( valid ) + { + base.VersionStringSymbian = ver; + } + return valid; + } + + private bool BuildS60Version() + { + string ver = string.Empty; + string fileName = Path.Combine( DriveName, KS60BuildInfoFileAndPath ); + // + try + { + if ( File.Exists( fileName ) ) + { + using ( StreamReader reader = new StreamReader( fileName ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + if ( line.IndexOf( KS60BuildInfoMarkerText ) == 0 ) + { + int breakPos = line.IndexOf( "\\n" ); + if ( breakPos > 0 ) + { + ver = line.Substring( KS60BuildInfoMarkerText.Length, breakPos - KS60BuildInfoMarkerText.Length ); + break; + } + } + line = reader.ReadLine(); + } + } + } + } + catch + { + } + + // Update version + bool valid = string.IsNullOrEmpty( ver ) == false; + if ( valid ) + { + base.VersionStringS60 = ver; + } + return valid; + } + #endregion + + #region Internal constants + private const string KSymbianBuildInfoMarkerText = "ManufacturerSoftwareBuild"; + private const string KS60BuildInfoMarkerText = "V "; + private const string KSymbianBuildInfoFileAndPath = @"epoc32\data\buildinfo.txt"; + private const string KSymbianVariantPath = @"epoc32\include\variant\"; + private const string KS60BuildInfoFileAndPath = @"epoc32\data\z\resource\versions\sw.txt"; + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Environment/EnvEntryBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Environment/EnvEntryBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.IO; +using System.Text; + +namespace SymbianUtils.Environment +{ + public abstract class EnvEntryBase + { + #region Static factory function + internal static EnvEntryBase New( DriveInfo aDriveInfo ) + { + bool valid; + // + EnvEntryBase ret = new EnvEntry( aDriveInfo, out valid ); + if ( valid == false ) + { + ret = new EnvEntryNull(); + } + return ret; + } + #endregion + + #region Constructors + protected EnvEntryBase( DriveInfo aDriveInfo ) + { + iDriveInfo = aDriveInfo; + } + #endregion + + #region API + public string CombineWithFile( string aFileName ) + { + string ret = aFileName; + // + if ( iDriveInfo != null ) + { + string drive = DriveName; + + if ( aFileName.Length > 2 ) + { + bool isDrive = aFileName[ 1 ] == ':'; + if ( isDrive ) + { + // Remove drive before combining with environment drive + aFileName = aFileName.Substring( 2 ); + } + + // Strip trailing backslash from drive name if already part + // of file name prefix + if ( aFileName.StartsWith( "\\" ) && drive.EndsWith( "\\" ) ) + { + drive = drive.Substring( 0, drive.Length - 1 ); + } + } + + ret = drive + aFileName; + } + // + return ret; + } + #endregion + + #region Properties + public bool IsValid + { + get + { + bool ret = ( iDriveInfo != null ) && ( string.IsNullOrEmpty( iVersionStringSymbian ) == false ); + return ret; + } + } + + public DriveInfo DriveInfo + { + get { return iDriveInfo; } + } + + public string DriveName + { + get + { + string ret = string.Empty; + if ( iDriveInfo != null ) + { + ret = iDriveInfo.Name; + } + return ret; + } + } + + public string VolumeName + { + get + { + string ret = string.Empty; + if ( iDriveInfo != null ) + { + ret = string.Format( "[ {0} ]", iDriveInfo.VolumeLabel ); + } + return ret; + } + } + + public string VersionStringSymbian + { + get { return iVersionStringSymbian; } + protected set { iVersionStringSymbian = value; } + } + + public string VersionStringS60 + { + get { return iVersionStringS60; } + protected set { iVersionStringS60 = value; } + } + + public bool IsS60Environment + { + get { return string.IsNullOrEmpty( iVersionStringS60 ) == false; } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.Append( DriveName ); + ret.Append( " " ); + ret.Append( VolumeName ); + ret.Append( " " ); + + // Try to use S60 version string if we have it... + if ( VersionStringS60.Length > 0 ) + { + ret.Append( VersionStringS60 ); + } + else + { + ret.Append( VersionStringSymbian ); + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private readonly DriveInfo iDriveInfo; + private string iVersionStringSymbian = string.Empty; + private string iVersionStringS60 = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Environment/EnvEntryNull.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Environment/EnvEntryNull.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.IO; +using System.Text; + +namespace SymbianUtils.Environment +{ + public class EnvEntryNull : EnvEntryBase + { + #region Constructors + public EnvEntryNull() + : base( null ) + { + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Environment/EnvLocator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Environment/EnvLocator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace SymbianUtils.Environment +{ + public class EnvLocator + { + #region Constructors + public EnvLocator() + { + LocateEnvironmentDrives(); + } + #endregion + + #region Properties + public int Count + { + get { return iEnvironments.Count; } + } + + public EnvEntryBase this[ int aIndex ] + { + get { return iEnvironments[ aIndex ]; } + } + #endregion + + #region Internal methods + private void LocateEnvironmentDrives() + { + DriveInfo[] drives = DriveInfo.GetDrives(); + foreach ( DriveInfo drive in drives ) + { + if ( drive.DriveType == DriveType.Fixed ) + { + EnvEntryBase environment = EnvEntryBase.New( drive ); + bool valid = environment.IsValid; + if ( valid ) + { + iEnvironments.Add( environment ); + } + } + } + } + #endregion + + #region Internal constants + private const int Removable = 2; + private const int LocalDisk = 3; + private const int Network = 4; + private const int CD = 5; + private const int RAMDrive = 6; + #endregion + + #region Data members + private List iEnvironments = new List( 3 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Environment/SymbianCommandLineEnvValidator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Environment/SymbianCommandLineEnvValidator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Text; +using System.Diagnostics; + +namespace SymbianUtils.Environment +{ + public class SymbianCommandLineEnvValidator + { + #region API + public static bool CheckEnvVarsValidForSymbianOSCompilation( bool aShowWarningDialogs ) + { + bool valid = false; + // + ProcessStartInfo info = new ProcessStartInfo( "calc.exe" ); + info.UseShellExecute = false; + + // Check env vars and make sure standard epoc32 paths are included + StringDictionary envVars = info.EnvironmentVariables; + + string path = envVars[ "PATH" ]; + string epocRoot = envVars[ "EPOCROOT" ]; + + if ( path.IndexOf( @"\epoc32\tools" ) < 0 ) + { + if ( aShowWarningDialogs ) + { + System.Windows.Forms.MessageBox.Show( @"Your path doesn't appear to support the necessary" + System.Environment.NewLine + + @"\Epoc32\... environment variables.", + "EPOC Environment Variables Undefined" ); + } + } + else if ( epocRoot == string.Empty ) + { + if ( aShowWarningDialogs ) + { + System.Windows.Forms.MessageBox.Show( @"You need to define EPOCROOT, e.g. to the value '\'", + "EPOCROOT Undefined" ); + } + } + else if ( epocRoot != @"\" ) + { + if ( aShowWarningDialogs ) + { + System.Windows.Forms.MessageBox.Show( @"The Active Object toolkit requires EPOCROOT be set to '\'", + "EPOCROOT Value Not Supported" ); + } + } + else + { + valid = true; + } + // + return valid; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FSDeletableResource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FSDeletableResource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace SymbianUtils.FileSystem +{ + public class FSDeletableResource : DisposableObject + { + #region Constructors + public FSDeletableResource( string aFileName ) + : this( new FileInfo( aFileName ) ) + { + } + + public FSDeletableResource( FileInfo aFile ) + { + iFile = aFile; + } + #endregion + + #region Properties + public FileInfo File + { + get { return iFile; } + } + + public string FileName + { + get { return iFile.FullName; } + } + #endregion + + #region DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iFile != null ) + { + Utilities.FSUtilities.DeleteFile( iFile.FullName ); + } + iFile = null; + } + } + #endregion + + #region Data members + private FileInfo iFile = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FSDirectoryScanner.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FSDirectoryScanner.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.ComponentModel; +using SymbianUtils; + +namespace SymbianUtils.FileSystem +{ + public class FSDirectoryScanner : DisposableObject + { + #region Delegates & events + public delegate void OperationStarted( FSDirectoryScanner aScanner ); + public event OperationStarted Started; + public delegate void ProgressHandler( FSDirectoryScanner aScanner, int aProgress, FileInfo aFile ); + public event ProgressHandler Progress; + public delegate void OperationComplete( FSDirectoryScanner aScanner ); + public event OperationComplete Complete; + #endregion + + #region Constructors + public FSDirectoryScanner() + { + iWorker.ProgressChanged += new ProgressChangedEventHandler( Worker_ProgressChanged ); + iWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler( Worker_RunWorkerCompleted ); + iWorker.DoWork += new DoWorkEventHandler( Worker_DoWork ); + } + #endregion + + #region API + public virtual void Start( DirectoryInfo aDirectory ) + { + iWorker.RunWorkerAsync( aDirectory ); + } + #endregion + + #region Framework API + protected virtual void OnFileLocated( FileInfo aFile ) + { + } + #endregion + + #region Worker event handlers + private void Worker_DoWork( object aSender, DoWorkEventArgs aArgs ) + { + if ( Started != null ) + { + Started( this ); + } + // + DirectoryInfo dir = aArgs.Argument as DirectoryInfo; + if ( dir != null && dir.Exists ) + { + // Locate all the map files in the directory + FileInfo[] fileInfoList = dir.GetFiles( "*.*" ); + int count = fileInfoList.Length; + for( int i=0; i aExtensions ) + { + iDescription = aDescription.Trim(); + AddRange( aExtensions ); + } + + public FSExtensionDescriptor( string aDescription, params string[] aExtensions ) + { + iDescription = aDescription.Trim(); + AddRange( aExtensions ); + } + #endregion + + #region API + public void Add( string aExtension ) + { + if ( !string.IsNullOrEmpty( aExtension ) ) + { + string ext = aExtension.Trim(); + if ( !string.IsNullOrEmpty( ext ) ) + { + iExtensions.Add( ext ); + } + } + } + + public void AddRange( IEnumerable aExtensions ) + { + foreach ( string e in aExtensions ) + { + Add( e ); + } + } + + public bool ContainsExtension( string aExtension ) + { + string searchFor = aExtension.ToUpper(); + Predicate searcher = delegate( string aEntry ) + { + return ( aEntry.ToUpper() == searchFor ); + }; + // + string ret = iExtensions.Find( searcher ); + bool found = !string.IsNullOrEmpty( ret ); + return found; + } + #endregion + + #region Properties + public int Count + { + get { return iExtensions.Count; } + } + + public string FirstExtension + { + get + { + string ret = string.Empty; + // + if ( Count > 0 ) + { + ret = this[ 0 ]; + } + // + return ret; + } + } + + public string[] Extensions + { + get { return iExtensions.ToArray(); } + } + + public string Description + { + get { return iDescription; } + } + + public string this[ int aIndex ] + { + get { return iExtensions[ aIndex ]; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override int GetHashCode() + { + return iDescription.GetHashCode(); + } + + public override string ToString() + { + // Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.* + StringBuilder ret = new StringBuilder( Description ); + // + if ( ret.Length > 0 && iExtensions.Count > 0 ) + { + StringBuilder extList = new StringBuilder(); + + foreach ( string ext in iExtensions ) + { + extList.Append( ext ); + extList.Append( ";" ); + } + + // Strip final ";". + extList.Length = extList.Length - 1; + + // Save as formatted extension + string list = extList.ToString(); + ret.AppendFormat( " ({0})|{1}", list, list ); + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private readonly string iDescription; + private List iExtensions = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FSExtensionList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FSExtensionList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; + +namespace SymbianUtils.FileSystem +{ + public class FSExtensionList : IEnumerable + { + #region Constructors + public FSExtensionList() + { + } + #endregion + + #region API + public void Clear() + { + iEntries.Clear(); + } + + public void Add( string aExtension, string aDescription ) + { + Add( new FSExtensionDescriptor( aExtension, aDescription ) ); + } + + public void Add( FSExtensionDescriptor aEntry ) + { + if ( !Contains( aEntry ) ) + { + iEntries.Add( aEntry.GetHashCode(), aEntry ); + } + } + + public void AddRange( IEnumerable aEntries ) + { + foreach ( FSExtensionDescriptor entry in aEntries ) + { + Add( entry ); + } + } + + public bool Contains( string aExtension ) + { + bool ret = false; + // + foreach ( FSExtensionDescriptor entry in this ) + { + if ( entry.ContainsExtension( aExtension ) ) + { + ret = true; + break; + } + } + // + return ret; + } + + public bool Contains( FSExtensionDescriptor aEntry ) + { + bool ret = iEntries.ContainsKey( aEntry.GetHashCode() ); + return ret; + } + #endregion + + #region Properties + public int Count + { + get { return iEntries.Count; } + } + + public FSExtensionDescriptor this[ int aIndex ] + { + get { return iEntries[ aIndex ]; } + } + + public FSExtensionDescriptor this[ string aExtension ] + { + get + { + FSExtensionDescriptor ret = null; + // + if ( Contains( aExtension ) ) + { + FSExtensionDescriptor temp = new FSExtensionDescriptor( aExtension ); + ret = iEntries[ temp.GetHashCode() ]; + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + // Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.* + StringBuilder ret = new StringBuilder(); + + foreach ( FSExtensionDescriptor ext in this ) + { + string extString = ext.ToString(); + ret.AppendFormat( "{0};", extString ); + } + + // Add "all files" + ret.Append( "All Files (*.*)|*.*" ); + + return ret.ToString(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( KeyValuePair kvp in iEntries ) + { + yield return kvp.Value; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair kvp in iEntries ) + { + yield return kvp.Value; + } + } + #endregion + + #region Data members + private SortedList iEntries = new SortedList(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FSLog.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FSLog.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,145 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Windows.Forms; +using SymbianUtils; +using SymbianUtils.Tracer; + +namespace SymbianUtils.FileSystem +{ + public sealed class FSLog : DisposableObject, ITracer + { + #region Constructors + public FSLog() + : this( false ) + { + } + + public FSLog( bool aIncludeTimeStamp ) + { + iIncludeTimeStamp = aIncludeTimeStamp; + // + try + { + string path = Application.ExecutablePath; + string exe = Path.GetFileName( path ); + path = Path.GetDirectoryName( path ); + // + string file = Path.Combine( path, exe + ".debug.txt" ); + iStream = new StreamWriter( new FileStream( file, FileMode.Create ) ); + iStream.AutoFlush = true; + } + catch ( Exception ) + { + } + } + #endregion + + #region API + public void TraceAlways( string aMessage ) + { + DoTrace( aMessage, true ); + } + #endregion + + #region Properties + public bool Verbose + { + get { return iVerbose; } + set { iVerbose = value; } + } + #endregion + + #region Internal methods + private void DoTrace( string aLine, bool aDiagnostics ) + { + if ( aDiagnostics ) + { + System.Diagnostics.Debug.WriteLine( aLine ); + } + + // Try to output to file + if ( iStream != null ) + { + try + { + iStream.WriteLine( aLine ); + } + catch ( Exception ) + { + iStream.Close(); + iStream = null; + } + } + } + #endregion + + #region DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iStream != null ) + { + iStream.Close(); + } + iStream = null; + } + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + StringBuilder text = new StringBuilder( aMessage ); + if ( iIncludeTimeStamp ) + { + DateTime now = DateTime.Now; + text.Insert( 0, now.ToLongTimeString() + " - " ); + } + + string msg = text.ToString(); + System.Diagnostics.Debug.WriteLine( msg ); + + if ( iVerbose ) + { + System.Console.WriteLine( msg ); + DoTrace( msg, false ); + } + } + + public void Trace( string aFormat, params object[] aParams ) + { + string text = string.Format( aFormat, aParams ); + Trace( text ); + } + #endregion + + #region Data members + private readonly bool iIncludeTimeStamp; + private StreamWriter iStream; + private bool iVerbose = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FilePair/FileNamePair.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FilePair/FileNamePair.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,151 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; + +namespace SymbianUtils.FileSystem.FilePair +{ + public class FileNamePair + { + #region Constructors + public FileNamePair() + { + } + + public FileNamePair( string aSourceName ) + { + iSource = aSourceName; + } + + public FileNamePair( string aSourceName, string aDestinationName ) + { + iSource = aSourceName; + iDestination = aDestinationName; + } + #endregion + + #region API + public void SetCustomDestinationPath( string aFolder ) + { + string fileName = Path.GetFileName( Source ); + fileName = Path.Combine( aFolder, fileName ); + Destination = fileName; + // + if ( Destination.Length > 0 && ( Destination[ 0 ] == Path.AltDirectorySeparatorChar || Destination[ 0 ] == Path.DirectorySeparatorChar ) ) + { + Destination = Destination.Substring( 1 ); + } + } + #endregion + + #region Properties + public bool ProcessFile + { + get + { + bool ret = false; + // + if ( IsValid ) + { + if ( SourceExists ) + { + if ( !SkipIfEmptyFile || SourceFileSize > 0 ) + { + ret = true; + } + } + } + // + return ret; + } + } + + public bool IsValid + { + get + { + bool sourceSet = ( Source.Length > 0 ); + bool destinationSet = ( Destination.Length > 0 ); + // + return ( sourceSet && destinationSet ); + } + } + + public bool SkipIfEmptyFile + { + get { return iSkipIfEmptyFile; } + set { iSkipIfEmptyFile = value; } + } + + public bool SourceExists + { + get + { + bool exists = File.Exists( Source ); + return exists; + } + } + + public bool DeleteFile + { + get { return iDeleteFile; } + set { iDeleteFile = value; } + } + + public string Source + { + get { return iSource; } + set { iSource = value; } + } + + public string Destination + { + get { return iDestination; } + set { iDestination = value; } + } + + public long SourceFileSize + { + get + { + long ret = 0; + // + try + { + if ( SourceExists ) + { + System.IO.FileInfo info = new FileInfo( Source ); + ret = info.Length; + } + } + catch( Exception ) + { + } + // + return ret; + } + } + #endregion + + #region Data members + private bool iDeleteFile = false; + private bool iSkipIfEmptyFile = true; + private string iSource = string.Empty; + private string iDestination = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FilePair/FileNamePairCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/FilePair/FileNamePairCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; + +namespace SymbianUtils.FileSystem.FilePair +{ + public class FileNamePairCollection : IEnumerable + { + #region Constructor + public FileNamePairCollection() + { + } + #endregion + + #region API + public void Clear() + { + iList.Clear(); + } + + public void Add( IEnumerable aList ) + { + foreach ( FileNamePair entry in aList ) + { + Add( entry ); + } + } + + public void Add( FileNamePair aItem ) + { + iList.Add( aItem ); + } + + public void RemoveAt( int aIndex ) + { + iList.RemoveAt( aIndex ); + } + + public bool Contains( FileNamePair aItem ) + { + bool exists = false; + // + foreach ( FileNamePair entry in iList ) + { + if ( entry.Source.ToLower() == aItem.Source.ToLower() ) + { + exists = true; + break; + } + else if ( entry.Destination.ToLower() == aItem.Destination.ToLower() ) + { + exists = true; + break; + } + } + // + return exists; + } + #endregion + + #region Properties + public int Count + { + get { return iList.Count; } + } + + public FileNamePair this[ int aIndex ] + { + get + { + FileNamePair item = (FileNamePair) iList[ aIndex ]; + return item; + } + } + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( FileNamePair entry in iList ) + { + yield return entry; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( FileNamePair entry in iList ) + { + yield return entry; + } + } + #endregion + + #region Data members + private List iList = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/Utilities/FSUtilities.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileSystem/Utilities/FSUtilities.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,238 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections; + +namespace SymbianUtils.FileSystem.Utilities +{ + public static class FSUtilities + { + #region Constants + public const int KKiloByte = 1024; + public const int KMegaByte = KKiloByte * KKiloByte; + #endregion + + #region API + public static bool Exists( string aFileName ) + { + bool ret = false; + // + try + { + ret = File.Exists( aFileName ); + } + catch ( Exception ) + { + } + // + return ret; + } + + public static void DeleteFile( string aFileName ) + { + try + { + if ( File.Exists( aFileName ) ) + { + FileAttributes attribs = File.GetAttributes( aFileName ); + attribs &= ~FileAttributes.ReadOnly; + attribs &= ~FileAttributes.System; + attribs &= ~FileAttributes.Hidden; + File.SetAttributes( aFileName, attribs ); + + File.Delete( aFileName ); + } + } + finally + { + } + } + + public static string PrettyFileFormatSize( long aValue, bool aExtraRounding ) + { + string ret = string.Empty; + + if ( aValue < 1024000 ) // If < 1000K + { + long sizeInK = 0; + + if ( aValue != 0 ) + { + sizeInK = (long) ( (aValue + 512) >> 10 ); + + if (sizeInK < 1) + { + sizeInK = 1; + } + if (sizeInK > 999) + { + sizeInK = 999; + } + } + + ret = sizeInK.ToString() + "K"; + } + else + { + double sizeInM = (double) aValue; + sizeInM /= (double) KMegaByte; + if ( sizeInM < 1 ) + { + sizeInM = 1; + } + + string postfix = "M"; + if ( sizeInM >= 1000 ) + { + sizeInM /= 1024; // Size in G + if (sizeInM < 1) + { + sizeInM = 1; + } + + postfix = "G"; + } + + if ( sizeInM > 999.9) + { + sizeInM = 999.9; + } + + if ( aExtraRounding ) + { + sizeInM += 0.499999; + } + + ret = sizeInM.ToString( "##############.00" ) + postfix; + } + + return ret; + } + + public static string FormatFileSize( long aSize ) + { + string ret = ""; + if ( aSize > KMegaByte ) + { + ret = aSize.ToString("###,000,000"); + } + else if ( aSize > 1024 ) + { + ret = aSize.ToString("###,000"); + } + else + { + ret += aSize.ToString("###"); + } + return ret; + } + + public static string MakeTempFileName( string aPath ) + { + string tempFileName = string.Empty; + // + while( tempFileName == string.Empty || File.Exists( tempFileName ) ) + { + DateTime date = DateTime.Now; + // + tempFileName = "temp_file_" + date.Minute.ToString("d2") + "_" + date.Ticks.ToString("d6") + ".tmp"; + tempFileName = Path.Combine( aPath, tempFileName ); + // + System.Threading.Thread.Sleep( 5 ); + } + // + return tempFileName; + } + + public static string StripAllExtensions( string aFileName ) + { + string temp = Path.GetFileNameWithoutExtension( aFileName ); + string ret = string.Empty; + // + do + { + ret = temp; + temp = Path.GetFileNameWithoutExtension( ret ); + } + while( temp != ret ); + + return ret; + } + + public static void ClearTempPath() + { + try + { + string path = TempPathBaseDir; + DirectoryInfo dir = new DirectoryInfo( path ); + // + if ( dir.Exists ) + { + dir.Delete( true ); + } + } + catch ( Exception ) + { + } + } + + public static string MakeTempPath() + { + string ret = string.Empty; + string temp = TempPathBaseDir; + // + while ( ret == string.Empty ) + { + try + { + string tempPathExtension = SymbianUtils.Strings.StringUtils.MakeRandomString(); + string path = Path.Combine( temp, tempPathExtension ) + Path.DirectorySeparatorChar; + // + DirectoryInfo dir = new DirectoryInfo( path ); + if ( !dir.Exists ) + { + dir.Create(); + ret = path; + } + } + catch ( Exception ) + { + } + } + // + return ret; + } + #endregion + + #region Internal properties + private static string TempPathBaseDir + { + get + { + string temp = Path.Combine( Path.GetTempPath(), KTempPathFolder ); + return temp; + } + } + #endregion + + #region Internal constants + private const string KTempPathFolder = "SymbianNetTools"; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileTypes/SymFileType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileTypes/SymFileType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.FileTypes +{ + public class SymFileType + { + #region Constructors + public SymFileType( string aExtension, string aDescription ) + { + iExtension = aExtension; + iDescription = aDescription; + } + #endregion + + #region API + #endregion + + #region Properties + public string Extension + { + get { return iExtension; } + } + + public string Description + { + get { return iDescription; } + } + #endregion + + #region From System.Object + public override bool Equals( object aObject ) + { + if ( aObject != null ) + { + if ( aObject is SymFileType ) + { + SymFileType type = (SymFileType) aObject; + return string.Compare( Extension, type.Extension, StringComparison.CurrentCultureIgnoreCase ) == 0; + } + } + // + return base.Equals( aObject ); + } + + public override int GetHashCode() + { + return Extension.GetHashCode(); + } + + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + ret.AppendFormat( "{0} ({1})|{2}", Description, Extension, Extension ); + // + return ret.ToString(); + } + #endregion + + #region Data members + private readonly string iExtension; + private readonly string iDescription; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileTypes/SymFileTypeList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/FileTypes/SymFileTypeList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using SymbianUtils; + +namespace SymbianUtils.FileTypes +{ + public class SymFileTypeList : IEnumerable + { + #region Constructors + public SymFileTypeList() + { + } + #endregion + + #region API + public void Clear() + { + iTypes.Clear(); + } + + public void Add( SymFileType aType ) + { + if ( !iTypes.ContainsKey( aType.Extension ) ) + { + iTypes.Add( aType.Extension.ToUpper(), aType ); + } + } + + public void AddRange( IEnumerable aTypes ) + { + foreach ( SymFileType type in aTypes ) + { + Add( type ); + } + } + + public bool IsSupported( string aFileName ) + { + string ext = Path.GetExtension( aFileName ); + bool ret = iTypes.ContainsKey( ext.ToUpper() ); + return ret; + } + #endregion + + #region Properties + public int Count + { + get { return iTypes.Count; } + } + #endregion + + #region From System.Object + public override string ToString() + { + // Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All files (*.*)|*.* + StringBuilder ret = new StringBuilder(); + // + foreach ( KeyValuePair kvp in iTypes ) + { + string extension = kvp.Value.ToString(); + ret.Append( "|" ); + } + + // Remove last | if present + int length = ret.Length; + if ( length > 0 ) + { + if ( ret[ length - 1 ] == '|' ) + { + ret.Length = length - 1; + } + } + // + return ret.ToString(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( KeyValuePair type in iTypes ) + { + yield return type.Value; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair type in iTypes ) + { + yield return type.Value; + } + } + #endregion + + #region Data members + private Dictionary iTypes = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Graphics/ScreenCopyUtil.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Graphics/ScreenCopyUtil.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Drawing; +using System.Drawing.Imaging; +using System.Drawing.Drawing2D; + +namespace SymbianUtils.Graphics +{ + public static class ScreenUtils + { + public static Color ColorAtPixel( Point aPos ) + { + Bitmap bitmap = new Bitmap( 1, 1, PixelFormat.Format32bppArgb ); + System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage( bitmap ); + graphics.CopyFromScreen( aPos.X, aPos.Y, 0, 0, new Size( 1, 1 ) ); + Color ret = bitmap.GetPixel( 0, 0 ); + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Graphics/SymRect.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Graphics/SymRect.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Drawing; + +namespace SymbianUtils.Graphics +{ + public class SymRect + { + #region Constructors + public SymRect() + { + } + + public SymRect( Rectangle aRect ) + { + iRectangle = aRect; + } + + public SymRect( Point aTopleft, Size aSize ) + { + iRectangle = new Rectangle( aTopleft, aSize ); + } + #endregion + + #region API + public void Inflate( int aDx, int aDy ) + { + iRectangle.Inflate( aDx, aDy ); + } + + public void Offset( int aDx, int aDy ) + { + iRectangle.Offset( aDx, aDy ); + } + + public void Offset( Size aSize ) + { + iRectangle.Offset( aSize.Width, aSize.Height ); + } + + public void Offset( Point aPosition ) + { + iRectangle.Offset( aPosition.X, aPosition.Y ); + } + + public void HalfOffset( Size aSize ) + { + Offset( aSize.Width / 2, aSize.Height / 2 ); + } + + public void HalfOffset( Point aPosition ) + { + Offset( aPosition.X / 2, aPosition.Y / 2 ); + } + #endregion + + #region Properties + public Rectangle Rectangle + { + get { return iRectangle; } + set { iRectangle = value; } + } + + public Size Size + { + get { return iRectangle.Size; } + set { iRectangle.Size = value; } + } + + public Point Location + { + get { return iRectangle.Location; } + set { iRectangle.Location = value; } + } + + public Point TopLeft + { + get { return iRectangle.Location; } + } + + public Point TopRight + { + get { return new Point( iRectangle.Right, iRectangle.Top ); } + } + + public Point BottomLeft + { + get { return new Point( iRectangle.Left, iRectangle.Bottom ); } + } + + public Point BottomRight + { + get { return new Point( iRectangle.Right, iRectangle.Bottom ); } + } + + public int Width + { + get { return iRectangle.Width; } + } + + public int Height + { + get { return iRectangle.Height; } + } + + public int Top + { + get { return iRectangle.Top; } + } + + public int Bottom + { + get { return iRectangle.Bottom; } + } + + public int Left + { + get { return iRectangle.Left; } + } + + public int Right + { + get { return iRectangle.Right; } + } + #endregion + + #region Operators + public static implicit operator Rectangle( SymRect aRect ) + { + return aRect.Rectangle; + } + + public static implicit operator SymRect( Rectangle aRect ) + { + return new SymRect( aRect ); + } + #endregion + + #region Data members + private Rectangle iRectangle = new Rectangle(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/MarshallingUtils/MarshalHelper.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/MarshallingUtils/MarshalHelper.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.IO; +using System.Runtime.InteropServices; + +namespace SymbianUtils.MarshallingUtils +{ + public static class MarshalHelper + { + #region Constructors + #endregion + + #region API + public static T Read( byte[] aData ) + { + return Read( aData, 0 ); + } + + public static T Read( byte[] aData, int aOffset ) + { + int size = Marshal.SizeOf( typeof( T ) ); + + byte[] buffer = new byte[ size ]; + for ( int i = 0; i < buffer.Length; i++ ) + { + int pos = aOffset + i; + buffer[ i ] = aData[ pos ]; + } + + GCHandle handle = GCHandle.Alloc( buffer, GCHandleType.Pinned ); + T ret = (T) Marshal.PtrToStructure( handle.AddrOfPinnedObject(), typeof( T ) ); + handle.Free(); + + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Mmp/MmpFileInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Mmp/MmpFileInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.Mmp +{ + public class MmpFileInfo + { + #region Enumerations + public enum TTargetType + { + ETargetTypeEXE = 0, + ETargetTypeDLL, + ETargetTypeUnsupported + } + #endregion + + #region Constructor & destructor + public MmpFileInfo( string aFileName ) + { + iFileName = aFileName; + } + #endregion + + #region Properties + public string FileName + { + get { return iFileName; } + } + + public List Uids + { + get { return iUids; } + } + + public uint MostSignificantUid + { + get + { + uint ret = 0; + // + if ( Uids.Count > 0 ) + { + ret = Uids[ Uids.Count - 1 ]; + } + // + return ret; + } + } + + public string Target + { + get { return iTarget; } + set { iTarget = value; } + } + + public TTargetType TargetType + { + get { return iTargetType; } + set { iTargetType = value; } + } + #endregion + + #region Data members + private readonly string iFileName; + private List iUids = new List(); + private string iTarget = string.Empty; + private TTargetType iTargetType = TTargetType.ETargetTypeUnsupported; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Mmp/MmpFileReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Mmp/MmpFileReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.Mmp +{ + public class MmpFileReader : AsyncTextFileReader + { + #region Constructor & destructor + public MmpFileReader( string aFileName ) + : base( aFileName ) + { + iFileInfo = new MmpFileInfo( aFileName ); + } + #endregion + + #region API + public void Read() + { + base.SyncRead(); + } + #endregion + + #region Properties + public MmpFileInfo FileInfo + { + get { return iFileInfo; } + } + #endregion + + #region Internal methods + private string[] ExtractElements( string aLine ) + { + List ret = new List(); + // + string line = aLine.Trim(); + line = line.Replace( '\t', ' ' ); + // + string[] elements = line.Split( new char[] { ' ' } ); + foreach ( string element in elements ) + { + if ( element.Length > 0 && element != " " ) + { + ret.Add( element ); + } + } + // + return ret.ToArray(); + } + #endregion + + #region From AsyncTextFileReader + protected override void HandleFilteredLine( string aLine ) + { + string[] elements = ExtractElements( aLine ); + // + if ( elements.Length >= 2 ) + { + string line = elements[ 0 ].ToUpper(); + // + if ( line == "TARGET" ) + { + iFileInfo.Target = elements[ 1 ]; + + // Use extension as a means of guessing target type. + string extension = System.IO.Path.GetExtension( iFileInfo.Target ).ToUpper(); + if ( extension == ".EXE" && iFileInfo.TargetType == MmpFileInfo.TTargetType.ETargetTypeUnsupported ) + { + iFileInfo.TargetType = MmpFileInfo.TTargetType.ETargetTypeEXE; + } + } + else if ( line == "UID" ) + { + for ( int i = 1; i < elements.Length; i++ ) + { + try + { + string uidString = elements[ i ]; + + uint val = 0; + if ( uint.TryParse( uidString, out val ) ) + { + iFileInfo.Uids.Add( val ); + } + else + { + // Try again, skipping any possible leading 0x prefix and using + // hex number formatting. + if ( uidString.StartsWith( "0x" ) ) + { + uidString = uidString.Substring( 2 ); + if ( uint.TryParse( uidString, System.Globalization.NumberStyles.HexNumber, null, out val ) ) + { + iFileInfo.Uids.Add( val ); + } + } + } + } + catch ( Exception ) + { + } + } + } + else if ( line == "TARGETTYPE" ) + { + // These are the only target types we need to support at the moment. + string targetType = elements[ 1 ].ToUpper(); + // + if ( targetType == "EXE" ) + { + iFileInfo.TargetType = MmpFileInfo.TTargetType.ETargetTypeEXE; + } + else if ( targetType == "EXEXP" ) + { + iFileInfo.TargetType = MmpFileInfo.TTargetType.ETargetTypeEXE; + } + else if ( targetType == "DLL" ) + { + iFileInfo.TargetType = MmpFileInfo.TTargetType.ETargetTypeDLL; + } + } + } + } + #endregion + + #region Data members + private readonly MmpFileInfo iFileInfo; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/PluginManager/PluginAssemblyAttribute.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/PluginManager/PluginAssemblyAttribute.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Reflection; + +namespace SymbianUtils.PluginManager +{ + [AttributeUsage( AttributeTargets.Assembly, AllowMultiple=false, Inherited=false )] + public class PluginAssemblyAttribute : Attribute + { + #region Constructors + public PluginAssemblyAttribute() + { + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/PluginManager/PluginManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/PluginManager/PluginManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,419 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using System.Reflection; + +namespace SymbianUtils.PluginManager +{ + public class PluginManager : DisposableObject, IEnumerable + { + #region Events + public delegate void PluginLoadedHandler( T aPlugin ); + public event PluginLoadedHandler PluginLoaded; + #endregion + + #region Constructors + public PluginManager() + { + } + + public PluginManager( bool aDiagnostics ) + { + iDiagnostics = aDiagnostics; + } + + public PluginManager( int aMinimumNumberOfExpectedPlugins ) + { + iMinimumNumberOfExpectedPlugins = aMinimumNumberOfExpectedPlugins; + } + + public PluginManager( bool aDiagnostics, int aMinimumNumberOfExpectedPlugins ) + : this( aDiagnostics ) + { + iMinimumNumberOfExpectedPlugins = aMinimumNumberOfExpectedPlugins; + } + #endregion + + #region API - loading + public void Load( object[] aPluginConstructorParameters ) + { + Trace( "Load() - invoked by: " + System.Environment.StackTrace ); + Assembly assembly = Assembly.GetCallingAssembly(); + string path = Path.GetDirectoryName( assembly.Location ); + FindPluginsWithinPath( path, KDefaultSearchSpecification, aPluginConstructorParameters, assembly ); + } + + public void LoadFromCallingAssembly() + { + Trace( "LoadFromCallingAssembly(1) - invoked by: " + System.Environment.StackTrace ); + Assembly assembly = Assembly.GetCallingAssembly(); + FindPluginsWithinAssembly( assembly, true, new object[] {} ); + Rationalise(); + } + + public void LoadFromCallingAssembly( object[] aPluginConstructorParameters ) + { + Trace( "LoadFromCallingAssembly(2) - invoked by: " + System.Environment.StackTrace ); + Assembly assembly = Assembly.GetCallingAssembly(); + FindPluginsWithinAssembly( assembly, true, aPluginConstructorParameters ); + Rationalise(); + } + + public void LoadFromPath( string aPath, object[] aPluginConstructorParameters ) + { + FindPluginsWithinPath( aPath, KDefaultSearchSpecification, aPluginConstructorParameters, null ); + } + + public void LoadFromPath( string aPath, string aMatchSpec, object[] aPluginConstructorParameters ) + { + FindPluginsWithinPath( aPath, aMatchSpec, aPluginConstructorParameters, null ); + } + #endregion + + #region API - misc + public void Unload() + { + foreach ( T plugin in iPlugins ) + { + IDisposable disposable = plugin as IDisposable; + if ( disposable != null ) + { + disposable.Dispose(); + } + } + // + iPlugins.Clear(); + } + + public void Sort( IComparer aComparer ) + { + iPlugins.Sort( aComparer ); + } + + public void Sort( Comparison aComparer ) + { + iPlugins.Sort( aComparer ); + } + + public bool Predicate( Predicate aPredicate ) + { + bool ret = iPlugins.Exists( aPredicate ); + return ret; + } + + public void Rationalise() + { + List plugins = iPlugins; + iPlugins = new List(); + // + int count = plugins.Count; + for ( int i = count - 1; i >= 0; i-- ) + { + T pluginToCheck = plugins[ i ]; + plugins.RemoveAt( i ); + Trace( "Rationalise() - checking hierarchy for derivates of: " + pluginToCheck.GetType().ToString() ); + // + bool isDerviedFromByOtherPlugin = IsClassDerivedFrom( plugins, pluginToCheck ); + Trace( "Rationalise() - is base class for other plugin: " + isDerviedFromByOtherPlugin ); + // + if ( !isDerviedFromByOtherPlugin ) + { + iPlugins.Add( pluginToCheck ); + Trace( "Rationalise() - found good plugin: " + pluginToCheck.GetType().ToString() ); + OnPluginLoaded( pluginToCheck ); + } + } + + // Check that we loaded the expected minimum amount + count = iPlugins.Count; + SymbianUtils.SymDebug.SymDebugger.Assert( iMinimumNumberOfExpectedPlugins < 0 || count >= iMinimumNumberOfExpectedPlugins ); + } + #endregion + + #region Properties + public int Count + { + get { return iPlugins.Count; } + } + + public T this[ int aIndex ] + { + get { return iPlugins[ aIndex ]; } + } + + public Type PluginType + { + get { return typeof( T ); } + } + #endregion + + #region Internal constants + private const string KDefaultSearchSpecification = "*.plugin.dll"; + #endregion + + #region Event propgation + private void OnPluginLoaded( T aPlugin ) + { + if ( PluginLoaded != null ) + { + PluginLoaded( aPlugin ); + } + } + #endregion + + #region Internal methods + private void Trace( string aMessage ) + { + System.Diagnostics.Debug.WriteLineIf( iDiagnostics, "PluginLoader<" + typeof(T).Name + "> " + aMessage ); + } + + private void Trace( Exception aException, string aFunction ) + { + Trace( string.Format( "PluginLoader.{0}() - exception: {1}", aFunction, aException.Message ) ); + Trace( string.Format( "PluginLoader.{0}() - stack: {1}", aFunction, aException.StackTrace ) ); + // + if ( aException is ReflectionTypeLoadException ) + { + ReflectionTypeLoadException refEx = (ReflectionTypeLoadException) aException; + foreach ( Exception l in refEx.LoaderExceptions ) + { + Trace( string.Format( " loader exception: {0}", l.Message ) ); + Trace( string.Format( " loader stack: {0}", l.StackTrace ) ); + } + } + else if ( aException is FileNotFoundException ) + { + FileNotFoundException fnf = (FileNotFoundException) aException; + Trace( string.Format( " file name: {0}", fnf.FileName ) ); + Trace( string.Format( " fusion log: {0}", fnf.FusionLog ) ); + } + } + + private static bool IsClassDerivedFrom( List aPluginList, T aPlugin ) + { + bool ret = false; + Type checkType = aPlugin.GetType(); + // + foreach ( T plugin in aPluginList ) + { + Type type = plugin.GetType(); + if ( type.IsSubclassOf( checkType ) ) + { + ret = true; + break; + } + } + // + return ret; + } + + private void CreateFromTypes( Type[] aTypes, object[] aPluginConstructorParameters ) + { + Type pluginType = PluginType; + Trace( "CreateFromTypes() - got " + aTypes.Length + " types. Searching for instances of: " + pluginType.Name ); + // + foreach ( Type type in aTypes ) + { + if ( pluginType.IsAssignableFrom( type ) ) + { + Trace( "CreateFromTypes() - found type: " + type.Name ); + if ( !type.IsAbstract ) + { + Trace( "CreateFromTypes() - type \'" + type.Name + "\' is concrete implementation" ); + CreateFromType( type, aPluginConstructorParameters ); + } + } + } + } + + private void CreateFromType( Type aType, object[] aPluginConstructorParameters ) + { + try + { + Trace( "CreateFromType() - calling constructor: " + aType.Name ); + // + object ret = CallConstructor( aType, aPluginConstructorParameters ); + if ( ret != null ) + { + T plugin = (T) ret; + Trace( "CreateFromType() - saving instance: " + plugin.GetType().ToString() ); + iPlugins.Add( plugin ); + } + } + catch ( FileNotFoundException ) + { + } + catch ( Exception e ) + { + Trace( e, "CreateFromType" ); + } + } + + private object CallConstructor( Type aType, object[] aParameters ) + { + object ret = null; + // + try + { + ret = Activator.CreateInstance( aType, aParameters ); + } + catch ( Exception e ) + { + Trace( e, "CallConstructor" ); + } + // + return ret; + } + + private void LoadAssemblyAndCreatePlugins( string aFileName, object[] aPluginConstructorParameters, bool aExplicit ) + { + try + { + Trace( "LoadAssemblyAndCreatePlugins() - Trying to load plugins from dll: " + aFileName ); + if ( SymbianUtils.Assemblies.AssemblyHelper.IsCLRAssembly( aFileName ) ) + { + Assembly pluginAssembly = Assembly.LoadFrom( aFileName ); + if ( pluginAssembly != null ) + { + FindPluginsWithinAssembly( pluginAssembly, aExplicit, aPluginConstructorParameters ); + } + } + } + catch ( BadImageFormatException ) + { + // Not a managed dll - ignore error + } + catch ( Exception assemblyLoadException ) + { + Trace( assemblyLoadException, "LoadAssemblyAndCreatePlugins" ); + } + } + + private void FindPluginsWithinAssembly( Assembly aAssembly, bool aExplit, object[] aPluginConstructorParameters ) + { + bool okayToGetTypes = aExplit; + +#if BETTER_PERFORMANCE + // If explit load requested, then don't check for plugin attribute. Otherwise, to avoid + // enumerating all types we can check for our special "plugin" attribute + object[] attributes = aAssembly.GetCustomAttributes( typeof( PluginAssemblyAttribute ), false) ; + if ( attributes != null && attributes.Length > 0 ) + { + okayToGetTypes = true; + } +#else + okayToGetTypes = true; +#endif + + // Now get types + if ( okayToGetTypes ) + { + Trace( "DoLoad() - getting types from assembly: " + aAssembly.Location ); + Type[] types = aAssembly.GetTypes(); + CreateFromTypes( types, aPluginConstructorParameters ); + } + } + + private void FindPluginsWithinPath( string aPath, string aMatchSpec, object[] aPluginConstructorParameters, Assembly aAdditionalSearchAssembly ) + { + Trace( string.Format( "FindPluginsWithinPath() - path: {0}, matchSpec: {1}, invoked by: {2}", aPath, aMatchSpec, System.Environment.StackTrace ) ); + Unload(); + + // Find from path + string[] dllNames = Directory.GetFiles( aPath, aMatchSpec ); + foreach ( string dll in dllNames ) + { + string justFileName = Path.GetFileName( dll ); + LoadAssemblyAndCreatePlugins( dll, aPluginConstructorParameters, false ); + } + + // Check additional assembly + if ( aAdditionalSearchAssembly != null ) + { + FindPluginsWithinAssembly( aAdditionalSearchAssembly, true, aPluginConstructorParameters ); + } + + // Check hierarchy for derived plugins + Rationalise(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( T p in iPlugins ) + { + yield return p; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( T p in iPlugins ) + { + yield return p; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "Found: {0} of type: {1}", iPlugins.Count, typeof(T).Name ); + if ( iMinimumNumberOfExpectedPlugins > 0 ) + { + ret.AppendFormat( ", expected: {2}", iMinimumNumberOfExpectedPlugins ); + } + return ret.ToString(); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + foreach ( T obj in iPlugins ) + { + IDisposable disp = obj as IDisposable; + if ( disp != null ) + { + disp.Dispose(); + } + } + // + iPlugins.Clear(); + iPlugins = null; + } + } + #endregion + + #region Data members + private bool iDiagnostics = false; + private int iMinimumNumberOfExpectedPlugins = -1; + private List iPlugins = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/ProcessAndThread/ProcessInformation.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/ProcessAndThread/ProcessInformation.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + +namespace SymbianUtils.ProcessAndThread +{ + [StructLayout( LayoutKind.Sequential )] + internal struct ProcessInformation + { + public IntPtr hProcess; + public IntPtr hThread; + public uint dwProcessId; + public uint dwThreadId; + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/ProcessAndThread/ProcessLauncher.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/ProcessAndThread/ProcessLauncher.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using System.Runtime.InteropServices; +using System.ComponentModel; + +namespace SymbianUtils.ProcessAndThread +{ + public class ProcessLauncher + { + #region API + public static int Launch( string aFileName, string aCommandLineArguments, string aCurrentDirectory, bool aShowWindow ) + { + return Launch( aFileName, aCommandLineArguments, aCurrentDirectory, aShowWindow, 0 ); + } + + public static int Launch( string aFileName, string aCommandLineArguments, string aCurrentDirectory, bool aShowWindow, int aWaitTimeInMs ) + { + // See http://msdn.microsoft.com/en-us/library/ms682425.aspx + // See http://msdn2.microsoft.com/en-us/library/ms682425.aspx + // See http://www.pinvoke.net/default.aspx/kernel32/CreateProcess.html + ProcessInformation pi = new ProcessInformation(); + StartupInformation si = new StartupInformation(); + if ( !aShowWindow ) + { + si.dwFlags = STARTF_USESHOWWINDOW; + si.wShowWindow = SW_SHOWMINIMIZED; + } + + si.cb = Marshal.SizeOf( si ); + SecurityAttributes pSec = new SecurityAttributes(); + pSec.nLength = Marshal.SizeOf( pSec ); + SecurityAttributes tSec = new SecurityAttributes(); + tSec.nLength = Marshal.SizeOf( tSec ); + // + int error = 0; + bool suceeded = CreateProcess( aFileName, aCommandLineArguments, ref pSec, ref tSec, false, 0, IntPtr.Zero, aCurrentDirectory, ref si, out pi ) != false; + if ( !suceeded ) + { + error = Marshal.GetLastWin32Error(); + } + else + { + if ( aWaitTimeInMs != 0 ) + { + // Wait + WaitForSingleObject( pi.hProcess, aWaitTimeInMs ); + } + + // Tidy up + CloseHandle( pi.hThread ); + CloseHandle( pi.hProcess ); + + int hResult = GetExitCodeProcess( pi.hProcess, ref error ); + if ( error != 0 ) + { + Win32Exception exception = new Win32Exception( error ); + throw exception; + } + } + // + return error; + } + #endregion + + #region Internal constants + private const int STARTF_USESHOWWINDOW = 0x00000001; + private const int SW_HIDE = 0; + private const int SW_SHOWNORMAL = 1; + private const int SW_SHOWMINIMIZED = 2; + private const int SW_SHOWMAXIMIZED = 3; + #endregion + + #region Internal PInvoke wrappers + [DllImport( "kernel32.dll", SetLastError = true )] + static extern int GetExitCodeProcess( IntPtr hProcess, ref int lpExitCode ); + + [DllImport( "kernel32.dll", SetLastError = true )] + internal static extern bool CreateProcess( string lpApplicationName, + string lpCommandLine, + ref SecurityAttributes lpProcessAttributes, + ref SecurityAttributes lpThreadAttributes, + bool bInheritHandles, + uint dwCreationFlags, + IntPtr lpEnvironment, + string lpCurrentDirectory, + ref StartupInformation lpStartupInfo, + out ProcessInformation lpProcessInformation ); + + [DllImport("kernel32", SetLastError=true, ExactSpelling=true)] + internal static extern Int32 WaitForSingleObject( IntPtr handle, Int32 milliseconds ); + + [DllImport( "kernel32.dll", SetLastError = true )] + [return: MarshalAs( UnmanagedType.Bool )] + internal static extern bool CloseHandle( IntPtr hObject ); + #endregion + } + + public static class ProcessLauncherWithBlockingWait + { + #region API + public static int Launch( string aFileName, string aCommandLineArguments, string aCurrentDirectory ) + { + return Launch( aFileName, aCommandLineArguments, aCurrentDirectory, false ); + } + + public static int Launch( string aFileName, string aCommandLineArguments, string aCurrentDirectory, bool aShowWindow ) + { + LaunchWorkerThread worker = new LaunchWorkerThread( aFileName, aCommandLineArguments, aCurrentDirectory ); + return worker.LaunchAndWait( aShowWindow ); + } + #endregion + } + + #region Internal class + internal class LaunchWorkerThread + { + #region Constructors + public LaunchWorkerThread( string aFileName, string aCommandLineArguments, string aCurrentDirectory ) + { + iFileName = aFileName; + iCommandLineArguments = aCommandLineArguments; + iCurrentDirectory = aCurrentDirectory; + } + #endregion + + #region API + public int LaunchAndWait( bool aShowWindow ) + { + Thread thread = new Thread( new ParameterizedThreadStart( this.ThreadFunction ) ); + thread.Priority = ThreadPriority.BelowNormal; + thread.Start( aShowWindow ); + // + while ( thread.IsAlive ) + { + Application.DoEvents(); + Thread.Sleep( 250 ); + } + // + return iError; + } + #endregion + + #region Internal methods + private void ThreadFunction( object aData ) + { + bool showWindow = (bool) aData; + iError = ProcessLauncher.Launch( iFileName, iCommandLineArguments, iCurrentDirectory, showWindow, (int) WAIT_INFINITE ); + } + #endregion + + #region Internal constants + private static uint WAIT_INFINITE = 0xFFFFFFFF; + #endregion + + #region Data members + private int iError = -1; + private readonly string iFileName; + private readonly string iCommandLineArguments; + private readonly string iCurrentDirectory; + #endregion + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/ProcessAndThread/SecurityAttributes.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/ProcessAndThread/SecurityAttributes.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + +namespace SymbianUtils.ProcessAndThread +{ + [StructLayout( LayoutKind.Sequential )] + internal struct SecurityAttributes + { + public int nLength; + public IntPtr lpSecurityDescriptor; + public bool bInheritHandle; + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/ProcessAndThread/StartupInformation.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/ProcessAndThread/StartupInformation.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; + +namespace SymbianUtils.ProcessAndThread +{ + [StructLayout( LayoutKind.Sequential )] + internal struct StartupInformation + { + public int cb; + public string lpReserved; + public string lpDesktop; + public string lpTitle; + public uint dwX; + public uint dwY; + public uint dwXSize; + public uint dwYSize; + public uint dwXCountChars; + public uint dwYCountChars; + public uint dwFillAttribute; + public uint dwFlags; + public short wShowWindow; + public short cbReserved2; + public IntPtr lpReserved2; + public IntPtr hStdInput; + public IntPtr hStdOutput; + public IntPtr hStdError; + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Range/AddressRange.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Range/AddressRange.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,328 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; + +namespace SymbianUtils.Range +{ + public class AddressRange : IComparable + { + #region Delegates & events + public delegate void ChangeHandler( AddressRange aAddressRange ); + public event ChangeHandler RangeChanged; + #endregion + + #region Constructors + public AddressRange() + { + } + + public AddressRange( string aSpecifier ) + { + this.Parse( aSpecifier ); + } + + public AddressRange( uint aMin, uint aMax ) + { + iMin = aMin; + iMax = aMax; + } + + public AddressRange( long aMin, long aMax ) + : this( (uint) aMin, (uint) aMax ) + { + } + + public AddressRange( AddressRange aCopy ) + : this( aCopy.Min, aCopy.Max ) + { + } + #endregion + + #region API + public void Set( uint aMin, uint aMax ) + { + iMax = aMax; + iMin = aMin; + } + + public bool Contains( uint aAddress ) + { + bool ret = ( aAddress >= iMin && aAddress <= iMax ); + return ret; + } + + public bool Contains( long aAddress ) + { + bool ret = Contains( (uint) aAddress ); + return ret; + } + + public bool Contains( AddressRange aRange ) + { + bool ret = Contains( aRange.Min ) && Contains( aRange.Max ); + return ret; + } + + public void Reset() + { + iMin = uint.MaxValue; + iMax = uint.MinValue; + // + OnChanging(); + } + + public void Update( AddressRange aRange ) + { + AddressRange transaction = TransactionBegin(); + // + UpdateMin( aRange.Min ); + UpdateMax( aRange.Max ); + // + TransactionEnd( transaction ); + } + + public void UpdateMin( uint aProposedMin ) + { + uint old = iMin; + iMin = Math.Min( iMin, aProposedMin ); + // + if ( old != iMin ) + { + OnChanging(); + } + } + + public void UpdateMax( uint aProposedMax ) + { + uint old = iMax; + iMax = Math.Max( iMax, aProposedMax ); + // + if ( old != iMax ) + { + OnChanging(); + } + } + + public void UpdateMin( long aProposedMin ) + { + UpdateMin( (uint) aProposedMin ); + } + + public void UpdateMax( long aProposedMax ) + { + UpdateMax( (uint) aProposedMax ); + } + + public void Parse( string aValue ) + { + Match m = KRegEx.Match( aValue ); + if ( m.Success ) + { + string min = m.Groups[ "Min" ].Value.Replace( "0x", string.Empty ); + string max = m.Groups[ "Max" ].Value.Replace( "0x", string.Empty ); + + // Also need to know if they are hex or decimal specifiers + int baseMin = ( m.Groups[ 0 ].Value == "0x" ? 16 : 10 ); + int baseMax = ( m.Groups[ 1 ].Value == "0x" ? 16 : 10 ); + + // Now convert + uint valueMin = System.Convert.ToUInt32( min, baseMin ); + uint valueMax = System.Convert.ToUInt32( max, baseMax ); + + // Make range... + AddressRange transaction = TransactionBegin(); + // + UpdateMin( valueMin ); + UpdateMin( valueMax ); + // + TransactionEnd( transaction ); + } + else + { + throw new ArgumentException( "Invalid range format - expected [0x]AAA - [0x]BBB" ); + } + } + #endregion + + #region Properties + public uint Min + { + get { return iMin; } + set + { + if ( iMin != value ) + { + iMin = value; + OnChanging(); + } + } + } + + public uint Max + { + get { return iMax; } + set + { + if ( iMax != value ) + { + iMax = value; + OnChanging(); + } + } + } + + public uint Size + { + get + { + uint ret = Max - Min + 1; + return ret; + } + } + + public bool IsValid + { + get + { + bool goodMin = ( iMin != uint.MaxValue ); + bool goodMax = ( iMax != uint.MinValue ); + // + return ( goodMin && goodMax ); + } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.AppendFormat( "{0:x8}-{1:x8}", Min, Max ); + return ret.ToString(); + } + + public override int GetHashCode() + { + return (int) ( Min ^ Max ); + } + + public override bool Equals( object aObject ) + { + bool ret = false; + // + if ( aObject != null ) + { + if ( aObject is AddressRange ) + { + AddressRange other = (AddressRange) aObject; + // + int compareMin = other.Min.CompareTo( this.Min ); + int compareMax = other.Max.CompareTo( this.Max ); + // + ret = ( compareMin == 0 && compareMax == 0 ); + } + else + { + ret = base.Equals( aObject ); + } + } + // + return ret; + } + #endregion + + #region Operators + public static implicit operator AddressRange( string aSpecifier ) + { + AddressRange ret = new AddressRange( aSpecifier ); + return ret; + } + #endregion + + #region Internal regular expressions + private static readonly Regex KRegEx = new Regex( + "(?(?((0x))0x[A-Fa-f0-9]{1,8}|[0-9]{1,8}))\\s*\\-\\s*(?<"+ + "Max>(?((0x))0x[A-Fa-f0-9]{1,8}|[0-9]{1,8}))", + RegexOptions.CultureInvariant + | RegexOptions.Compiled + ); + #endregion + + #region From IComparable + public int CompareTo( AddressRange aOther ) + { + int ret = 1; + // + if ( aOther != null ) + { + ret = this.Min.CompareTo( aOther.Min ); + } + // + return ret; + } + #endregion + + #region Internal methods + private void OnChanging() + { + if ( !InTransaction ) + { + OnChanged(); + } + } + + protected virtual void OnChanged() + { + if ( RangeChanged != null ) + { + RangeChanged( this ); + } + } + + private bool InTransaction + { + get { return iTransactionCount > 0; } + } + + private AddressRange TransactionBegin() + { + ++iTransactionCount; + // + AddressRange ret = new AddressRange( this.Min, this.Min ); + return ret; + } + + private void TransactionEnd( AddressRange aTransaction ) + { + System.Diagnostics.Debug.Assert( iTransactionCount > 0 ); + --iTransactionCount; + // + if ( aTransaction.CompareTo( this ) != 0 ) + { + OnChanging(); + } + } + #endregion + + #region Data members + private uint iMin = uint.MaxValue; + private uint iMax = uint.MinValue; + private int iTransactionCount = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Range/AddressRangeCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Range/AddressRangeCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using SymbianUtils.Range; + +namespace SymbianUtils.Range +{ + public class AddressRangeCollection : IComparer + { + #region Constructors + public AddressRangeCollection() + { + + } + + public AddressRangeCollection( IEnumerable aList ) + { + foreach ( AddressRange entry in aList ) + { + Add( entry ); + } + } + #endregion + + #region API + public void Add( AddressRange aRange ) + { + int pos = iRange.BinarySearch( aRange, this ); + + // If not already added... + if ( pos < 0 ) + { + pos = ~pos; + + int prevItemPos = pos - 1; + if ( prevItemPos >= 0 ) + { + AddressRange last = iRange[ pos - 1 ]; + if ( last.Max + 1 == aRange.Min ) + { + last.UpdateMax( aRange.Max ); + } + else + { + iRange.Insert( pos, aRange ); + } + } + else + { + iRange.Insert( pos, aRange ); + } + } + } + + public bool Contains( uint aValue ) + { + bool ret = false; + // + AddressRange temp = new AddressRange( aValue, aValue ); + int pos = NearestIndexOf( temp ); + if ( pos >= 0 ) + { + ret = true; + } + // + return ret; + } + + public void Clear() + { + iRange.Clear(); + } + #endregion + + #region Properties + public int Count + { + get { return iRange.Count; } + } + + public AddressRange this[ int aIndex ] + { + get { return iRange[ aIndex ]; } + } + + public AddressRange RangeFirst + { + get + { + AddressRange ret = null; + // + if ( iRange.Count > 0 ) + { + ret = iRange[ 0 ]; + } + // + return ret; + } + } + + public AddressRange RangeLast + { + get + { + AddressRange ret = null; + // + int count = iRange.Count; + if ( count > 0 ) + { + ret = iRange[ count - 1 ]; + } + // + return ret; + } + } + #endregion + + #region Internal methods + private int NearestIndexOf( AddressRange aRange ) + { + int pos = iRange.BinarySearch( aRange, this ); + return pos; + } + #endregion + + #region From IComparer + public int Compare( AddressRange aLeft, AddressRange aRight ) + { + int ret = -1; + // + if ( aLeft.Min > aRight.Max ) + { + ret = 1; + } + else if ( aLeft.Contains( aRight ) || aRight.Contains( aLeft ) ) + { + ret = 0; + } + // + return ret; + } + #endregion + + #region Data members + private List iRange = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/RawItems/RawItem.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/RawItems/RawItem.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,250 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; + +namespace SymbianUtils.RawItems +{ + public class RawItem + { + #region Constructors + public RawItem() + : this( 0, 0, 0, "...." ) + { + } + + public RawItem( uint aAddress, uint aReversedData, uint aOriginalData, string aCharacterisedData ) + { + iAddress = aAddress; + iData = aReversedData; + iOriginalData = aOriginalData; + iCharacterisedData = aCharacterisedData; + } + + public RawItem( uint aAddress, uint aData ) + { + iAddress = aAddress; + iData = aData; + + // Reverse bytes to get the original data + uint[] bytes = AsBytes( aData ); + iOriginalData = SwapEndianness( bytes ); + + // Get chars + iCharacterisedData = ConvertToCharacters( bytes ); + } + #endregion + + #region API + public int PrintableCharacterCount( bool aUnicode, ref int aDotCount ) + { + int count = 0; + // + int start = ( aUnicode ) ? 1 : 0; + int delta = ( aUnicode ) ? 2 : 1; + int length = iCharacterisedData.Length; + // + for ( int i = start; i < length; i += delta ) + { + char c = iCharacterisedData[ i ]; + int charAsInt = System.Convert.ToInt32( c ); + + if ( c >= 32 && c < 128 || c == 0x0D || c == 0x0A || c == 0x09 ) + { + ++count; + } + if ( c == '.' ) + { + ++aDotCount; + } + } + return count; + } + #endregion + + #region Properties + public uint Address + { + get { return iAddress; } + set { iAddress = value; } + } + + public uint Data + { + get { return iData; } + set { iData = value; } + } + + public byte[] DataArray + { + get + { + byte[] ret = new byte[ 4 ]; + // + ret[ 0 ] = (byte) ( ( iData >> 0 ) & 0xFF ); + ret[ 1 ] = (byte) ( ( iData >> 8 ) & 0xFF ); + ret[ 2 ] = (byte) ( ( iData >> 16 ) & 0xFF ); + ret[ 3 ] = (byte) ( ( iData >> 24 ) & 0xFF ); + // + return ret; + } + } + + public ushort[] DataArrayWords + { + get + { + ushort[] ret = new ushort[ 2 ]; + // + ret[ 0 ] = (ushort) ( ( iData ) & 0x0000FFFF ); + ret[ 1 ] = (ushort) ( ( iData >> 16 ) & 0x0000FFFF ); + // + return ret; + } + } + + public uint OriginalData + { + get { return iOriginalData; } + set { iOriginalData = value; } + } + + public string CharacterisedData + { + get { return iCharacterisedData; } + set { iCharacterisedData = value; } + } + + public string OriginalCharacterisedData + { + get + { + char[] reversedCharacterisedData = new char[ iCharacterisedData.Length ]; + for (int i = 0; i < iCharacterisedData.Length; i+=4) + { + string bytes = iCharacterisedData.Substring(i, 4); + reversedCharacterisedData[i] = bytes[3]; + reversedCharacterisedData[i+1] = bytes[2]; + reversedCharacterisedData[i+2] = bytes[1]; + reversedCharacterisedData[i+3] = bytes[0]; + } + // + string characterisedData = new string(reversedCharacterisedData); + return characterisedData; + } + } + + public string OriginalCharacterisedDataAsUnicode + { + get + { + StringBuilder text = new StringBuilder( OriginalCharacterisedData ); + for( int i = text.Length-1; i >= 0; i-=2 ) + { + text.Remove( i, 1 ); + } + string ret = text.ToString(); + return ret; + } + } + + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + + public static uint RoundToNearestDWord( uint aValue ) + { + uint dwords = aValue / KSizeOfOneRawItemInBytes; + uint ret = dwords * KSizeOfOneRawItemInBytes; + uint remainder = aValue % KSizeOfOneRawItemInBytes; + // + if ( remainder > 0 ) + { + ret += KSizeOfOneRawItemInBytes; + } + // + return ret; + } + #endregion + + #region Constants + public const uint KSizeOfOneRawItemInBytes = 4; + #endregion + + #region Internal methods + private static uint[] AsBytes( uint aValue ) + { + uint[] ret = new uint[4]; + // + ret[ 0 ] = ( aValue ) & 0xFF; + ret[ 1 ] = ( aValue >> 8 ) & 0xFF; + ret[ 2 ] = ( aValue >> 16 ) & 0xFF; + ret[ 3 ] = ( aValue >> 24 ) & 0xFF; + // + return ret; + } + + private static uint SwapEndianness( uint aValue ) + { + uint[] bytes = AsBytes( aValue ); + return SwapEndianness( bytes ); + } + + private static uint SwapEndianness( uint[] aBytes ) + { + System.Diagnostics.Debug.Assert( aBytes.Length == KSizeOfOneRawItemInBytes ); + uint ret = 0; + // + ret += ( aBytes[ 3 ] << 0 ); + ret += ( aBytes[ 2 ] << 8 ); + ret += ( aBytes[ 1 ] << 16 ); + ret += ( aBytes[ 0 ] << 24 ); + // + return ret; + } + + private static string ConvertToCharacters( uint[] aBytes ) + { + StringBuilder ret = new StringBuilder(); + // + foreach ( uint val in aBytes ) + { + char c = System.Convert.ToChar( val ); + // + if ( c <= 0x20 || c >= 0x7f || c == '%' ) + { + c = '.'; + } + // + ret.Insert( 0, c ); + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private object iTag = null; + private uint iAddress; + private uint iData; + private uint iOriginalData; + private string iCharacterisedData = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/RawItems/RawItemCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/RawItems/RawItemCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,175 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; + +namespace SymbianUtils.RawItems +{ + public class RawItemCollection : IEnumerable + { + #region Constructors + public RawItemCollection() + { + } + #endregion + + #region API + public void Clear() + { + iRawItems.Clear(); + } + + public void Add( RawItem aItem ) + { + iRawItems.Add( aItem ); + } + + public int CountPadding( byte aPaddingByte ) + { + int ret = 0; + bool finished = false; + // + for ( int i = Count - 1; !finished && i >= 0; i-- ) + { + RawItem item = this[ i ]; + long dataValue = item.OriginalData; + // + for ( int j = 0; j < 4; j++ ) + { + long mask = 0x000000FFL << ( j * 8 ); + long value = ( mask & dataValue ); + int shiftBy = ( j * 8 ); + long valueClean = value >> shiftBy; + if ( valueClean == aPaddingByte ) + { + ++ret; + } + else + { + finished = true; + break; + } + } + } + // + return ret; + } + + public int PrintableCharacterCount( bool aUnicode, bool aIncludeFirstItem, out int aDotCount ) + { + aDotCount = 0; + int i = ( aIncludeFirstItem ) ? 0 : 1; + // + int ret = 0; + for ( ; i < iRawItems.Count; i++ ) + { + RawItem item = iRawItems[ i ]; + ret += item.PrintableCharacterCount( aUnicode, ref aDotCount ); + } + // + return ret; + } + + public int PrintableCharacterCount( bool aUnicode, out int aDotCount ) + { + int ret = 0; + aDotCount = 0; + // + foreach ( RawItem item in iRawItems ) + { + ret += item.PrintableCharacterCount( aUnicode, ref aDotCount ); + } + // + return ret; + } + #endregion + + #region Properties + public string FirstLine + { + get + { + StringBuilder ret = new StringBuilder(); + // + int count = Count; + for ( int i = 0; i < 8; i += 8 ) + { + for ( int j = 0; j < 8 && i + j < count; j++ ) + { + RawItem item = this[ i + j ]; + ret.Append( item.OriginalCharacterisedData ); + } + } + // + return ret.ToString(); + } + } + + public int Count + { + get { return iRawItems.Count; } + } + + public RawItem this[ int aIndex ] + { + get + { + RawItem ret = iRawItems[ aIndex ]; + return ret; + } + } + #endregion + + #region IEnumerable Members + IEnumerator IEnumerable.GetEnumerator() + { + return new RawItemCollectionEnumerator( this ); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return new RawItemCollectionEnumerator( this ); + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + int count = Count; + for ( int i = 0; i < count; i += 8 ) + { + for ( int j = 0; j < 8 && i + j < count; j++ ) + { + RawItem item = this[ i + j ]; + ret.Append( item.OriginalCharacterisedData ); + } + ret.Append( System.Environment.NewLine ); + } + // + return ret.ToString(); + } + #endregion + + #region Data members + private List iRawItems = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/RawItems/RawItemCollectionEnumerator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/RawItems/RawItemCollectionEnumerator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; + +namespace SymbianUtils.RawItems +{ + internal class RawItemCollectionEnumerator : IEnumerator + { + #region Constructors + public RawItemCollectionEnumerator( RawItemCollection aCollection ) + { + iCollection = aCollection; + } + #endregion + + #region From IEnumeratorFrom + RawItem IEnumerator.Current + { + get { return iCollection[ iCurrentIndex ]; } + } + #endregion + + #region IEnumerator Members + object IEnumerator.Current + { + get + { + return iCollection[ iCurrentIndex ]; + } + } + + bool IEnumerator.MoveNext() + { + return ( ++iCurrentIndex < iCollection.Count ); + } + + void IEnumerator.Reset() + { + iCurrentIndex = -1; + } + #endregion + + #region IDisposable Members + void IDisposable.Dispose() + { + } + #endregion + + #region Data members + private readonly RawItemCollection iCollection; + private int iCurrentIndex = -1; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SerializedOperations/SerializedOperation.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SerializedOperations/SerializedOperation.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,276 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.ComponentModel; + +namespace SymbianUtils.SerializedOperations +{ + public abstract class SerializedOperation : DisposableObject, IComparable + { + #region Delegates & events + public delegate void EventHandler( SerializedOperation aOperation ); + public event EventHandler Started; + public event EventHandler Completed; + #endregion + + #region Constructors + protected SerializedOperation() + : this( true ) + { + } + + protected SerializedOperation( bool aEnabled ) + { + Enabled = aEnabled; + // + iWorker.DoWork += new DoWorkEventHandler( DoWork ); + } + #endregion + + #region Framework API + protected abstract void PerformOperation(); + + public virtual long Priority + { + get { return 0; } + } + #endregion + + #region API + public void EnableAndWait() + { + Trace( "[{0}] EnableAndWait() - START - enabled: {1}, busy: {2}", this.GetType().Name, Enabled, IsBusy ); + System.Diagnostics.Debug.Assert( Enabled == false ); + System.Diagnostics.Debug.Assert( !IsBusy ); + + if ( IsBusy ) + { + while ( IsBusy ) + { + Trace( "[{0}] EnableAndWait() - still busy?: {1}", this.GetType().Name, IsBusy ); + Thread.Sleep( 10 ); + } + } + else + { + SymbianUtils.SymDebug.SymDebugger.Assert( iWaitForCompletion == null ); + using ( iWaitForCompletion = new AutoResetEvent( false ) ) + { + // Enable the operation + Trace( "[{0}] EnableAndWait() - enabling item...", this.GetType().Name ); + Enabled = true; + + // And now block until it completes + Trace( "[{0}] EnableAndWait() - sleeping...", this.GetType().Name ); + iWaitForCompletion.WaitOne(); + Trace( "[{0}] EnableAndWait() - slept!", this.GetType().Name ); + } + } + + Trace( "[{0}] EnableAndWait() - END", this.GetType().Name ); + } + #endregion + + #region Properties + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + + public bool IsBusy + { + get { return iWorker.IsBusy; } + } + + public bool Enabled + { + get { return iEnabled; } + set + { + lock ( iEnabledLock ) + { + if ( value != iEnabled ) + { + iEnabled = value; + if ( OperationManager != null ) + { + OperationManager.OnOperationEnabledStatusChanged( this ); + } + } + } + } + } + + internal SerializedOperationManager OperationManager + { + get { return iManager; } + set { iManager = value; } + } + #endregion + + #region Event handlers + private void DoWork( object aSender, DoWorkEventArgs aArgs ) + { + System.Diagnostics.Debug.Assert( OperationManager != null ); + NotifyStarted(); + // + try + { + PerformOperation(); + } + catch ( Exception opException ) + { + OperationManager.Trace( string.Format( "OPERATION EXCEPTION MSG - op: {0} ({1}) - msg: {2}", this.ToString(), this.GetType(), opException.Message ) ); + OperationManager.Trace( string.Format( "OPERATION EXCEPTION STK {0}", opException.StackTrace ) ); + } + // + NotifyCompleted(); + } + + private void WorkerCompleted() + { + Trace( "[{0}] WorkerCompleted() - START", this.GetType().Name ); + // + System.Diagnostics.Debug.Assert( OperationManager != null ); + OperationManager.OperationCompleted( this ); + // + if ( iWaitForCompletion != null ) + { + Trace( "[{0}] WorkerCompleted() - unblocking main thread...", this.GetType().Name ); + iWaitForCompletion.Set(); + } + // + Trace( "[{0}] WorkerCompleted() - END", this.GetType().Name ); + } + #endregion + + #region Internal methods + protected void Trace( string aMessage ) + { + iManager.Trace( aMessage ); + } + + protected void Trace( string aFormat, params object[] aParams ) + { + iManager.Trace( aFormat, aParams ); + } + + internal void Start() + { + Start( null ); + } + + internal void Start( object aParameter ) + { + System.Diagnostics.Debug.Assert( Enabled ); + iWorker.RunWorkerAsync( aParameter ); + } + + private void NotifyStarted() + { + try + { + if ( Started != null ) + { + Started( this ); + } + } + catch ( Exception ) + { + } + } + + private void NotifyCompleted() + { + try + { + if ( Completed != null ) + { + Completed( this ); + } + try + { + WorkerCompleted(); + } + catch ( Exception ) + { + } + } + catch ( Exception ) + { + } + } + #endregion + + #region From IComparable + public int CompareTo( SerializedOperation aOther ) + { + int ret = 1; + // + if ( aOther != null ) + { + ret = this.Priority.CompareTo( aOther.Priority ); + } + // + return ret; + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iWaitForCompletion != null ) + { + iWaitForCompletion.Close(); + iWaitForCompletion = null; + } + if ( iWorker != null ) + { + iWorker.Dispose(); + iWorker = null; + } + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return this.GetType().Name; + } + #endregion + + #region Data members + private object iTag = null; + private object iEnabledLock = new object(); + private bool iEnabled = true; + private SerializedOperationManager iManager = null; + private BackgroundWorker iWorker = new BackgroundWorker(); + private AutoResetEvent iWaitForCompletion = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SerializedOperations/SerializedOperationManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SerializedOperations/SerializedOperationManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,383 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.ComponentModel; +using SymbianUtils.Tracer; + +namespace SymbianUtils.SerializedOperations +{ + public class SerializedOperationManager : DisposableObject, ITracer + { + #region Enumerations + public enum TState + { + EStateOperationsStarted = 0, + EStateOperationsSuspended, + EStateOperationsCompleted + } + #endregion + + #region Delegates & events + public delegate void QueueStateHandler( TState aState ); + public event QueueStateHandler StateHandler; + #endregion + + #region Constructors + public SerializedOperationManager() + : this( null ) + { + } + + public SerializedOperationManager( ITracer aTracer ) + { + iTracer = aTracer; + } + #endregion + + #region API + public virtual void Clear() + { + lock ( iQueue ) + { + Stop(); + iQueue.Clear(); + } + } + + public void Start() + { + Enabled = true; + StartNextOperation(); + } + + public void Stop() + { + Enabled = false; + } + + public void Queue( SerializedOperation aOperation ) + { + Trace( "Queue() - START - enabled: {0}, count: {1}, OpInProg: {2}", Enabled, iQueue.Count, OperationInProgress ); + lock ( iQueue ) + { + Trace( "Queue() - aOperation.Enabled: {0}, aOperation: {1}", aOperation.Enabled, aOperation.GetType().Name ); + + aOperation.OperationManager = this; + iQueue.Add( aOperation ); + + // Sort the list so that the highest priority item is first + Comparison sortByPriority = delegate( SerializedOperation aLeft, SerializedOperation aRight ) + { + // We want highest-to-lowest sort order + int ret = aLeft.CompareTo( aRight ); + return ret * -1; + }; + iQueue.Sort( sortByPriority ); + + Trace( "Queue() - {{{0}}} - Queue now contains {1} entries, amEnabled: {2}", aOperation.GetType(), Count, Enabled ); + } + + StartNextOperation(); + Trace( "Queue() - END - enabled: {0}, count: {1}, OpInProg: {2}", Enabled, iQueue.Count, OperationInProgress ); + Trace( "" ); + Trace( "" ); + } + #endregion + + #region Properties + public int Count + { + get + { + lock( iQueue ) + { + return iQueue.Count; + } + } + } + + public bool Enabled + { + get { return iEnabled; } + private set + { + lock ( iEnabledLock ) + { + if ( iEnabled != value ) + { + Trace( "Enabled - current value: {0}, new value: {1}", iEnabled, value ); + iEnabled = value; + // + TState e = value ? TState.EStateOperationsStarted : TState.EStateOperationsSuspended; + if ( StateHandler != null ) + { + StateHandler( e ); + } + } + } + } + } + + public ITracer Tracer + { + get + { + ITracer ret = this; + // + if ( iTracer != null ) + { + ret = iTracer; + } + // + return ret; + } + set { iTracer = value; } + } + + public bool OperationInProgress + { + get + { + lock ( iQueue ) + { + return iPendingOperation; + } + } + private set + { + lock ( iQueue ) + { + iPendingOperation = value; + } + } + } + + public bool IsCompleteAndIdle + { + get + { + bool ret = false; + // + lock ( iQueue ) + { + int enabledCount = OperationCountEnabled; + if ( Enabled == false ) + { + // To be complete when we are disabled, then there must be + // no items that are ready to run. + ret = ( enabledCount == 0 ); + } + else + { + // If we are enabled, then we are complete when there are + // no more enabled items left to run. + ret = ( enabledCount == 0 ); + } + } + // + return ret; + } + } + #endregion + + #region ITracer Members + public void Trace( string aMessage ) + { + if ( iTracer != null ) + { + iTracer.Trace( "[" + this.GetType().Name + "] " + aMessage ); + } + } + + public void Trace( string aFormat, params object[] aParams ) + { + if ( iTracer != null ) + { + string text = string.Format( aFormat, aParams ); + iTracer.Trace( "[" + this.GetType().Name + "] {0}", text ); + } + } + #endregion + + #region Internal methods + internal void OnOperationEnabledStatusChanged( SerializedOperation aOperation ) + { + StartNextOperation(); + } + + internal void OperationCompleted( SerializedOperation aOperation ) + { + OperationInProgress = false; + Trace( "OpComplete() - Operation completed {{{0}}}, queue contains {1} more entries, amEnabled: {2}", aOperation.GetType(), Count, Enabled ); + // + StartNextOperation(); + } + + private void StartNextOperation() + { + TraceQueue( string.Format( "StartNextOperation() - START - Enabled: {0}", Enabled ) ); + + lock ( iQueue ) + { + Trace( "StartNextOperation() - count: {0}, OpInProg: {1}", iQueue.Count, OperationInProgress ); + bool enabled = Enabled; + if ( enabled ) + { + if ( OperationInProgress ) + { + Trace( "StartNextOperation() - Already running operation!" ); + } + else + { + SerializedOperation op = FindNextOp(); + if ( op != null ) + { + iQueue.Remove( op ); + // + Trace( string.Empty ); + Trace( string.Empty ); + Trace( "StartNextOperation() - ****************************************************************************" ); + Trace( "StartNextOperation() - starting op: {0}/{1} [{2}]", 1, iQueue.Count + 1, op.GetType() + " - " + op.ToString() ); + Trace( "StartNextOperation() - ****************************************************************************" ); + // + op.Start(); + + OperationInProgress = true; + } + else + { + Trace( "StartNextOperation() - Queue is empty or no enabled items!" ); + if ( StateHandler != null ) + { + StateHandler( TState.EStateOperationsCompleted ); + } + } + } + } + else + { + Trace( "StartNextOperation() - Queue is disabled!" ); + } + } + + Trace( "StartNextOperation() - END - count: {0}, OpInProg: {1}, Enabled: {2}", iQueue.Count, OperationInProgress, Enabled ); + Trace( "" ); + } + + private void TraceQueue( string aFrom ) + { + StringBuilder text = new StringBuilder(); + + text.AppendLine( string.Format( "========================== {0} ==========================", aFrom ) ); + text.AppendLine( string.Format( "opInPrgress: {0}", OperationInProgress ) ); + text.AppendLine( string.Format( "enabled: {0}", Enabled ) ); + // + lock ( iQueue ) + { + int count = iQueue.Count; + text.AppendLine( string.Format( "count: {0}", count ) ); + text.AppendLine( "" ); + + int i = 1; + foreach ( SerializedOperation op in iQueue ) + { + text.AppendLine( string.Format( "[{0:d2}/{1:d2}] enabled: {2}, busy: {3}, pri: {4:d10}, name: {5}", i, count, System.Convert.ToInt32( op.Enabled ), System.Convert.ToInt32( op.IsBusy ), op.Priority, op.ToString() ) ); + ++i; + } + } + // + text.AppendLine( "" ); + text.AppendLine( "" ); + // + Trace( text.ToString() ); + } + + private SerializedOperation FindNextOp() + { + TraceQueue( "FindNextOp()" ); + SerializedOperation ret = null; + // + foreach ( SerializedOperation op in iQueue ) + { + System.Diagnostics.Debug.Assert( !op.IsBusy ); + if ( op.Enabled ) + { + ret = op; + break; + } + } + // + return ret; + } + + private int OperationCountEnabled + { + get + { + int ret = 0; + // + lock ( iQueue ) + { + Action act = delegate(SerializedOperation op ) + { + if ( op.Enabled ) + { + ++ret; + } + }; + iQueue.ForEach( act ); + } + // + return ret; + } + } + + private int OperationCountDisabled + { + get + { + int ret = 0; + // + lock ( iQueue ) + { + Action act = delegate( SerializedOperation op ) + { + if ( !op.Enabled ) + { + ++ret; + } + }; + iQueue.ForEach( act ); + } + // + return ret; + } + } + #endregion + + #region Data members + private ITracer iTracer; + private List iQueue = new List(); + private bool iPendingOperation = false; + private bool iEnabled = false; + private object iEnabledLock = new object(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettings.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettings.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,779 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Xml; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Diagnostics; +using System.Collections; +using System.Windows.Forms; +using System.Drawing; +using Microsoft.Win32; + +namespace SymbianUtils.Settings +{ + public class XmlSettings : IEnumerable + { + #region Constructors + public XmlSettings( string aFileName ) + { + FullyQualifiedFileName = aFileName; + } + #endregion + + #region Store & Restore API + public void Restore() + { + string file = FullyQualifiedFileName; + if (System.IO.File.Exists(file)) + { + XmlTextReader reader = new XmlTextReader(file); + try + { + reader.WhitespaceHandling = WhitespaceHandling.None; + reader.MoveToContent(); + ReadData(reader); + } + catch (XmlException) + { + // Ignore for now + } + finally + { + reader.Close(); + } + } + } + + public void Store() + { + string file = FullyQualifiedFileName; + XmlTextWriter writer = new XmlTextWriter(file, System.Text.Encoding.UTF8); + try + { + writer.Formatting = Formatting.Indented; + WriteData(writer); + } + catch (XmlException) + { + // Ignore for now + } + finally + { + writer.Close(); + } + } + #endregion + + #region API + public void Clear() + { + iCategories.Clear(); + } + + public void Add( XmlSettingCategory aCategory ) + { + iCategories.Add( aCategory.Name, aCategory ); + } + + public bool Exists( string aCategory ) + { + return iCategories.ContainsKey( aCategory ); + } + + public bool Exists( string aCategory, string aKey ) + { + bool ret = false; + // + if ( Exists( aCategory ) ) + { + XmlSettingCategory category = this[ aCategory ]; + ret = category.Exists( aKey ); + } + // + return ret; + } + + public void Remove( string aCategory ) + { + if ( Exists( aCategory ) ) + { + iCategories.Remove( aCategory ); + } + } + + public void Remove( string aCategory, string aKey ) + { + if ( Exists( aCategory ) ) + { + XmlSettingCategory category = this[ aCategory ]; + category.Remove( aKey ); + } + } + #endregion + + #region Loading & Saving + public void Save( string aCategory, object aObject ) + { + if ( aObject is TextBox ) + { + DoSave( aCategory, aObject as TextBox ); + } + else if ( aObject is RadioButton ) + { + DoSave( aCategory, aObject as RadioButton ); + } + else if ( aObject is CheckBox ) + { + DoSave( aCategory, aObject as CheckBox ); + } + else if ( aObject is ComboBox ) + { + DoSave( aCategory, aObject as ComboBox ); + } + else if ( aObject is IXmlSettingsSimple ) + { + DoSave( aCategory, aObject as IXmlSettingsSimple ); + } + else if ( aObject is IXmlSettingsExtended ) + { + DoSave( aCategory, aObject as IXmlSettingsExtended ); + } + else if ( aObject is Form ) + { + DoSave( aCategory, aObject as Form ); + } + } + + public void Load( string aCategory, object aObject ) + { + if ( aObject is TextBox ) + { + DoLoad( aCategory, aObject as TextBox ); + } + else if ( aObject is RadioButton ) + { + DoLoad( aCategory, aObject as RadioButton ); + } + else if ( aObject is CheckBox ) + { + DoLoad( aCategory, aObject as CheckBox ); + } + else if ( aObject is ComboBox ) + { + DoLoad( aCategory, aObject as ComboBox ); + } + else if ( aObject is IXmlSettingsSimple ) + { + DoLoad( aCategory, aObject as IXmlSettingsSimple ); + } + else if ( aObject is IXmlSettingsExtended ) + { + DoLoad( aCategory, aObject as IXmlSettingsExtended ); + } + else if ( aObject is Form ) + { + DoLoad( aCategory, aObject as Form ); + } + } + + #region Basic types + public void Save( string aCategory, string aName, int aValue ) + { + this[ aCategory, aName ] = aValue; + } + + public void Save( string aCategory, string aName, uint aValue ) + { + this[ aCategory, aName ] = aValue; + } + + public void Save( string aCategory, string aName, long aValue ) + { + this[ aCategory, aName ] = aValue; + } + + public void Save( string aCategory, string aName, bool aValue ) + { + this[ aCategory, aName ] = aValue; + } + + public void Save( string aCategory, string aName, string aValue ) + { + this[ aCategory, aName ] = aValue; + } + + public void Save( string aCategory, string aName, object aValue ) + { + this[ aCategory, aName ].Value = aValue; + } + + public void Save( string aCategory, string aName, Point aValue ) + { + this[ aCategory, aName ].Value = string.Format( "{0},{1}", aValue.X, aValue.Y ); + } + + public void Save( string aCategory, string aName, Size aValue ) + { + this[ aCategory, aName ].Value = string.Format( "{0},{1}", aValue.Width, aValue.Height ); + } + + public int LoadInt( string aCategory, string aName ) + { + return Load( aCategory, aName, 0 ); + } + + public int Load( string aCategory, string aName, int aDefault ) + { + int ret = aDefault; + if ( Exists( aCategory, aName ) ) + { + ret = this[ aCategory, aName ]; + } + return ret; + } + + public uint LoadUint( string aCategory, string aName ) + { + return Load( aCategory, aName, 0U ); + } + + public uint Load( string aCategory, string aName, uint aDefault ) + { + uint ret = aDefault; + if ( Exists( aCategory, aName ) ) + { + ret = this[ aCategory, aName ]; + } + return ret; + } + + public long LoadLong( string aCategory, string aName ) + { + return Load( aCategory, aName, 0L ); + } + + public long Load( string aCategory, string aName, long aDefault ) + { + long ret = aDefault; + if ( Exists( aCategory, aName ) ) + { + ret = this[ aCategory, aName ]; + } + return ret; + } + + public bool LoadBool( string aCategory, string aName ) + { + return Load( aCategory, aName, false ); + } + + public bool Load( string aCategory, string aName, bool aDefault ) + { + bool ret = aDefault; + if ( Exists( aCategory, aName ) ) + { + ret = this[ aCategory, aName ]; + } + return ret; + } + + public string Load( string aCategory, string aName ) + { + return Load( aCategory, aName, string.Empty ); + } + + public string Load( string aCategory, string aName, string aDefault ) + { + string ret = aDefault; + if ( Exists( aCategory, aName ) ) + { + ret = this[ aCategory, aName ]; + } + return ret; + } + + public object LoadObject( string aCategory, string aName ) + { + return Load( aCategory, aName, null ); + } + + public object Load( string aCategory, string aName, object aDefault ) + { + object ret = aDefault; + if ( Exists( aCategory, aName ) ) + { + ret = this[ aCategory, aName ].Value; + } + return ret; + } + + public Point Load( string aCategory, string aName, Point aDefault ) + { + Point ret = aDefault; + if ( Exists( aCategory, aName ) ) + { + ret = this[ aCategory, aName ]; + } + return ret; + } + + public Size Load( string aCategory, string aName, Size aDefault ) + { + Size ret = aDefault; + if ( Exists( aCategory, aName ) ) + { + ret = this[ aCategory, aName ]; + } + return ret; + } + #endregion + + #endregion + + #region Properties + public int Count + { + get { return iCategories.Count; } + } + + public string FileName + { + get + { + FileInfo info = new FileInfo(FullyQualifiedFileName); + return info.Name; + } + set + { + FileInfo newNameInfo = new FileInfo(value); + FileInfo fullNameInfo = new FileInfo(FullyQualifiedFileName); + string fileName = fullNameInfo.DirectoryName; + fileName += newNameInfo.Name; + FullyQualifiedFileName = fileName; + } + } + + public string FullyQualifiedFileName + { + get { return iFullyQualifiedFileName; } + set + { + string path = string.Empty; + try + { + path = Path.GetDirectoryName(value); + + } + catch(ArgumentException) + { + } + + if (path == null || path.Length == 0) + { + // Get the path from the current app domain + iFullyQualifiedFileName = Path.Combine(System.Windows.Forms.Application.StartupPath, Path.GetFileName(value)); + } + else + { + iFullyQualifiedFileName = value; + } + } + } + + public static Version CurrentSettingsVersion + { + get { return iCurrentSettingsVersion; } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( KeyValuePair pair in iCategories ) + { + yield return pair.Value; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( KeyValuePair pair in iCategories ) + { + yield return pair.Value; + } + } + #endregion + + #region Indexers + public XmlSettingCategory this[ int aIndex ] + { + get + { + string key = iCategories.Keys[ aIndex ]; + return iCategories[ key ]; + } + } + + public XmlSettingCategory this[ string aCategory ] + { + get + { + XmlSettingCategory ret = new XmlSettingCategory( aCategory ); + if ( Exists( aCategory ) ) + { + ret = iCategories[ aCategory ]; + } + else + { + iCategories.Add( aCategory, ret ); + } + // + return ret; + } + } + + public XmlSettingsValue this[ string aCategory, string aKey ] + { + get + { + XmlSettingCategory category = this[ aCategory ]; + XmlSettingsValue value = category[ aKey ]; + return value; + } + set + { + XmlSettingCategory category = this[ aCategory ]; + category[ aKey ] = value; + } + } + + public XmlSettingsValue this[ string aCategory, object aObject ] + { + get + { + string key = aObject.ToString(); + if ( aObject is System.Windows.Forms.Control ) + { + key = ( aObject as Control ).Name; + } + return this[ aCategory, key ]; + } + set + { + string key = aObject.ToString(); + if ( aObject is System.Windows.Forms.Control ) + { + key = ( aObject as Control ).Name; + } + this[ aCategory, key ] = value; + } + } + #endregion + + #region Internal write helpers + private void WriteData(XmlWriter aWriter) + { + aWriter.WriteStartElement( null, "configuration", null ); + // + WriteConfigSections( aWriter ); + WriteSectionItems( aWriter ); + // + aWriter.WriteEndElement(); + } + + private void WriteConfigSections(XmlWriter aWriter) + { + aWriter.WriteStartElement( null, "configSections", null ); + // + foreach( XmlSettingCategory cat in this ) + { + aWriter.WriteStartElement("section", null); + aWriter.WriteAttributeString("name", cat.Name); + aWriter.WriteAttributeString("version", cat.Version.ToString()); + aWriter.WriteRaw(" "); + aWriter.WriteEndElement(); + } + // + aWriter.WriteEndElement(); + } + + private void WriteSectionItems(XmlWriter aWriter) + { + aWriter.WriteStartElement(null, "sectionItems", null); + // + foreach ( XmlSettingCategory cat in this ) + { + cat.WriteSettings( aWriter ); + } + // + aWriter.WriteEndElement(); + } + #endregion + + #region Internal read helpers + private void ReadData(XmlReader aReader) + { + aReader.ReadStartElement("configuration"); + // + ReadConfigSections( aReader ); + ReadSectionItems( aReader ); + // + aReader.ReadEndElement(); // configuration + } + + private void ReadConfigSections(XmlReader aReader) + { + aReader.ReadStartElement("configSections"); + // + while (!aReader.EOF && aReader.Name == "section") + { + if (aReader.NodeType != XmlNodeType.EndElement) + { + XmlSettingCategory category = new XmlSettingCategory( aReader ); + iCategories.Add( category.Name, category ); + } + aReader.Read(); + } + // + aReader.ReadEndElement(); // configSections + } + + private void ReadSingleSection( XmlReader aReader ) + { + string sectionName = aReader.Name; + + // Advance to first section key & pair + if ( aReader.IsEmptyElement ) + { + // It's empty - doesn't contain any content + } + else + { + bool readOkay = aReader.Read(); + + // Search for the existing section definition + if ( readOkay && Exists( sectionName ) ) + { + XmlSettingCategory cat = this[ sectionName ]; + cat.ReadSettings( aReader ); + } + } + } + + private void ReadSectionItems(XmlReader aReader) + { + aReader.ReadStartElement( "sectionItems" ); + // + while ( !aReader.EOF && !( aReader.NodeType == XmlNodeType.EndElement && aReader.Name == "sectionItems" ) ) + { + ReadSingleSection( aReader ); + aReader.Read(); + } + // + aReader.ReadEndElement(); // sectionItems + } + #endregion + + #region Internal settings savers + private void DoSave( string aCategory, IXmlSettingsSimple aObject ) + { + string name = aObject.XmlSettingsPersistableName; + string value = aObject.XmlSettingPersistableValue; + this[ aCategory, name ] = value; + } + + private void DoLoad( string aCategory, IXmlSettingsSimple aObject ) + { + string name = aObject.XmlSettingsPersistableName; + string value = this[ aCategory, name ]; + aObject.XmlSettingPersistableValue = value; + } + + private void DoSave( string aCategory, IXmlSettingsExtended aObject ) + { + aObject.XmlSettingsSave( this, aCategory ); + } + + private void DoLoad( string aCategory, IXmlSettingsExtended aObject ) + { + aObject.XmlSettingsLoad( this, aCategory ); + } + + private void DoSave( string aCategory, TextBox aControl ) + { + this[ aCategory, aControl.Name ] = aControl.Text; + } + + private void DoLoad( string aCategory, TextBox aControl ) + { + DoLoad( aCategory, aControl, string.Empty ); + } + + private void DoLoad( string aCategory, TextBox aControl, string aDefault ) + { + string val = this[ aCategory, aControl.Name ]; + if ( val.Length > 0 ) + { + aControl.Text = val; + } + else + { + aControl.Text = aDefault; + } + } + + private void DoSave( string aCategory, CheckBox aControl ) + { + this[ aCategory, aControl.Name ] = aControl.Checked; + } + + private void DoLoad( string aCategory, CheckBox aControl ) + { + aControl.Checked = this[ aCategory, aControl ]; + } + + private void DoSave( string aCategory, RadioButton aControl ) + { + this[ aCategory, aControl.Name ] = aControl.Checked; + } + + private void DoLoad( string aCategory, RadioButton aControl ) + { + aControl.Checked = this[ aCategory, aControl ]; + } + + private void DoSave( string aCategory, ComboBox aControl ) + { + XmlSettingCategory category = this[ aCategory ]; + + // Basic prefix + string baseName = string.Format( "{0}###Item###", aControl.Name ); + + // Write count, selection + category[ baseName + "Count" ] = aControl.Items.Count; + category[ baseName + "SelectedIndex" ] = aControl.SelectedIndex; + + // Write items + int itemIndex = 0; + foreach ( object item in aControl.Items ) + { + string itemName = string.Format( "{0}{1:d6}", baseName, itemIndex++ ); + category[ itemName ] = item.ToString(); + } + } + + private void DoLoad( string aCategory, ComboBox aControl ) + { + XmlSettingCategory category = this[ aCategory ]; + + aControl.BeginUpdate(); + + // Basic prefix + string baseName = string.Format( "{0}###Item###", aControl.Name ); + + // Get count, selection + int count = category[ baseName + "Count" ].ToInt( 0 ); + int selectedIndex = category[ baseName + "SelectedIndex" ].ToInt( 0 ); + + // Get items + for ( int itemIndex = 0; itemIndex < count; itemIndex++ ) + { + string itemName = string.Format( "{0}{1:d6}", baseName, itemIndex++ ); + string itemText = category[ itemName ]; + bool alreadyExists = aControl.Items.Contains( itemText ); + if ( !alreadyExists ) + { + aControl.Items.Add( itemText ); + } + } + + // Set selection if possible + if ( selectedIndex >= 0 && selectedIndex < aControl.Items.Count ) + { + aControl.SelectedIndex = selectedIndex; + } + aControl.EndUpdate(); + } + + private void DoSave( string aCategory, Form aForm ) + { + XmlSettingCategory category = this[ aCategory ]; + + // Save location (if relevant) + Point location = new Point(); + if ( aForm.WindowState == FormWindowState.Normal ) + { + location = aForm.Location; + } + Save( aCategory, "__#Location#__", location ); + + // Save size + Size size = new Size(); + if ( aForm.WindowState == FormWindowState.Normal ) + { + size = aForm.Size; + } + Save( aCategory, "__#Size#__", size ); + + // Save window state + category[ "__#State#__" ] = aForm.WindowState.ToString(); + } + + private void DoLoad( string aCategory, Form aForm ) + { + aForm.StartPosition = FormStartPosition.Manual; + + if ( Exists( aCategory ) ) + { + XmlSettingCategory category = this[ aCategory ]; + + // Get initial string setting values + string stringState = category[ "__#State#__" ]; + string stringLocation = category[ "__#Location#__" ]; + string stringSize = category[ "__#Size#__" ]; + + // Convert to correct types + FormWindowState state = (FormWindowState) System.Enum.Parse( typeof( FormWindowState ), stringState ); + Point location = Load( aCategory, "__#Location#__" , new Point( 0, 0 ) ); + Size size = Load( aCategory, "__#Size#__", aForm.MinimumSize ); + // + aForm.Location = location; + aForm.WindowState = state; + if ( aForm.WindowState == FormWindowState.Normal ) + { + aForm.Size = size; + } + } + else + { + // Go with defaults for everything + aForm.WindowState = FormWindowState.Maximized; + } + } + #endregion + + #region Data members + private static Version iCurrentSettingsVersion = new Version( 2, 0, 0 ); + private string iFullyQualifiedFileName = string.Empty; + private SortedList iCategories = new SortedList(); + #endregion + } +} + + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettingsBoundedList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettingsBoundedList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,174 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; + +namespace SymbianUtils.Settings +{ + public class XmlSettingsBoundedList + { + #region Constructors + public XmlSettingsBoundedList( string aCategory, XmlSettings aSettings ) + { + // Since the max capacity was not supplied, we can attempt to read + // it from the settings or then if not found, we default to 10. + iSettings = aSettings; + iCategory = aCategory; + iMaxCapacity = SettingsMaxCapacity; + // + Restore(); + } + + public XmlSettingsBoundedList( string aCategory, XmlSettings aSettings, int aMaxCapacity ) + { + iSettings = aSettings; + iCategory = aCategory; + iMaxCapacity = aMaxCapacity; + // + Restore(); + } + #endregion + + #region API + public void Restore() + { + // Newest additions are stored at the front of the list. + // Oldest items are therefore at the end + iList.Clear(); + // + int settingsCount = SettingsCount; + for ( int i = 0; i < settingsCount && i < MaxCapacity; i++ ) + { + string item = SettingItem(i); + iList.Add( item ); + } + } + + public void Store() + { + // Remove all entries that already exist + // within the settings object + RemoveAllExistingSettings(); + + // Now add the replacement items + int settingsCount = iList.Count; + SettingsCount = settingsCount; + for(int i=0; i MaxCapacity ) + { + iList.RemoveAt( MaxCapacity ); + } + } + #endregion + + #region Properties + public int MaxCapacity + { + get { return iMaxCapacity; } + } + + public string Category + { + get { return iCategory; } + } + + public int Count + { + get { return iList.Count; } + } + #endregion + + #region Internal properties + private int SettingsCount + { + get + { + int count = 0; + string countAsString = iSettings[Category, "_NumberOfItems"]; + if (countAsString != null) + { + count = System.Convert.ToInt32(countAsString); + } + return count; + } + set + { + iSettings[Category, "_NumberOfItems"] = value.ToString(); + } + } + + private int SettingsMaxCapacity + { + get + { + int capacity = 0; + string capacityAsString = iSettings[Category, "_MaxCapacity"]; + if (capacityAsString != null) + { + capacity = System.Convert.ToInt32(capacityAsString); + } + return capacity; + } + set + { + iSettings[Category, "_MaxCapacity"] = value.ToString(); + } + } + #endregion + + #region Internal methods + private string MakeSettingsKey( int aIndex ) + { + return "_Entry_Id_" + aIndex.ToString( "0000" ); + } + + private string SettingItem( int aIndex ) + { + string key = MakeSettingsKey( aIndex ); + string itemValue = iSettings[ Category, key ]; + // + return itemValue; + } + + private void RemoveAllExistingSettings() + { + iSettings.Remove( Category ); + } + #endregion + + #region Data members + int iMaxCapacity = 100; + readonly string iCategory; + readonly XmlSettings iSettings; + List iList = new List(10); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettingsCategory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettingsCategory.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Xml; +using System.Text; +using System.IO; +using System.Collections.Generic; +using Microsoft.Win32; +using System.Diagnostics; +using System.Collections; +using System.Windows.Forms; + +namespace SymbianUtils.Settings +{ + public class XmlSettingCategory + { + #region Constructors + public XmlSettingCategory( string aName ) + { + iName = aName; + iVersion = (Version) XmlSettings.CurrentSettingsVersion.Clone(); + } + + public XmlSettingCategory( XmlReader aReader ) + { + XmlUtils.ReadAttributeValue( aReader, "name", out iName ); + // + string versionAsString; + XmlUtils.ReadAttributeValue( aReader, "version", out versionAsString ); + iVersion = new Version( versionAsString ); + } + #endregion + + #region Store & Restore API + internal void WriteSettings( XmlWriter aWriter ) + { + aWriter.WriteStartElement( Name, null ); + // + foreach ( KeyValuePair pair in iSettings ) + { + // Write overall item encapsulation header + aWriter.WriteStartElement( "item", null ); + + // Write key + aWriter.WriteAttributeString( "key", pair.Key ); + + // Get value object to write itself out + pair.Value.Write( aWriter ); + + // End item + aWriter.WriteEndElement(); + } + // + aWriter.WriteEndElement(); + } + + internal void ReadSettings( XmlReader aReader ) + { + while ( !aReader.EOF && aReader.Name == "item" ) + { + if ( aReader.NodeType != XmlNodeType.EndElement ) + { + string key = XmlUtils.ReadAttributeValue( aReader, "key" ); + // + XmlSettingsValue value = new XmlSettingsValue( aReader ); + iSettings.Add( key, value ); + } + aReader.Read(); + } + // + SymbianUtils.SymDebug.SymDebugger.Assert(aReader.Name == Name); + } + #endregion + + #region Misc. API + internal void Add( string aKey, string aValue ) + { + XmlSettingsValue value = new XmlSettingsValue( aValue ); + iSettings.Add( aKey, value ); + } + + internal void Remove( string aKey ) + { + if ( iSettings.ContainsKey( aKey ) ) + { + iSettings.Remove( aKey ); + } + } + + public bool Contains( string aKey ) + { + return iSettings.ContainsKey( aKey ); + } + + public bool Exists( string aKey ) + { + return Contains( aKey ); + } + #endregion + + #region Properties + public string Name + { + get { return iName; } + } + + public Version Version + { + get { return iVersion; } + } + #endregion + + #region Indexers + public XmlSettingsValue this[ string aKey ] + { + get + { + XmlSettingsValue ret = new XmlSettingsValue( string.Empty ); + // + if ( Exists( aKey ) ) + { + ret = iSettings[ aKey ]; + } + else + { + iSettings.Add( aKey, ret ); + } + // + return ret; + } + set + { + if ( !Exists( aKey ) ) + { + iSettings.Add( aKey, value ); + } + else + { + // Item already exists + iSettings[ aKey ] = value; + } + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly string iName; + private readonly Version iVersion; + private SortedList iSettings = new SortedList(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettingsInterfaces.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettingsInterfaces.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Xml; +using System.Text; +using System.IO; +using System.Collections.Generic; +using Microsoft.Win32; +using System.Diagnostics; +using System.Collections; +using System.Windows.Forms; + +namespace SymbianUtils.Settings +{ + public interface IXmlSettingsSimple + { + string XmlSettingsPersistableName { get; } + + string XmlSettingPersistableValue { get; set; } + } + + public interface IXmlSettingsExtended + { + void XmlSettingsSave( XmlSettings aSettings, string aCategory ); + + void XmlSettingsLoad( XmlSettings aSettings, string aCategory ); + } +} + + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettingsValue.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettingsValue.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,290 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Xml; +using System.Text; +using System.IO; +using System.Drawing; +using System.ComponentModel; +using System.Collections.Generic; +using System.Diagnostics; +using System.Collections; +using System.Windows.Forms; +using Microsoft.Win32; + +namespace SymbianUtils.Settings +{ + public class XmlSettingsValue + { + #region Constructors + internal XmlSettingsValue( object aValue ) + { + Value = aValue; + } + + internal XmlSettingsValue( XmlReader aReader ) + { + try + { + Read( aReader ); + } + catch ( Exception ) + { + } + } + #endregion + + #region Store & Restore API + internal void Write( XmlWriter aWriter ) + { + string typeString = Value.GetType().ToString(); + aWriter.WriteAttributeString( "type", typeString ); + // + string valueString = Value.ToString(); + aWriter.WriteAttributeString( "value", valueString ); + } + + internal void Read( XmlReader aReader ) + { + string typeString = XmlUtils.ReadAttributeValue( aReader, "type" ); + string valueString = XmlUtils.ReadAttributeValue( aReader, "value" ); + // + Type type = Type.GetType( typeString ); + TypeConverter converter = TypeDescriptor.GetConverter( type ); + // + bool canConvertFromString = converter.CanConvertFrom( valueString.GetType() ); + if ( canConvertFromString ) + { + object value = converter.ConvertFromString( valueString ); + Value = value; + } + else + { + Value = valueString; + } + } + #endregion + + #region Operators + public static implicit operator XmlSettingsValue( int aValue ) + { + XmlSettingsValue ret = new XmlSettingsValue( aValue ); + return ret; + } + + public static implicit operator XmlSettingsValue( string aValue ) + { + XmlSettingsValue ret = new XmlSettingsValue( aValue ); + return ret; + } + + public static implicit operator XmlSettingsValue( bool aValue ) + { + XmlSettingsValue ret = new XmlSettingsValue( aValue ); + return ret; + } + + public static implicit operator XmlSettingsValue( uint aValue ) + { + XmlSettingsValue ret = new XmlSettingsValue( aValue ); + return ret; + } + + public static implicit operator XmlSettingsValue( long aValue ) + { + XmlSettingsValue ret = new XmlSettingsValue( aValue ); + return ret; + } + + public static implicit operator int( XmlSettingsValue aValue ) + { + int ret = aValue.ToInt(); + return ret; + } + + public static implicit operator string( XmlSettingsValue aValue ) + { + string ret = aValue.ToString(); + return ret; + } + + public static implicit operator bool( XmlSettingsValue aValue ) + { + bool ret = aValue.ToBool(); + return ret; + } + + public static implicit operator uint( XmlSettingsValue aValue ) + { + uint ret = aValue.ToUint(); + return ret; + } + + public static implicit operator long( XmlSettingsValue aValue ) + { + long ret = aValue.ToLong(); + return ret; + } + + public static implicit operator Size( XmlSettingsValue aValue ) + { + Size ret = aValue.ToSize(); + return ret; + } + + public static implicit operator Point( XmlSettingsValue aValue ) + { + Point ret = aValue.ToPoint(); + return ret; + } + #endregion + + #region Conversion methods + public int ToInt() + { + return ToInt( 0 ); + } + + public int ToInt( int aDefault ) + { + int ret = XmlSettingsValueConverter.Convert( this, aDefault ); + return ret; + } + + public uint ToUint() + { + return ToUint( 0 ); + } + + public uint ToUint( uint aDefault ) + { + uint ret = XmlSettingsValueConverter.Convert( this, aDefault ); + return ret; + } + + public long ToLong() + { + return ToLong( 0 ); + } + + public long ToLong( long aDefault ) + { + long ret = XmlSettingsValueConverter.Convert( this, aDefault ); + return ret; + } + + public bool ToBool() + { + return ToBool( false ); + } + + public bool ToBool( bool aDefault ) + { + bool defaultApplied = false; + bool ret = XmlSettingsValueConverter.Convert( this, aDefault, out defaultApplied ); + // + if ( defaultApplied ) + { + string valueAsString = ToString().ToLower().Trim(); + // + switch ( valueAsString ) + { + case "true": + case "yes": + case "1": + ret = true; + break; + case "false": + case "no": + case "0": + ret = false; + break; + default: + ret = aDefault; + break; + } + } + // + return ret; + } + + public string ToString( string aDefault ) + { + string ret = XmlSettingsValueConverter.Convert( this, aDefault ); + return ret; + } + + public Point ToPoint() + { + return ToPoint( new Point( 0, 0 ) ); + } + + public Point ToPoint( Point aDefault ) + { + Point ret = XmlSettingsValueConverter.Convert( this, aDefault ); + return ret; + } + + public Size ToSize() + { + return ToSize( new Size( 0, 0 ) ); + } + + public Size ToSize( Size aDefault ) + { + Size ret = XmlSettingsValueConverter.Convert( this, aDefault ); + return ret; + } + #endregion + + #region Properties + internal object Value + { + get { return iValue; } + set + { + if ( value == null ) + { + throw new Exception( "Value cannot be NULL" ); + } + else if ( value.GetType() == typeof( XmlSettingsValue ) ) + { + SymbianUtils.SymDebug.SymDebugger.Break(); + } + + iValue = value; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return Value.ToString(); + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private object iValue = string.Empty; + #endregion + } +} + + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettingsValueConverter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlSettingsValueConverter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Xml; +using System.Text; +using System.IO; +using System.ComponentModel; +using System.Collections.Generic; + +namespace SymbianUtils.Settings +{ + internal static class XmlSettingsValueConverter + { + public static T Convert( XmlSettingsValue aValue, T aDefault ) + { + bool defaultApplied = false; + return Convert( aValue, aDefault, out defaultApplied ); + } + + public static T Convert( XmlSettingsValue aValue, T aDefault, out bool aDefaultApplied ) + { + T ret = aDefault; + aDefaultApplied = true; + // + Type srcType = aValue.Value.GetType(); + Type destType = aDefault.GetType(); + // + try + { + // Don't need to convert if source and destination types are + // identical. + if ( srcType == destType ) + { + ret = (T) aValue.Value; + } + else + { + // Don't try to convert empty strings. + if ( aValue.Value is string && destType != typeof( string ) ) + { + string val = ( (string) aValue.Value ).Trim(); + if ( val == string.Empty ) + { + return aDefault; + } + } + + // Try the type converter instead + TypeConverter converter = TypeDescriptor.GetConverter( destType ); + if ( converter.CanConvertFrom( srcType ) ) + { + if ( aValue.Value is string ) + { + string text = (string) aValue.Value; + ret = (T) converter.ConvertFromInvariantString( text ); + } + else + { + ret = (T) converter.ConvertFrom( aValue.Value ); + } + aDefaultApplied = false; + } + else + { + SymbianUtils.SymDebug.SymDebugger.Break(); + } + } + } + catch ( System.FormatException ) + { + SymbianUtils.SymDebug.SymDebugger.Break(); + } + // + return ret; + } + } +} + + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlUtilities.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Settings/XmlUtilities.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Xml; +using System.Collections; + +namespace SymbianUtils.Settings +{ + internal class XmlUtils + { + public static string ReadAttributeValue( XmlReader aReader, string aAttributeName ) + { + string ret = string.Empty; + ReadAttributeValue( aReader, aAttributeName, out ret ); + return ret; + } + + public static void ReadAttributeValue( XmlReader aReader, string aAttributeName, out string aValue ) + { + aValue = string.Empty; + // + bool foundName = aReader.MoveToAttribute(aAttributeName); + if ( foundName ) + { + while ( aReader.ReadAttributeValue() ) + { + aValue += aReader.Value; + } + } + else + { + throw new Exception( "Could not find attribute \'" + aAttributeName + "\' in xml element" ); + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Objects/SrcClass.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Objects/SrcClass.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.SourceParser.Objects +{ + public class SrcClass + { + #region Enumerations + public enum TType + { + ETypeGlobalFunctionClass = 0, + ETypeProperClass + } + #endregion + + #region Constructors + public SrcClass() + { + } + #endregion + + #region Constants + public const string KClassSeparator = "::"; + #endregion + + #region API + public void AddMethod( SrcMethod aMethod ) + { + aMethod.Class = this; + iMethods.Add( aMethod ); + } + #endregion + + #region Properties + public TType Type + { + get + { + TType ret = TType.ETypeGlobalFunctionClass; + // + if ( Name.Length != 0 ) + { + ret = TType.ETypeProperClass; + } + // + return ret; + } + } + + public string Name + { + get { return iName; } + set { iName = value; } + } + + public List Methods + { + get { return iMethods; } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( Name ); + // + return ret.ToString(); + } + #endregion + + #region Data members + private string iName = string.Empty; + private List iMethods = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Objects/SrcMethod.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Objects/SrcMethod.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.SourceParser.Objects +{ + public class SrcMethod + { + #region Constructors + public SrcMethod() + { + } + #endregion + + #region API + public void AddParameter( SrcMethodParameter aParameter ) + { + iParameters.Add( aParameter ); + } + #endregion + + #region Properties + public string Name + { + get { return iName; } + set { iName = value; } + } + + public string FullName + { + get { return ToString(); } + } + + public string FullNameWithoutParameters + { + get + { + StringBuilder ret = new StringBuilder(); + + if ( Class != null ) + { + ret.Append( Class ); + ret.Append( SrcClass.KClassSeparator ); + } + + // Add method name itself + ret.Append( Name ); + return ret.ToString(); + } + } + + public SrcMethodModifier Modifier + { + get { return iModifier; } + set { iModifier = value; } + } + + public List Parameters + { + get { return iParameters; } + } + + public SrcClass Class + { + get { return iClass; } + set { iClass = value; } + } + + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.Append( FullNameWithoutParameters ); + + // Add parameters if present + ret.Append( "(" ); + if ( Parameters.Count > 0 ) + { + foreach ( SrcMethodParameter param in Parameters ) + { + ret.Append( param ); + ret.Append( ", " ); + } + + // Remove redundant trailing comma + ret.Remove( ret.Length - 2, 2 ); + } + ret.Append( ")" ); + + // Add the modifier + ret.Append( Modifier ); + + return ret.ToString(); + } + #endregion + + #region Data members + private string iName = string.Empty; + private object iTag = null; + private SrcClass iClass = null; + private SrcMethodModifier iModifier = new SrcMethodModifier(); + private List iParameters = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Objects/SrcMethodModifier.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Objects/SrcMethodModifier.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.SourceParser.Objects +{ + public class SrcMethodModifier + { + #region Enumerations + public enum TModifier + { + ENone = 0, + EConst + } + #endregion + + #region Constructors + public SrcMethodModifier() + { + } + #endregion + + #region API + #endregion + + #region Properties + public TModifier Type + { + get { return iModifier; } + set { iModifier = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + string ret = string.Empty; + // + switch ( iModifier ) + { + case TModifier.EConst: + ret = " const"; + break; + default: + case TModifier.ENone: + break; + } + // + return ret; + } + #endregion + + #region Data members + private TModifier iModifier; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Objects/SrcMethodParameter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Objects/SrcMethodParameter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.SourceParser.Objects +{ + public class SrcMethodParameter + { + #region Constructors + public SrcMethodParameter() + { + } + #endregion + + #region API + #endregion + + #region Properties + public string Name + { + get { return iName; } + set { iName = value; } + } + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region Data members + private string iName = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Parsers/ParserSrcClass.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Parsers/ParserSrcClass.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.SourceParser.Objects; + +namespace SymbianUtils.SourceParser.Parsers +{ + public class ParserSrcClass + { + #region Constructors + public ParserSrcClass() + { + } + #endregion + + #region API + public SrcClass Parse( ref string aText ) + { + SrcClass ret = new SrcClass(); + + // First look for the class separator. If we find that, then everything before + // it is the class name. + // + // If no class separator exists, then we treat the whole thing as the class + // name. + int pos = aText.IndexOf( SrcClass.KClassSeparator ); + if ( pos > 0 || pos < 0 ) + { + // By default, treat the whole text as the class name + string className = aText; + if ( pos > 0 ) + { + className = aText.Substring( 0, pos ); + aText = aText.Substring( pos + SrcClass.KClassSeparator.Length ); + ret.Name = className; + } + else + { + // Everything was consumed... We return the 'global function' class + // for this text + aText = string.Empty; + } + } + else + { + // First thing in the string is the class separator. + // Odd? + System.Diagnostics.Debug.Assert( false ); + } + + return ret; + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Parsers/ParserSrcMethod.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Parsers/ParserSrcMethod.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,234 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.SourceParser.Objects; +using SymbianUtils.SourceParser.Parsers; + +namespace SymbianUtils.SourceParser.Parsers +{ + public class ParserSrcMethod + { + #region Constructors + public ParserSrcMethod() + { + } + #endregion + + #region API + public SrcMethod Parse( ref string aText ) + { + SrcMethod ret = null; + // + if ( aText.Length > 0 ) + { + string parameters = string.Empty; + // + if ( ContainsParameters( aText ) ) + { + // This leaves modifiers intact + parameters = ExtractParameters( ref aText ); + } + + // Look for the class separator. If we find that, then everything after + // it is the method name. + // + // If no class separator exists, then we treat the whole thing as the method + // name. + int pos = aText.IndexOf( SrcClass.KClassSeparator ); + + // By default, treat the whole text as the class name + string methodText = aText; + if ( pos >= 0 ) + { + methodText = aText.Substring( pos + SrcClass.KClassSeparator.Length ); + aText = aText.Substring( 0, pos + SrcClass.KClassSeparator.Length ); + } + else + { + // Everything was consumed... + aText = string.Empty; + } + + // Make a new method. Work out if the method text + // actually has any parameters + ret = new SrcMethod(); + + // Try to parse the modifiers. We extract that first + // to leave us with just the method name and the parameters. + bool hasModifier = ContainsModifier( methodText ); + if ( hasModifier ) + { + ParserSrcMethodModifier parser = new ParserSrcMethodModifier(); + SrcMethodModifier modifier = parser.Parse( ref methodText ); + if ( modifier != null ) + { + ret.Modifier = modifier; + } + } + + // Try to parse the parameters. We can also use this + // to calculate the exact method name. + if ( parameters.Length > 0 ) + { + ParserSrcMethodParameter parser = new ParserSrcMethodParameter(); + parser.Parse( ref parameters, ret ); + } + + // What's left should be the method name followed by "()" if the + // 'method' wasn't a label. + if ( ContainsParameters( methodText ) ) + { + // Discard "()"; + pos = methodText.LastIndexOf( "(" ); + methodText = methodText.Substring( 0, pos ); + } + + ret.Name = methodText; + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private static bool ContainsParameters( string aText ) + { + // Search initiall for '(' - if that is found, then + // we should also find a closing bracket. + bool parameters = false; + int openingBracketPos = aText.IndexOf( "(" ); + // + if ( openingBracketPos > 0 ) + { + // Should also be a closing bracket and it should + // appear after the opening bracket + int closingBracketPos = aText.LastIndexOf( ")" ); + parameters = ( closingBracketPos > openingBracketPos ); + } + // + return parameters; + } + + private static bool ContainsModifier( string aText ) + { + bool modifiers = false; + + int openingBracketPos = aText.IndexOf( "(" ); + if ( openingBracketPos >= 0 ) + { + int closingBracketPos = openingBracketPos; + SymbianUtils.Strings.StringParsingUtils.SkipToEndOfSection( ref aText, ref closingBracketPos, '(', ')' ); + + if ( closingBracketPos > openingBracketPos ) + { + // everything here on is the modifier text; + string modifierText = aText.Substring( closingBracketPos + 1 ); + modifiers = ( modifierText.Trim().Length > 0 ); + } + } + // + return modifiers; + } + + private static string ExtractParameters( ref string aText ) + { + const string KOperatorChevronText = "operator <<"; + + // DoAppendFormatList(T1&, const T3&, std::__va_list, T2*) + // DoAppendFormatList(T1&, TBuf<(int)256>, std::__va_list, T2*) + // Method::Wibble( something ) + // Method::Wibble( RPointerArray ) + // RTest::operator ()(int, int, const unsigned short*) + // TDesC16::Left(int) const + // CObjectCon::AtL(int) const + // User::Panic(const TDesC16&, int) + // operator <<(RWriteStream&, const unsigned char&) + + // Handle special case of "operator <<" confusing matters + string workingText = aText; + int operatorOpeningChevronPos = aText.IndexOf( KOperatorChevronText ); + if ( operatorOpeningChevronPos >= 0 ) + { + aText = aText.Substring( 0, operatorOpeningChevronPos + KOperatorChevronText.Length ); + workingText = workingText.Substring( operatorOpeningChevronPos + KOperatorChevronText.Length ); + } + else + { + aText = string.Empty; + } + + string ret = string.Empty; + // + int closingPos = 0; + int openingPos = 0; + int templatePos = 0; + // + while ( openingPos >= 0 ) + { + if ( templatePos >= 0 ) + templatePos = workingText.IndexOf( "<", templatePos ); + openingPos = workingText.IndexOf( "(", openingPos ); + + if ( templatePos >= 0 && templatePos < openingPos ) + { + // Template region appears before the next bracket. Skip + // over all characters until we hit the end of the template + // section + int endingPos = templatePos; + SymbianUtils.Strings.StringParsingUtils.SkipToEndOfSection( ref workingText, ref endingPos, '<', '>' ); + + if ( endingPos < 0 ) + { + // Matching closing brace was never found - dealing with operator << ? + templatePos = -1; + } + else + { + // Something like DoAppendFormatList(T1&, const T3&, std::__va_list, T2*) ??? + templatePos = endingPos; + openingPos = endingPos; + } + } + else if ( openingPos >= 0 ) + { + // Skipped over any template nonsense. Work backward from the end + // in order to locate start of parameters. + closingPos = workingText.LastIndexOf( ')' ); + openingPos = closingPos; + SymbianUtils.Strings.StringParsingUtils.SkipToBeginningOfSection( ref workingText, ref openingPos, '(', ')' ); + + string parameters = workingText.Substring( openingPos + 1, ( closingPos - openingPos ) - 1 ).Trim(); + ret = parameters; + workingText = workingText.Substring( 0, openingPos + 1 ) + workingText.Substring( closingPos ); + aText = aText + workingText; + break; + } + } + // + return ret; + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Parsers/ParserSrcMethodModifier.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Parsers/ParserSrcMethodModifier.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.SourceParser.Objects; + +namespace SymbianUtils.SourceParser.Parsers +{ + public class ParserSrcMethodModifier + { + #region Constructors + public ParserSrcMethodModifier() + { + } + #endregion + + #region API + public SrcMethodModifier Parse( ref string aText ) + { + SrcMethodModifier ret = null; + + // Should not be the first or second character as + // we should always have an opening bracket before + // the closing bracket, and the shortest possible + // valid sequence is "()" where is a + // single character (type). + // + // Needs to also handle tricky things like...: + // + // RDbHandle::operator ->() const + + int closingBracketPos = aText.LastIndexOf( ")" ); + System.Diagnostics.Debug.Assert( closingBracketPos >= 1 ); + + // Get the modifier text. We currently only support + // one modifier and that's the const keyword + string modifierText = aText.Substring( closingBracketPos + 1 ).Trim(); + if ( modifierText.Length > 0 ) + { + ret = new SrcMethodModifier(); + + if ( modifierText.ToLower() == "const" ) + { + ret.Type = SrcMethodModifier.TModifier.EConst; + } + } + + // Clean up the text object we were passed... + aText = aText.Substring( 0, closingBracketPos + 1 ); + + return ret; + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Parsers/ParserSrcMethodParameter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/Parsers/ParserSrcMethodParameter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.SourceParser.Objects; + +namespace SymbianUtils.SourceParser.Parsers +{ + public class ParserSrcMethodParameter + { + #region Constructors + public ParserSrcMethodParameter() + { + } + #endregion + + #region API + public void Parse( ref string aText, SrcMethod aMethod ) + { + /* + * TPtrC16::TPtrC16(const unsigned short*) + * TPtrC16::TPtrC16(const TDesC16&) + * UserHal::MemoryInfo(TDes8&) + * RHandleBase::Close() + * TBufCBase16::Copy(const TDesC16&, int) + * CBufFlat::NewL(int) + * TBufCBase16::TBufCBase16() + * CServer2::RunL() + * CServer2::StartL(const TDesC16&) + * CServer2::DoCancel() + * CServer2::RunError(int) + * CServer2::DoConnect(const RMessage2&) + * CServer2::CServer2__sub_object(int, CServer2::TServerType) + */ + string paramType = string.Empty; + while ( aText.Length > 0 ) + { + int commaPos = aText.IndexOf( "," ); + // + paramType = aText; + if ( commaPos > 0 ) + { + paramType = aText.Substring( 0, commaPos ).Trim(); + if ( commaPos < aText.Length ) + aText = aText.Substring( commaPos + 1 ).Trim(); + else + aText = string.Empty; + } + else + { + // Everything was consumed + aText = string.Empty; + } + + // Should have the parameter same now. Make a new parameter + SrcMethodParameter parameter = new SrcMethodParameter(); + parameter.Name = paramType; + aMethod.AddParameter( parameter ); + } + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/SourceParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SourceParser/SourceParser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.SourceParser.Objects; +using SymbianUtils.SourceParser.Parsers; + +namespace SymbianUtils.SourceParser +{ + public class SourceParser + { + #region Constructors + public SourceParser() + { + } + #endregion + + #region API + public SrcMethod Parse( string aText ) + { + ParserSrcMethod methodParser = new ParserSrcMethod(); + SrcMethod method = methodParser.Parse( ref aText ); + + // And then parse what's left as the class + if ( method != null ) + { + ParserSrcClass classParser = new ParserSrcClass(); + SrcClass classObject = classParser.Parse( ref aText ); + // + classObject.AddMethod( method ); + } + + return method; + } + #endregion + + #region Properties + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Streams/SymbianStreamReaderLE.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Streams/SymbianStreamReaderLE.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,218 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.IO; +using SymbianUtils; + +namespace SymbianUtils.Streams +{ + public class SymbianStreamReaderLE : DisposableObject + { + #region Enumerations + [Flags] + public enum TCloseOperation + { + ENone = 0, + ECloseStream = 1, + EResetPosition = 2 + } + #endregion + + #region Factory + public static SymbianStreamReaderLE New( Stream aStream ) + { + return new SymbianStreamReaderLE( aStream, TCloseOperation.ENone ); + } + + public static SymbianStreamReaderLE New( Stream aStream, TCloseOperation aFlags ) + { + return new SymbianStreamReaderLE( aStream, aFlags ); + } + #endregion + + #region Constructors + private SymbianStreamReaderLE( Stream aStream, TCloseOperation aFlags ) + { + iStream = aStream; + iFlags = aFlags; + iOriginalPosition = aStream.Position; + } + #endregion + + #region API + public sbyte ReadInt8() + { + sbyte b = (sbyte) iStream.ReadByte(); + return b; + } + + public short ReadInt16() + { + sbyte low = ReadInt8(); + sbyte high = ReadInt8(); + int ret = ( high << 8 ) + low; + return (short) ret; + } + + public int ReadInt32() + { + int low = ReadInt16(); + int high = ReadInt16(); + int ret = ( high << 16 ) + low; + return ret; + } + + public byte ReadUInt8() + { + return (byte) iStream.ReadByte(); + } + + public ushort ReadUInt16() + { + byte[] temp = new byte[ 2 ]; + iStream.Read( temp, 0, temp.Length ); + // + ushort ret = 0; + for ( int i = 1; i >= 0; i-- ) + { + ret |= temp[ i ]; + if ( i > 0 ) + { + ret <<= 8; + } + } + return ret; + } + + public uint ReadUInt32() + { + uint low = ReadUInt16(); + uint high = ReadUInt16(); + uint ret = ( high << 16 ) + low; + return ret; + } + + public string ReadString( int aLengthInCharacters ) + { + byte[] bytes = new byte[ aLengthInCharacters ]; + // + string ret = string.Empty; + if ( iStream.Read( bytes, 0, bytes.Length ) == bytes.Length ) + { + ret = SymbianUtils.Strings.StringParsingUtils.BytesToString( bytes ); + } + // + return ret; + } + + public string ReadStringUTF16( int aLengthInCharacters ) + { + byte[] bytes = new byte[ aLengthInCharacters * 2 ]; + // + string ret = string.Empty; + if ( iStream.Read( bytes, 0, bytes.Length ) == bytes.Length ) + { + ret = Encoding.Unicode.GetString( bytes ); + } + // + return ret; + } + + public byte[] ReadBytes( int aCount ) + { + byte[] bytes = new byte[ aCount ]; + int ret = iStream.Read( bytes, 0, bytes.Length ); + if ( ret != bytes.Length ) + { + throw new Exception( "Unable to read byte data" ); + } + return bytes; + } + + public long Seek( long aPosition ) + { + long ret = Seek( aPosition, SeekOrigin.Begin ); + return ret; + } + + public long Seek( long aPosition, SeekOrigin aOrigin ) + { + long ret = iStream.Seek( aPosition, aOrigin ); + return ret; + } + #endregion + + #region Properties + public Stream BaseStream + { + get { return iStream; } + } + + public long Position + { + get { return iStream.Position; } + set + { + Seek( value ); + } + } + + public long Offset + { + get + { + long ret = Position - iOriginalPosition; + return ret; + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iStream != null ) + { + if ( ( iFlags & TCloseOperation.EResetPosition ) != 0 ) + { + iStream.Seek( iOriginalPosition, SeekOrigin.Begin ); + } + // + if ( ( iFlags & TCloseOperation.ECloseStream ) != 0 ) + { + iStream.Close(); + } + } + iStream = null; + } + } + #endregion + + #region Data members + private readonly TCloseOperation iFlags; + private readonly long iOriginalPosition; + private Stream iStream = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Strings/StringCaser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Strings/StringCaser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; + +namespace SymbianUtils.Strings +{ + public class StringCaser + { + public static string PrettyCase( string aValue ) + { + string ret = string.Empty; + // + if ( aValue.Length > 0 ) + { + ret = aValue.Substring( 0, 1 ).ToUpper() + aValue.Substring( 1 ).ToLower(); + } + // + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Strings/StringParsingUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Strings/StringParsingUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,129 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.Strings +{ + public static class StringParsingUtils + { + public static void SkipToEndOfSection( ref string aText, ref int aStartPos, char aOpeningChar, char aClosingChar ) + { + bool found = false; + int charCount = 1; + int pos = aStartPos; + // + while ( charCount > 0 && ++pos < aText.Length ) + { + System.Diagnostics.Debug.Assert( pos >= 0 && pos < aText.Length ); + + char character = aText[ pos ]; + if ( character == aOpeningChar ) + ++charCount; + else if ( character == aClosingChar ) + --charCount; + if ( charCount == 0 ) + { + found = true; + break; + } + } + // + aStartPos = -1; + if ( found == true ) + aStartPos = pos; + } + + public static void SkipToBeginningOfSection( ref string aText, ref int aStartPos, char aOpeningChar, char aClosingChar ) + { + bool found = false; + int charCount = 1; + int pos = aStartPos; + // + while ( charCount > 0 && --pos < aText.Length ) + { + System.Diagnostics.Debug.Assert( pos >= 0 && pos < aText.Length ); + + char character = aText[ pos ]; + if ( character == aClosingChar ) + ++charCount; + else if ( character == aOpeningChar ) + --charCount; + if ( charCount == 0 ) + { + found = true; + break; + } + } + // + aStartPos = -1; + if ( found == true ) + aStartPos = pos; + } + + public static bool IsNumeric( string aText, bool aAllowHex ) + { + bool ret = true; + // + foreach ( char c in aText ) + { + if ( char.IsDigit( c ) ) + { + } + else if ( char.IsLetter( c ) && aAllowHex ) + { + char upper = Char.ToUpper( c ); + const string KHexChars = "ABCDEF"; + if ( KHexChars.IndexOf( upper ) < 0 ) + { + ret = false; + break; + } + } + else + { + ret = false; + break; + } + } + // + return ret; + } + + public static string BytesToString( byte[] aBytes ) + { + return BytesToString( aBytes, aBytes.Length ); + } + + public static string BytesToString( byte[] aBytes, int aLength ) + { + return BytesToString( aBytes, 0, aLength ); + } + + public static string BytesToString( byte[] aBytes, int aStart, int aEnd ) + { + StringBuilder ret = new StringBuilder(); + for ( int i = aStart; i < aEnd; i++ ) + { + byte b = aBytes[ i ]; + ret.Append( System.Convert.ToChar( b ) ); + } + return ret.ToString(); + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Strings/StringUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Strings/StringUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.Strings +{ + public static class StringUtils + { + public static string MakeRandomString() + { + return MakeRandomString( 20 ); + } + + public static string MakeRandomString( int aLength ) + { + StringBuilder ret = new StringBuilder(); + + Random random = new Random( DateTime.UtcNow.Millisecond ); + for ( int i = 0; i < aLength; i++ ) + { + char c = Convert.ToChar( Convert.ToInt32( Math.Floor( 26 * random.NextDouble() + 65 ) ) ); + ret.Append( c ); + } + + return ret.ToString(); + } + + public static bool StartsWithAny( string[] aPrefixes, string aText ) + { + bool ret = false; + // + foreach ( string p in aPrefixes ) + { + if ( aText.StartsWith( p ) ) + { + ret = true; + break; + } + } + // + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SymbianUtils.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SymbianUtils.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,268 @@ + + + Local + 9.0.30729 + 2.0 + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + Debug + AnyCPU + + + + + SymbianUtils + + + JScript + Grid + IE50 + false + Library + SymbianUtils + OnBuildSuccess + + + + + + + 2.0 + + + bin\Debug\ + false + 285212672 + false + + + DEBUG;TRACE + + + true + 4096 + false + + + false + false + false + false + 4 + full + prompt + + + bin\Release\ + false + 285212672 + false + + + TRACE + + + false + 4096 + false + + + true + false + false + false + 4 + none + prompt + + + + System + + + System.Data + + + System.Drawing + + + System.Windows.Forms + + + System.XML + + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code + + + Code + + + + + + + + + + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + + + + + + + + + + + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SymbianUtils.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SymbianUtils.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ + + + 7.10.6030 + Debug + AnyCPU + D:\My Documents\Visual Studio Projects\ShellUtils\bin\Debug\;D:\Programming\Visual Studio Projects\ShellUtils\bin\Debug\;C:\USERS\Visual Studio Projects\ShellUtils\bin\Debug\;C:\USERS\Visual Studio Projects\Libs\ShellUtils\bin\Debug\;C:\Documents and Settings\PC User\My Documents\Visual Studio Projects\Libs\ShellUtils\bin\Debug\ + + + + + 0 + ProjectFiles + 0 + + + false + false + false + false + false + + + Project + + + + + + + + + + + true + + + false + false + false + false + false + + + Project + + + + + + + + + + + true + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SymbianUtils.prjx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SymbianUtils.prjx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SymbianUtils.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SymbianUtils.sln Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianUtils", "SymbianUtils.csproj", "{6014E363-D5C6-4A7B-88D1-D4F3D7CEA9A4}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {6014E363-D5C6-4A7B-88D1-D4F3D7CEA9A4}.Debug.ActiveCfg = Debug|.NET + {6014E363-D5C6-4A7B-88D1-D4F3D7CEA9A4}.Debug.Build.0 = Debug|.NET + {6014E363-D5C6-4A7B-88D1-D4F3D7CEA9A4}.Release.ActiveCfg = Release|.NET + {6014E363-D5C6-4A7B-88D1-D4F3D7CEA9A4}.Release.Build.0 = Release|.NET + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SymbianUtils.suo Binary file crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/SymbianUtils.suo has changed diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Synchronicity/TSynchronicity.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Synchronicity/TSynchronicity.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,32 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; + +namespace SymbianUtils +{ + public enum TSynchronicity + { + EAsynchronous = 0, + ESynchronous + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Base/AsyncReaderBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Base/AsyncReaderBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,282 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using SymbianUtils.Tracer; + +namespace SymbianUtils +{ + public abstract class AsyncReaderBase : DisposableObject, ITracer + { + #region Events + public enum TEvent + { + EReadingStarted = 0, + EReadingProgress, + EReadingComplete + } + + public delegate void Observer( TEvent aEvent, AsyncReaderBase aSender ); + public event Observer iObserver; + + public delegate void ExceptionHandler( Exception aException, AsyncReaderBase aSender ); + public event ExceptionHandler iExceptionHandler; + #endregion + + #region Construct & destruct + protected AsyncReaderBase() + : this( null ) + { + } + + protected AsyncReaderBase( ITracer aTracer ) + { + iTracer = aTracer; + + // Make sure the thread has a unique name... + iWorkerThread = new Thread( new System.Threading.ThreadStart( WorkerThreadFunction ) ); + iWorkerThread.Name = "WorkerThreadFunction_" + SymbianUtils.Strings.StringUtils.MakeRandomString(); + iWorkerThread.Priority = System.Threading.ThreadPriority.BelowNormal; + iWorkerThread.IsBackground = true; + } + #endregion + + #region API + protected virtual void StartRead( TSynchronicity aSynchronicity ) + { + switch ( aSynchronicity ) + { + default: + case TSynchronicity.EAsynchronous: + AsyncRead(); + break; + case TSynchronicity.ESynchronous: + SyncRead(); + break; + } + } + + protected virtual void AsyncRead() + { + lock( this ) + { + iWorkerThread.Start(); + } + } + + protected virtual void SyncRead() + { + WorkerThreadFunction(); + } + #endregion + + #region From DisposableObject - Cleanup Framework + protected override void CleanupManagedResources() + { + try + { + } + finally + { + base.CleanupManagedResources(); + } + } + + protected override void CleanupUnmanagedResources() + { + try + { + } + finally + { + base.CleanupUnmanagedResources(); + } + } + #endregion + + #region Properties + public bool IsReady + { + get + { + lock(this) + { + return iReady; + } + } + } + + public int Progress + { + get + { + lock(this) + { + int progress = 0; + // + if ( Size == 0 ) + { + progress = 0; + } + else + { + progress = CalculateProgress(); + } + // + return progress; + } + } + } + + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + #endregion + + #region Read handlers + protected virtual void HandleReadStarted() + { + } + + protected virtual void HandleReadCompleted() + { + } + + protected virtual void HandleReadException( Exception aException ) + { + if ( iExceptionHandler != null ) + { + iExceptionHandler( aException, this ); + } + } + #endregion + + #region Abstract reading framework + protected abstract void PerformOperation(); + protected abstract long Size { get; } + protected abstract long Position { get; } + #endregion + + #region Framework methods + protected virtual int CalculateProgress() + { + float positionAsFloat = (float)Position; + float sizeAsFloat = (float)Size; + int progress = (int)((positionAsFloat / sizeAsFloat) * 100.0); + // + return System.Math.Max(1, System.Math.Min(100, progress)); + } + + protected virtual void NotifyEvent( TEvent aEvent ) + { + // Prevents reporting the same progress repeatedly... + if ( aEvent == TEvent.EReadingProgress ) + { + int progress = Progress; + if ( progress == iLastProgress ) + { + return; + } + iLastProgress = progress; + } + + if ( iObserver != null ) + { + iObserver( aEvent, this ); + } + } + #endregion + + #region Internal methods + private void WorkerThreadFunction() + { + try + { + lock( this ) + { + iLastProgress = -1; + iReady = false; + HandleReadStarted(); + NotifyEvent( TEvent.EReadingStarted ); + } + + // Record start time + iOperationStartTime = DateTime.Now; + + PerformOperation(); + } + catch( Exception exception ) + { + lock( this ) + { + HandleReadException( exception ); + } + } + finally + { + Dispose(); + // + lock( this ) + { + try + { + HandleReadCompleted(); + } + catch( Exception exception ) + { + HandleReadException( exception ); + } + iReady = true; + NotifyEvent( TEvent.EReadingComplete ); + } + } + } + #endregion + + #region ITracer Members + public void Trace( string aMessage ) + { + if ( iTracer != null ) + { + iTracer.Trace( aMessage ); + } + } + + public void Trace( string aFormat, params object[] aParams ) + { + Trace( string.Format( aFormat, aParams ) ); + } + #endregion + + #region Internal data members + protected bool iReady = true; + protected DateTime iOperationStartTime; + #endregion + + #region Data members + private readonly ITracer iTracer; + private readonly Thread iWorkerThread; + private object iTag = null; + private int iLastProgress = -1; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Filters/AsyncTextReaderFilter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Filters/AsyncTextReaderFilter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; + +namespace SymbianUtils +{ + public class AsyncTextReaderFilter + { + #region Enumerations + public enum TSpecificMatchType + { + ESpecificMustMatch = 0, + ESpecificMustNotMatch + } + + public enum TRemoveType + { + ERemoveNothing = 0, + ERemoveAllInstances, + ERemoveLastInstanceOnwards, + ERemoveLastInstanceStartingAtPreviousSpaceOnwards + } + #endregion + + #region Construct & destruct + public AsyncTextReaderFilter( string aMatchString ) + : this( aMatchString, TRemoveType.ERemoveAllInstances ) + { + } + + public AsyncTextReaderFilter( string aMatchString, TRemoveType aRemoveType ) + : this( aMatchString, aRemoveType, TSpecificMatchType.ESpecificMustMatch ) + { + } + + public AsyncTextReaderFilter( string aMatchString, TRemoveType aRemoveType, TSpecificMatchType aMatchType ) + { + iMatchString = aMatchString; + iRemoveType = aRemoveType; + iMatchType = aMatchType; + } + #endregion + + #region Properties + public string MatchString + { + get { return iMatchString; } + set { iMatchString = value; } + } + + public TRemoveType RemoveType + { + get { return iRemoveType; } + set { iRemoveType = value; } + } + + public TSpecificMatchType MatchType + { + get { return iMatchType; } + set { iMatchType = value; } + } + #endregion + + #region Internal API + internal bool Matches( string aLine ) + { + int index = aLine.IndexOf( MatchString ); + // + bool matchedFilter = false; + if ( index >= 0 ) + { + matchedFilter = ( MatchType == TSpecificMatchType.ESpecificMustMatch ); + } + else if ( index < 0 ) + { + matchedFilter = ( MatchType == TSpecificMatchType.ESpecificMustNotMatch ); + } + // + return matchedFilter; + } + + internal void Process( ref string aLine ) + { + int index = aLine.IndexOf( MatchString ); + // + if ( index >= 0 ) + { + switch( RemoveType ) + { + default: + case TRemoveType.ERemoveNothing: + { + break; + } + case TRemoveType.ERemoveAllInstances: + { + aLine = aLine.Replace( MatchString, "" ); + break; + } + case TRemoveType.ERemoveLastInstanceOnwards: + { + index = aLine.LastIndexOf( MatchString ); + aLine = aLine.Substring( 0, index ); + break; + } + case TRemoveType.ERemoveLastInstanceStartingAtPreviousSpaceOnwards: + { + int lastSpacePos = aLine.LastIndexOf( ' ', index ); + if ( lastSpacePos < index ) + { + aLine = aLine.Substring( 0, lastSpacePos ); + } + else + { + aLine = aLine.Substring( 0, index ); + } + break; + } + } + } + } + #endregion + + #region Data members + private string iMatchString = string.Empty; + private TRemoveType iRemoveType = TRemoveType.ERemoveLastInstanceOnwards; + private TSpecificMatchType iMatchType = TSpecificMatchType.ESpecificMustMatch; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Filters/AsyncTextReaderFilterCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Filters/AsyncTextReaderFilterCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; + +namespace SymbianUtils +{ + public class AsyncTextReaderFilterCollection : IEnumerable + { + #region Enumerations + public enum TCombinationType + { + ECombinationTypeUndefined = 0, + ECombinationTypeOR, + ECombinationTypeAND, + ECombinationTypeNOT + } + #endregion + + #region Constructors + public AsyncTextReaderFilterCollection() + { + } + #endregion + + #region API - Filter processing + public bool ProcessFilters( ref string aLine ) + { + bool propagateLine = false; + // + if ( aLine.Length > 0 ) + { + int matchCount = 0; + int filterCount = Count; + + // First phase: check for filter matches + for ( int i = 0; i < filterCount; i++ ) + { + AsyncTextReaderFilter filter = this[ i ]; + // + bool matchedFilter = filter.Matches( aLine ); + if ( matchedFilter ) + { + ++matchCount; + } + } + + // Second phase: check for overall match against combined + // criteria. + propagateLine = ( filterCount == 0 ); // Default to true when no filters + switch ( CombinationType ) + { + case TCombinationType.ECombinationTypeOR: + propagateLine = ( matchCount > 0 ); + break; + case TCombinationType.ECombinationTypeAND: + propagateLine = ( matchCount == filterCount ); + break; + case TCombinationType.ECombinationTypeNOT: + propagateLine = ( matchCount == 0 ); + break; + default: + case TCombinationType.ECombinationTypeUndefined: + break; + } + + // Third phase: process filter + if ( propagateLine ) + { + for ( int i = 0; i < filterCount; i++ ) + { + AsyncTextReaderFilter filter = this[ i ]; + filter.Process( ref aLine ); + } + } + } + + return propagateLine; + } + #endregion + + #region API - Filter management + public void Add( AsyncTextReaderFilter aFilter ) + { + iFilters.Add( aFilter ); + } + + public void RemoveAt( int aIndex ) + { + iFilters.RemoveAt( aIndex ); + } + + public void Remove( AsyncTextReaderFilter aFilter ) + { + iFilters.Remove( aFilter ); + } + + public void Clear() + { + iFilters.Clear(); + } + + #endregion + + #region Properties + public int Count + { + get { return iFilters.Count; } + } + + public AsyncTextReaderFilter this[ int aIndex ] + { + get { return (AsyncTextReaderFilter) iFilters[ aIndex ]; } + } + + public TCombinationType CombinationType + { + get { return iCombinationType; } + set { iCombinationType = value; } + } + #endregion + + #region IEnumerable Members + public IEnumerator GetEnumerator() + { + return new AsyncTextReaderFilterCollectionEnumerator( this ); + } + #endregion + + #region Data members + private TCombinationType iCombinationType = TCombinationType.ECombinationTypeUndefined; + private ArrayList iFilters = new ArrayList(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Filters/AsyncTextReaderFilterCollectionEnumerator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Filters/AsyncTextReaderFilterCollectionEnumerator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; + +namespace SymbianUtils +{ + public class AsyncTextReaderFilterCollectionEnumerator : IEnumerator + { + #region Constructors + public AsyncTextReaderFilterCollectionEnumerator( AsyncTextReaderFilterCollection aCollection ) + { + iCollection = aCollection; + } + #endregion + + #region IEnumerator Members + public void Reset() + { + iCurrentIndex = -1; + } + + public object Current + { + get + { + return (AsyncTextReaderFilter) iCollection[ iCurrentIndex ]; + } + } + + public bool MoveNext() + { + return ( ++iCurrentIndex < iCollection.Count ); + } + #endregion + + #region Data members + private readonly AsyncTextReaderFilterCollection iCollection; + private int iCurrentIndex = -1; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Prefix/AsyncTextReaderPrefix.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Prefix/AsyncTextReaderPrefix.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; + +namespace SymbianUtils +{ + public class AsyncTextReaderPrefix + { + #region Construct & destruct + public AsyncTextReaderPrefix() + : this( string.Empty ) + { + } + + public AsyncTextReaderPrefix( string aMsgPrefix ) + : this( aMsgPrefix, string.Empty ) + { + } + + public AsyncTextReaderPrefix( string aMsgPrefix, string aMsgPostfix ) + { + iMsgPrefix = aMsgPrefix; + iMsgPostfix = aMsgPostfix; + } + #endregion + + #region Properties + public string MsgPrefix + { + get { return iMsgPrefix; } + } + + public string MsgPostfix + { + get { return iMsgPostfix; } + } + #endregion + + #region Internal API + internal void Clean( ref string aLine ) + { + if ( MsgPrefix.Length > 0 ) + { + int pos = aLine.IndexOf( MsgPrefix ); + if ( pos >= 0 ) + { + pos += MsgPrefix.Length; + aLine = aLine.Substring( pos ); + } + else + { + aLine = string.Empty; + } + } + // + if ( MsgPostfix.Length > 0 ) + { + int pos = aLine.LastIndexOf( MsgPostfix ); + if ( pos >= 0 ) + { + pos -= MsgPostfix.Length; + aLine = aLine.Substring( 0, pos - 1 ); + } + else + { + aLine = string.Empty; + } + } + } + #endregion + + #region Data members + private readonly string iMsgPrefix; + private readonly string iMsgPostfix; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Array/AsyncArrayReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Array/AsyncArrayReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using SymbianUtils.Tracer; + +namespace SymbianUtils.TextUtilities.Readers.Types.Array +{ + public interface AsyncArrayObjectSupplier + { + #region AsyncArrayObjectSupplier interface declaration + int ObjectCount { get; } + TType this[ int aIndex ] { get; } + #endregion + } + + public abstract class AsyncArrayReader : AsyncReaderBase + { + #region Constructors + protected AsyncArrayReader( AsyncArrayObjectSupplier aObjectSupplier ) + : this( aObjectSupplier, null ) + { + } + + protected AsyncArrayReader( AsyncArrayObjectSupplier aObjectSupplier, ITracer aTracer ) + : base( aTracer ) + { + iObjectSupplier = aObjectSupplier; + } + #endregion + + #region Abstract reading framework + protected abstract void HandleObject( TType aObject, int aIndex, int aCount ); + #endregion + + #region From AsyncReaderBase + protected override long Size + { + get + { + long size = 0; + // + lock( this ) + { + size = iObjectSupplier.ObjectCount; + } + // + return size; + } + } + + protected override long Position + { + get + { + long position = 0; + // + lock( this ) + { + position = iCurrentIndex; + } + // + return position; + } + } + #endregion + + #region Properties + public int CurrentIndex + { + get + { + lock( this ) + { + return iCurrentIndex; + } + } + } + + protected AsyncArrayObjectSupplier ObjectSupplier + { + get { return iObjectSupplier; } + } + #endregion + + #region Internal methods + protected override void PerformOperation() + { + int count = 0; + lock( this ) + { + count = iObjectSupplier.ObjectCount; + iCurrentIndex = -1; + } + + System.DateTime tenPercentTime = DateTime.Now; + + int newProgress = 0; + int oldProgress = 0; + while( CurrentIndex < count - 1 ) + { + lock( this ) + { + ++iCurrentIndex; + } + // + lock( this ) + { + TType obj = iObjectSupplier[ iCurrentIndex ]; + HandleObject( obj, iCurrentIndex-1, count ); + newProgress = Progress; + } + // + if ( newProgress != oldProgress ) + { +#if DEBUG + if ( newProgress > 0 && ( newProgress % 10 ) == 0 ) + { + System.DateTime now = DateTime.Now; + long intermediateTickDuration = ( ( now.Ticks - tenPercentTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( newProgress.ToString( "d2" ) + " % COMPLETE - " + intermediateTickDuration.ToString( "d12" ) ); + tenPercentTime = now; + } +#endif + NotifyEvent( TEvent.EReadingProgress ); + oldProgress = newProgress; + } + } + + System.DateTime endTime = DateTime.Now; + long tickDuration = ( ( endTime.Ticks - iOperationStartTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( "ARRAY READ COMPLETE - " + tickDuration.ToString( "d12" ) ); + } + #endregion + + #region Data members + private int iCurrentIndex = -1; + private readonly AsyncArrayObjectSupplier iObjectSupplier; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Array/AsyncEnumerableReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Array/AsyncEnumerableReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections.Generic; +using SymbianUtils.Tracer; + +namespace SymbianUtils.TextUtilities.Readers.Types.Array +{ + public abstract class AsyncEnumerableReader : AsyncReaderBase + { + #region Constructors + protected AsyncEnumerableReader( ITracer aTracer ) + : base( aTracer ) + { + } + + protected AsyncEnumerableReader( int aCount, IEnumerator aEnumerator ) + : this( aCount, aEnumerator, null ) + { + } + + protected AsyncEnumerableReader( int aCount, IEnumerator aEnumerator, ITracer aTracer ) + : base( aTracer ) + { + Setup( aCount, aEnumerator ); + } + #endregion + + #region API + protected void Setup( long aCount, IEnumerator aEnumerator ) + { + iCount = aCount; + iEnumerator = aEnumerator; + } + #endregion + + #region Abstract reading framework + protected abstract void HandleObject( TType aObject, long aIndex, long aCount ); + #endregion + + #region From AsyncReaderBase + protected override long Size + { + get { return iCount; } + } + + protected override long Position + { + get { return iCurrentIndex; } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + protected override void PerformOperation() + { +#if DEBUG + System.DateTime tenPercentTime = DateTime.Now; +#endif + iCurrentIndex = -1; + int newProgress = 0; + int oldProgress = 0; + // + bool hasEntry = iEnumerator.MoveNext(); + while ( hasEntry ) + { + ++iCurrentIndex; + TType entry = iEnumerator.Current; + HandleObject( entry, iCurrentIndex, iCount ); + newProgress = Progress; + // + if ( newProgress != oldProgress ) + { +#if DEBUG + if ( newProgress > 0 && ( newProgress % 10 ) == 0 ) + { + System.DateTime now = DateTime.Now; + long intermediateTickDuration = ( ( now.Ticks - tenPercentTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( newProgress.ToString( "d2" ) + " % COMPLETE - " + intermediateTickDuration.ToString( "d12" ) ); + tenPercentTime = now; + } +#endif + NotifyEvent( TEvent.EReadingProgress ); + oldProgress = newProgress; + } + + // Move to next item + hasEntry = iEnumerator.MoveNext(); + } + +#if DEBUG + System.DateTime endTime = DateTime.Now; + long tickDuration = ( ( endTime.Ticks - iOperationStartTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( "ARRAY READ COMPLETE - " + tickDuration.ToString( "d12" ) ); +#endif + } + #endregion + + #region Data members + private long iCount = 0; + private IEnumerator iEnumerator = null; + private long iCurrentIndex = -1; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Array/AsyncQueueReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Array/AsyncQueueReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using SymbianUtils.Tracer; + +namespace SymbianUtils.TextUtilities.Readers.Types.Array +{ + public interface AsyncQueueObjectSupplier + { + #region AsyncQueueObjectSupplier interface declaration + int QueueLength { get; } + TType Dequeue(); + #endregion + } + + public abstract class AsyncQueueReader : AsyncReaderBase + { + #region Construct & destruct + public AsyncQueueReader( AsyncQueueObjectSupplier aObjectSupplier ) + : this( aObjectSupplier, null ) + { + } + + public AsyncQueueReader( AsyncQueueObjectSupplier aObjectSupplier, ITracer aTracer ) + : base( aTracer ) + { + iObjectSupplier = aObjectSupplier; + } + #endregion + + #region Abstract reading framework + protected abstract void HandleObject( TType aObject, int aIndex, int aCount ); + #endregion + + #region From AsyncReaderBase + protected override long Size + { + get + { + long size = 0; + // + lock( this ) + { + size = iObjectSupplier.QueueLength; + } + // + return size; + } + } + + protected override long Position + { + get + { + long position = 0; + // + lock( this ) + { + position = iCurrentIndex; + } + // + return position; + } + } + #endregion + + #region Properties + public int CurrentIndex + { + get + { + lock( this ) + { + return iCurrentIndex; + } + } + } + + protected AsyncQueueObjectSupplier ObjectSupplier + { + get { return iObjectSupplier; } + } + #endregion + + #region Internal methods + protected override void PerformOperation() + { + int count = 0; + lock( this ) + { + count = iObjectSupplier.QueueLength; + iCurrentIndex = -1; + } + + System.DateTime tenPercentTime = DateTime.Now; + + int newProgress = 0; + int oldProgress = 0; + while( CurrentIndex < count - 1 ) + { + lock( this ) + { + ++iCurrentIndex; + } + // + lock( this ) + { + TType obj = iObjectSupplier.Dequeue(); + HandleObject( obj, iCurrentIndex-1, count ); + newProgress = Progress; + } + // + if ( newProgress != oldProgress ) + { +#if DEBUG + if ( newProgress > 0 && ( newProgress % 10 ) == 0 ) + { + System.DateTime now = DateTime.Now; + long intermediateTickDuration = ( ( now.Ticks - tenPercentTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( newProgress.ToString( "d2" ) + " % COMPLETE - " + intermediateTickDuration.ToString( "d12" ) ); + tenPercentTime = now; + } +#endif + NotifyEvent( TEvent.EReadingProgress ); + oldProgress = newProgress; + } + } + + System.DateTime endTime = DateTime.Now; + long tickDuration = ( ( endTime.Ticks - iOperationStartTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( "QUEUE READ COMPLETE - " + tickDuration.ToString( "d12" ) ); + } + #endregion + + #region Data members + private int iCurrentIndex = -1; + private readonly AsyncQueueObjectSupplier iObjectSupplier; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Binary/AsyncBinaryFileReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Binary/AsyncBinaryFileReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; + +namespace SymbianUtils +{ + public abstract class AsyncBinaryFileReader : AsyncBinaryReaderBase + { + #region Construct & destruct + public AsyncBinaryFileReader( string aFileName ) + : this( aFileName, KDefaultReadChunkSize ) + { + } + + public AsyncBinaryFileReader( string aFileName, int aReadChunkSize ) + { + iSourceFileName = aFileName; + iReadChunkSize = aReadChunkSize; + } + #endregion + + #region Constants + public const int KDefaultReadChunkSize = 512; + #endregion + + #region Properties + public string FileName + { + get + { + string fileName = string.Empty; + // + lock( this ) + { + fileName = iSourceFileName; + } + // + return fileName; + } + } + + protected BinaryReader Reader + { + get { return iReader; } + } + #endregion + + #region New API + protected virtual void HandleReaderOpen() + { + } + #endregion + + #region From DisposableObject - Cleanup Framework + protected override void CleanupManagedResources() + { + try + { + Cleanup(); + } + finally + { + base.CleanupManagedResources(); + } + } + #endregion + + #region From AsyncReaderBase + protected override void HandleReadStarted() + { + iReader = new BinaryReader( new FileStream( FileName, FileMode.Open, FileAccess.Read ) ); + HandleReaderOpen(); + // + base.HandleReadStarted(); + } + + protected override void HandleReadCompleted() + { + try + { + Cleanup(); + } + finally + { + base.HandleReadCompleted(); + } + } + #endregion + + #region Abstract reading framework + protected override byte[] ProvideReadBytes() + { + byte[] ret = iReader.ReadBytes( iReadChunkSize ); + return ret; + } + + protected override long Size + { + get + { + long size = 0; + // + lock( this ) + { + if ( iReader != null && iReader.BaseStream != null ) + { + size = iReader.BaseStream.Length; + } + } + // + return size; + } + } + + protected override long Position + { + get + { + long position = 0; + // + lock( this ) + { + if ( iReader != null && iReader.BaseStream != null ) + { + position = iReader.BaseStream.Position; + } + } + // + return position; + } + } + #endregion + + #region Internal methods + private void Cleanup() + { + lock( this ) + { + if ( iReader != null ) + { + iReader.Close(); + iReader = null; + } + } + } + #endregion + + #region Data members + private BinaryReader iReader; + private readonly int iReadChunkSize; + private readonly string iSourceFileName; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Binary/AsyncBinaryReaderBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Binary/AsyncBinaryReaderBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using SymbianUtils.Tracer; + +namespace SymbianUtils +{ + public abstract class AsyncBinaryReaderBase : AsyncReaderBase + { + #region Construct & destruct + protected AsyncBinaryReaderBase() + : this( null ) + { + } + + protected AsyncBinaryReaderBase( ITracer aTracer ) + : base( aTracer ) + { + } + #endregion + + #region Read handlers + protected virtual bool ContinueProcessing() + { + return false; + } + + protected virtual bool ImmediateAbort() + { + return false; + } + + protected virtual void HandleReadBytes( byte[] aData ) + { + } + #endregion + + #region Abstract reading framework + protected abstract byte[] ProvideReadBytes(); + #endregion + + #region Internal methods + protected override void PerformOperation() + { + bool forcedContinue = false; + bool immediateAbort = false; + byte[] bytes; + // + lock( this ) + { + bytes = ProvideReadBytes(); + forcedContinue = ContinueProcessing(); + immediateAbort = ImmediateAbort(); + } + + System.DateTime tenPercentTime = DateTime.Now; + + int oldProgress = 0; + int newProgress = 0; + while ( ( bytes != null && bytes.Length > 0 ) || forcedContinue && !immediateAbort ) + { + lock( this ) + { + HandleReadBytes( bytes ); + } + // + lock( this ) + { + newProgress = Progress; + if ( newProgress != oldProgress ) + { +#if DEBUG + if ( newProgress > 0 && ( newProgress % 10 ) == 0 ) + { + System.DateTime now = DateTime.Now; + long intermediateTickDuration = ( ( now.Ticks - tenPercentTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( newProgress.ToString( "d2" ) + " % COMPLETE - " + intermediateTickDuration.ToString( "d12" ) ); + tenPercentTime = now; + } +#endif + NotifyEvent( TEvent.EReadingProgress ); + oldProgress = newProgress; + } + bytes = ProvideReadBytes(); + } + // + lock( this ) + { + forcedContinue = ContinueProcessing(); + } + } + + System.DateTime endTime = DateTime.Now; + long tickDuration = ( ( endTime.Ticks - iOperationStartTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( "BINARY READ COMPLETE - " + tickDuration.ToString( "d12" ) ); + } + + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Text/AsyncTextDataReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Text/AsyncTextDataReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,173 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using SymbianUtils.Tracer; + +namespace SymbianUtils +{ + public abstract class AsyncTextDataReader : AsyncTextReader + { + #region Enumerations + public enum TReadDirection + { + EReadDirectionForwards = 0, + EReadDirectionBackwards + } + #endregion + + #region Construct & destruct + protected AsyncTextDataReader( string[] aLines ) + : this( aLines, new AsyncTextReaderPrefix() ) + { + } + + protected AsyncTextDataReader( string[] aLines, ITracer aTracer ) + : this( aLines, new AsyncTextReaderPrefix(), aTracer ) + { + } + + protected AsyncTextDataReader( string[] aLines, AsyncTextReaderPrefix aPrefixes ) + : this( aLines, TReadDirection.EReadDirectionForwards, aPrefixes ) + { + } + + protected AsyncTextDataReader( string[] aLines, AsyncTextReaderPrefix aPrefixes, ITracer aTracer ) + : this( aLines, TReadDirection.EReadDirectionForwards, aPrefixes, aTracer ) + { + } + + protected AsyncTextDataReader( string[] aLines, TReadDirection aReadDirection ) + : this( aLines, TReadDirection.EReadDirectionForwards, new AsyncTextReaderPrefix(), null ) + { + } + + protected AsyncTextDataReader( string[] aLines, TReadDirection aReadDirection, ITracer aTracer ) + : this( aLines, TReadDirection.EReadDirectionForwards, new AsyncTextReaderPrefix(), aTracer ) + { + } + + protected AsyncTextDataReader( string[] aLines, TReadDirection aReadDirection, AsyncTextReaderPrefix aPrefixes ) + : this( aLines, aReadDirection, aPrefixes, null ) + { + } + + protected AsyncTextDataReader( string[] aLines, TReadDirection aReadDirection, AsyncTextReaderPrefix aPrefixes, ITracer aTracer ) + : base( aPrefixes, aTracer ) + { + iLines = aLines; + iReadDirection = aReadDirection; + // + switch( iReadDirection ) + { + default: + case TReadDirection.EReadDirectionForwards: + iLineIndex = 0; + break; + case TReadDirection.EReadDirectionBackwards: + iLineIndex = iLines.Length - 1; + break; + } + } + #endregion + + #region Properties + public int LineNumber + { + get { return iLineIndex; } + } + #endregion + + #region Abstract reading framework + protected override int CalculateProgress() + { + int prog = 0; + // + switch( iReadDirection ) + { + default: + case TReadDirection.EReadDirectionForwards: + { + prog = base.CalculateProgress(); + break; + } + case TReadDirection.EReadDirectionBackwards: + { + float positionAsFloat = (float)Position; + float sizeAsFloat = (float)Size; + prog = (int)((positionAsFloat / sizeAsFloat) * 100.0); + prog = System.Math.Max(1, System.Math.Min(100, prog)); + break; + } + } + // + return prog; + } + + protected override string ProvideReadLine() + { + string ret = null; + // + switch( iReadDirection ) + { + default: + case TReadDirection.EReadDirectionForwards: + if ( iLineIndex < iLines.Length ) + { + ret = iLines[ iLineIndex++ ]; + } + break; + case TReadDirection.EReadDirectionBackwards: + if ( iLineIndex >= 0 ) + { + ret = iLines[ iLineIndex-- ]; + } + break; + } + // + return ret; + } + + protected override long Size + { + get + { + long size = iLines.LongLength; + return size; + } + } + + protected override long Position + { + get + { + long position = (long) iLineIndex; + return position; + } + } + #endregion + + #region Data members + private readonly string[] iLines; + private readonly TReadDirection iReadDirection; + private int iLineIndex = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Text/AsyncTextFileReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Text/AsyncTextFileReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,202 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using SymbianUtils.Tracer; + +namespace SymbianUtils +{ + public abstract class AsyncTextFileReader : AsyncTextReader + { + #region Constructors + protected AsyncTextFileReader( string aFileName ) + : this( aFileName, new AsyncTextReaderPrefix(), null ) + { + } + + protected AsyncTextFileReader( string aFileName, ITracer aTracer ) + : this( aFileName, new AsyncTextReaderPrefix(), false, aTracer ) + { + } + + protected AsyncTextFileReader( string aFileName, bool aRouteBlankLines, ITracer aTracer ) + : this( aFileName, new AsyncTextReaderPrefix(), aRouteBlankLines, aTracer ) + { + } + + protected AsyncTextFileReader( string aFileName, AsyncTextReaderPrefix aPrefixes ) + : this( aFileName, aPrefixes, false, null ) + { + } + + protected AsyncTextFileReader( string aFileName, AsyncTextReaderPrefix aPrefixes, ITracer aTracer ) + : this( aFileName, aPrefixes, false, aTracer ) + { + } + + protected AsyncTextFileReader( string aFileName, AsyncTextReaderPrefix aPrefixes, bool aRouteBlankLines ) + : this( aFileName, aPrefixes, aRouteBlankLines, null ) + { + } + + protected AsyncTextFileReader( string aFileName, AsyncTextReaderPrefix aPrefixes, bool aRouteBlankLines, ITracer aTracer ) + : base( aPrefixes, aRouteBlankLines, aTracer ) + { + iSourceFileName = aFileName; + } + #endregion + + #region From DisposableObject - Cleanup Framework + protected override void CleanupManagedResources() + { + try + { + Cleanup(); + } + finally + { + base.CleanupManagedResources(); + } + } + #endregion + + #region Properties + public string FileName + { + get + { + string fileName = string.Empty; + // + lock( this ) + { + fileName = iSourceFileName; + } + // + return fileName; + } + } + + public long LineNumber + { + get + { + long lineNumber = 0; + // + lock( this ) + { + lineNumber = iLineNumber; + } + // + return lineNumber; + } + } + #endregion + + #region From AsyncReaderBase + protected override void HandleReadStarted() + { + FileStream stream = new FileStream( FileName, FileMode.Open, FileAccess.Read, FileShare.Read ); + iReader = new StreamReader( stream, Encoding.UTF8, false, 1024 ); + + // Cache length because this property is VERY expensive to call. + if ( iReader.BaseStream != null ) + { + iSize = iReader.BaseStream.Length; + } + // + base.HandleReadStarted(); + } + + protected override void HandleReadCompleted() + { + try + { + Cleanup(); + } + finally + { + base.HandleReadCompleted(); + } + } + #endregion + + #region Abstract reading framework + protected override string ProvideReadLine() + { + ++iLineNumber; + return iReader.ReadLine(); + } + + protected override long Size + { + get + { + long size = 0; + // + lock( this ) + { + size = iSize; + } + // + return size; + } + } + + protected override long Position + { + get + { + long position = 0; + // + lock( this ) + { + if (iReader != null && iReader.BaseStream != null) + { + position = iReader.BaseStream.Position; + } + } + // + return position; + } + } + #endregion + + #region Internal methods + private void Cleanup() + { + lock( this ) + { + if ( iReader != null ) + { + iReader.Close(); + iReader = null; + } + } + } + #endregion + + #region Data members + private readonly string iSourceFileName; + private StreamReader iReader; + private long iLineNumber; + private long iSize; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Text/AsyncTextReader.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Text/AsyncTextReader.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,130 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using SymbianUtils.Tracer; + +namespace SymbianUtils +{ + public abstract class AsyncTextReader : AsyncTextReaderBase + { + #region Constructors + protected AsyncTextReader() + : this( new AsyncTextReaderPrefix() ) + { + } + + protected AsyncTextReader( ITracer aTracer ) + : this( new AsyncTextReaderPrefix(), aTracer ) + { + } + + protected AsyncTextReader( AsyncTextReaderPrefix aPrefixes ) + : this( aPrefixes, null ) + { + } + + protected AsyncTextReader( AsyncTextReaderPrefix aPrefixes, ITracer aTracer ) + : this( aPrefixes, false, aTracer ) + { + } + + protected AsyncTextReader( AsyncTextReaderPrefix aPrefixes, bool aRouteBlankLines, ITracer aTracer ) + : base( aTracer ) + { + iPrefixes = aPrefixes; + iRouteBlankLines = aRouteBlankLines; + } + #endregion + + #region API + public void AddFilter( AsyncTextReaderFilter aFilter ) + { + iFilters.Add( aFilter ); + } + #endregion + + #region Properties + public AsyncTextReaderPrefix PrefixDefinition + { + get { return iPrefixes; } + } + + public AsyncTextReaderFilterCollection Filters + { + get { return iFilters; } + } + + public bool RouteBlankLines + { + get { return iRouteBlankLines; } + } + + public string OriginalLine + { + get { return iOriginalLine; } + } + #endregion + + #region New Framework + protected abstract void HandleFilteredLine( string aLine ); + #endregion + + #region From AsyncTextReaderBase + protected override void HandleReadLine( string aLine ) + { + iOriginalLine = ( aLine != null ? aLine : string.Empty ); + bool isBlankLine = ( aLine != null && aLine.Length == 0 ); + // + if ( aLine != null ) + { + if ( ( isBlankLine && RouteBlankLines ) || aLine.Length > 0 ) + { + // Clean it + if ( !isBlankLine ) + { + iPrefixes.Clean( ref aLine ); + } + + // Process filter on line + bool propagateLine = true; + if ( iFilters != null && !isBlankLine ) + { + propagateLine = iFilters.ProcessFilters( ref aLine ); + } + + // Notify derived classes + if ( propagateLine ) + { + HandleFilteredLine( aLine ); + } + } + } + } + #endregion + + #region Data members + private readonly AsyncTextReaderPrefix iPrefixes; + private readonly bool iRouteBlankLines; + private string iOriginalLine = string.Empty; + private AsyncTextReaderFilterCollection iFilters = new AsyncTextReaderFilterCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Text/AsyncTextReaderBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Readers/Types/Text/AsyncTextReaderBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using SymbianUtils.Tracer; + +namespace SymbianUtils +{ + public abstract class AsyncTextReaderBase : AsyncReaderBase + { + #region Constructors + protected AsyncTextReaderBase() + : this( null ) + { + } + + protected AsyncTextReaderBase( ITracer aTracer ) + : base( aTracer ) + { + } + #endregion + + #region Properties + protected bool TrimLine + { + get { return iTrimLine; } + set { iTrimLine = value; } + } + #endregion + + #region Read handlers + protected virtual bool ContinueProcessing() + { + return false; + } + + protected virtual bool ImmediateAbort() + { + return false; + } + + protected virtual void HandleReadLine( string aLine ) + { + } + #endregion + + #region Framework API + protected abstract string ProvideReadLine(); + + protected virtual void OnProgressChanged( int aProgress ) + { + NotifyEvent( TEvent.EReadingProgress ); + } + #endregion + + #region Internal constants + private const int KProgressCheckGranularity = 500; + #endregion + + #region Internal methods + protected override void PerformOperation() + { + bool forcedContinue = false; + bool immediateAbort = false; + string line; + // + lock( this ) + { + line = ProvideReadLine(); + forcedContinue = ContinueProcessing(); + immediateAbort = ImmediateAbort(); + } + + System.DateTime tenPercentTime = DateTime.Now; + + int newProgress = 0; + int oldProgress = 0; + int progressTracker = 0; + + while ( ( line != null || forcedContinue ) && !immediateAbort ) + { + if ( line != null && TrimLine ) + { + line = line.Trim(); + } + // + lock( this ) + { + HandleReadLine( line ); + } + // + lock( this ) + { + if ( progressTracker == KProgressCheckGranularity ) + { + newProgress = Progress; + progressTracker = 0; + } + + ++progressTracker; + } + if ( newProgress != oldProgress ) + { +#if DEBUG + if ( newProgress > 0 && ( newProgress % 10 ) == 0 ) + { + System.DateTime now = DateTime.Now; + long intermediateTickDuration = ( ( now.Ticks - tenPercentTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( newProgress.ToString( "d2" ) + " % COMPLETE - " + intermediateTickDuration.ToString( "d12" ) ); + tenPercentTime = now; + } +#endif + OnProgressChanged( newProgress ); + oldProgress = newProgress; + } + // + lock( this ) + { + line = ProvideReadLine(); + forcedContinue = ContinueProcessing(); + immediateAbort = ImmediateAbort(); + } + } + + System.DateTime endTime = DateTime.Now; + long tickDuration = ( ( endTime.Ticks - iOperationStartTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( "TEXT READ COMPLETE - " + tickDuration.ToString( "d12" ) ); + } + #endregion + + #region Data members + private bool iTrimLine = true; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Writers/AsyncTextWriters.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/TextUtilities/Writers/AsyncTextWriters.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,881 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using System.Drawing; + +namespace SymbianUtils +{ + #region Enumerations + public enum TNotUsingThread + { + ENotUsingThread + } + #endregion + + public abstract class AsyncTextWriterBase : DisposableObject + { + #region Events + public enum TEvent + { + EWritingStarted = 0, + EWritingProgress, + EWritingComplete + } + + public delegate void Observer( TEvent aEvent, AsyncTextWriterBase aObject ); + public event Observer iObserver; + #endregion + + #region Construct & destruct + public AsyncTextWriterBase() + : this( System.Threading.ThreadPriority.BelowNormal ) + { + } + + public AsyncTextWriterBase( System.Threading.ThreadPriority aPriority ) + { + iWorkerThread = new Thread( new System.Threading.ThreadStart( WorkerThreadFunction ) ); + iWorkerThread.Name = "WorkerThreadFunction_" + this.ToString(); + iWorkerThread.Priority = aPriority; + iWorkerThread.IsBackground = true; + } + + public AsyncTextWriterBase( TNotUsingThread aNotUsingThread ) + { + } + #endregion + + #region API + public void AsyncWrite() + { + lock( this ) + { + if ( iWorkerThread != null ) + { + iWorkerThread.Start(); + } + } + } + #endregion + + #region From DisposableObject - Cleanup Framework + protected override void CleanupManagedResources() + { + try + { + } + finally + { + base.CleanupManagedResources(); + } + } + + protected override void CleanupUnmanagedResources() + { + try + { + } + finally + { + base.CleanupUnmanagedResources(); + } + } + #endregion + + #region Properties + public bool IsReady + { + get + { + lock(this) + { + return iReady; + } + } + set + { + lock( this ) + { + iReady = value; + } + } + } + + public int Progress + { + get + { + lock(this) + { + if (Size == 0) + return 0; + else + { + float positionAsFloat = (float)Position; + float sizeAsFloat = (float)Size; + int progress = (int)((positionAsFloat / sizeAsFloat) * 100.0); + // + return System.Math.Max(1, System.Math.Min(100, progress)); + } + } + } + } + #endregion + + #region Write handlers + protected virtual bool ContinueProcessing() + { + return false; + } + + protected virtual void HandleWriteStarted() + { + } + + protected virtual void HandleWriteCompleted() + { + } + + protected virtual void HandleWriteException( Exception aException ) + { + } + #endregion + + #region Abstract writing framework + public abstract void ExportData(); + public abstract long Size { get; } + public abstract long Position { get; } + #endregion + + #region Internal methods + private void NotifyEvent( TEvent aEvent ) + { + if ( iObserver != null ) + { + iObserver( aEvent, this ); + } + } + + private void AsyncWriteLines() + { + bool forcedContinue = false; + lock( this ) + { + forcedContinue = ContinueProcessing(); + } + + while( Progress != KAllWorkCompletedPercentage || forcedContinue ) + { + ExportData(); + + lock( this ) + { + NotifyEvent( TEvent.EWritingProgress ); + forcedContinue = ContinueProcessing(); + } + } + } + + private void WorkerThreadFunction() + { + try + { + lock( this ) + { + iReady = false; + HandleWriteStarted(); + NotifyEvent( TEvent.EWritingStarted ); + } + + AsyncWriteLines(); + } + catch( Exception exception ) + { + lock( this ) + { + HandleWriteException( exception ); + } + } + finally + { + lock( this ) + { + HandleWriteCompleted(); + iReady = true; + NotifyEvent( TEvent.EWritingComplete ); + } + } + } + #endregion + + #region Internal constants + protected const int KAllWorkCompletedPercentage = 100; + #endregion + + #region Data members + protected bool iReady = true; + private readonly Thread iWorkerThread; + #endregion + } + + public abstract class AsyncTextFileWriter : AsyncTextWriterBase + { + #region Construct & destruct + public AsyncTextFileWriter( string aFileName ) + { + iSourceFileName = aFileName; + } + + public AsyncTextFileWriter( string aFileName, TNotUsingThread aNotUsingThread ) + : this( aNotUsingThread ) + { + iSourceFileName = aFileName; + } + + public AsyncTextFileWriter( TNotUsingThread aNotUsingThread ) + : base( aNotUsingThread ) + { + } + #endregion + + #region API + public void ConstructWriter() + { + iWriter = new StreamWriter( FileName ); + } + + public void WriteLine( string aLine ) + { + iWriter.WriteLine( aLine ); + } + #endregion + + #region Properties + public StreamWriter Writer + { + get { return iWriter; } + } + + public string FileName + { + get { return iSourceFileName; } + } + #endregion + + #region From DisposableObject - Cleanup Framework + protected override void CleanupManagedResources() + { + try + { + Cleanup(); + } + finally + { + base.CleanupManagedResources(); + } + } + #endregion + + #region From AsyncTextWriterBase + protected override void HandleWriteStarted() + { + if ( iWriter == null ) + { + ConstructWriter(); + } + + base.HandleWriteStarted(); + } + + protected override void HandleWriteCompleted() + { + try + { + Cleanup(); + } + finally + { + base.HandleWriteCompleted(); + } + } + #endregion + + #region Internal methods + private void Cleanup() + { + lock( this ) + { + if ( iWriter != null ) + { + iWriter.Close(); + iWriter = null; + } + } + } + #endregion + + #region Data members + private StreamWriter iWriter; + private readonly string iSourceFileName; + #endregion + } + + public abstract class AsyncHTMLFileWriter : AsyncTextFileWriter + { + #region Construct & destruct + public AsyncHTMLFileWriter( string aFileName ) + : base( aFileName ) + { + } + + public AsyncHTMLFileWriter( TNotUsingThread aNotUsingThread ) + : base( aNotUsingThread ) + { + } + + public AsyncHTMLFileWriter( string aFileName, TNotUsingThread aNotUsingThread ) + : base( aFileName ) + { + } + #endregion + + #region Enumerations + public enum TAlignment + { + EAlignNone = -1, + EAlignLeft = 0, + EAlignRight, + EAlignCenter, + EAlignJustify + } + #endregion + + #region Helper methods - document + public void WriteDocumentBegin() + { + WriteLine( "" ); + WriteLine( "" ); + } + + public void WriteDocumentEnd() + { + WriteLine( "" ); + } + #endregion + + #region Helper methods - header + public void WriteHeadBegin() + { + WriteLine( "" ); + } + + public void WriteHeadEnd() + { + Writer.WriteLine( "" ); + } + + public void WriteTitle( string aTitle ) + { + Writer.WriteLine( "" + aTitle + "" ); + } + + public void WriteStyleBegin() + { + WriteLine( "" ); + WriteLine( "" ); + } + #endregion + + #region Helper methods - body + public void WriteBodyBegin() + { + WriteLine( "" ); + } + + public void WriteBodyEnd() + { + WriteLine( "" ); + } + #endregion + + #region Helper methods - tables + public void WriteTableBegin() + { + WriteTableBegin( 100 ); + } + + public void WriteTableBegin( int aWidthPercentage ) + { + WriteLine( "" ); + } + + public void WriteTableBeginWidthPixels( int aWidthPixels, Color aColor ) + { + string color = ColorString( aColor ); + WriteLine( "
" ); + } + + public void WriteTableEnd() + { + Writer.WriteLine( "
" ); + } + + public void WriteTableRowBegin() + { + WriteLine( "" ); + } + + public void WriteTableRowEnd() + { + WriteLine( "" ); + } + + public void WriteTableColumnBegin() + { + WriteTableColumnBegin( TAlignment.EAlignNone, string.Empty ); + } + + public void WriteTableColumnBegin( TAlignment aAlignment, string aStyle ) + { + WriteTableColumnBegin( aAlignment, aStyle, -1 ); + } + + public void WriteTableColumnBegin( TAlignment aAlignment, string aStyle, int aPixelWidth ) + { + StringBuilder line = new StringBuilder(); + line.Append( "" ); + WriteLine( line.ToString() ); + } + + public void WriteTableColumnEnd() + { + WriteLine( "" ); + } + + public void WriteTableColumn( string aValue ) + { + WriteTableColumn( aValue, TAlignment.EAlignNone, string.Empty ); + } + + public void WriteTableColumn( string aValue, TAlignment aAlignment ) + { + WriteTableColumn( aValue, aAlignment, string.Empty ); + } + + public void WriteTableColumn( string aValue, string aStyle ) + { + WriteTableColumn( aValue, TAlignment.EAlignNone, aStyle ); + } + + public void WriteTableColumn( string aValue, TAlignment aAlignment, string aStyle ) + { + WriteTableColumnBegin( aAlignment, aStyle ); + Writer.Write( aValue ); + WriteTableColumnEnd(); + } + + public void WriteTableColumnFormatted( long aNumber, string aFormat ) + { + WriteTableColumnFormatted( aNumber, aFormat, TAlignment.EAlignNone ); + } + + public void WriteTableColumnFormatted( long aNumber, string aFormat, TAlignment aAlignment ) + { + WriteTableColumnFormatted( aNumber, aFormat, aAlignment, string.Empty ); + } + + public void WriteTableColumnFormatted( long aNumber, string aFormat, TAlignment aAlignment, string aStyle ) + { + WriteTableColumn( aNumber.ToString( aFormat ), aAlignment, aStyle ); + } + + public void WriteTableColumn( long aNumber ) + { + WriteTableColumn( aNumber, "d" ); + } + + public void WriteTableColumn( long aNumber, string aStyle ) + { + WriteTableColumnFormatted( aNumber, "d", TAlignment.EAlignNone, aStyle ); + } + + public void WriteTableColumn( long aNumber, TAlignment aAlignment ) + { + WriteTableColumnFormatted( aNumber, "d", aAlignment, string.Empty ); + } + + public void WriteTableColumn( long aNumber, TAlignment aAlignment, string aStyle ) + { + WriteTableColumnFormatted( aNumber, "d", aAlignment, aStyle ); + } + + public void WriteTableColumnHex( long aNumber ) + { + WriteTableColumnHex( aNumber, string.Empty ); + } + + public void WriteTableColumnHex( long aNumber, string aStyle ) + { + WriteTableColumnHex( aNumber, TAlignment.EAlignNone, aStyle ); + } + + public void WriteTableColumnHex( long aNumber, TAlignment aAlignment, string aStyle ) + { + WriteTableColumn( aNumber.ToString( "x8" ), aAlignment, aStyle ); + } + + public void WriteTableColumnHexAddress( long aNumber ) + { + WriteTableColumnHexAddress( aNumber, TAlignment.EAlignNone ); + } + + public void WriteTableColumnHexAddress( long aNumber, TAlignment aAlignment ) + { + WriteTableColumnHexAddress( aNumber, aAlignment, string.Empty ); + } + + public void WriteTableColumnHexAddress( long aNumber, TAlignment aAlignment, string aStyle ) + { + WriteTableColumn( "0x" + aNumber.ToString( "x8" ), aAlignment, aStyle ); + } + + public void WriteTableColumnSpace() + { + WriteTableColumnBegin(); + WriteLine( " " ); + WriteTableColumnEnd(); + } + + public void WriteTableColumnSpace( int aPixelWidth ) + { + WriteTableColumnBegin(); + WriteLine( " " ); + WriteTableColumnEnd(); + } + + public void WriteTableColumnEmpty() + { + WriteTableColumnBegin(); + WriteTableColumnEnd(); + } + #endregion + + #region Helper methods - blocks/paragraphs + public void WriteDivisionBegin() + { + WriteLine( "
" ); + } + + public void WriteDivisionBegin( string aStyle ) + { + WriteDivisionBegin( TAlignment.EAlignNone, aStyle ); + } + + public void WriteDivisionBeginWithId( string aId ) + { + WriteDivisionBegin( TAlignment.EAlignNone, string.Empty, aId ); + } + + public void WriteDivisionBegin( TAlignment aAlignment ) + { + WriteDivisionBegin( aAlignment, string.Empty ); + } + + public void WriteDivisionBegin( TAlignment aAlignment, string aStyle ) + { + WriteDivisionBegin( aAlignment, aStyle, string.Empty ); + } + + public void WriteDivisionBegin( TAlignment aAlignment, string aStyle, string aId ) + { + StringBuilder line = new StringBuilder(); + line.Append( "" ); + // + WriteLine( line.ToString() ); + } + + public void WriteDivisionEnd() + { + WriteLine( "
" ); + } + + public void WriteParagraphBegin() + { + WriteLine( "

" ); + } + + public void WriteParagraphBegin( string aClass ) + { + WriteLine( "

" ); + } + + public void WriteParagraphEnd() + { + WriteLine( "

" ); + } + + public void WriteSpanBegin() + { + WriteSpanBegin( string.Empty ); + } + + public void WriteSpanBegin( string aClass ) + { + WriteSpanBegin( aClass, string.Empty ); + } + + public void WriteSpanBegin( string aClass, string aId ) + { + Writer.Write( "" ); + } + + public void WriteSpanEnd() + { + WriteLine( "" ); + } + + public void WriteNewLine() + { + WriteLine( "
" ); + } + #endregion + + #region Helper methods - text + public void WriteText( string aText ) + { + Writer.Write( aText ); + } + + public void WriteText( string aText, string aStyle ) + { + Writer.Write( "" ); + Writer.Write( aText ); + Writer.Write( "" ); + } + + public void WriteLine( string aText, string aStyle ) + { + StringBuilder line = new StringBuilder(); + // + line.Append( "" ); + line.Append( aText ); + line.Append( "" ); + // + WriteLine( line.ToString() ); + } + + public void WriteSpace() + { + Writer.Write( " " ); + } + #endregion + + #region Helper methods - links (anchors) + public void WriteAnchorBegin( string aPageAddress ) + { + WriteAnchorBeginWithStyle( aPageAddress, string.Empty ); + } + + public void WriteAnchorBeginWithStyle( string aPageAddress, string aStyle ) + { + StringBuilder line = new StringBuilder(); + line.Append( "" ); + Writer.Write( line.ToString() ); + } + + public void WriteAnchorEnd() + { + WriteLine( "" ); + } + + public void WriteAnchorWithName( string aName ) + { + WriteAnchorWithName( aName, string.Empty ); + } + + public void WriteAnchorWithName( string aName, string aValue ) + { + StringBuilder line = new StringBuilder(); + line.Append( "" ); + line.Append( aValue ); + line.Append( "" ); + Writer.Write( line.ToString() ); + } + + public void WriteAnchorWithTarget( string aTargetName, string aURL, string aText ) + { + StringBuilder line = new StringBuilder(); + line.Append( "" ); + line.Append( aText ); + line.Append( "" ); + Writer.Write( line.ToString() ); + } + #endregion + + #region Helper methods - colors + public static string ColorString( Color aColor ) + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( "#" ); + ret.Append( aColor.R.ToString("x2") ); + ret.Append( aColor.G.ToString("x2") ); + ret.Append( aColor.B.ToString("x2") ); + // + return ret.ToString(); + } + #endregion + + #region Internal methods + static string FormattedId( string aId ) + { + string ret = string.Empty; + // + if ( aId != string.Empty ) + { + ret = " ID=\"" + aId + "\" "; + } + // + return ret; + } + + static string FormattedClass( string aStyleName ) + { + string ret = string.Empty; + // + if ( aStyleName != string.Empty ) + { + ret = " CLASS=\"" + aStyleName + "\""; + } + // + return ret; + } + + static string FormattedWidthPixel( int aWidth ) + { + string ret = string.Empty; + // + if ( aWidth > 0 ) + { + ret = " WIDTH=\"" + aWidth.ToString() + "px\""; + } + // + return ret; + } + + static string FormattedWidthPercent( int aWidth ) + { + string ret = string.Empty; + // + if ( aWidth > 0 ) + { + ret = " WIDTH=\"" + aWidth.ToString() + "%\""; + } + // + return ret; + } + + static string FormattedAlignment( TAlignment aAlignment ) + { + StringBuilder line = new StringBuilder(); + // + if ( aAlignment != TAlignment.EAlignNone ) + { + line.Append( " ALIGN=\"" ); + switch( aAlignment ) + { + case TAlignment.EAlignLeft: + line.Append( "LEFT" ); + break; + case TAlignment.EAlignRight: + line.Append( "RIGHT" ); + break; + case TAlignment.EAlignCenter: + line.Append( "CENTER" ); + break; + case TAlignment.EAlignJustify: + line.Append( "JUSTIFY" ); + break; + default: + case TAlignment.EAlignNone: + break; + } + line.Append( "\"" ); + } + // + return line.ToString(); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Threading/BlockingQueue.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Threading/BlockingQueue.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,221 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Threading; + +namespace SymbianUtils.Threading +{ + public class BlockingQueue : ICollection, IEnumerable + { + #region Constructors + public BlockingQueue() + : this( -1 ) + { + } + + public BlockingQueue( int aMaxSize ) + { + iMaxSize = aMaxSize; + iQueue = new Queue(); + } + #endregion + + #region API + public void Enqueue( T aItem ) + { + lock ( this.SyncRoot ) + { + // We want to prevent the queue from growing beyond it's own + // bounds, unless the creator requested an unbounded queue. + if ( iMaxSize > 0 ) + { + while ( this.Count >= iMaxSize ) + { + try + { + Monitor.Wait( this.SyncRoot ); + } + catch + { + Monitor.PulseAll( this.SyncRoot ); + throw; + } + } + } + + // Now it's okay to add the item + iQueue.Enqueue( aItem ); + + // If the count is now one, then we've just added the first + // item, in which case we must pulse the monitor because + // there could be blocked threads that are stuck inside the Dequeue() + // method, waiting for published content. + int count = this.Count; + if ( count == 1 ) + { + Monitor.PulseAll( this.SyncRoot ); + } + } + } + + public bool TryToDequeue( out T aItem ) + { + bool ret = false; + aItem = default( T ); + // + lock ( this.SyncRoot ) + { + if ( this.Count > 0 ) + { + aItem = iQueue.Dequeue(); + ret = true; + } + } + // + return ret; + } + + public void Clear() + { + lock ( this.SyncRoot ) + { + iQueue.Clear(); + + // Pulse, since clearing the items might allow a thread blocked + // inside Enqueue() to push something to the head of the list + Monitor.PulseAll( this.SyncRoot ); + } + } + + public T Dequeue() + { + lock ( this.SyncRoot ) + { + // Wait until the queue contains some content. + while ( this.Count == 0 ) + { + try + { + Monitor.Wait( this.SyncRoot ); + } + catch + { + Monitor.PulseAll( this.SyncRoot ); + throw; + } + } + + T ret = iQueue.Dequeue(); + + // We dequeue the item and then check to see if we have + // just opened up the first free slot in the queue. + // If so, we must pulse the monitor because there could be + // threads blocked inside the Enqueue() method that are waiting + // for space to become available. + int count = this.Count; + if ( iMaxSize > 0 && count == iMaxSize - 1 ) + { + Monitor.PulseAll( this.SyncRoot ); + } + // + return ret; + } + } + + public T Peek() + { + lock ( this.SyncRoot ) + { + return iQueue.Peek(); + } + } + + public bool Contains( T aItem ) + { + lock ( this.SyncRoot ) + { + bool ret = iQueue.Contains( aItem ); + return ret; + } + } + + public T[] ToArray() + { + lock ( this.SyncRoot ) + { + T[] ret = iQueue.ToArray(); + return ret; + } + } + #endregion + + #region From IEnumerable + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + throw new NotImplementedException( "You cannot enumerate a Blocking Queue - get the values and enumerate those instead" ); + } + #endregion + + #region From ICollection + public void CopyTo( Array aArray, int aIndex ) + { + lock ( this.SyncRoot ) + { + ICollection baseCol = (ICollection) iQueue; + baseCol.CopyTo( aArray, aIndex ); + } + } + + public int Count + { + get + { + lock ( this.SyncRoot ) + { + return iQueue.Count; + } + } + } + + public bool IsSynchronized + { + get { return true; } + } + + public object SyncRoot + { + get + { + if ( this.iSyncRoot == null ) + { + Interlocked.CompareExchange( ref this.iSyncRoot, new object(), null ); + } + return iSyncRoot; + } + } + #endregion + + #region Data members + private readonly Queue iQueue; + private object iSyncRoot = null; + private readonly int iMaxSize; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Threading/MultiThreadedProcessor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Threading/MultiThreadedProcessor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,262 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Threading; +using System.Reflection; + +namespace SymbianUtils.Threading +{ + public class MultiThreadedProcessor : DisposableObject + { + #region Enumerations + public enum TEvent + { + EEventStarting = 0, + EEventCompleted + } + #endregion + + #region Delegates & events + public delegate void ProcessorEventHandler( TEvent aEvent ); + public event ProcessorEventHandler EventHandler = delegate { }; + // + public delegate void ItemProcessor( T aItem ); + public event ItemProcessor ProcessItem = null; + // + public delegate void ExceptionHandler( Exception aException ); + public event ExceptionHandler Exception; + #endregion + + #region Constructors + public MultiThreadedProcessor( IEnumerable aCollection ) + : this( aCollection, ThreadPriority.Normal ) + { + } + + public MultiThreadedProcessor( IEnumerable aCollection, ThreadPriority aPriority ) + { + PopulateQueue( aCollection ); + iThreadPriorities = aPriority; + iProcessorCount = System.Environment.ProcessorCount; + } + #endregion + + #region Framework API + public virtual void Start( TSynchronicity aSynchronicity ) + { + iSynchronicity = aSynchronicity; + OnEvent( MultiThreadedProcessor.TEvent.EEventStarting ); + + int count = iQueue.Count; + if ( count == 0 ) + { + // Nothing to do! + OnEvent( MultiThreadedProcessor.TEvent.EEventCompleted ); + } + else + { + // For sync mode, we need to block until the operation + // completes. + DestroyBlocker(); + if ( aSynchronicity == TSynchronicity.ESynchronous ) + { + iSynchronousBlocker = new ManualResetEvent( false ); + } + + // Create worker threads to process queue items. One per + // processor core. + CreateThreads(); + + if ( aSynchronicity == TSynchronicity.ESynchronous ) + { + System.Diagnostics.Debug.Assert( iSynchronousBlocker != null ); + + // Now wait. + using ( iSynchronousBlocker ) + { + iSynchronousBlocker.WaitOne(); + } + iSynchronousBlocker = null; + + // See comments in "RunThread" below for details about why + // we do this here - it avoids a race condition. + OperationComplete(); + } + } + } + + protected virtual bool Process( T aItem ) + { + return false; + } + + protected virtual void OnException( Exception aException ) + { + if ( Exception != null ) + { + Exception( aException ); + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + protected void PopulateQueue( IEnumerable aCollection ) + { + iQueue.Clear(); + // + foreach ( T item in aCollection ) + { + iQueue.Enqueue( item ); + } + } + + private void CreateThreads() + { + Random r = new Random( DateTime.Now.Millisecond ); + // + int count = System.Environment.ProcessorCount; + for ( int i = 0; i < count; i++ ) + { + string name = string.Format( "Processor Thread {0:d3} {1:d8}", i, r.Next() ); + Thread t = new Thread( new ThreadStart( RunThread ) ); + t.IsBackground = true; + t.Priority = iThreadPriorities; + iThreads.Add( t ); + // + t.Start(); + } + } + + private void RunThread() + { + // Process items until none are left. + while ( iQueue.Count > 0 ) + { + T item; + // + bool dequeued = iQueue.TryToDequeue( out item ); + if ( dequeued ) + { + // First try virtual function call. If that fails then + // we'll resort to trying an event handler. + try + { + bool processed = Process( item ); + if ( processed == false && ProcessItem != null ) + { + ProcessItem( item ); + } + } + catch ( Exception e ) + { + // Let the derived class handle exceptions + OnException( e ); + } + } + } + + // If all the threads have finished then the entire + // operation is complete. + bool finished = false; + lock ( iThreads ) + { + iThreads.Remove( Thread.CurrentThread ); + finished = ( iThreads.Count == 0 ); + } + + // Check for completion + if ( finished ) + { + // If we're operating synchronously, then let the main + // thread (the one that is currently blocked) report + // completion. This prevents a race condition whereby the worker + // threads (i.e. the thread in which this function is running) + // notifies about completion before the main thread has started + // blocking (waiting). This can cause an exception whereby + // the client might dispose of this object twice. + if ( iSynchronicity == TSynchronicity.EAsynchronous ) + { + OperationComplete(); + } + else + { + // Will be done by "Start" + } + + // Always release the blocker to "unblock" the main thread + ReleaseBlocker(); + } + } + + private void OperationComplete() + { + OnEvent( MultiThreadedProcessor.TEvent.EEventCompleted ); + } + + private void DestroyBlocker() + { + if ( iSynchronousBlocker != null ) + { + iSynchronousBlocker.Close(); + iSynchronousBlocker = null; + } + } + + private void ReleaseBlocker() + { + if ( iSynchronousBlocker != null ) + { + iSynchronousBlocker.Set(); + } + } + + protected virtual void OnEvent( TEvent aEvent ) + { + EventHandler( aEvent ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + DestroyBlocker(); + } + } + #endregion + + #region Data members + private readonly int iProcessorCount; + private readonly ThreadPriority iThreadPriorities; + private BlockingQueue iQueue = new BlockingQueue(); + private List iThreads = new List(); + private ManualResetEvent iSynchronousBlocker = null; + private TSynchronicity iSynchronicity = TSynchronicity.ESynchronous; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Tracer/ISymTracer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Tracer/ISymTracer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.Tracer +{ + public interface ITracer + { + void Trace( string aMessage ); + void Trace( string aFormat, params object[] aParams ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/CRC32Checksum.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/CRC32Checksum.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.Utilities +{ + public class CRC32Checksum + { + #region Constructors + public CRC32Checksum() + : this( 0 ) + { + } + + public CRC32Checksum( uint aValue ) + { + iCRC = aValue; + } + #endregion + + #region API + public void Reset() + { + iCRC = 0; + } + + public void Checksum( byte aByte ) + { + iCRC = ( iCRC >> 8 ) ^ KCCIT_CRC_Table[ ( iCRC ^ aByte ) & 0xff ]; + } + + public void Checksum( byte[] aBuffer ) + { + Checksum( aBuffer, 0, aBuffer.Length ); + } + + public void Checksum( byte[] aBuffer, int aOffset, int aCount ) + { + for ( int i = aOffset; i < aOffset + aCount; i++ ) + { + iCRC = ( iCRC >> 8 ) ^ KCCIT_CRC_Table[ ( iCRC ^ aBuffer[ i ] ) & 0xff ]; + } + } + #endregion + + #region Properties + public uint Value + { + get { return iCRC; } + } + + public byte[] ValueArray + { + get + { + byte[] result = new byte[ 4 ]; + // + result[ 0 ] = (byte) ( ( iCRC >> 24 ) & 0xFF ); + result[ 1 ] = (byte) ( ( iCRC >> 16 ) & 0xFF ); + result[ 2 ] = (byte) ( ( iCRC >> 8 ) & 0xFF ); + result[ 3 ] = (byte) ( ( iCRC >> 0 ) & 0xFF ); + // + return result; + } + } + #endregion + + #region Internal lookup table + private readonly static uint[] KCCIT_CRC_Table = new uint[] + { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d + }; + #endregion + + #region Data members + private uint iCRC = 0; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/DisposableObject.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/DisposableObject.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,101 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; + +namespace SymbianUtils +{ + public class DisposableObject : IDisposable + { + #region Constructors + public DisposableObject() + { + } + + ~DisposableObject() + { + // Not allowed to access managed resources from + // within a C# destructor (in this context we are being + // called by the GC and it will take care of disposing of + // other managed resources for us). + Cleanup( false, true ); + } + #endregion + + #region Properties + public bool HaveBeenDisposedOf + { + get { return iHaveBeenDisposedOf; } + } + #endregion + + #region API - Cleanup Framework + protected virtual void CleanupManagedResources() + { + } + + protected virtual void CleanupUnmanagedResources() + { + } + #endregion + + #region From IDisposable + public void Dispose() + { + // In this situation, we are programatically being asked to + // release all resources, including managed ones. + Cleanup( true, true ); + + // Take yourself off the Finalization queue + // to prevent finalization code for this object + // from executing a second time. + GC.SuppressFinalize( this ); + } + #endregion + + #region Internal methods + private void Cleanup( bool aReleaseManagedResources, bool aReleaseUnmanagedResources ) + { + lock( this ) + { + if ( iHaveBeenDisposedOf == false ) + { + try + { + if ( aReleaseManagedResources ) + { + CleanupManagedResources(); + } + if ( aReleaseUnmanagedResources ) + { + CleanupUnmanagedResources(); + } + + iHaveBeenDisposedOf = true; + } + catch + { + } + } + } + } + #endregion + + #region Data members + private bool iHaveBeenDisposedOf = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/HTMLEntityUtility.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/HTMLEntityUtility.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; + +namespace SymbianUtils +{ + public class HTMLEntityUtility + { + public static string Entitize(string text) + { + return Entitize(text, true); + } + + public static string Entitize( string aText, bool aEntitizeQuotAmpAndLtGt) + { + StringBuilder ret = new StringBuilder( aText.Length ); + + for(int i=0;i 127 || code < 32 ) || (aEntitizeQuotAmpAndLtGt && ((code == 34) || (code == 38) || (code == 60) || (code == 62)))) + { + ret.Append( "&#" + code + ";" ); + } + else if ( aText[i] == '\'' || aText[i] == '@' || aText[i] == '\"' ) + { + ret.Append( "." ); + } + else + { + ret.Append( aText[i] ); + } + } + + return ret.ToString(); + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/MemoryModelUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/MemoryModelUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,375 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; + +#region MOVING MEMORY MODEL +// 00000000-003FFFFF Unmapped +// 00400000-2FFFFFFF Moving process data +// 30000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M, always ends at 40000000) +// 40000000-5FFFFFFF RAM drive +// 60000000-60001FFF Super page/CPU page +// 61000000-61003FFF Page directory (16K) +// 61020000-6103FFFF Page table info (4096 * 8bytes = 32K) +// 61100000-611FFFFF Cache flush area +// 61200000-612FFFFF Alternate cache flush area +// 62000000-623FFFFF Page tables (up to 4096 * 1K) +// 63000000-63FFFFFF Primary I/O mappings +// 64000000-64FFFFFF Kernel .data/.bss, initial stack, kernel heap +// 65000000-655FFFFF fixed processes - usually 2 or 3Mb each. +// 65600000-F1FFFFFF Kernel section (includes extra I/O mappings) +// F2000000-F3FFFFFF Kernel code (RAM size/2) +// F4000000-F7FFFFFF User code (RAM size) +// F8000000-FFEFFFFF ROM +// FFF00000-FFFFFFFF Exception vectors +#endregion +#region MULTIPLE MEMORY MODEL +// Linear address map (1Gb configuration): +// 00000000-003FFFFF Unmapped +// 00400000-1FFFFFFF Local data +// 20000000-3BFFFFFF Shared data +// 3C000000-3DFFFFFF RAM loaded code (=phys ram size up to 256M) +// 3E000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M) +// 40000000-7FFFFFFF Unused +// +// 80000000-8FFFFFFF ROM +// 90000000-9FFFFFFF User Global Area +// A0000000-BFFFFFFF RAM drive +// C0000000-C0001FFF Super page/CPU page +// C0040000-C00403FF ASID info (256 ASIDs) +// C0080000-C00FFFFF Page table info +// C1000000-C13FFFFF Page directories (up to 256 * 16KB) +// C2000000-C5FFFFFF Page tables +// C6000000-C6FFFFFF Primary I/O mappings +// C7000000-C7FFFFFF +// C8000000-C8FFFFFF Kernel .data/.bss, initial stack, kernel heap +// C9000000-C91FFFFF Kernel stacks +// C9200000-FFEFFFFF Extra kernel mappings (I/O, RAM loaded device drivers) +// FFF00000-FFFFFFFF Exception vectors +// +// +// Linear address map (2Gb configuration): +// 00000000-003FFFFF Unmapped +// 00400000-37FFFFFF Local data +// 38000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M) +// 40000000-6FFFFFFF Shared data +// 70000000-7FFFFFFF RAM loaded code (=phys ram size up to 256M) +// +// 80000000-8FFFFFFF ROM +// 90000000-9FFFFFFF User Global Area +// A0000000-BFFFFFFF RAM drive +// C0000000-C0001FFF Super page/CPU page +// C0040000-C00403FF ASID info (256 ASIDs) +// C0080000-C00FFFFF Page table info +// C1000000-C13FFFFF Page directories (up to 256 * 16KB) +// C2000000-C5FFFFFF Page tables +// C6000000-C6FFFFFF Primary I/O mappings +// C7000000-C7FFFFFF +// C8000000-C8FFFFFF Kernel .data/.bss, initial stack, kernel heap +// C9000000-C91FFFFF Kernel stacks +// C9200000-FFEFFFFF Extra kernel mappings (I/O, RAM loaded device drivers) +// FFF00000-FFFFFFFF Exception vectors +#endregion + +namespace SymbianUtils +{ + public static class MemoryModel + { + #region Enumerations + public enum TMemoryModelType + { + EMemoryModelUnknown = -1, + EMemoryModelMoving = 0, + EMemoryModelMultiple + } + + public enum TMemoryModelRegion + { + // Common + EMemoryModelRegionUnmapped = 0, + EMemoryModelRegionDLLStaticData, + EMemoryModelRegionRAMLoadedCode, + EMemoryModelRegionROM, + EMemoryModelRegionUserGlobalArea, + EMemoryModelRegionRAMDrive, + EMemoryModelRegionSuperAndCPUPages, + EMemoryModelRegionPageTableInfo, + EMemoryModelRegionPageDirectories, + EMemoryModelRegionPageTables, + EMemoryModelRegionPrimaryIOMappings, + EMemoryModelRegionUnknown, + EMemoryModelRegionKernelGlobalsInitialStackKernelHeap, + EMemoryModelRegionExtraKernelMappings, + EMemoryModelRegionExceptionVectors, + + // Moving + EMemoryModelRegionMovingProcessData, + EMemoryModelRegionCacheFlushArea, + EMemoryModelRegionCacheFlushAreaAlternate, + EMemoryModelRegionKernelCode, + EMemoryModelRegionFixedProcesses, + EMemoryModelRegionUserCode, + + // Multiple + EMemoryModelRegionSharedData, + EMemoryModelRegionLocalData, + EMemoryModelRegionASIDInfo, + EMemoryModelRegionKernelStacks, + } + #endregion + + #region API + public static TMemoryModelType TypeByAddress( long aAddress ) + { + // This is not a very good way of doing this. Should be + // either a UI option or then something in the symbol file + // that we are reading... + TMemoryModelType ret = TMemoryModelType.EMemoryModelUnknown; + // + if ( aAddress >= 0xc8000000 && aAddress < 0xC8FFFFFF) + { + // Kernel global, Multiple Memory Model + ret = TMemoryModelType.EMemoryModelMultiple; + } + else if ( aAddress >= 0x80000000 && aAddress < 0x8FFFFFFF ) + { + // ROM Symbol, Multiple Memory Model + ret = TMemoryModelType.EMemoryModelMultiple; + } + else if ( aAddress >= 0x3C000000 && aAddress < 0x3DFFFFFF ) + { + // [1gb] RAM Symbol, Moving Memory Model + ret = TMemoryModelType.EMemoryModelMultiple; + } + else if ( aAddress >= 0x70000000 && aAddress < 0x7FFFFFFF ) + { + // [2gb] RAM Symbol, Moving Memory Model + ret = TMemoryModelType.EMemoryModelMultiple; + } + else if ( aAddress >= 0xF8000000 && aAddress < 0xFFEFFFFF ) + { + // ROM Symbol, Moving Memory Model + ret = TMemoryModelType.EMemoryModelMoving; + } + else if ( aAddress >= 0xF4000000 && aAddress < 0xF7FFFFFF ) + { + // RAM Symbol, Moving Memory Model + ret = TMemoryModelType.EMemoryModelMoving; + } + else if ( aAddress >= 0x64000000 && aAddress < 0x64FFFFFF ) + { + // Kernel global, Moving Memory Model + ret = TMemoryModelType.EMemoryModelMoving; + } + + return ret; + } + + public static TMemoryModelRegion RegionByAddress( long aAddress, TMemoryModelType aType ) + { + TMemoryModelRegion ret = TMemoryModelRegion.EMemoryModelRegionUnknown; + // + if ( aType == TMemoryModelType.EMemoryModelMoving ) + { + #region Moving Memory Model + if ( aAddress >= 0x00000000 && aAddress < 0x003FFFFF ) + { + // 00000000-003FFFFF Unmapped + ret = TMemoryModelRegion.EMemoryModelRegionUnmapped; + } + else if ( aAddress >= 0x00400000 && aAddress < 0x2FFFFFFF ) + { + // 00400000-2FFFFFFF Moving process data + ret = TMemoryModelRegion.EMemoryModelRegionMovingProcessData; + } + else if ( aAddress >= 0x30000000 && aAddress < 0x3FFFFFFF ) + { + // 30000000-3FFFFFFF DLL static data (=phys ram size/2 up to 128M, always ends at 40000000) + ret = TMemoryModelRegion.EMemoryModelRegionDLLStaticData; + } + else if ( aAddress >= 0x40000000 && aAddress < 0x5FFFFFFF ) + { + // 40000000-5FFFFFFF RAM drive + ret = TMemoryModelRegion.EMemoryModelRegionRAMDrive; + } + else if ( aAddress >= 0x60000000 && aAddress < 0x60001FFF ) + { + // 60000000-60001FFF Super page/CPU page + ret = TMemoryModelRegion.EMemoryModelRegionSuperAndCPUPages; + } + else if ( aAddress >= 0x61000000 && aAddress < 0x61003FFF ) + { + // 61000000-61003FFF Page directory (16K) + ret = TMemoryModelRegion.EMemoryModelRegionPageDirectories; + } + else if ( aAddress >= 0x61020000 && aAddress < 0x6103FFFF ) + { + // 61020000-6103FFFF Page table info (4096 * 8bytes = 32K) + ret = TMemoryModelRegion.EMemoryModelRegionPageTableInfo; + } + else if ( aAddress >= 0x61100000 && aAddress < 0x611FFFFF ) + { + // 61100000-611FFFFF Cache flush area + ret = TMemoryModelRegion.EMemoryModelRegionCacheFlushArea; + } + else if ( aAddress >= 0x61200000 && aAddress < 0x612FFFFF ) + { + // 61200000-612FFFFF Alternate cache flush area + ret = TMemoryModelRegion.EMemoryModelRegionCacheFlushAreaAlternate; + } + else if ( aAddress >= 0x62000000 && aAddress < 0x623FFFFF ) + { + // 62000000-623FFFFF Page tables (up to 4096 * 1K) + ret = TMemoryModelRegion.EMemoryModelRegionPageTables; + } + else if ( aAddress >= 0x63000000 && aAddress < 0x63FFFFFF ) + { + // 63000000-63FFFFFF Primary I/O mappings + ret = TMemoryModelRegion.EMemoryModelRegionPrimaryIOMappings; + } + else if ( aAddress >= 0x64000000 && aAddress < 0x64FFFFFF ) + { + // 64000000-64FFFFFF Kernel .data/.bss, initial stack, kernel heap + ret = TMemoryModelRegion.EMemoryModelRegionKernelGlobalsInitialStackKernelHeap; + } + else if ( aAddress >= 0x65000000 && aAddress < 0x655FFFFF ) + { + // 65000000-655FFFFF fixed processes - usually 2 or 3Mb each. + ret = TMemoryModelRegion.EMemoryModelRegionFixedProcesses; + } + else if ( aAddress >= 0x65600000 && aAddress < 0xF1FFFFFF ) + { + // 65600000-F1FFFFFF Kernel section (includes extra I/O mappings) + ret = TMemoryModelRegion.EMemoryModelRegionExtraKernelMappings; + } + else if ( aAddress >= 0xF2000000 && aAddress < 0xF3FFFFFF ) + { + // F2000000-F3FFFFFF Kernel code (RAM size/2) + ret = TMemoryModelRegion.EMemoryModelRegionKernelCode; + } + else if ( aAddress >= 0xF4000000 && aAddress < 0xF7FFFFFF ) + { + // F4000000-F7FFFFFF User code (RAM size) + ret = TMemoryModelRegion.EMemoryModelRegionUserCode; + } + else if ( aAddress >= 0xF8000000 && aAddress < 0xFFEFFFFF ) + { + // F8000000-FFEFFFFF ROM + ret = TMemoryModelRegion.EMemoryModelRegionROM; + } + else if ( aAddress >= 0xFFF00000 && aAddress < 0xFFFFFFFF ) + { + // FFF00000-FFFFFFFF Exception vectors + ret = TMemoryModelRegion.EMemoryModelRegionExceptionVectors; + } + #endregion + } + else if ( aType == TMemoryModelType.EMemoryModelMultiple ) + { + #region Multiple Memory Model + if ( aAddress >= 0x00000000 && aAddress < 0x003FFFFF ) + { + // 00000000-003FFFFF Unmapped + ret = TMemoryModelRegion.EMemoryModelRegionUnmapped; + } + else if ( aAddress >= 0x00400000 && aAddress < 0x6FFFFFFF ) + { + // Skip overlapping 2gb vs 1gb regions + ret = TMemoryModelRegion.EMemoryModelRegionUnknown; + } + else if ( aAddress >= 0x70000000 && aAddress < 0x7FFFFFFF ) + { + // 70000000-7FFFFFFF RAM Loaded Code + ret = TMemoryModelRegion.EMemoryModelRegionRAMLoadedCode; + } + else if ( aAddress >= 0x80000000 && aAddress < 0x8FFFFFFF ) + { + // 80000000-8FFFFFFF ROM + ret = TMemoryModelRegion.EMemoryModelRegionROM; + } + else if ( aAddress >= 0x90000000 && aAddress < 0x9FFFFFFF ) + { + // 90000000-9FFFFFFF User Global Area + ret = TMemoryModelRegion.EMemoryModelRegionUserGlobalArea; + } + else if ( aAddress >= 0xA0000000 && aAddress < 0xBFFFFFFF ) + { + // A0000000-BFFFFFFF RAM drive + ret = TMemoryModelRegion.EMemoryModelRegionRAMDrive; + } + else if ( aAddress >= 0xC0000000 && aAddress < 0xC0001FFF ) + { + // C0000000-C0001FFF Super page/CPU page + ret = TMemoryModelRegion.EMemoryModelRegionSuperAndCPUPages; + } + else if ( aAddress >= 0xC0040000 && aAddress < 0xC00403FF ) + { + // C0040000-C00403FF ASID info (256 ASIDs) + ret = TMemoryModelRegion.EMemoryModelRegionASIDInfo; + } + else if ( aAddress >= 0xC0080000 && aAddress < 0xC00FFFFF ) + { + // C0080000-C00FFFFF Page table info + ret = TMemoryModelRegion.EMemoryModelRegionPageTableInfo; + } + else if ( aAddress >= 0xC1000000 && aAddress < 0xC13FFFFF ) + { + // C1000000-C13FFFFF Page directories (up to 256 * 16KB) + ret = TMemoryModelRegion.EMemoryModelRegionPageDirectories; + } + else if ( aAddress >= 0xC2000000 && aAddress < 0xC5FFFFFF ) + { + // C2000000-C5FFFFFF Page tables + ret = TMemoryModelRegion.EMemoryModelRegionPageTables; + } + else if ( aAddress >= 0xC6000000 && aAddress < 0xC6FFFFFF ) + { + // C6000000-C6FFFFFF Primary I/O mappings + ret = TMemoryModelRegion.EMemoryModelRegionPrimaryIOMappings; + } + else if ( aAddress >= 0xC7000000 && aAddress < 0xC7FFFFFF ) + { + // C7000000-C7FFFFFF + ret = TMemoryModelRegion.EMemoryModelRegionUnknown; + } + else if ( aAddress >= 0xC8000000 && aAddress < 0xC8FFFFFF ) + { + // C8000000-C8FFFFFF Kernel .data/.bss, initial stack, kernel heap + ret = TMemoryModelRegion.EMemoryModelRegionKernelGlobalsInitialStackKernelHeap; + } + else if ( aAddress >= 0xC9000000 && aAddress < 0xC91FFFFF ) + { + // C9000000-C91FFFFF Kernel stacks + ret = TMemoryModelRegion.EMemoryModelRegionKernelStacks; + } + else if ( aAddress >= 0xC9200000 && aAddress < 0xFFEFFFFF ) + { + // C9200000-FFEFFFFF Extra kernel mappings (I/O, RAM loaded device drivers) + ret = TMemoryModelRegion.EMemoryModelRegionExtraKernelMappings; + } + else if ( aAddress >= 0xFFF00000 && aAddress < 0xFFFFFFFF ) + { + // FFF00000-FFFFFFFF Exception vectors + ret = TMemoryModelRegion.EMemoryModelRegionExceptionVectors; + } + #endregion + } + // + return ret; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/NumberBaseUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/NumberBaseUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,271 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections; + +namespace SymbianUtils +{ + public class NumberBaseUtils + { + #region Enumerations + public enum TNumberBase + { + EDecimal = 10, + EHex = 16 + } + #endregion + + public static long TextToDecimalNumber( string aText ) + { + string copyOfText = aText; + TNumberBase numberBase = TNumberBase.EDecimal; + long longResult = 0; + // + bool result = TextToDecimalNumber( ref copyOfText, out longResult, out numberBase ); + if ( result == false ) + { + longResult = 0; + } + // + return longResult; + } + + public static long TextToDecimalNumber( string aText, TNumberBase aNumberBase ) + { + long ret = 0; + // + try + { + ret = System.Convert.ToInt64( aText, (int) aNumberBase ); + } + finally + { + } + // + return ret; + } + + public static bool TextToDecimalNumber( ref string aText, out long aValue, out TNumberBase aBase ) + { + string address = aText; + + // Check if its a decimal or hex string + aBase = TNumberBase.EDecimal; + aValue = 0; + // + TNumberBase numberBase = TNumberBase.EDecimal; + if (address.Length > 2 && (address.Substring(0, 2) == "0x" || address.Substring(0, 2) == "0X")) + { + // Assume hex & remove prefix + numberBase = TNumberBase.EHex; + address = address.Substring(2); + } + + // Check each char + bool okToConvert = (address.Length > 0); + foreach (char character in address) + { + if (character != ' ' && char.IsDigit(character) == false) + { + // Is it a hex digit? + char upperCaseChar = char.ToUpper(character); + switch (upperCaseChar) + { + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + numberBase = TNumberBase.EHex; // Now its definite + break; + default: + okToConvert = false; + break; + } + } + } + + address = address.Trim(); + if ( address.Length > 0 && okToConvert ) + { + // Convert number to base 10. + try + { + aValue = System.Convert.ToInt64( address, (int) numberBase ); + aText = address; + aBase = numberBase; + } + catch( ArgumentOutOfRangeException ) + { + okToConvert = false; + } + } + return okToConvert; + } + + public static bool TryTextToDecimalNumber( ref string aText, out string aOutput, out long aValue, out TNumberBase aBase ) + { + string address = aText; + int endingOffset = 0; + + // Check if its a decimal or hex string + aBase = TNumberBase.EDecimal; + aValue = 0; + // + TNumberBase numberBase = TNumberBase.EDecimal; + int characterIndex = 0; + string prefix = string.Empty; + if (address.Length > 2 && (address.Substring(0, 2) == "0x" || address.Substring(0, 2) == "0X")) + { + // Assume hex & remove prefix + numberBase = TNumberBase.EHex; + prefix = address.Substring(0, 2); + address = address.Substring(2); + } + + // Check each char + bool validCharacter = (address.Length > 0); + while (validCharacter && characterIndex < address.Length ) + { + char character = address[characterIndex]; + if (char.IsDigit(character) == false) + { + // Is it a hex digit? + char upperCaseChar = char.ToUpper(character); + switch (upperCaseChar) + { + case '-': + break; + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + numberBase = TNumberBase.EHex; // Now its definite + break; + default: + validCharacter = false; + break; + } + } + + characterIndex++; + if (validCharacter) + endingOffset++; + } + + if (endingOffset > 0) + { + // Convert number to base 10. + aOutput = address.Substring(0, endingOffset).Trim(); + aValue = System.Convert.ToInt64(aOutput, (int) numberBase); + aOutput = prefix + aOutput; + aBase = numberBase; + aText = aText.Substring(endingOffset + prefix.Length); + } + else + { + aOutput = string.Empty; + aValue = 0; + aBase = TNumberBase.EDecimal; + } + + return (endingOffset > 0); + } + + public static bool TryTextToDecimalNumber( ref string aText, out string aOutput, out long aValue, TNumberBase aBase ) + { + string address = aText; + int endingOffset = 0; + + // Check if its a decimal or hex string + aValue = 0; + // + TNumberBase numberBase = aBase; + int characterIndex = 0; + string prefix = string.Empty; + if (address.Length > 2 && (address.Substring(0, 2) == "0x" || address.Substring(0, 2) == "0X")) + { + // Assume hex & remove prefix + numberBase = TNumberBase.EHex; + prefix = address.Substring(0, 2); + address = address.Substring(2); + } + + // Check each char + bool validCharacter = (address.Length > 0); + while( validCharacter && characterIndex < address.Length ) + { + char character = address[characterIndex]; + if (char.IsDigit(character) == false) + { + // Is it a hex digit? + char upperCaseChar = char.ToUpper(character); + switch (upperCaseChar) + { + case '-': + break; + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + numberBase = TNumberBase.EHex; // Now its definite + break; + default: + validCharacter = false; + break; + } + } + + characterIndex++; + if (validCharacter) + endingOffset++; + } + + if (endingOffset > 0) + { + try + { + // Convert number to base 10. + string output = address.Substring(0, endingOffset).Trim();; + aValue = System.Convert.ToInt64( output, (int) numberBase ); + aOutput = prefix + output; + aText = aText.Substring(endingOffset + prefix.Length); + } + catch( Exception ) + { + endingOffset = -1; + aOutput = string.Empty; + aValue = 0; + } + } + else + { + aOutput = string.Empty; + aValue = 0; + } + + return (endingOffset > 0); + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/NumberFormattingUtils.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/NumberFormattingUtils.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; + +namespace SymbianUtils +{ + public class NumberFormattingUtils + { + public static string NumberAsPercentageInt( long aValue, long aOneHundredPercentValue ) + { + float percent = (float) aValue / (float) aOneHundredPercentValue; + percent *= (float) 100.0; + // + int percentAsInt = Math.Min( 100, ( (int) ( percent + 0.5 ) ) ); + string ret = percentAsInt.ToString(); + return ret; + } + + public static string NumberAsPercentageOneDP( long aValue, long aOneHundredPercentValue ) + { + double percent = (double) aValue / (double) aOneHundredPercentValue; + percent *= (double) 100.0; + // + string ret = percent.ToString("##0.0"); + return ret; + } + + public static string NumberAsPercentageTwoDP( long aValue, long aOneHundredPercentValue ) + { + double percent = (double) aValue / (double) aOneHundredPercentValue; + percent *= (double) 100.0; + // + string ret = percent.ToString("##0.00"); + return ret; + } + + public static string NumberAsPercentageThreeDP( long aValue, long aOneHundredPercentValue ) + { + double percent = (double) aValue / (double) aOneHundredPercentValue; + percent *= (double) 100.0; + // + string ret = percent.ToString("##0.000"); + return ret; + } + } + +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/PrefixParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/PrefixParser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,206 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; + +namespace SymbianUtils +{ + public static class PrefixParser + { + public static long SkipPrefixAndReadLong( string aPrefix, ref string aLine ) + { + long ret = 0; + // + if ( aLine.IndexOf( aPrefix ) >= 0 ) + { + SkipPrefix( aPrefix, ref aLine ); + ret = ReadLong( ref aLine ); + } + // + return ret; + } + + public static long SkipPrefixAndReadLongHex( string aPrefix, ref string aLine ) + { + long ret = 0; + // + if ( aLine.IndexOf( aPrefix ) >= 0 ) + { + SkipPrefix( aPrefix, ref aLine ); + ret = ReadLongHex( ref aLine ); + } + // + return ret; + } + + public static int SkipPrefixAndReadInt( string aPrefix, ref string aLine ) + { + int ret = 0; + // + if ( aLine.IndexOf( aPrefix ) >= 0 ) + { + SkipPrefix( aPrefix, ref aLine ); + ret = (int) ReadLong( ref aLine ); + } + // + return ret; + } + + public static uint SkipPrefixAndReadUint( string aPrefix, ref string aLine ) + { + uint ret = 0; + // + if ( aLine.IndexOf( aPrefix ) >= 0 ) + { + SkipPrefix( aPrefix, ref aLine ); + ret = (uint) ReadLong( ref aLine ); + } + // + return ret; + } + + public static bool SkipPrefixAndReadBool( string aPrefix, ref string aLine ) + { + bool ret = false; + // + if ( aLine.IndexOf( aPrefix ) >= 0 ) + { + SkipPrefix( aPrefix, ref aLine ); + ret = ReadBool( ref aLine ); + } + // + return ret; + } + + public static void SkipPrefix( string aPrefix, ref string aLine ) + { + int index = aLine.IndexOf( aPrefix ); + if ( index >= 0 ) + aLine = aLine.Substring( index + aPrefix.Length ); + aLine = aLine.Trim(); + } + + public static uint ReadUint( ref string aLine ) + { + uint retUint = 0; + long retLong = 0; + SymbianUtils.NumberBaseUtils.TNumberBase numberBase; + string discardedText; + bool convertedOkay = SymbianUtils.NumberBaseUtils.TryTextToDecimalNumber( ref aLine, out discardedText, out retLong, out numberBase ); + if ( convertedOkay ) + { + try + { + retUint = System.Convert.ToUInt32( retLong ); + } + catch ( OverflowException ) + { + } + } + // + return retUint; + } + + public static int ReadInt( ref string aLine ) + { + int retInt = 0; + long retLong = 0; + SymbianUtils.NumberBaseUtils.TNumberBase numberBase; + string discardedText; + bool convertedOkay = SymbianUtils.NumberBaseUtils.TryTextToDecimalNumber( ref aLine, out discardedText, out retLong, out numberBase ); + if ( convertedOkay ) + { + try + { + retInt = System.Convert.ToInt32( retLong ); + } + catch ( OverflowException ) + { + } + } + // + return retInt; + } + + public static long ReadLong( ref string aLine ) + { + long ret = -1; + SymbianUtils.NumberBaseUtils.TNumberBase numberBase; + string discardedText; + bool convertedOkay = SymbianUtils.NumberBaseUtils.TryTextToDecimalNumber( ref aLine, out discardedText, out ret, out numberBase ); + return ret; + } + + public static long ReadLongHex( ref string aLine ) + { + long ret = 0; + string discardedText; + bool convertedOkay = SymbianUtils.NumberBaseUtils.TryTextToDecimalNumber( ref aLine, out discardedText, out ret, SymbianUtils.NumberBaseUtils.TNumberBase.EHex ); + return ret; + } + + public static bool ReadBool( ref string aLine ) + { + bool ret = false; + + // Trim the start of the line + aLine = aLine.TrimStart(); + string upperLine = aLine.ToUpper(); + // + if ( upperLine == "YES" || upperLine == "TRUE" || upperLine == "1" ) + { + ret = true; + } + else if ( upperLine == "NO" || upperLine == "FALSE" || upperLine == "0" ) + { + ret = false; + } + else + { + int endIndex = 0; + bool continueSearchingForEndIndex = true; + for ( int i = 0; i < aLine.Length && continueSearchingForEndIndex; i++ ) + { + char character = aLine[ i ]; + switch ( character ) + { + case '1': + case '0': + ++endIndex; + break; + default: + continueSearchingForEndIndex = false; + break; + } + } + + string boolAsString = aLine.Substring( 0, endIndex ); + // + try + { + int boolAsInt = System.Convert.ToInt32( boolAsString ); + ret = ( boolAsInt > 0 ); + aLine = aLine.Substring( endIndex ); + } + catch ( Exception ) + { + } + } + // + return ret; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/RawByteToTextConverter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/RawByteToTextConverter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,220 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; + +namespace SymbianUtils.Utilities +{ + public class RawByteUtility + { + public static void ConvertToCharacter( byte aByte, StringBuilder aBuilder ) + { + if ( aByte <= 32 || aByte > 126 ) + { + aBuilder.Append( '.' ); + } + else + { + aBuilder.Append( System.Convert.ToChar( aByte ) ); + } + } + + public static string ConvertDataToText( IEnumerable aBytes, bool aFlushEntireList, ref uint aStartingAddress ) + { + Queue queue = new Queue(); + foreach ( byte b in aBytes ) + { + queue.Enqueue( b ); + } + return ConvertDataToText( queue, aFlushEntireList, ref aStartingAddress ); + } + + public static string ConvertDataToText( Queue aByteQueue, bool aFlushEntireQueue, ref uint aStartingAddress ) + { + RawByteConverter converter = new RawByteConverter(); + string ret = converter.Convert( aByteQueue, aFlushEntireQueue, ref aStartingAddress ); + return ret; + } + + public static uint CombineBytes( uint aByte0, uint aByte1, uint aByte2, uint aByte3 ) + { + aByte0 = ( aByte0 << 24 ); + aByte1 = ( aByte1 << 16 ); + aByte2 = ( aByte2 << 8 ); + // + uint ret = ( aByte0 + aByte1 + aByte2 + aByte3 ); + // + return ret; + } + + public static string CreateHexData( byte aByte0, byte aByte1, byte aByte2, byte aByte3 ) + { + StringBuilder charData = new StringBuilder(); + // + charData.Append( aByte0.ToString("x2") + " " ); + charData.Append( aByte1.ToString("x2") + " " ); + charData.Append( aByte2.ToString("x2") + " " ); + charData.Append( aByte3.ToString("x2") + " " ); + // + string charDataString = charData.ToString(); + return charDataString; + } + + public static string CreateCharacterisedData( uint aDWord ) + { + byte b3 = (byte) ( aDWord & 0x000000FF ); + byte b2 = (byte) ( ( aDWord & 0x0000FF00 ) >> 8 ); + byte b1 = (byte) ( ( aDWord & 0x00FF0000 ) >> 16 ); + byte b0 = (byte) ( ( aDWord & 0xFF000000 ) >> 24 ); + // + return CreateCharacterisedData( b0, b1, b2, b3 ); + } + + public static string CreateCharacterisedData( byte[] aBytes ) + { + if ( aBytes.Length != 4 ) + { + throw new ArgumentException( "Expected 4 byte array" ); + } + + return CreateCharacterisedData( aBytes[ 0 ], aBytes[ 1 ], aBytes[ 2 ], aBytes[ 3 ] ); + } + + public static string CreateCharacterisedData( byte aByte0, byte aByte1, byte aByte2, byte aByte3 ) + { + StringBuilder charData = new StringBuilder(); + // + ConvertToCharacter( aByte3, charData ); + ConvertToCharacter( aByte2, charData ); + ConvertToCharacter( aByte1, charData ); + ConvertToCharacter( aByte0, charData ); + // + string charDataString = charData.ToString(); + return charDataString; + } + } + + public class RawByteConverter + { + #region Delegates & events + public delegate void HandleLine( string aLine ); + public event HandleLine iLineHandler; + #endregion + + #region Constructors + public RawByteConverter() + { + } + #endregion + + #region API + public string Convert( Queue aByteQueue, bool aFlushEntireQueue, ref uint aStartingAddress ) + { + const int KNumberOfBytesPerLine = 16; + + StringBuilder ret = new StringBuilder(); + + // First try to build entire lines of 16 bytes + while ( aByteQueue.Count >= KNumberOfBytesPerLine ) + { + StringBuilder byteVals = new StringBuilder(); + byteVals.Append( aStartingAddress.ToString( "x8" ) + ": " ); + int bytesProcessedForThisLine = 0; + // + StringBuilder byteChars = new StringBuilder(); + while ( bytesProcessedForThisLine != KNumberOfBytesPerLine ) + { + // Extract at most 4 bytes of data to process + byte b0 = aByteQueue.Dequeue(); + byte b1 = aByteQueue.Dequeue(); + byte b2 = aByteQueue.Dequeue(); + byte b3 = aByteQueue.Dequeue(); + + // Create double-char hex representation of each character + byteVals.Append( RawByteUtility.CreateHexData( b0, b1, b2, b3 ) ); + + // Character representation of data... + byteChars.Append( RawByteUtility.CreateCharacterisedData( b0, b1, b2, b3 ) ); + + // Handle new line scenario + bytesProcessedForThisLine += 4; + } + + byteVals.Append( byteChars.ToString() ); + byteVals.Append( System.Environment.NewLine ); + // + if ( iLineHandler != null ) + { + iLineHandler( byteVals.ToString() ); + } + // + ret.Append( byteVals.ToString() ); + aStartingAddress += KNumberOfBytesPerLine; + } + + // Extract remaining data only if the client specified that the entire queue should + // be emptied + int numberLeft = aByteQueue.Count; + if ( aFlushEntireQueue && numberLeft > 0 && numberLeft < 16 ) + { + StringBuilder byteVals = new StringBuilder(); + byteVals.Append( aStartingAddress.ToString( "x8" ) + ": " ); + // + StringBuilder byteChars = new StringBuilder(); + while ( aByteQueue.Count > 0 ) + { + byte b0 = aByteQueue.Dequeue(); + + // Create double-char hex representation of each character + byteVals.Append( b0.ToString( "x2" ) + " " ); + + // Character representation of data... + RawByteUtility.ConvertToCharacter( b0, byteChars ); + } + + // We may need to pad some bytes + int padCount = KNumberOfBytesPerLine - numberLeft; + while ( padCount > 0 ) + { + byteVals.Append( " " + " " ); + byteChars.Append( "." ); + --padCount; + } + + // Combine data + byteVals.Append( byteChars.ToString() ); + byteVals.Append( System.Environment.NewLine ); + // + if ( iLineHandler != null ) + { + iLineHandler( byteVals.ToString() ); + } + // + ret.Append( byteVals.ToString() ); + aStartingAddress += (uint) numberLeft; + } + + return ret.ToString(); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/TracePrefixAnalyser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/Utilities/TracePrefixAnalyser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; + +namespace SymbianUtils +{ + public class TracePrefixAnalyser + { + #region Constructors + public TracePrefixAnalyser() + { + } + #endregion + + #region API + public bool CleanLine( ref string aLine ) + { + bool matched = false; + string prefix = IdentifyTracePrefixFromLine( aLine ); + // + if ( prefix.Length > 0 ) + { + int prefixPos = aLine.IndexOf( prefix ); + aLine = aLine.Substring( prefixPos + prefix.Length ); + matched = true; + } + // + return matched; + } + + public StringBuilder CleanFile( string aFileName ) + { + StringBuilder lines = new StringBuilder(); + // + using( StreamReader reader = new StreamReader( aFileName ) ) + { + string line = reader.ReadLine(); + while( line != null ) + { + CleanLine( ref line ); + lines.Append( line + System.Environment.NewLine ); + // + line = reader.ReadLine(); + } + } + // + return lines; + } + + public string IdentifyTracePrefixFromLine( string aLine ) + { + string prefix = string.Empty; + // + if ( aLine.IndexOf( KFinalPrefix ) >= 0 ) + { + prefix = KFinalPrefix; + } + // + return prefix; + } + + public string IdentifyTracePrefix( string aFileName ) + { + string prefix = string.Empty; + // + try + { + using( StreamReader reader = new StreamReader( aFileName ) ) + { + int lineCounter = 0; + string line = string.Empty; + // + while( lineCounter < KNumberOfLinesToCheck && line != null ) + { + try + { + line = reader.ReadLine(); + // + if ( line != null ) + { + string tmp = IdentifyTracePrefixFromLine( line ); + if ( tmp.Length > 0 ) + { + prefix = tmp; + break; + } + } + } + catch(Exception) + { + line = null; + } + // + ++lineCounter; + } + } + } + catch( Exception ) + { + } + // + return prefix; + } + #endregion + + #region Internal constants + private const int KNumberOfLinesToCheck = 500; + #endregion + + #region Data members + private const int KLineLookAheadCount = 200; + private const string KFinalPrefix = "msg:"; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/XRef/XRefEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/XRef/XRefEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.XRef +{ + public class XRefEngine + { + #region Constructors + public XRefEngine() + { + } + #endregion + + #region API + public bool Contains( XRefIdentifer aIdentifier ) + { + bool ret = false; + // + foreach ( XRefIdentifer identifier in iIdentifiers ) + { + if ( identifier.Identifier == aIdentifier.Identifier ) + { + ret = true; + break; + } + } + // + return ret; + } + + public void ParseIdentifiers( string aText ) + { + XRefIdentiferExtractor extractor = new XRefIdentiferExtractor( aText ); + + // Add items, checking for dupes + foreach ( XRefIdentifer identifier in extractor.Identifiers ) + { + if ( !Contains( identifier ) ) + { + iIdentifiers.Add( identifier ); + } + } + } + #endregion + + #region Properties + public List Identifiers + { + get { return iIdentifiers; } + } + #endregion + + #region Data members + private readonly List iIdentifiers = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/XRef/XRefIdentifer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/XRef/XRefIdentifer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.XRef +{ + public class XRefIdentifer : IComparable + { + #region Constructors + public XRefIdentifer( string aIdentifier ) + { + iIdentifier = aIdentifier; + } + #endregion + + #region Properties + public string Identifier + { + get { return iIdentifier; } + } + #endregion + + #region Data members + private readonly string iIdentifier; + #endregion + + #region From IComparable + public int CompareTo( XRefIdentifer aOther ) + { + int ret = 1; + // + if ( aOther != null ) + { + ret = aOther.Identifier.CompareTo( Identifier ); + } + // + return ret; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/XRef/XRefIdentiferExtractor.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/XRef/XRefIdentiferExtractor.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,283 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Strings; + +namespace SymbianUtils.XRef +{ + public class XRefIdentiferExtractor + { + #region Constructors + public XRefIdentiferExtractor( string aFunction ) + { + iIdentifiers = ExtractSearchableElements( aFunction ); + } + #endregion + + #region Properties + public List Identifiers + { + get { return iIdentifiers; } + } + #endregion + + #region Internal methods + private static bool ContainsParameters( string aText ) + { + // Search initiall for '(' - if that is found, then + // we should also find a closing bracket. + bool parameters = false; + int openingBracketPos = aText.IndexOf( "(" ); + // + if ( openingBracketPos > 0 ) + { + // Should also be a closing bracket and it should + // appear after the opening bracket + int closingBracketPos = aText.LastIndexOf( ")" ); + parameters = ( closingBracketPos > openingBracketPos ); + } + // + return parameters; + } + + private static string ExtractParameters( ref string aText ) + { + const string KOperatorChevronText = "operator <<"; + + // DoAppendFormatList(T1&, const T3&, std::__va_list, T2*) + // DoAppendFormatList(T1&, TBuf<(int)256>, std::__va_list, T2*) + // Method::Wibble( something ) + // Method::Wibble( RPointerArray ) + // RTest::operator ()(int, int, const unsigned short*) + // TDesC16::Left(int) const + // CObjectCon::AtL(int) const + // User::Panic(const TDesC16&, int) + // operator <<(RWriteStream&, const unsigned char&) + + // Handle special case of "operator <<" confusing matters + string workingText = aText; + int operatorOpeningChevronPos = aText.IndexOf( KOperatorChevronText ); + if ( operatorOpeningChevronPos >= 0 ) + { + aText = aText.Substring( 0, operatorOpeningChevronPos + KOperatorChevronText.Length ); + workingText = workingText.Substring( operatorOpeningChevronPos + KOperatorChevronText.Length ); + } + else + { + aText = string.Empty; + } + + string ret = string.Empty; + // + int closingPos = 0; + int openingPos = 0; + int templatePos = 0; + // + while ( openingPos >= 0 ) + { + if ( templatePos >= 0 ) + templatePos = workingText.IndexOf( "<", templatePos ); + openingPos = workingText.IndexOf( "(", openingPos ); + + if ( templatePos >= 0 && templatePos < openingPos ) + { + // Template region appears before the next bracket. Skip + // over all characters until we hit the end of the template + // section + int endingPos = templatePos; + StringParsingUtils.SkipToEndOfSection( ref workingText, ref endingPos, '<', '>' ); + + if ( endingPos < 0 ) + { + // Matching closing brace was never found - dealing with operator << ? + templatePos = -1; + } + else + { + // Something like DoAppendFormatList(T1&, const T3&, std::__va_list, T2*) ??? + templatePos = endingPos; + openingPos = endingPos; + } + } + else if ( openingPos >= 0 ) + { + // Skipped over any template nonsense. Work backward from the end + // in order to locate start of parameters. + closingPos = workingText.LastIndexOf( ')' ); + openingPos = closingPos; + StringParsingUtils.SkipToBeginningOfSection( ref workingText, ref openingPos, '(', ')' ); + + string parameters = workingText.Substring( openingPos + 1, ( closingPos - openingPos ) - 1 ).Trim(); + ret = parameters; + workingText = workingText.Substring( 0, openingPos + 1 ) + workingText.Substring( closingPos ); + aText = aText + workingText; + break; + } + } + // + return ret; + } + + private static void SplitParameters( string aParams, ref List aEntries ) + { + /* + * TPtrC16::TPtrC16(const unsigned short*) + * TPtrC16::TPtrC16(const TDesC16&) + * UserHal::MemoryInfo(TDes8&) + * RHandleBase::Close() + * TBufCBase16::Copy(const TDesC16&, int) + * CBufFlat::NewL(int) + * TBufCBase16::TBufCBase16() + * CServer2::RunL() + * CServer2::StartL(const TDesC16&) + * CServer2::DoCancel() + * CServer2::RunError(int) + * CServer2::DoConnect(const RMessage2&) + * CServer2::CServer2__sub_object(int, CServer2::TServerType) + */ + string paramType; + while ( aParams.Length > 0 ) + { + int commaPos = aParams.IndexOf( "," ); + // + paramType = aParams; + if ( commaPos > 0 ) + { + paramType = aParams.Substring( 0, commaPos ).Trim(); + if ( commaPos < aParams.Length ) + aParams = aParams.Substring( commaPos + 1 ).Trim(); + else + aParams = string.Empty; + } + else + { + // Everything was consumed + aParams = string.Empty; + } + + // Add it + aEntries.Add( paramType ); + } + } + + private static string[] IdentifyFurtherClassAndMethodInformation( string aEntry ) + { + string[] classAndMethodData = aEntry.Split( new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries ); + return classAndMethodData; + } + + private static List ExtractSearchableElements( string aFunction ) + { + List workingData = new List(); + + // See if this entry contains parameter data? + if ( ContainsParameters( aFunction ) ) + { + // This call modifies aFunction so that the parameters are removed + string parameters = ExtractParameters( ref aFunction ); + + // Now we get the individual parameter elements from the arguments + SplitParameters( parameters, ref workingData ); + } + + // Extract class & method names if present + string[] classAndMethodData = aFunction.Split( new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries ); + if ( classAndMethodData.Length > 0 ) + { + foreach ( string identifiedEntry in classAndMethodData ) + { + workingData.Add( identifiedEntry ); + } + } + else + { + // Not a class & method - so just take the entire text as a + // global function name + workingData.Add( aFunction ); + } + + // Recursively check for any more class types, e.g. in the following entry: + // + // CServer2::CServer2__sub_object(int, CServer2::TServerType) + // + // We also need to extract CServer2 and TServerType as individual elements + for ( int i = workingData.Count - 1; i >= 0; i-- ) + { + string entry = workingData[ i ]; + string[] furtherSplit = IdentifyFurtherClassAndMethodInformation( entry ); + if ( furtherSplit != null && furtherSplit.Length > 1 ) + { + foreach ( string furtherEntry in furtherSplit ) + { + workingData.Add( furtherEntry ); + } + + // Remove defunct entry + workingData.RemoveAt( i ); + } + } + + // Clean up phase + List cleanedEntries = new List(); + foreach ( string identifiedEntry in workingData ) + { + string entry = identifiedEntry; + + // Now go through the identified entries and ensure they don't include + // any pointer (*), reference (&) or bracketry. + int pos = entry.IndexOfAny( new char[] { '*', '+', '&', '[', ']', '<', '>', '(', ')' } ); + if ( pos >= 0 ) + { + entry = entry.Substring( 0, pos ); + } + + // Strip any reserved keywords + if ( entry.Length > 0 ) + { + entry = entry.Replace( "const", string.Empty ); + entry = entry.Replace( "static", string.Empty ); + entry = entry.Replace( "public", string.Empty ); + entry = entry.Replace( "protected", string.Empty ); + entry = entry.Replace( "private", string.Empty ); + entry = entry.Replace( "__sub_object", string.Empty ); + // + if ( !cleanedEntries.Contains( entry ) ) + { + cleanedEntries.Add( entry.Trim() ); + } + } + } + + // Convert to XRefIdentifiers + List finalEntries = new List(); + foreach ( string cleanedEntry in cleanedEntries ) + { + XRefIdentifer item = new XRefIdentifer( cleanedEntry ); + finalEntries.Add( item ); + } + // + return finalEntries; + } + #endregion + + #region Data members + private readonly List iIdentifiers; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/XRef/XRefLauncher.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/XRef/XRefLauncher.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace SymbianUtils.XRef +{ + public class XRefLauncher + { + #region Constructors + public XRefLauncher() + { + } + #endregion + + #region API + public void Launch( XRefIdentifer aIdentifier, XRefSettings aSettings ) + { + string url = aSettings.ServerRootPath + "ident?i=" + aIdentifier.Identifier; + System.Diagnostics.Process.Start( url ); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/XRef/XRefSettings.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianUtils/XRef/XRefSettings.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,89 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.Settings; + +namespace SymbianUtils.XRef +{ + public class XRefSettings : DisposableObject + { + #region Constructors + public XRefSettings() + { + iSettings = new XmlSettings( SettingsFileName ); + iSettings.Restore(); + // + ValidateSettings(); + } + #endregion + + #region API + #endregion + + #region Properties + public static string SettingsFileName + { + get { return "XRefSettings.xml"; } + } + + public string ServerRootPath + { + get + { + string ret = iSettings[ "XRef", "ServerRootPath" ]; + if ( string.IsNullOrEmpty( ret ) ) + { + ret = KDefaultXRefURL; + } + return ret; + } + set { iSettings[ "XRef", "ServerRootPath" ] = value; } + } + #endregion + + #region Internal methods + private void ValidateSettings() + { + if ( !iSettings.Exists( "XRef", "ServerRootPath" ) ) + { + iSettings[ "XRef", "ServerRootPath" ] = KDefaultXRefURL; + } + } + #endregion + + #region From DisposableObject - Cleanup Framework + protected override void CleanupUnmanagedResources() + { + if ( iSettings != null ) + { + iSettings.Store(); + iSettings = null; + } + } + #endregion + + #region Internal constants + private const string KDefaultXRefURL = "http://your-xref-server-name-goes-here/"; + #endregion + + #region Data members + private XmlSettings iSettings; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Base/SXILElement.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Base/SXILElement.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; +using SymbianTree; + +namespace SymbianXmlInputLib.Elements +{ + public abstract class SXILElement : SymNodeAddAsChild, IEnumerable + { + #region Constructors + protected SXILElement() + { + } + #endregion + + #region API + #endregion + + #region Properties + public abstract string Name + { + get; + set; + } + #endregion + + #region Internal methods + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( SymNode node in this.Children ) + { + yield return node as SXILElement; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( SymNode node in this.Children ) + { + yield return node as SXILElement; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/Category/SXILElementCategory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/Category/SXILElementCategory.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; + +namespace SymbianXmlInputLib.Elements.Types.Category +{ + public class SXILElementCategory : SXILElement + { + #region Constructors + internal SXILElementCategory() + : this( string.Empty ) + { + } + + internal SXILElementCategory( string aName ) + { + iName = aName; + } + #endregion + + #region API + #endregion + + #region Properties + public override string Name + { + get { return iName; } + set { iName = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private string iName = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/Command/SXILElementCommand.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/Command/SXILElementCommand.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; + +namespace SymbianXmlInputLib.Elements.Types.Command +{ + public class SXILElementCommand : SXILElement + { + #region Constructors + internal SXILElementCommand() + : this( string.Empty ) + { + } + + internal SXILElementCommand( string aName ) + : this( aName, string.Empty ) + { + } + + internal SXILElementCommand( string aName, string aDetails ) + { + iName = aName; + iDetails = aDetails; + } + #endregion + + #region API + #endregion + + #region Properties + public override string Name + { + get { return iName; } + set { iName = value; } + } + + public string Details + { + get { return iDetails; } + set { iDetails = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private string iName = string.Empty; + private string iDetails = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/Extension/SXILElementExtension.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/Extension/SXILElementExtension.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; + +namespace SymbianXmlInputLib.Elements.Types.Extension +{ + public class SXILElementExtension : SXILElement + { + #region Enumerations + public enum TType + { + ETypeSuccess = 0, + ETypeFailure + } + #endregion + + #region Constructors + internal SXILElementExtension() + : this( string.Empty, TType.ETypeSuccess ) + { + } + + internal SXILElementExtension( string aName, TType aType ) + { + Name = aName; + Type = aType; + } + #endregion + + #region API + #endregion + + #region Properties + public override string Name + { + get { return iName; } + set { iName = value; } + } + + public TType Type + { + get { return iType; } + set { iType = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private string iName = string.Empty; + private TType iType = TType.ETypeSuccess; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/FileSystem/SXILElementDirectory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/FileSystem/SXILElementDirectory.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; + +namespace SymbianXmlInputLib.Elements.Types.FileSystem +{ + public class SXILElementDirectory : SXILElementFileSystem + { + #region Constructors + internal SXILElementDirectory( DirectoryInfo aDir ) + { + iDirectory = aDir; + } + #endregion + + #region API + #endregion + + #region Properties + public override bool Exists + { + get { return iDirectory.Exists; } + } + + public override string Name + { + get { return iDirectory.FullName; } + set { iDirectory = new DirectoryInfo( value ); } + } + + public DirectoryInfo Directory + { + get { return iDirectory; } + } + + public FileInfo[] Files + { + get { return iDirectory.GetFiles(); } + } + #endregion + + #region Operators + public static implicit operator DirectoryInfo( SXILElementDirectory aElement ) + { + return aElement.iDirectory; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private DirectoryInfo iDirectory; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/FileSystem/SXILElementFile.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/FileSystem/SXILElementFile.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; + +namespace SymbianXmlInputLib.Elements.Types.FileSystem +{ + public class SXILElementFile : SXILElementFileSystem + { + #region Constructors + internal SXILElementFile( FileInfo aFile ) + { + iFile = aFile; + } + #endregion + + #region API + #endregion + + #region Properties + public override bool Exists + { + get { return iFile.Exists; } + } + + public override string Name + { + get { return iFile.FullName; } + set { iFile = new FileInfo( value ); } + } + #endregion + + #region Operators + public static implicit operator FileInfo( SXILElementFile aElement ) + { + return aElement.iFile; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private FileInfo iFile; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/FileSystem/SXILElementFileSystem.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Elements/Types/FileSystem/SXILElementFileSystem.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; + +namespace SymbianXmlInputLib.Elements.Types.FileSystem +{ + public abstract class SXILElementFileSystem : SXILElement + { + #region Constructors + protected SXILElementFileSystem() + { + } + #endregion + + #region API + #endregion + + #region Properties + public abstract bool Exists + { + get; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNode.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNode.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; +using SymbianTree; +using SymbianUtils; +using SymbianXmlInputLib.Elements; + +namespace SymbianXmlInputLib.Parser.Nodes +{ + public abstract class SXILParserNode + { + #region Constructors + protected SXILParserNode() + : this( string.Empty ) + { + } + + protected SXILParserNode( string aDescription ) + { + iDescription = aDescription; + } + #endregion + + #region Framework API + public virtual void XmlParse( XmlNode aNode ) + { + foreach ( XmlNode child in aNode.ChildNodes ) + { + iChildren.XmlParse( child, Parser ); + } + } + + public virtual bool CanHandle( XmlNode aNode ) + { + return false; + } + + public virtual bool IsMulti + { + get { return false; } + } + #endregion + + #region Properties + public SXILParserNodeCollection Children + { + get { return iChildren; } + set { iChildren = value; } + } + + protected SXILDocument Document + { + get { return Parser.Document; } + } + + internal SXILParser Parser + { + get { return iParser; } + set { iParser = value; } + } + #endregion + + #region From System.Object + public override int GetHashCode() + { + int ret = 0; + // + if ( string.IsNullOrEmpty( iDescription ) ) + { + ret = this.GetType().GetHashCode(); + } + else + { + ret = iDescription.GetHashCode(); + } + // + return ret; + } + #endregion + + #region Data members + private readonly string iDescription; + private SXILParser iParser = null; + private SXILParserNodeCollection iChildren = new SXILParserNodeCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNodeCategory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNodeCategory.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; +using SymbianTree; +using SymbianUtils; +using SymbianXmlInputLib.Elements; +using SymbianXmlInputLib.Elements.Types.Category; + +namespace SymbianXmlInputLib.Parser.Nodes +{ + public class SXILParserNodeCategory : SXILParserNode + { + #region Constructors + public SXILParserNodeCategory( string aName ) + { + iName = aName; + } + #endregion + + #region From SXILParserNode + public override bool IsMulti + { + get { return true; } + } + + public override bool CanHandle( XmlNode aNode ) + { + bool ret = base.CanHandle( aNode ); + // + if ( !ret ) + { + string name = aNode.Name.Trim().ToUpper(); + if ( name == "CATEGORY" ) + { + // Is it our category? + foreach ( XmlAttribute attrib in aNode.Attributes ) + { + name = attrib.Name.ToUpper(); + if ( name == "NAME" ) + { + string value = attrib.Value.Trim().ToUpper(); + if ( value == iName.ToUpper() ) + { + ret = true; + break; + } + } + } + } + } + // + return ret; + } + + public override void XmlParse( XmlNode aNode ) + { + System.Diagnostics.Debug.Assert( aNode.Name.ToUpper() == "CATEGORY" ); + System.Diagnostics.Debug.Assert( aNode.Attributes.Count >= 1 ); + + SXILElementCategory category = new SXILElementCategory( iName ); + base.Document.AppendChild( category ); + base.Document.CurrentNode = category; + // + base.XmlParse( aNode ); + // + base.Document.MakeParentCurrent(); + } + #endregion + + #region From System.Object + public override int GetHashCode() + { + return iName.GetHashCode(); + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private readonly string iName; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNodeCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNodeCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; +using SymbianTree; +using SymbianUtils; +using SymbianXmlInputLib.Elements; + +namespace SymbianXmlInputLib.Parser.Nodes +{ + public class SXILParserNodeCollection + { + #region Constructors + public SXILParserNodeCollection() + { + } + #endregion + + #region API + public void Clear() + { + iNodes.Clear(); + } + + internal void Add( SXILParserNode aParser ) + { + int hash = aParser.GetHashCode(); + if ( iNodes.ContainsKey( hash ) ) + { + throw new Exception( "The specified parser node already exists" ); + } + iNodes.Add( hash, aParser ); + } + #endregion + + #region Properties + #endregion + + #region Internal methods + private SXILParserNode this[ string aName ] + { + get + { + SXILParserNode ret = null; + // + int hash = aName.GetHashCode(); + if ( iNodes.ContainsKey( hash ) ) + { + ret = iNodes[ hash ]; + } + // + return ret; + } + } + + internal bool XmlParse( XmlNode aNode, SXILParser aMasterParser ) + { + bool handled = false; + // + SXILParserNode child = this[ aNode.Name ]; + if ( child != null ) + { + child.Parser = aMasterParser; + child.XmlParse( aNode ); + handled = true; + } + else + { + // No direct name-based match, check for multi entries + foreach ( KeyValuePair kvp in iNodes ) + { + SXILParserNode parserNode = kvp.Value; + bool isMulti = parserNode.IsMulti; + if ( isMulti ) + { + bool canHandle = parserNode.CanHandle( aNode ); + if ( canHandle ) + { + parserNode.Parser = aMasterParser; + parserNode.XmlParse( aNode ); + handled = true; + break; + } + } + } + } + // + return handled; + } + #endregion + + #region Internal methods + private Dictionary iNodes = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNodeCommand.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNodeCommand.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,98 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; +using SymbianTree; +using SymbianUtils; +using SymbianXmlInputLib.Elements; +using SymbianXmlInputLib.Elements.Types.Command; + +namespace SymbianXmlInputLib.Parser.Nodes +{ + public class SXILParserNodeCommand : SXILParserNode + { + #region Constructors + public SXILParserNodeCommand() + { + } + + public SXILParserNodeCommand( string aDescription ) + : base( aDescription ) + { + } + #endregion + + #region From SXILParserNode + public override bool IsMulti + { + get + { + return true; + } + } + + public override void XmlParse( XmlNode aNode ) + { + XmlAttributeCollection attribs = aNode.Attributes; + if ( attribs.Count < 1 || attribs[ "name" ] == null ) + { + throw new ArgumentException( "Mandatory name node missing" ); + } + + XmlAttribute nameAttribute = attribs[ "name" ]; + string name = nameAttribute.Value.Trim(); + + // Get details if present + string details = aNode.InnerText.Trim(); + + SXILElementCommand command = new SXILElementCommand( name, details ); + base.Document.CurrentNode.Add( command ); + + iHandled = true; + } + + public override bool CanHandle( XmlNode aNode ) + { + bool ret = false; + + // We must support categories that contain multiple commands + // therefore we must provide a means of preventing an already-populated command from + // processing multiple xml tags. + if ( !iHandled ) + { + // This command instance has not yet successfully processed a command, so + // it's okay to at least attempt to handle it - providing the xml tag is + // our expected "command" name. + ret = ( aNode.Name.ToUpper() == KXmlTagName ); + } + // + return ret; + } + #endregion + + #region Internal constants + private const string KXmlTagName = "COMMAND"; + #endregion + + #region Data members + private bool iHandled = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNodeExtension.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNodeExtension.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; +using SymbianTree; +using SymbianUtils; +using SymbianXmlInputLib.Elements; +using SymbianXmlInputLib.Elements.Types.Extension; + +namespace SymbianXmlInputLib.Parser.Nodes +{ + public class SXILParserNodeExtension : SXILParserNode + { + #region Constructors + public SXILParserNodeExtension() + { + } + #endregion + + #region From SXILParserNode + public override void XmlParse( XmlNode aNode ) + { + XmlAttributeCollection attribs = aNode.Attributes; + if ( attribs.Count < 1 || attribs[ "name" ] == null ) + { + throw new ArgumentException( "Mandatory name node missing" ); + } + + XmlAttribute nameAttrib = attribs[ "name" ]; + string name = nameAttrib.Value.Trim(); + + SXILElementExtension.TType type = SXILElementExtension.TType.ETypeSuccess; + if ( attribs[ "type" ] != null ) + { + string typeName = attribs[ "type" ].Value.Trim().ToUpper(); + if ( typeName == "FAILED") + { + type = SXILElementExtension.TType.ETypeFailure; + } + } + + SXILElementExtension entry = new SXILElementExtension( name, type ); + base.Document.CurrentNode.Add( entry ); + } + #endregion + + #region Properties + #endregion + + #region From System.Object + public override int GetHashCode() + { + return "extension".GetHashCode(); + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNodeFileSystem.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/Nodes/SXILParserNodeFileSystem.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; +using SymbianTree; +using SymbianUtils; +using SymbianXmlInputLib.Elements; +using SymbianXmlInputLib.Elements.Types.FileSystem; + +namespace SymbianXmlInputLib.Parser.Nodes +{ + public class SXILParserNodeFileSystem : SXILParserNode + { + #region Constructors + public SXILParserNodeFileSystem() + { + } + #endregion + + #region From SXILParserNode + public override bool CanHandle( XmlNode aNode ) + { + bool ret = base.CanHandle( aNode ); + // + if ( !ret && aNode.NodeType == XmlNodeType.Element ) + { + string name = aNode.Name.ToUpper(); + if ( name == "FILE" || name == "DIRECTORY" ) + { + int count = aNode.Attributes.Count; + if ( count == 1 && aNode.Attributes[ "name" ] != null ) + { + ret = true; + } + } + } + // + return ret; + } + + public override bool IsMulti + { + get { return true; } + } + + public override void XmlParse( XmlNode aNode ) + { + string type = aNode.Name; + XmlAttribute name = aNode.Attributes[ "name" ]; + // + if ( type == "file" ) + { + string value = name.Value.Trim(); + base.Document.CurrentNode.Add( new SXILElementFile( new FileInfo( value ) ) ); + } + else if ( type == "directory" ) + { + string value = name.Value.Trim(); + base.Document.CurrentNode.Add( new SXILElementDirectory( new DirectoryInfo( value ) ) ); + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/SXILDocument.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/SXILDocument.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; +using SymbianTree; + +namespace SymbianXmlInputLib.Elements +{ + public class SXILDocument : SymDocument, IEnumerable + { + #region Constructors + public SXILDocument() + { + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( SymNode node in this.Children ) + { + yield return node as SXILElement; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( SymNode node in this.Children ) + { + yield return node as SXILElement; + } + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/SXILParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Parser/SXILParser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Xml; +using System.Text; +using System.Collections.Generic; +using SymbianTree; +using SymbianUtils; +using SymbianXmlInputLib.Elements; +using SymbianXmlInputLib.Parser.Nodes; + +namespace SymbianXmlInputLib.Parser +{ + public class SXILParser : DisposableObject + { + #region Constructors + public SXILParser( string aFileName, string aRootNodeName, SXILDocument aDocument ) + { + iFileName = aFileName; + iDocument = aDocument; + iRootNodeName = aRootNodeName; + // + XmlReaderSettings settings = new XmlReaderSettings(); + settings.ConformanceLevel = ConformanceLevel.Auto; + settings.IgnoreComments = true; + settings.CheckCharacters = true; + settings.IgnoreWhitespace = true; + // + iReader = XmlReader.Create( iFileName, settings ); + iXmlDocument.Load( iReader ); + } + #endregion + + #region API + public void Parse() + { + ValidateRoot(); + ParseTopLevelNodes(); + } + + public void CategoryAdd( string aName, SXILParserNodeCollection aParsers ) + { + SXILParserNodeCategory category = new SXILParserNodeCategory( aName ); + category.Children = aParsers; + iParsers.Add( category ); + } + + public void CategoryAdd( string aName, params SXILParserNode[] aParserNodes ) + { + SXILParserNodeCategory category = new SXILParserNodeCategory( aName ); + foreach ( SXILParserNode parserNode in aParserNodes ) + { + category.Children.Add( parserNode ); + } + iParsers.Add( category ); + } + #endregion + + #region Properties + internal SXILDocument Document + { + get { return iDocument; } + } + #endregion + + #region Internal methods + private void ValidateRoot() + { + XmlElement root = iXmlDocument.DocumentElement; + if ( root != null && root.Name != iRootNodeName ) + { + throw new Exception( "Document Root Incorrect" ); + } + } + + private void ParseTopLevelNodes() + { + foreach ( XmlNode child in iXmlDocument.DocumentElement ) + { + bool handled = iParsers.XmlParse( child, this ); + if ( handled ) + { + } + } + } + + private void OnElementStart() + { + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + base.CleanupManagedResources(); + iReader.Close(); + } + #endregion + + #region Data members + private readonly string iFileName; + private readonly string iRootNodeName; + private readonly SXILDocument iDocument; + private readonly XmlReader iReader; + private XmlDocument iXmlDocument = new XmlDocument(); + private SXILParserNodeCollection iParsers = new SXILParserNodeCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "e43243e6-466a-45c2-bfaf-b6cf221f3b06" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/SymbianXmlInputLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianXmlInputLib/SymbianXmlInputLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {56ECA873-7D1D-45E7-A583-A5388D753321} + Library + Properties + SymbianXmlInputLib + SymbianXmlInputLib + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8} + SymbianTree + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/CodeSegDefinition.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/CodeSegDefinition.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; + +namespace SymbolLib.CodeSegDef +{ + public class CodeSegDefinition : CodeSegResolverEntry + { + #region Enumerations + [Flags] + public enum TAttributes + { + EAttributeNone = 0, + EAttributeXIP = 1, + EAttributeRAM = 2, + } + #endregion + + #region Constructors & destructor + public CodeSegDefinition() + : this( string.Empty ) + { + } + + public CodeSegDefinition( string aFileName ) + : this( aFileName, string.Empty ) + { + } + + public CodeSegDefinition( string aEnvFileName, string aImageFileName ) + : base( aEnvFileName, aImageFileName ) + { + } + #endregion + + #region Constants + public const string KMapFileExtension = ".map"; + public const string KSysBinPath = @"\sys\bin\"; + public const string KROMBinaryPath = "z:" + KSysBinPath; + #endregion + + #region API + #endregion + + #region Properties + public string MapFileName + { + get + { + string ret = string.Empty; + // + if ( !String.IsNullOrEmpty( EnvironmentFileNameAndPath ) ) + { + ret = EnvironmentFileNameAndPath + KMapFileExtension; + } + // + return ret; + } + } + + public bool MapFileExists + { + get + { + bool ret = false; + // + try + { + string fileName = MapFileName; + ret = File.Exists( fileName ); + } + finally + { + } + // + return ret; + } + } + + public bool AddressValid + { + get + { + bool good = iRange.IsValid; + return good; + } + } + + public uint AddressStart + { + get { return (uint) iRange.Min; } + set + { + iRange.UpdateMin( value ); + UpdateAttributes(); + } + } + + public uint AddressEnd + { + get { return (uint) iRange.Max; } + set + { + iRange.UpdateMax( value ); + UpdateAttributes(); + } + } + + public uint Checksum + { + get { return iChecksum; } + set { iChecksum = value; } + } + + public AddressRange AddressRange + { + get { return iRange; } + } + + public TAttributes Attributes + { + get { return iAttributes; } + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( iRange.ToString() ); + ret.Append( " " ); + ret.Append( base.ToString() ); + // + return ret.ToString(); + } + #endregion + + #region Internal methods + private void UpdateAttributes() + { + // Remove XIP/RAM attrib before we work out the type... + iAttributes &= ~TAttributes.EAttributeRAM; + iAttributes &= ~TAttributes.EAttributeXIP; + + MemoryModel.TMemoryModelType type = MemoryModel.TypeByAddress( AddressStart ); + if ( type != MemoryModel.TMemoryModelType.EMemoryModelUnknown ) + { + MemoryModel.TMemoryModelRegion region = MemoryModel.RegionByAddress( AddressStart, type ); + // + if ( region == MemoryModel.TMemoryModelRegion.EMemoryModelRegionROM ) + { + iAttributes |= TAttributes.EAttributeXIP; + } + else if ( region == MemoryModel.TMemoryModelRegion.EMemoryModelRegionRAMLoadedCode ) + { + iAttributes |= TAttributes.EAttributeRAM; + } + } + } + #endregion + + #region Data members + private readonly AddressRange iRange = new AddressRange(); + private uint iChecksum = 0; + private TAttributes iAttributes = TAttributes.EAttributeNone; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/CodeSegDefinitionCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/CodeSegDefinitionCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,198 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace SymbolLib.CodeSegDef +{ + public class CodeSegDefinitionCollection : IEnumerable + { + #region Constructors & destructor + public CodeSegDefinitionCollection() + : this( 10 ) + { + } + + public CodeSegDefinitionCollection( int aGranularity ) + { + iEntries = new List( aGranularity ); + } + #endregion + + #region API + public void Reset() + { + iEntries.Clear(); + } + + public void Add( CodeSegDefinition aNewEntry ) + { + if ( aNewEntry.ImageFileName.Length == 0 ) + { + throw new ArgumentException( "Invalid code seg definition entry" ); + } + + // Our check-for-exists predicate + Predicate existsPredicate = delegate( CodeSegDefinition aEntry ) + { + return aEntry.ImageFileName.ToLower() == aNewEntry.ImageFileName.ToLower(); + }; + + // Check whether there is already an entry that matches + if ( !iEntries.Exists( existsPredicate ) ) + { + iEntries.Add( aNewEntry ); + } + else + { +#if TRACE_RESOLVER + System.Diagnostics.Debug.WriteLine( "IGNORING DUPE CodeSegDefinition: " + aNewEntry.ToString() ); +#endif + } + } + + public void Remove( CodeSegDefinition aRemoveEntry ) + { + if ( aRemoveEntry.ImageFileName.Length == 0 ) + { + throw new ArgumentException( "Invalid code seg definition entry" ); + } + + // Our check-for-match predicate + Predicate matchPredicate = delegate( CodeSegDefinition aEntry ) + { + return aEntry.ImageFileName.ToLower() == aRemoveEntry.ImageFileName.ToLower(); + }; + + // Remove any matching entries + iEntries.RemoveAll( matchPredicate ); + } + + public int IndexOf( CodeSegDefinition aEntry ) + { + int index = -1; + int i = 0; + // + foreach ( CodeSegDefinition entry in iEntries ) + { + if ( entry.EnvironmentFileNameAndPath.ToLower() == aEntry.EnvironmentFileNameAndPath.ToLower() ) + { + index = i; + break; + } + ++i; + } + // + return index; + } + + public void SortByFileName() + { + iEntries.Sort( new CodeSegDefinitionCollectionCompareByFileName() ); + } + + public void SortByAddress() + { + iEntries.Sort( new CodeSegDefinitionCollectionCompareByAddress() ); + } + + public CodeSegDefinition DefinitionByAddress( long aAddress ) + { + CodeSegDefinition ret = null; + // + foreach ( CodeSegDefinition entry in iEntries ) + { + if ( entry.AddressRange.Contains( aAddress ) ) + { + ret = entry; + break; + } + } + // + return ret; + } + + public CodeSegDefinition FindByCodeSegmentFileNameAndPath( string aImageCodeSegmentFileNameAndPath ) + { + CodeSegDefinition temp = new CodeSegDefinition( string.Empty, aImageCodeSegmentFileNameAndPath ); + int index = iEntries.IndexOf( temp ); + + int x = 0; + if ( x != 0 ) + { + int count = iEntries.Count; + for( int i=0; i " + e.EnvironmentFileNameAndPath + " ] IMG[ " + e.ImageFileName + " => " + e.ImageFileNameAndPath + " ]" ); +#endif + } + } + + if ( index >= 0 && index < Count ) + { + temp = this[ index ]; + } + else + { + // Not found + temp = null; + } + // + return temp; + } + + public void MergeInto( CodeSegDefinitionCollection aItems ) + { + foreach ( CodeSegDefinition entry in aItems ) + { + Add( entry ); + } + } + #endregion + + #region Properties + public int Count + { + get { return iEntries.Count; } + } + + public CodeSegDefinition this[ int aIndex ] + { + get { return iEntries[ aIndex ]; } + } + #endregion + + #region IEnumerable Members + public IEnumerator GetEnumerator() + { + return new CodeSegDefinitionCollectionEnumerator( this ); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return new CodeSegDefinitionCollectionEnumerator( this ); + } + #endregion + + #region Data members + private readonly List iEntries; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/CodeSegDefinitionCollectionComparers.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/CodeSegDefinitionCollectionComparers.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; + +namespace SymbolLib.CodeSegDef +{ + internal class CodeSegDefinitionCollectionCompareByFileName : IComparer + { + #region IComparer Members + public int Compare( object aLeft, object aRight ) + { + int ret = -1; + // + if ( aLeft == null || aRight == null ) + { + if ( aRight == null ) + { + ret = 1; + } + } + else + { + CodeSegDefinition left = (CodeSegDefinition) aLeft; + CodeSegDefinition right = (CodeSegDefinition) aRight; + // + ret = Compare( left, right ); + } + // + return ret; + } + #endregion + + #region IComparer Members + int IComparer.Compare( CodeSegDefinition aLeft, CodeSegDefinition aRight ) + { + int ret = -1; + // + if ( aLeft == null || aRight == null ) + { + if ( aRight == null ) + { + ret = 1; + } + } + else + { + ret = string.Compare( aLeft.ImageFileNameAndPath, aRight.ImageFileNameAndPath, true ); + } + // + return ret; + } + #endregion + } + + internal class CodeSegDefinitionCollectionCompareByAddress : IComparer + { + #region IComparer Members + public int Compare( object aLeft, object aRight ) + { + int ret = -1; + // + if ( aLeft == null || aRight == null ) + { + if ( aRight == null ) + { + ret = 1; + } + } + else + { + CodeSegDefinition left = (CodeSegDefinition) aLeft; + CodeSegDefinition right = (CodeSegDefinition) aRight; + // + ret = Compare( left, right ); + } + // + return ret; + } + #endregion + + #region IComparer Members + int IComparer.Compare( CodeSegDefinition aLeft, CodeSegDefinition aRight ) + { + int ret = -1; + if ( aLeft.AddressStart == aRight.AddressStart && aLeft.AddressEnd == aRight.AddressEnd ) + { + ret = 0; + } + else if ( aLeft.AddressEnd == aRight.AddressStart ) + { + System.Diagnostics.Debug.Assert( aLeft.AddressStart < aRight.AddressStart ); + System.Diagnostics.Debug.Assert( aRight.AddressEnd >= aLeft.AddressEnd ); + // + ret = -1; + } + else if ( aLeft.AddressStart == aRight.AddressEnd ) + { + System.Diagnostics.Debug.Assert( aRight.AddressStart < aLeft.AddressStart ); + System.Diagnostics.Debug.Assert( aLeft.AddressEnd >= aRight.AddressEnd ); + // + ret = 1; + } + else if ( aLeft.AddressStart > aRight.AddressEnd ) + { + System.Diagnostics.Debug.Assert( aLeft.AddressEnd > aRight.AddressEnd ); + System.Diagnostics.Debug.Assert( aLeft.AddressEnd > aRight.AddressStart ); + ret = 1; + } + else if ( aLeft.AddressEnd < aRight.AddressStart ) + { + System.Diagnostics.Debug.Assert( aLeft.AddressStart < aRight.AddressEnd ); + System.Diagnostics.Debug.Assert( aRight.AddressEnd > aLeft.AddressEnd ); + ret = -1; + } + // + return ret; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/CodeSegDefinitionCollectionEnumerator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/CodeSegDefinitionCollectionEnumerator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace SymbolLib.CodeSegDef +{ + internal class CodeSegDefinitionCollectionEnumerator : IEnumerator + { + #region Constructors & destructor + public CodeSegDefinitionCollectionEnumerator( CodeSegDefinitionCollection aCollection ) + { + iCollection = aCollection; + } + #endregion + + #region IEnumerator Members + public void Reset() + { + iCurrentIndex = -1; + } + + public object Current + { + get + { + return iCollection[ iCurrentIndex ]; + } + } + + public bool MoveNext() + { + return ( ++iCurrentIndex < iCollection.Count ); + } + #endregion + + #region IDisposable Members + void IDisposable.Dispose() + { + } + #endregion + + #region IEnumerator Members + CodeSegDefinition IEnumerator.Current + { + get { return iCollection[ iCurrentIndex ]; } + } + #endregion + + #region Data members + private readonly CodeSegDefinitionCollection iCollection; + private int iCurrentIndex = -1; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/CodeSegDefinitionParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/CodeSegDefinitionParser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Text.RegularExpressions; +using SymbianUtils; +using SymbolLib.Sources.Map.Engine; + +namespace SymbolLib.CodeSegDef +{ + public class CodeSegDefinitionParser + { + #region Constructors & destructor + public CodeSegDefinitionParser() + { + iResolver = null; + } + + public CodeSegDefinitionParser( CodeSegResolver aResolver ) + { + iResolver = aResolver; + } + #endregion + + #region Properties + public bool MapFileMustExistsWhenCreatingEntry + { + get { return iMapFileMustExistsWhenCreatingEntry; } + set { iMapFileMustExistsWhenCreatingEntry = value; } + } + #endregion + + #region API + public CodeSegDefinition ParseDefinition( string aLine ) + { + CodeSegDefinition ret = null; + // + Match m = iCodeSegRegEx.Match( aLine ); + if ( m.Success ) + { + ret = new CodeSegDefinition(); + // + string gpAddressStart = m.Groups[ "StartAddress" ].Value; + string gpAddressEnd = m.Groups[ "EndAddress" ].Value; + string gpBinary = m.Groups[ "Binary" ].Value; + // + ret.AddressStart = uint.Parse( gpAddressStart, System.Globalization.NumberStyles.HexNumber ); + ret.AddressEnd = uint.Parse( gpAddressEnd, System.Globalization.NumberStyles.HexNumber ); + ret.ImageFileNameAndPath = gpBinary; + } + // + return ret; + } + + public CodeSegDefinition ParseAndResolveDefinition( string aLine ) + { + if ( iResolver == null ) + { + throw new Exception( "Resolver is not initialised" ); + } + // + CodeSegDefinition ret = null; + CodeSegDefinition entry = ParseDefinition( aLine ); + if ( entry != null ) + { + ret = iResolver.Resolve( entry, MapFileMustExistsWhenCreatingEntry ); + } + // + return ret; + } + #endregion + + #region Internal constants + private static readonly Regex iCodeSegRegEx = new Regex( + @"(?[a-fA-F0-9]{8})-(?[a-fA-F0-9]{8})\s{1}(?.+)", + RegexOptions.IgnoreCase + ); + private const int KBaseHex = 16; + #endregion + + #region Data members + private readonly CodeSegResolver iResolver; + private bool iMapFileMustExistsWhenCreatingEntry = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/CodeSegResolver.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/CodeSegResolver.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,244 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbianUtils.SerializedOperations; + +namespace SymbolLib.CodeSegDef +{ + public class CodeSegResolver : ITracer + { + #region Constructors + public CodeSegResolver() + : this( null ) + { + } + + public CodeSegResolver( ITracer aTracer ) + { + iTracer = aTracer; + iPrimer = new CodeSegDefinitionPrimer( this ); + } + #endregion + + #region Constants + public const string KSysBinPath = @"\sys\bin\"; + public const string KROMBinaryPath = "z:" + KSysBinPath; + public const string KMapFileExtension = ".map"; + #endregion + + #region API + public void Clear() + { + lock ( iResolvedEntries ) + { + iResolvedEntries.Reset(); + } + } + + public void Sort() + { + lock ( iResolvedEntries ) + { + iResolvedEntries.Sort(); + } + } + + public void Remove( CodeSegResolverEntry aEntry ) + { + lock ( iResolvedEntries ) + { + iResolvedEntries.Remove( aEntry ); + } + } + + public void Add( CodeSegResolverEntry aEntry ) + { + lock ( iResolvedEntries ) + { + iResolvedEntries.Add( aEntry ); + } + } + + public CodeSegDefinition Resolve( CodeSegDefinition aDefinition ) + { + return Resolve( aDefinition, false ); + } + + public CodeSegDefinition Resolve( CodeSegDefinition aDefinition, bool aMapFileMustExistsWhenCreatingEntry ) + { + CodeSegDefinition ret = aDefinition; + + // ... and now try to resolve real file name on the PC side + string realPCMapFileName = ResolveByImageCodeSegmentFileName( ret.ImageFileNameAndPath ); + if ( realPCMapFileName != string.Empty ) + { + ret.EnvironmentFileNameAndPath = realPCMapFileName; + } + else if ( aMapFileMustExistsWhenCreatingEntry == false ) + { + MemoryModel.TMemoryModelType memModelType = MemoryModel.TypeByAddress( ret.AddressStart ); + MemoryModel.TMemoryModelRegion memModelRegion = MemoryModel.RegionByAddress( ret.AddressStart, memModelType ); + + // Don't cache ROM code segments + switch ( memModelRegion ) + { + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionRAMLoadedCode: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionUserGlobalArea: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionDLLStaticData: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionKernelGlobalsInitialStackKernelHeap: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionKernelCode: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionMovingProcessData: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionFixedProcesses: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionUserCode: + System.Diagnostics.Debug.WriteLine( "[WARNING] Map file for: " + ret.ImageFileNameAndPath + " was not found => creating empty MapFile for this RAM-loaded code seg." ); + ret.EnvironmentFileNameAndPath = CreateDefaultReleaseFileName( ret.ImageFileName ); + break; + + // Common + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionUnmapped: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionRAMDrive: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionSuperAndCPUPages: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionPageTableInfo: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionPageDirectories: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionPageTables: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionPrimaryIOMappings: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionUnknown: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionExtraKernelMappings: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionExceptionVectors: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionROM: + + // Moving + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionCacheFlushArea: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionCacheFlushAreaAlternate: + + // Multiple + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionSharedData: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionLocalData: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionASIDInfo: + case MemoryModel.TMemoryModelRegion.EMemoryModelRegionKernelStacks: + ret = null; + break; + } + } + else + { + ret = null; + } + + return ret; + } + + public string ResolveByImageCodeSegmentFileName( string aFileName ) + { + // See if the collection contains a suitable entry + lock ( iResolvedEntries ) + { + string ret = string.Empty; + CodeSegResolverEntry entry = iResolvedEntries.FindByCodeSegmentFileNameAndPath( aFileName.ToLower() ); + if ( entry != null ) + { + ret = entry.EnvironmentFileNameAndPath; + } + // + return ret; + } + } + + public string CreateDefaultReleaseFileName( string aImageFileName ) + { + string ret = CombineWithDriveLetter( @"epoc32\release\armv5\urel\" + Path.GetFileName( aImageFileName ) ); + return ret; + } + + public static string ConvertCodeSegToMapFileName( string aCodeSegmentName ) + { + // We first must extract the actual binary (Dll/Exe) name: + string name = Path.GetFileName( aCodeSegmentName ); + + // We append the map extension (don't replace the original extension) + name += CodeSegDefinition.KMapFileExtension; + + return name; + } + #endregion + + #region Properties + public CodeSegDefinitionPrimer Primer + { + get { return iPrimer; } + } + + public int ResolvedEntryCount + { + get + { + lock ( iResolvedEntries ) + { + return iResolvedEntries.Count; + } + } + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + if ( iTracer != null ) + { + iTracer.Trace( aMessage ); + } + } + + public void Trace( string aFormat, params object[] aParams ) + { + if ( iTracer != null ) + { + iTracer.Trace( aFormat, aParams ); + } + } + #endregion + + #region Internal methods + internal string DriveLetter + { + get { return iPrimer.DriveLetter; } + set { iPrimer.DriveLetter = value; } + } + + protected string CombineWithDriveLetter( string aFileName ) + { + string ret = string.Empty; + lock ( this ) + { + ret = Path.Combine( DriveLetter, aFileName ).ToLower(); + } + return ret; + } + #endregion + + #region Data members + private readonly CodeSegDefinitionPrimer iPrimer; + private readonly ITracer iTracer; + private CodeSegResolverEntryCollection iResolvedEntries = new CodeSegResolverEntryCollection( 50 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/CodeSegResolverEntry.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/CodeSegResolverEntry.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,220 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; + +namespace SymbolLib.CodeSegDef +{ + public class CodeSegResolverEntry + { + #region Enumerations + public enum TBuildType + { + EReleaseTypeRelease = 0, + EReleaseTypeDebug + } + + public enum TSourceType + { + ESourceNotDefined = 0, + ESourceWasMapFile, + ESourceWasSymbolFile + } + #endregion + + #region Constructors & destructor + public CodeSegResolverEntry() + { + } + + public CodeSegResolverEntry( string aFileName ) + { + EnvironmentFileNameAndPath = aFileName; + ImageFileNameAndPath = Path.Combine( CodeSegResolver.KROMBinaryPath, Path.GetFileName( aFileName ) ).ToLower(); + } + + public CodeSegResolverEntry( string aEnvFileName, string aImageFileName ) + { + EnvironmentFileNameAndPath = aEnvFileName.ToLower(); + ImageFileNameAndPath = aImageFileName.ToLower(); + } + #endregion + + #region API + #endregion + + #region Properties + public TSourceType Source + { + get { return iSource; } + set { iSource = value; } + } + + public TBuildType BuildType + { + get { return iBuildType; } + set { iBuildType = value; } + } + + public string EnvironmentFileName + { + get { return Path.GetFileName( EnvironmentFileNameAndPath ); } + } + + public string EnvironmentFileNameAndPath + { + get { return iFileNameAndPath_InEnvironment; } + set + { + iFileNameAndPath_InEnvironment = value; + + // Try to identify the release type (build) based upon the + // filename directory information. We'll default to UREL. + if ( value.Length > 0 ) + { + iBuildType = BuildTypeByFileName( value ); + } + } + } + + public string ImageFileName + { + get + { + string ret = string.Empty; + string val = ImageFileNameAndPath; + // + if ( !string.IsNullOrEmpty( val ) ) + { + // Try to get rid of all file extensions + while ( ret == string.Empty ) + { + try + { + ret = Path.GetFileName( val ); + } + catch ( ArgumentException ) + { + if ( val.Length > 0 ) + { + val = val.Substring( 0, val.Length - 1 ); + } + else + { + break; + } + } + } + } + // + return ret; + } + } + + public string ImageFileNameAndPath + { + get { return iFileNameAndPath_InImage; } + set + { + iFileNameAndPath_InImage = value; + } + } + + public string ImageFileNameAndPathWithoutDrive + { + get + { + string withoutDrive = Path.GetDirectoryName( ImageFileNameAndPath ); + // + if ( withoutDrive.Length > 2 && withoutDrive[ 1 ] == ':' && withoutDrive[ 2 ] == '\\' ) + { + withoutDrive = withoutDrive.Substring( 2 ); + } + if ( withoutDrive.Length > 0 && withoutDrive[ withoutDrive.Length - 1 ] != Path.DirectorySeparatorChar ) + { + withoutDrive += Path.DirectorySeparatorChar; + } + // + withoutDrive += Path.GetFileName( ImageFileNameAndPath ); + return withoutDrive; + } + } + #endregion + + #region From System.Object + public override string ToString() + { + return ImageFileNameAndPath.ToLower(); + } + + public override bool Equals( object aObject ) + { + bool isEqual = false; + // + if ( aObject != null ) + { + if ( aObject is CodeSegResolverEntry ) + { + CodeSegResolverEntry otherEntry = aObject as CodeSegResolverEntry; + // + isEqual = ( otherEntry.ImageFileNameAndPathWithoutDrive.ToLower() == ImageFileNameAndPathWithoutDrive.ToLower() ); + } + } + // + return isEqual; + } + + public override int GetHashCode() + { + return ImageFileNameAndPath.GetHashCode(); + } + #endregion + + #region Internal methods + private static TBuildType BuildTypeByFileName( string aFileName ) + { + TBuildType ret = TBuildType.EReleaseTypeRelease; + string path = "UREL"; + try + { + path = Path.GetDirectoryName( aFileName ).ToUpper(); + } + finally + { + } + // + if ( path == "UDEB" ) + { + } + else + { + ret = TBuildType.EReleaseTypeRelease; + } + // + return ret; + } + #endregion + + #region Data members + private string iFileNameAndPath_InEnvironment = string.Empty; + private string iFileNameAndPath_InImage = string.Empty; + private TBuildType iBuildType = TBuildType.EReleaseTypeRelease; + private TSourceType iSource = TSourceType.ESourceNotDefined; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/CodeSegResolverEntryCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/CodeSegResolverEntryCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace SymbolLib.CodeSegDef +{ + public class CodeSegResolverEntryCollection : IEnumerable + { + #region Constructors & destructor + public CodeSegResolverEntryCollection() + : this( 10 ) + { + } + + public CodeSegResolverEntryCollection( int aGranularity ) + { + iEntries = new List( aGranularity ); + } + #endregion + + #region API + public void Reset() + { + iEntries.Clear(); + } + + public void Add( CodeSegResolverEntry aNewEntry ) + { + if ( aNewEntry.ImageFileName.Length == 0 ) + { + throw new ArgumentException( "Invalid code seg definition entry" ); + } + + // Our check-for-exists predicate + Predicate existsPredicate = delegate( CodeSegResolverEntry aEntry ) + { + return aEntry.ImageFileName.ToLower() == aNewEntry.ImageFileName.ToLower(); + }; + + // Check whether there is already an entry that matches + if ( !iEntries.Exists( existsPredicate ) ) + { + iEntries.Add( aNewEntry ); + } + else + { +#if TRACE_RESOLVER + System.Diagnostics.Debug.WriteLine( "IGNORING DUPE CodeSegDefinition: " + aNewEntry.ToString() ); +#endif + } + } + + public void Remove( CodeSegResolverEntry aRemoveEntry ) + { + if ( String.IsNullOrEmpty( aRemoveEntry.ImageFileName ) ) + { + // Remove by environment file name + Predicate matchPredicate = delegate( CodeSegResolverEntry aEntry ) + { + return aEntry.EnvironmentFileName.ToLower() == aRemoveEntry.EnvironmentFileName.ToLower(); + }; + iEntries.RemoveAll( matchPredicate ); + } + else + { + // Remove by phone file name + Predicate matchPredicate = delegate( CodeSegResolverEntry aEntry ) + { + return aEntry.ImageFileName.ToLower() == aRemoveEntry.ImageFileName.ToLower(); + }; + iEntries.RemoveAll( matchPredicate ); + } + } + + public int IndexOf( CodeSegResolverEntry aEntry ) + { + int index = -1; + // + int count = iEntries.Count; + for( int i=0; i( Compare ) ); + } + + public CodeSegResolverEntry FindByCodeSegmentFileNameAndPath( string aImageCodeSegmentFileNameAndPath ) + { + CodeSegResolverEntry temp = new CodeSegResolverEntry( string.Empty, aImageCodeSegmentFileNameAndPath ); + int index = iEntries.IndexOf( temp ); + + int x = 0; + if ( x != 0 ) + { + int count = iEntries.Count; + for( int i=0; i " + e.EnvironmentFileNameAndPath + " ] IMG[ " + e.ImageFileName + " => " + e.ImageFileNameAndPath + " ]" ); +#endif + + } + } + + if ( index >= 0 && index < Count ) + { + temp = this[ index ]; + } + else + { + // Not found + temp = null; + } + // + return temp; + } + #endregion + + #region Properties + public int Count + { + get { return iEntries.Count; } + } + + public CodeSegResolverEntry this[ int aIndex ] + { + get { return iEntries[ aIndex ]; } + } + #endregion + + #region IEnumerable Members + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( CodeSegResolverEntry entry in iEntries ) + { + yield return entry; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( CodeSegResolverEntry entry in iEntries ) + { + yield return entry; + } + } + #endregion + + #region Internal methods + private static int Compare( CodeSegResolverEntry aLeft, CodeSegResolverEntry aRight ) + { + return aLeft.EnvironmentFileNameAndPath.CompareTo( aRight.EnvironmentFileNameAndPath ); + } + #endregion + + #region Data members + private readonly List iEntries; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/CodeSegResolverOperation.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/CodeSegResolverOperation.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Threading; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Specialized; +using System.Collections.Generic; +using System.ComponentModel; +using SymbianUtils; +using SymbianUtils.SerializedOperations; +using SymbolLib.Sources.Map.Parser; + +namespace SymbolLib.CodeSegDef +{ + public abstract class CodeSegResolverOperation : SerializedOperation + { + #region Events + public delegate void LocatedFileNameHandler( string aFileName ); + public event LocatedFileNameHandler LocatedFile; + public delegate void RawTextHandler( string aText ); + public event RawTextHandler RawText; + #endregion + + #region Constructors + protected CodeSegResolverOperation( CodeSegResolver aResolver, bool aResetResolver ) + : base( false ) + { + iResolver = aResolver; + iResetResolver = aResetResolver; + } + #endregion + + #region From SerializedOperation + protected override void PerformOperation() + { + base.Trace( "" ); + base.Trace( " => => => => => => => => => => => => => => => => => => => => => " ); + base.Trace( "" ); + base.Trace( "PerformOperation() - START - this: " + this.GetType().Name ); + + if ( iResetResolver ) + { + iResolver.Clear(); + } + + this.NotifyRawText( "Scanning..." ); + Scan(); + + base.Trace( "PerformOperation() - END - this: " + this.GetType().Name ); + } + #endregion + + #region API - new framework + protected abstract void Scan(); + #endregion + + #region API + protected void Add( CodeSegResolverEntry aEntry ) + { + NotifyFile( aEntry.ImageFileNameAndPath ); + base.Trace( "[{0}] device: {1}, host: {2}", this.GetType().Name, aEntry.ImageFileNameAndPath, aEntry.EnvironmentFileNameAndPath ); + // + iResolver.Add( aEntry ); + } + #endregion + + #region Properties + protected string DriveLetter + { + get { return iResolver.DriveLetter; } + set { iResolver.DriveLetter = value; } + } + #endregion + + #region Internal methods + protected void NotifyRawText( string aMessage ) + { + if ( RawText != null ) + { + RawText( aMessage ); + } + } + + protected void NotifyFile( string aFileName ) + { + if ( LocatedFile != null ) + { + LocatedFile( aFileName ); + } + } + + protected static string RemoveMapExtension( string aFileName ) + { + StringBuilder ret = new StringBuilder( aFileName ); + // + int pos = aFileName.LastIndexOf( CodeSegResolver.KMapFileExtension ); + if ( pos >= 1 ) + { + ret.Remove( pos, CodeSegResolver.KMapFileExtension.Length ); + } + // + return ret.ToString().ToLower(); + } + + protected static string GeneratePhoneBinaryNameAndPath( string aFileName ) + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( CodeSegResolver.KROMBinaryPath ); + ret.Append( Path.GetFileName( aFileName ).ToLower() ); + // + return ret.ToString(); + } + + protected string CombineWithDriveLetter( string aFileName ) + { + string ret = string.Empty; + lock( this ) + { + ret = Path.Combine( iResolver.DriveLetter, aFileName ).ToLower(); + } + return ret; + } + #endregion + + #region Data members + private readonly CodeSegResolver iResolver; + private readonly bool iResetResolver; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/Operations/CSROpScanDirectory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/Operations/CSROpScanDirectory.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Threading; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Specialized; +using System.Collections.Generic; +using System.ComponentModel; +using SymbianUtils; +using SymbianUtils.SerializedOperations; +using SymbolLib.Sources.Map.Parser; + +namespace SymbolLib.CodeSegDef +{ + internal class CSROpScanDirectory : CodeSegResolverOperation + { + #region Constructors + public CSROpScanDirectory( CodeSegResolver aResolver, bool aResetResolver, DirectoryInfo aDirectory ) + : base( aResolver, aResetResolver ) + { + iDirectory = aDirectory; + } + #endregion + + #region From CodeSegResolverOperation + protected override void Scan() + { + base.DriveLetter = Path.GetPathRoot( iDirectory.FullName ); + if ( iDirectory.Exists ) + { + // Locate all the map files in the directory + FileInfo[] fileInfoList = iDirectory.GetFiles( "*" + CodeSegResolver.KMapFileExtension ); + foreach ( FileInfo file in fileInfoList ) + { + string pcFileName = file.FullName; + + // Remove .map extension in order to get back to the pure binary dll/exe/etc name. + pcFileName = RemoveMapExtension( pcFileName ); + + // Prepare phone binary name by merging the PC-side filename with Z:\Sys\Bin + string phoneFileName = GeneratePhoneBinaryNameAndPath( pcFileName ); + + // Make entry + CodeSegResolverEntry entry = new CodeSegResolverEntry( pcFileName, phoneFileName ); + + base.Add( entry ); + } + } + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + private const string KRomDriveFileLetter = "Z:\\"; + #endregion + + #region Data members + private readonly DirectoryInfo iDirectory; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/Operations/CSROpScanObey.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/Operations/CSROpScanObey.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,95 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Threading; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Specialized; +using System.Collections.Generic; +using System.ComponentModel; +using SymbianUtils; +using SymbianUtils.SerializedOperations; +using SymbolLib.Sources.Map.Parser; + +namespace SymbolLib.CodeSegDef +{ + internal class CSROpScanObey : CodeSegResolverOperation + { + #region Constructors + public CSROpScanObey( CodeSegResolver aResolver, bool aResetResolver, FileInfo aFile ) + : base( aResolver, aResetResolver ) + { + iFile = aFile; + } + #endregion + + #region From CSROperation + protected override void Scan() + { + base.DriveLetter = Path.GetPathRoot( iFile.FullName ); + if ( iFile.Exists ) + { + using ( StreamReader reader = new StreamReader( iFile.FullName ) ) + { + string line = reader.ReadLine(); + // + while ( line != null ) + { + Match m = KMapParserRegex.Match( line ); + if ( m.Success ) + { + string nameHost = base.CombineWithDriveLetter( m.Groups[ "Host]" ].Value ); + string nameDevice = Path.Combine( KRomDriveFileLetter, m.Groups[ "Device" ].Value ); + // + CodeSegResolverEntry entry = new CodeSegResolverEntry( nameHost, nameDevice ); + // + base.Add( entry ); + } + // + line = reader.ReadLine(); + } + } + } + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + private const string KRomDriveFileLetter = "Z:\\"; + #endregion + + #region Data members + private readonly FileInfo iFile; + public static readonly Regex KMapParserRegex = new Regex( + "(?.+)\r\n\\=\r\n(?.+?)(?:\\s+)\\x22(?.+)\\x2" + + "2", + RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/Operations/CSROpScanSymbol.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/Operations/CSROpScanSymbol.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Threading; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections.Specialized; +using System.Collections.Generic; +using System.ComponentModel; +using SymbianUtils; +using SymbianUtils.SerializedOperations; +using SymbolLib.Sources.Map.Parser; + +namespace SymbolLib.CodeSegDef +{ + internal class CSROpScanSymbol : CodeSegResolverOperation + { + #region Constructors + public CSROpScanSymbol( CodeSegResolver aResolver, bool aResetResolver, FileInfo aFile, IEnumerable aBinaryNames ) + : base( aResolver, aResetResolver ) + { + iFile = aFile; + // + foreach ( string binary in aBinaryNames ) + { + iBinaries.Add( binary ); + } + } + #endregion + + #region From CSROperation + protected override void Scan() + { + base.DriveLetter = Path.GetPathRoot( iFile.FullName ); + foreach ( string binary in iBinaries ) + { + string envFileName = binary; + if ( envFileName[ 0 ] == Path.DirectorySeparatorChar ) + { + envFileName = envFileName.Substring( 1 ); + } + envFileName = CombineWithDriveLetter( envFileName ); + string imageFileName = CodeSegResolver.KROMBinaryPath + Path.GetFileName( envFileName ); + // + CodeSegResolverEntry entry = new CodeSegResolverEntry( envFileName, imageFileName ); + // + base.Add( entry ); + } + } + #endregion + + #region API + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + private const string KRomDriveFileLetter = "Z:\\"; + #endregion + + #region Data members + private readonly FileInfo iFile; + private List iBinaries = new List(); + public static readonly Regex KMapParserRegex = new Regex( + "(?.+)\r\n\\=\r\n(?.+?)(?:\\s+)\\x22(?.+)\\x2" + + "2", + RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/Primer/CodeSegDefinitionPrimer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/CodeSeg/Resolver/Primer/CodeSegDefinitionPrimer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using SymbianUtils; +using SymbianUtils.SerializedOperations; + +namespace SymbolLib.CodeSegDef +{ + public class CodeSegDefinitionPrimer : SerializedOperationManager + { + #region Constructor + internal CodeSegDefinitionPrimer( CodeSegResolver aResolver ) + : base( aResolver ) + { + iResolver = aResolver; + base.Start(); + } + #endregion + + #region Constants + #endregion + + #region API + public CodeSegResolverOperation PrimeFromDirectory( DirectoryInfo aDirectory ) + { + return PrimeFromDirectory( aDirectory, false ); + } + + public CodeSegResolverOperation PrimeFromDirectory( DirectoryInfo aDirectory, bool aResetResolver ) + { + CodeSegResolverOperation ret = new CSROpScanDirectory( iResolver, aResetResolver, aDirectory ); + Queue( ret ); + return ret; + } + + public CodeSegResolverOperation PrimeFromObey( FileInfo aFile ) + { + return PrimeFromObey( aFile, false ); + } + + public CodeSegResolverOperation PrimeFromObey( FileInfo aFile, bool aResetResolver ) + { + CodeSegResolverOperation ret = new CSROpScanObey( iResolver, aResetResolver, aFile ); + Queue( ret ); + return ret; + } + + public CodeSegResolverOperation PrimeFromBinaries( FileInfo aFile, IEnumerable aBinaryNames ) + { + return PrimeFromBinaries( aFile, aBinaryNames, false ); + } + + public CodeSegResolverOperation PrimeFromBinaries( FileInfo aFile, IEnumerable aBinaryNames, bool aResetResolver ) + { + CodeSegResolverOperation ret = new CSROpScanSymbol( iResolver, aResetResolver, aFile, aBinaryNames ); + Queue( ret ); + return ret; + } + #endregion + + #region Properties + #endregion + + #region Internal properties + internal string DriveLetter + { + get + { + lock ( iDriveLetter ) + { + return iDriveLetter; + } + } + set + { + lock ( iDriveLetter ) + { + iDriveLetter = value; + } + } + } + #endregion + + #region Data members + private readonly CodeSegResolver iResolver; + private string iDriveLetter = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Engines/Base/SymbolEngineBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Engines/Base/SymbolEngineBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbolLib.CodeSegDef; +using SymbolLib.Generics; + +namespace SymbolLib.Engines.Common +{ + public abstract class SymbolEngineBase : GenericSymbolEngine + { + #region Events + public delegate void ParsingStarted( SymbolEngineBase aEngine, string aFileName ); + public event ParsingStarted ParsingStartedHandler; + + public delegate void ParsingProgress( SymbolEngineBase aEngine, string aFileName, int aProgress ); + public event ParsingProgress ParsingProgressHandler; + + public delegate void ParsingCompleted( SymbolEngineBase aEngine, string aFileName ); + public event ParsingCompleted ParsingCompletedHandler; + + public delegate void CollectionCreated( SymbolEngineBase aEngine, GenericSymbolCollection aCollection ); + public event CollectionCreated CollectionCreatedHandler; + #endregion + + #region Construct & destruct + protected internal SymbolEngineBase( ITracer aTracer ) + : base( aTracer ) + { + } + #endregion + + #region API + public abstract bool AddressInRange( long aAddress ); + + public virtual int FileNameCount + { + get { return 0; } + } + + public virtual string FileName( int aIndex ) + { + return string.Empty; + } + + public virtual void LoadFromFile( string aFileName, TSynchronicity aSynchronicity ) + { + throw new NotSupportedException(); + } + + public virtual bool LoadFromDefinition( CodeSegDefinition aDefinition, TSynchronicity aSynchronicity ) + { + throw new NotSupportedException(); + } + + public virtual void LoadFromDefinitionCollection( CodeSegDefinitionCollection aCollection, TSynchronicity aSynchronicity ) + { + foreach ( CodeSegDefinition definition in aCollection ) + { + LoadFromDefinition( definition, aSynchronicity ); + } + } + + public virtual void UnloadAll() + { + } + + public virtual bool Unload( CodeSegDefinition aDefinition ) + { + return false; + } + + public virtual bool IsLoaded( CodeSegDefinition aDefinition ) + { + return false; + } + #endregion + + #region Internal event dispatchers + protected void OnParsingStarted( string aFileName ) + { + if ( ParsingStartedHandler != null ) + { + ParsingStartedHandler( this, aFileName ); + } + } + + protected void OnParsingProgress( string aFileName, int aProgress ) + { + if ( ParsingProgressHandler != null ) + { + ParsingProgressHandler( this, aFileName, aProgress ); + } + } + + protected void OnParsingCompleted( string aFileName ) + { + if ( ParsingCompletedHandler != null ) + { + ParsingCompletedHandler( this, aFileName ); + } + } + + protected void OnCollectionCreated( GenericSymbolCollection aCollection ) + { + if ( CollectionCreatedHandler != null ) + { + CollectionCreatedHandler( this, aCollection ); + } + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Engines/ROFS/ROFSEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Engines/ROFS/ROFSEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,473 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using SymbolLib.CodeSegDef; +using SymbolLib.Engines.Common; +using SymbolLib.Sources.Map.Engine; +using SymbolLib.Sources.Map.Parser; +using SymbolLib.Sources.Map.File; +using SymbolLib.Sources.Symbol.Engine; +using SymbolLib.Sources.Symbol.Collection; +using SymbolLib.Sources.Symbol.File; +using SymbolLib.Generics; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; + +namespace SymbolLib.Engines.ROFS +{ + public class ROFSEngine : SymbolEngineBase + { + #region Constructors + internal ROFSEngine( ITracer aTracer ) + : base( aTracer ) + { + iEngineMap = new MapFileEngineCollection( this ); + iEngineMap.Observer += new SymbianUtils.AsyncReaderBase.Observer( MapEngine_Observer ); + + iEngineSymbol = new SymbolFileEngineCollection( this, SymbolFileEngine.TActivationType.EOnDemand, true ); + iEngineSymbol.Observer += new SymbianUtils.AsyncReaderBase.Observer( SymbolEngine_Observer ); + } + #endregion + + #region API + public static TFileType IsSupported( string aFileName ) + { + TFileType ret = TFileType.EFileNotSupported; + // + try + { + string extension = Path.GetExtension( aFileName ).ToLower(); + if ( extension == ".symbol" ) + { + bool sawSomeValidContent = false; + // + SymbolFileEngine tempEngine = new SymbolFileEngine(null, SymbolFileEngine.TActivationType.EOnDemand, true ); + SymbolsForBinary symbols = tempEngine.ReadFirstCollection( aFileName, out sawSomeValidContent ); + + // For a valid ROFS symbol file, the first symbol should have an address of zero. + bool valid = ( symbols != null && symbols.Count > 0 && symbols[ 0 ].Address == 0 ); + if ( valid ) + { + ret = TFileType.EFileRofsSymbol; + } + else if ( sawSomeValidContent ) + { + // Probably just a file containing data files rather than code, but that's okay. + ret = TFileType.EFileRofsSymbol; + } + } + else if ( extension == ".map" ) + { + ret = MapFileEngineCollection.IsSupported( aFileName ); + } + } + catch(Exception) + { + } + // + return ret; + } + #endregion + + #region Properties + public CodeSegDefinitionParser DefinitionParser + { + get { return iEngineMap.CodeSegParser; } + } + + public CodeSegResolver DefinitionResolver + { + get { return iEngineMap.CodeSegResolver; } + } + + public SymbolFileEngineCollection SymbolFiles + { + get { return iEngineSymbol; } + } + + public string[] SymbolFileNames + { + get + { + string[] ret = iEngineSymbol.SymbolFileNames; + return ret; + } + } + + public string[] SymbolFileCollectionFileNames + { + get + { + string[] ret = iEngineSymbol.BinaryFileNames; + return ret; + } + } + + public List MapFileNames + { + get + { + List ret = new List(); + lock ( iEngineMap ) + { + ret.AddRange( iEngineMap.MapFileNames ); + } + return ret; + } + } + #endregion + + #region From SymbolEngineBase + public override bool AddressInRange( long aAddress ) + { + // Try map files first, then symbols (should be + // quicker this way). + bool ret = false; + lock ( iEngineMap ) + { + ret = iEngineMap.Range.Contains( aAddress ); + } + if ( ret == false ) + { + lock ( iEngineSymbol ) + { + ret = iEngineSymbol.Range.Contains( aAddress ); + } + } + // + return ret; + } + + public override int FileNameCount + { + get + { + int count = 0; + // + lock ( iEngineSymbol ) + { + count += iEngineSymbol.SymbolFileCount; + } + lock ( iEngineMap ) + { + count += iEngineMap.NumberOfCollections; + } + // + return count; + } + } + + public override string FileName( int aIndex ) + { + string ret = string.Empty; + // + lock ( iEngineMap ) + { + lock ( iEngineSymbol ) + { + int countSymbolFiles = iEngineSymbol.SymbolFileCount; + int countMapFiles = iEngineMap.NumberOfCollections; + // + if ( aIndex < countSymbolFiles ) + { + ret = iEngineSymbol.SymbolFileName( aIndex ); + } + else + { + // Must be a map index + aIndex -= countSymbolFiles; + // + if ( aIndex >= 0 && aIndex < iEngineMap.NumberOfCollections ) + { + ret = iEngineMap.MapFileName( aIndex ); + } + } + } + } + // + return ret; + } + + public override void LoadFromFile( string aFileName, TSynchronicity aSynchronicity ) + { + if ( SymbolFileEngine.IsSymbolFile( aFileName ) ) + { + iEngineSymbol.LoadFromFile( aFileName, aSynchronicity ); + } + else if ( MapFileEngine.IsMapFile( aFileName ) ) + { + iEngineMap.LoadFromFile( aFileName, aSynchronicity ); + } + else + { + throw new NotSupportedException(); + } + } + + public override bool LoadFromDefinition( CodeSegDefinition aDefinition, TSynchronicity aSynchronicity ) + { + // Try Symbol file first + bool wasActivated = false; + + lock ( this ) + { + wasActivated = iEngineSymbol.Load( aDefinition ); + if ( wasActivated == false ) + { + wasActivated = iEngineMap.Load( aDefinition, aSynchronicity ); + } + } + + return wasActivated; + } + + public override void UnloadAll() + { + lock ( iEngineMap ) + { + iEngineMap.UnloadAll(); + } + lock ( iEngineSymbol ) + { + iEngineSymbol.UnloadAll(); + } + } + + public override bool Unload( CodeSegDefinition aDefinition ) + { + bool ret = false; + lock ( this ) + { + ret = iEngineMap.Unload( aDefinition ); + + // Try with the Symbol engine if it wasn't a loaded map codeseg + if ( ret == false ) + { + ret = iEngineSymbol.Unload( aDefinition ); + } + } + + return ret; + } + + public override bool IsLoaded( CodeSegDefinition aDefinition ) + { + bool ret = false; + lock ( iEngineMap ) + { + ret = iEngineMap.IsLoaded( aDefinition ); + } + if ( ret == false ) + { + // Try with the Symbol engine if it wasn't a loaded map codeseg + lock( iEngineSymbol ) + { + ret = iEngineSymbol.IsLoaded( aDefinition ); + } + } + + return ret; + } + #endregion + + #region From GenericSymbolEngine + public override bool IsReady + { + get + { + bool mapReady = false; + lock( iEngineMap ) + { + mapReady = iEngineMap.IsReady; + } + // + bool symbolReady = false; + lock ( iEngineSymbol ) + { + symbolReady = iEngineSymbol.IsReady; + } + // + bool ret = ( mapReady && symbolReady ); + return ret; + } + } + + public override void Reset() + { + lock ( iEngineMap ) + { + iEngineMap.Reset(); + } + lock( iEngineSymbol ) + { + iEngineSymbol.Reset(); + } + } + + public override bool IsLoaded( string aFileName ) + { + bool loaded = false; + lock ( iEngineMap ) + { + loaded = iEngineMap.IsLoaded( aFileName ); + } + if ( loaded == false ) + { + lock ( iEngineSymbol ) + { + loaded = iEngineSymbol.IsLoaded( aFileName ); + } + } + // + return loaded; + } + + public override GenericSymbolCollection this[ int aIndex ] + { + get + { + GenericSymbolCollection ret = null; + // + lock ( iEngineMap ) + { + lock ( iEngineSymbol ) + { + int mapCount = iEngineMap.NumberOfCollections; + if ( aIndex >= 0 && aIndex < mapCount ) + { + ret = iEngineMap[ aIndex ]; + } + else + { + int symbolBaseIndex = ( aIndex - mapCount ); + int symbolCount = iEngineSymbol.NumberOfCollections; + if ( symbolBaseIndex >= 0 && symbolBaseIndex < symbolCount ) + { + ret = iEngineSymbol[ symbolBaseIndex ]; + } + } + } + } + // + return ret; + } + } + + public override AddressRange Range + { + get + { + AddressRange ret = new AddressRange(); + // + lock ( iEngineMap ) + { + ret.Update( iEngineMap.Range ); + } + lock ( iEngineSymbol ) + { + ret.Update( iEngineSymbol.Range ); + } + // + return ret; + } + } + + internal override void UnloadUntagged() + { + + } + #endregion + + #region From IGenericSymbolCollectionStatisticsInterface + public override int NumberOfCollections + { + get + { + int count = 0; + // + lock ( iEngineMap ) + { + count += iEngineMap.NumberOfCollections; + } + lock ( iEngineSymbol ) + { + count += iEngineSymbol.NumberOfCollections; + } + // + return count; + } + } + #endregion + + #region Event handlers + private void MapEngine_Observer( SymbianUtils.AsyncReaderBase.TEvent aEvent, SymbianUtils.AsyncReaderBase aSender ) + { + System.Diagnostics.Debug.Assert( aSender.Tag is MapFileEngine ); + MapFileEngine engine = (MapFileEngine) aSender.Tag; + // + switch( aEvent ) + { + case SymbianUtils.AsyncReaderBase.TEvent.EReadingStarted: + OnParsingStarted( engine.MapFileName ); + break; + case SymbianUtils.AsyncReaderBase.TEvent.EReadingProgress: + OnParsingProgress( engine.MapFileName, aSender.Progress ); + break; + case SymbianUtils.AsyncReaderBase.TEvent.EReadingComplete: + OnParsingCompleted( engine.MapFileName ); + break; + } + } + + private void MapEngine_MapLoaded( CodeSegDefinition aLoadedEntry, MapFile aMapFile ) + { + OnCollectionCreated( aMapFile ); + } + + private void SymbolEngine_Observer( SymbianUtils.AsyncReaderBase.TEvent aEvent, SymbianUtils.AsyncReaderBase aSender ) + { + System.Diagnostics.Debug.Assert( aSender.Tag is SymbolFileEngine ); + SymbolFileEngine engine = (SymbolFileEngine) aSender.Tag; + // + switch( aEvent ) + { + case SymbianUtils.AsyncReaderBase.TEvent.EReadingStarted: + OnParsingStarted( engine.SymbolFileName ); + break; + case SymbianUtils.AsyncReaderBase.TEvent.EReadingProgress: + OnParsingProgress( engine.SymbolFileName, aSender.Progress ); + break; + case SymbianUtils.AsyncReaderBase.TEvent.EReadingComplete: + OnParsingCompleted( engine.SymbolFileName ); + break; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly MapFileEngineCollection iEngineMap; + private readonly SymbolFileEngineCollection iEngineSymbol; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Engines/ROM/ROMEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Engines/ROM/ROMEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using SymbolLib.CodeSegDef; +using SymbolLib.Engines.Common; +using SymbolLib.Sources.Map.Engine; +using SymbolLib.Sources.Map.Parser; +using SymbolLib.Sources.Map.File; +using SymbolLib.Sources.Symbol.Engine; +using SymbolLib.Sources.Symbol.File; +using SymbolLib.Generics; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; + +namespace SymbolLib.Engines.ROM +{ + public class ROMEngine : SymbolEngineBase + { + #region Constructor & destructor + internal ROMEngine( ITracer aTracer ) + : base( aTracer ) + { + iEngineSymbol = new SymbolFileEngine( this, SymbolFileEngine.TActivationType.EImmediate, false ); + iEngineSymbol.Observer += new SymbianUtils.AsyncReaderBase.Observer( SymbolEngine_Observer ); + } + #endregion + + #region API + public static TFileType IsSupported( string aFileName ) + { + TFileType ret = TFileType.EFileNotSupported; + // + try + { + string extension = Path.GetExtension( aFileName ).ToLower(); + if ( extension == ".symbol" ) + { + SymbolFileEngine tempEngine = new SymbolFileEngine( null, SymbolFileEngine.TActivationType.EOnDemand, false ); + SymbolsForBinary symbols = tempEngine.ReadFirstCollection( aFileName ); + + // For a valid ROFS symbol file, the first symbol should have an address of zero. + bool containedNonZeroFirstSymbolCollection = ( symbols != null && symbols.Count > 0 && symbols[ 0 ].Address != 0 ); + if ( containedNonZeroFirstSymbolCollection ) + { + ret = TFileType.EFileRomSymbol; + } + } + } + catch ( Exception ) + { + } + // + return ret; + } + #endregion + + #region Properties + #endregion + + #region From SymbolEngineBase + public override bool AddressInRange( long aAddress ) + { + bool ret = iEngineSymbol.Range.Contains( aAddress ); + return ret; + } + + public override int FileNameCount + { + get + { + return 1; + } + } + + public override string FileName( int aIndex ) + { + string ret = string.Empty; + // + if ( aIndex == 0 ) + { + ret = iEngineSymbol.SymbolFileName; + } + // + return ret; + } + + public override void LoadFromFile( string aFileName, TSynchronicity aSynchronicity ) + { + string extn = Path.GetExtension( aFileName ).ToLower(); + if ( extn == ".symbol" ) + { + // ROM engine only supports loading a single symbol file + // at once. First unload any old file, then load new one. + UnloadAll(); + iEngineSymbol.LoadFromFile( aFileName, aSynchronicity ); + } + else + { + throw new NotSupportedException(); + } + } + + public override void UnloadAll() + { + Reset(); + } + + public override bool IsLoaded( CodeSegDefinition aDefinition ) + { + bool loaded = iEngineSymbol.IsLoaded( aDefinition ); + return loaded; + } + #endregion + + #region From GenericSymbolEngine + public override bool IsReady + { + get + { + return iEngineSymbol.IsReady; + } + } + + public override void Reset() + { + iEngineSymbol.Reset(); + } + + public override bool IsLoaded( string aFileName ) + { + bool loaded = iEngineSymbol.IsLoaded( aFileName ); + return loaded; + } + + public override GenericSymbolCollection this[ int aIndex ] + { + get + { + GenericSymbolCollection ret = iEngineSymbol[ aIndex ]; + return ret; + } + } + + public override AddressRange Range + { + get + { + return iEngineSymbol.Range; + } + } + + internal override void UnloadUntagged() + { + + } + #endregion + + #region From IGenericSymbolCollectionStatisticsInterface + public override int NumberOfCollections + { + get + { + return iEngineSymbol.NumberOfCollections; + } + } + #endregion + + #region Event handlers + private void SymbolEngine_Observer( SymbianUtils.AsyncReaderBase.TEvent aEvent, SymbianUtils.AsyncReaderBase aSender ) + { + switch( aEvent ) + { + case SymbianUtils.AsyncReaderBase.TEvent.EReadingStarted: + OnParsingStarted( iEngineSymbol.SymbolFileName ); + break; + case SymbianUtils.AsyncReaderBase.TEvent.EReadingProgress: + OnParsingProgress( iEngineSymbol.SymbolFileName, aSender.Progress ); + break; + case SymbianUtils.AsyncReaderBase.TEvent.EReadingComplete: + OnParsingCompleted( iEngineSymbol.SymbolFileName ); + break; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly SymbolFileEngine iEngineSymbol; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Engines/SymbolManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Engines/SymbolManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,324 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbolLib.Generics; +using SymbolLib.Engines.ROFS; +using SymbolLib.Engines.ROM; +using SymbolLib.Sources.Map.Engine; +using SymbolLib.Sources.Symbol.Engine; +using SymbolLib.CodeSegDef; + +namespace SymbolLib.Engines +{ + public class SymbolManager : ITracer + { + #region Construct & destruct + public SymbolManager() + : this( null ) + { + } + + public SymbolManager( ITracer aTracer ) + { + iTracer = aTracer; + // + iEngineROM = new ROMEngine( this ); + iEngineROFS = new ROFSEngine( this ); + } + #endregion + + #region API + public void Clear() + { + ClearTags(); + ROFSEngine.Reset(); + ROMEngine.Reset(); + } + + public Dictionary GetSupportedExtensions() + { + Dictionary ret = new Dictionary(); + // + ret.Add( "*.symbol", "Symbian OS Symbol File" ); + ret.Add( "*.map", "Symbian OS Map File" ); + ret.Add( "*.oby", "Symbian OS Obey File" ); + // + return ret; + } + + public bool IsLoaded( string aFileName ) + { + string fileName = aFileName.ToLower(); + bool loaded = iEngineROM.IsLoaded( fileName ); + // + if ( loaded == false ) + { + loaded = iEngineROFS.IsLoaded( fileName ); + } + // + return loaded; + } + + public void ClearTags() + { + iEngineROM.ClearTags(); + iEngineROFS.ClearTags(); + } + + public void LoadDynamicCodeSegment( CodeSegDefinition aCodeSegment, TSynchronicity aSynchronicity ) + { + ROFSEngine.LoadFromDefinition( aCodeSegment, aSynchronicity ); + } + + public void LoadDynamicCodeSegments( CodeSegDefinitionCollection aCodeSegments, TSynchronicity aSynchronicity ) + { + // Unload any pre-existing dynamically loaded content + ROFSEngine.UnloadAll(); + + // We must attempt to dynamically load all the code segements listed. + // For codesegments that we have no corresponding collection for, we'll allow + // a stub codesegment to be created in the ROFS engine - this ensures we + // at least show the codesegment name (though not function addresses) when we + // encounter an unrecognised address within the codesegment address space. + // + // For everything else, we load it (if it exists) or then if it's already been + // loaded by the CORE ROM symbol file, we ignore the request. + + // These are the code segs that we'll eventually push through to the + // ROFS engine. + CodeSegDefinitionCollection codeSegsToAttemptToLoad = new CodeSegDefinitionCollection(); + + // First pass - identify which code seg entries we already have loaded. + foreach ( CodeSegDefinition def in aCodeSegments ) + { + // Check if there is already a valid definition for this entry in + // the CORE ROM symbol table. If there is, the we don't need to do + // anything. + bool loaded = ROMEngine.IsLoaded( def ); + if ( !loaded ) + { + Trace( "SymbolManager.LoadDynamicCodeSegments() - will attempt to load: " + def ); + codeSegsToAttemptToLoad.Add( def ); + } + else + { + Trace( "SymbolManager.LoadDynamicCodeSegments() - not loading XIP code seg: " + def ); + } + } + + // Now, we have a ratified list that contains only code segments that weren't already managed + // by the CORE ROM engine. + ROFSEngine.LoadFromDefinitionCollection( codeSegsToAttemptToLoad, aSynchronicity ); + } + + public static TFileType IsSupported( string aFileName ) + { + TFileType ret = TFileType.EFileNotSupported; + // + FileInfo fileInfo = new FileInfo( aFileName ); + if ( fileInfo.Exists ) + { + // Try rom then rofs + ret = ROMEngine.IsSupported( aFileName ); + if ( ret == TFileType.EFileNotSupported ) + { + ret = ROFSEngine.IsSupported( aFileName ); + } + } + // + return ret; + } + #endregion + + #region Properties + public ROMEngine ROMEngine + { + get { return iEngineROM; } + } + + public ROFSEngine ROFSEngine + { + get { return iEngineROFS; } + } + + public int NumberOfCollections + { + get + { + int count = 0; + // + count += iEngineROM.NumberOfCollections; + count += iEngineROFS.NumberOfCollections; + // + return count; + } + } + + public int NumberOfEntries + { + get + { + int count = 0; + // + count += iEngineROM.NumberOfEntries; + count += iEngineROFS.NumberOfEntries; + // + return count; + } + } + + public bool IsReady + { + get + { + bool readyROM = iEngineROM.IsReady; + bool readyROFS = iEngineROFS.IsReady; + // + return ( readyROM && readyROFS ); + } + } + #endregion + + #region Lookup API + public bool AddressInRange( long aAddress ) + { + bool ret = iEngineROFS.AddressInRange( aAddress ); + if ( !ret ) + { + ret = iEngineROM.AddressInRange( aAddress ); + } + return ret; + } + + /// + /// Performs as substring match within each collection's host binary file name + /// for aFileName. + /// + /// + /// + public GenericSymbolCollection[] CollectionsByHostBinarySearch( string aFileName ) + { + List ret = new List(); + // + ret.AddRange( iEngineROM.CollectionsByHostBinarySearch( aFileName ) ); + ret.AddRange( iEngineROFS.CollectionsByHostBinarySearch( aFileName ) ); + // + return ret.ToArray(); + } + + public string SymbolNameByAddress( long aAddress ) + { + string ret = string.Empty; + + SymbolLib.Generics.GenericSymbol symbol = EntryByAddress( aAddress ); + if ( symbol != null ) + { + ret = symbol.Symbol; + } + + return ret; + } + + public GenericSymbol EntryByAddress( long aAddress ) + { + GenericSymbolCollection collection = null; + GenericSymbol ret = EntryByAddress( aAddress, out collection ); + return ret; + } + + public GenericSymbol EntryByAddress( long aAddress, out GenericSymbolCollection aCollection ) + { + aCollection = null; + GenericSymbolCollection rofsCollection = null; + + // First check with the map file engine to see if there is a loaded + // code segment entry that matches the specified address. + GenericSymbol ret = iEngineROFS.EntryByAddress( aAddress, ref rofsCollection ); + // + if ( ret == null ) + { + GenericSymbolCollection romCollection = null; + ret = iEngineROM.EntryByAddress( aAddress, ref romCollection ); + + // Decide which collection to return in the case that + // a) we found a matching symbol, or + // b) when we didn't. + if ( ret == null && rofsCollection != null ) + { + // ROFS wins by default if we found something inside the ROFS engine... + aCollection = rofsCollection; + } + else + { + // Otherwise we'll use the ROM collection (irrespective of whether something + // was found or not) + aCollection = romCollection; + } + } + else + { + // ROFS wins + aCollection = rofsCollection; + } + + return ret; + } + + public GenericSymbolCollection CollectionByAddress( long aAddress ) + { + // First check with the map file engine to see if there is a loaded + // code segment entry that matches the specified address. + GenericSymbolCollection ret = iEngineROFS.CollectionByAddress( aAddress ); + // + if ( ret == null ) + { + ret = iEngineROM.CollectionByAddress( aAddress ); + } + // + return ret; + } + #endregion + + #region ITracer Members + public void Trace( string aMessage ) + { + if ( iTracer != null ) + { + iTracer.Trace( aMessage ); + } + } + + public void Trace( string aFormat, params object[] aParams ) + { + Trace( string.Format( aFormat, aParams ) ); + } + #endregion + + #region Data members + private readonly ITracer iTracer; + private readonly ROMEngine iEngineROM; + private readonly ROFSEngine iEngineROFS; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Engines/TFileType.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Engines/TFileType.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; + +namespace SymbolLib.Engines +{ + public enum TFileType + { + EFileNotSupported = 0, + EFileRomSymbol, + EFileRofsSymbol, + EFileMap + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Collection/GenericSymbolCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Collection/GenericSymbolCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,311 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using SymbolLib.Utils; +using SymbianUtils.Range; + +namespace SymbolLib.Generics +{ + public abstract class GenericSymbolCollection : IEnumerable, IComparable + { + #region Construct & destruct + protected GenericSymbolCollection( string aHostBinaryFileName ) + { + HostBinaryFileName = aHostBinaryFileName; + } + #endregion + + #region Virtual API + public virtual void ClearTag() + { + Tagged = false; + } + + public virtual void WriteToStream( StreamWriter aWriter ) + { + // First write the binary name + aWriter.WriteLine( string.Empty ); + aWriter.WriteLine( "From " + HostBinaryFileName ); + aWriter.WriteLine( string.Empty ); + + foreach ( GenericSymbol symbol in this ) + { + aWriter.WriteLine( symbol.ToStringForStream() ); + } + } + #endregion + + #region Abstract API - methods + public abstract void Add( GenericSymbolEngine aEngine, GenericSymbol aSymbol ); + + public abstract void Remove( GenericSymbol aSymbol ); + + public abstract void RemoveAt( int aIndex ); + + public abstract IEnumerator CreateEnumerator(); + + public abstract IEnumerator CreateGenericEnumerator(); + + public abstract GenericSymbol SymbolForAddress( long aAddress ); + #endregion + + #region Abstract API - properties + public abstract int Count + { + get; + } + + public abstract GenericSymbol this[ int aIndex ] + { + get; + } + + public abstract void Sort(); + #endregion + + #region API + public bool AddressFallsWithinRange( long aAddress ) + { + bool found = false; + // + if ( this.Count == 1 && this[ 0 ].IsUnknownSymbol ) + { + int x = 0; + x++; + } + + if ( aAddress > 0 ) + { + if ( iAddresses == null ) + { + RebuildAddressRange(); + } + // + found = iAddresses.IsWithinRange( aAddress ); + } + // + return found; + } + +#if DEBUG + public void Dump() + { + int i = 0; + string line = string.Empty; + foreach ( GenericSymbol entry in this ) + { + line = i.ToString( "d8" ) + " [" + entry.Address.ToString( "x8" ) + "-" + entry.EndAddress.ToString( "x8" ) + "] " + entry.Symbol.ToString(); + System.Diagnostics.Debug.WriteLine( line ); + i++; + } + } + + public void Dump( long aAddress ) + { + int i = 0; + string line = string.Empty; + foreach ( GenericSymbol entry in this ) + { + if ( entry.FallsWithinDomain( aAddress ) ) + { + line = i.ToString( "d8" ) + " * [" + entry.Address.ToString( "x8" ) + "-" + entry.EndAddress.ToString( "x8" ) + "] " + entry.Symbol.ToString(); + } + else + { + line = i.ToString( "d8" ) + " [" + entry.Address.ToString( "x8" ) + "-" + entry.EndAddress.ToString( "x8" ) + "] " + entry.Symbol.ToString(); + } + System.Diagnostics.Debug.WriteLine( line ); + i++; + } + } +#endif + #endregion + + #region Symbol Properties + public GenericSymbol FirstSymbol + { + get + { + GenericSymbol ret = null; + if ( Count > 0 ) + { + ret = this[ 0 ]; + } + return ret; + } + } + + public GenericSymbol LastSymbol + { + get + { + GenericSymbol ret = null; + if ( Count > 0 ) + { + ret = this[ Count - 1 ]; + } + return ret; + } + } + #endregion + + #region Misc Properties + public bool Tagged + { + get { return iTagged; } + set { iTagged = value; } + } + + public long BaseAddress + { + get { return iBaseAddress; } + internal set { iBaseAddress = value; } + } + + public string HostBinaryFileName + { + get { return iHostBinaryFileName; } + set + { + System.Diagnostics.Debug.Assert( !value.ToLower().Contains( ".map" ) ); + iHostBinaryFileName = value; + } + } + + public bool HostBinaryExists + { + get { return File.Exists( HostBinaryFileName ); } + } + + public virtual long AddressRangeStart + { + get + { + long ret = 0; + // + if ( Count > 0 ) + { + ret = FirstSymbol.Address; + } + // + return ret; + } + } + + public virtual long AddressRangeEnd + { + get + { + long ret = 0xffffffff; + // + if ( Count > 0 ) + { + ret = LastSymbol.EndAddress; + } + // + return ret; + } + } + + public virtual AddressRange AddressRange + { + get { return new AddressRange( AddressRangeStart, AddressRangeEnd ); } + } + + public string SourceFile + { + get { return iSourceFile; } + internal set { iSourceFile = value; } + } + #endregion + + #region Internal methods + protected void RebuildAddressRange() + { + iAddresses = new SymbolAddressRange( this ); + } + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + return CreateEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return CreateGenericEnumerator(); + } + #endregion + + #region From IComparable + public int CompareTo( GenericSymbolCollection aOther ) + { + int ret = 1; + // + if ( aOther != null ) + { + ret = string.Compare( HostBinaryFileName, aOther.HostBinaryFileName, true ); + // + if ( aOther is GenericSymbolCollection ) + { + GenericSymbolCollection otherCol = (GenericSymbolCollection) aOther; + // + if ( BaseAddress == otherCol.BaseAddress ) + { + ret = 0; + } + else if ( BaseAddress > otherCol.BaseAddress ) + { + ret = 1; + } + else + { + ret = -1; + } + } + } + + // Debug check + if ( aOther == this ) + { + System.Diagnostics.Debug.Assert( ret == 0 ); + } + // + return ret; + } + #endregion + + #region From System.Object + public override string ToString() + { + return string.Format( "{0} {1}", AddressRange, iHostBinaryFileName ); + } + #endregion + + #region Data members + private bool iTagged = false; + private long iBaseAddress = 0; + private string iHostBinaryFileName = string.Empty; + private string iSourceFile = string.Empty; + private SymbolAddressRange iAddresses = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Collection/GenericSymbolCollectionList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Collection/GenericSymbolCollectionList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; + +namespace SymbolLib.Generics +{ + public class GenericSymbolCollectionList : IEnumerable< GenericSymbolCollection > + { + #region Construct & destruct + public GenericSymbolCollectionList() + { + } + #endregion + + #region API + public void Add( GenericSymbolCollection aCollection ) + { + iList.Add( aCollection ); + } + + public void Remove( GenericSymbolCollection aCollection ) + { + iList.Remove( aCollection ); + } + + public void Reset() + { + iList.Clear(); + } + #endregion + + #region Properties + public int Count + { + get { return iList.Count; } + } + + public GenericSymbolCollection this[ int aIndex ] + { + get { return (GenericSymbolCollection) iList[ aIndex ]; } + } + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + foreach ( GenericSymbolCollection col in iList ) + { + yield return col; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( GenericSymbolCollection col in iList ) + { + yield return col; + } + } + #endregion + + #region Data members + private List iList = new List( 100 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Collection/GenericSymbolCollectionLookupInterface.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Collection/GenericSymbolCollectionLookupInterface.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; + +namespace SymbolLib.Generics +{ + public interface IGenericSymbolCollectionLookupInterface + { + #region Query symbol entry & collection by address + GenericSymbol EntryByAddress( long aAddress, ref GenericSymbolCollection aCollection ); + #endregion + + #region Query collection by address + GenericSymbolCollection CollectionByAddress( long aAddress ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Collection/GenericSymbolCollectionStatisticsInterface.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Collection/GenericSymbolCollectionStatisticsInterface.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; + +namespace SymbolLib.Generics +{ + public interface IGenericSymbolCollectionStatisticsInterface + { + #region IGenericSymbolCollectionStatisticsInterface + int NumberOfCollections + { + get; + } + + int NumberOfEntries + { + get; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Comparer/GenericSymbolComparer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Comparer/GenericSymbolComparer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,82 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; + +namespace SymbolLib.Generics +{ + internal class GenericSymbolComparer : IComparer + { + #region IComparer Members + int IComparer.Compare( GenericSymbol aLeft, GenericSymbol aRight ) + { + int ret = -1; + // + if ( aLeft == null || aRight == null ) + { + if ( aRight == null ) + { + ret = 1; + } + } + else + { + int ret2 = aLeft.AddressRange.CompareTo( aRight.AddressRange ); + GenericSymbol left = aLeft; + System.Diagnostics.Debug.Assert( left.EndAddress >= left.Address ); + GenericSymbol right = aRight; + System.Diagnostics.Debug.Assert( right.EndAddress >= right.Address ); + // + if ( left.Address == right.Address && left.EndAddress == right.EndAddress ) + { + ret = 0; + } + else if ( left.EndAddress == right.Address ) + { + System.Diagnostics.Debug.Assert( left.Address < right.Address ); + System.Diagnostics.Debug.Assert( right.EndAddress >= left.EndAddress ); + // + ret = -1; + } + else if ( left.Address == right.EndAddress ) + { + System.Diagnostics.Debug.Assert( right.Address < left.Address ); + System.Diagnostics.Debug.Assert( left.EndAddress >= right.EndAddress ); + // + ret = 1; + } + else if ( left.Address > right.EndAddress ) + { + System.Diagnostics.Debug.Assert( left.EndAddress > right.EndAddress ); + System.Diagnostics.Debug.Assert( left.EndAddress > right.Address ); + ret = 1; + } + else if ( left.EndAddress < right.Address ) + { + System.Diagnostics.Debug.Assert( left.Address < right.EndAddress ); + System.Diagnostics.Debug.Assert( right.EndAddress > left.EndAddress ); + ret = -1; + } + System.Diagnostics.Debug.Assert( ret2 == ret ); + } + // + return ret; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Engine/GenericSymbolEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Engine/GenericSymbolEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,244 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; + +namespace SymbolLib.Generics +{ + public abstract class GenericSymbolEngine : IGenericSymbolCollectionLookupInterface, IGenericSymbolCollectionStatisticsInterface, IEnumerable, ITracer + { + #region Constructors + protected internal GenericSymbolEngine( ITracer aTracer ) + { + iTracer = aTracer; + } + #endregion + + #region Framework API + public virtual void ClearTags() + { + lock ( this ) + { + foreach ( GenericSymbolCollection collection in this ) + { + collection.ClearTag(); + } + } + } + + public virtual void SaveTaggedCollections( string aFileName ) + { + using ( StreamWriter writer = new StreamWriter( aFileName, false ) ) + { + lock ( this ) + { + foreach ( GenericSymbolCollection collection in this ) + { + if ( collection.Tagged ) + { + collection.WriteToStream( writer ); + } + } + } + } + } + + public abstract void Reset(); + + public abstract bool IsReady { get; } + + public abstract bool IsLoaded( string aFileName ); + + public abstract GenericSymbolCollection this[ int aIndex ] + { + get; + } + + public abstract AddressRange Range { get; } + + internal abstract void UnloadUntagged(); + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + return new GenericSymbolEngineEnumerator( this ); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return new GenericSymbolEngineEnumerator( this ); + } + #endregion + + #region From IGenericSymbolCollectionStatisticsInterface + public int NumberOfEntries + { + get + { + int count = 0; + // + lock ( this ) + { + foreach ( GenericSymbolCollection collection in this ) + { + count += collection.Count; + } + } + // + return count; + } + } + + public abstract int NumberOfCollections + { + get; + } + #endregion + + #region From IGenericSymbolCollectionLookupInterface + public GenericSymbolCollection[] CollectionsByHostBinarySearch( string aFileName ) + { + string searchingFor = aFileName.ToUpper(); + // + List ret = new List(); + // + lock ( this ) + { + for( int i=NumberOfCollections - 1; i>=0; i-- ) + { + GenericSymbolCollection collection = this[ i ]; + string hostBinName = collection.HostBinaryFileName.ToUpper(); + // + if ( hostBinName.Contains( searchingFor ) ) + { + ret.Add( collection ); + } + } + } + // + return ret.ToArray(); + } + + public GenericSymbol EntryByAddress( long aAddress ) + { + GenericSymbolCollection notUsed = null; + return EntryByAddress( aAddress, ref notUsed ); + } + + public GenericSymbol EntryByAddress( long aAddress, ref GenericSymbolCollection aCollection ) + { + GenericSymbol symbol = null; + aCollection = null; + // + lock ( this ) + { + // Debugging code + int debug = 0; + if ( debug != 0 ) + { + int count = NumberOfCollections; + for ( int i = 0; i < count; i++ ) + { + GenericSymbolCollection collection = this[ i ]; + string line = string.Empty; + if ( collection.AddressFallsWithinRange( aAddress ) ) + { + line = i.ToString( "d8" ) + " * [" + collection.AddressRangeStart.ToString( "x8" ) + " - " + collection.AddressRangeEnd.ToString( "x8" ) + "] " + " [" + ( collection.HostBinaryExists ? "Exists] " : "Notfnd] " ) + collection.HostBinaryFileName; + } + else + { + line = i.ToString( "d8" ) + " [" + collection.AddressRangeStart.ToString( "x8" ) + " - " + collection.AddressRangeEnd.ToString( "x8" ) + "] " + " [" + ( collection.HostBinaryExists ? "Exists] " : "Notfnd] " ) + collection.HostBinaryFileName; + } + System.Diagnostics.Debug.WriteLine( line ); + } + } + + // Production search code + if ( Range.Contains( aAddress ) ) + { + // Search for a suitable symbol entry that matches aAddress + int count = NumberOfCollections; + for ( int i = 0; i < count; i++ ) + { + GenericSymbolCollection collection = this[ i ]; + if ( collection.AddressFallsWithinRange( aAddress ) ) + { + // Should be able to locate a symbol within this collection... + symbol = collection.SymbolForAddress( aAddress ); + + aCollection = collection; + aCollection.Tagged = true; + break; + } + } + } + } + // + return symbol; + } + + public GenericSymbolCollection CollectionByAddress( long aAddress ) + { + GenericSymbolCollection ret = null; + + lock ( this ) + { + // Search for a suitable symbol entry that matches aAddress + int count = NumberOfCollections; + for ( int i = 0; i < count; i++ ) + { + GenericSymbolCollection collection = this[ i ]; + if ( collection.AddressFallsWithinRange( aAddress ) ) + { + ret = collection; + ret.Tagged = true; + break; + } + } + } + // + return ret; + } + #endregion + + #region ITracer Members + public void Trace( string aMessage ) + { + if ( iTracer != null ) + { + iTracer.Trace( aMessage ); + } + } + + public void Trace( string aFormat, params object[] aParams ) + { + Trace( string.Format( aFormat, aParams ) ); + } + #endregion + + #region Data members + private readonly ITracer iTracer; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Engine/GenericSymbolEngineEnumerator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Engine/GenericSymbolEngineEnumerator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; + +namespace SymbolLib.Generics +{ + internal class GenericSymbolEngineEnumerator : IEnumerator + { + #region Construct & destruct + public GenericSymbolEngineEnumerator( GenericSymbolEngine aEngine ) + { + iEngine = aEngine; + } + #endregion + + #region From IEnumerator + public void Reset() + { + iCurrentIndex = -1; + } + + public object Current + { + get + { + return iEngine[ iCurrentIndex ]; + } + } + + public bool MoveNext() + { + return ( ++iCurrentIndex < iEngine.NumberOfCollections ); + } + #endregion + + #region From IEnumerator + GenericSymbolCollection IEnumerator.Current + { + get { return iEngine[ iCurrentIndex ]; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly GenericSymbolEngine iEngine; + private int iCurrentIndex = -1; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Symbol/GenericSymbol.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Generic/Symbol/GenericSymbol.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,464 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Text; +using System.Text.RegularExpressions; +using SymbianUtils.Range; +using SymbianUtils; + +namespace SymbolLib.Generics +{ + #region Exception + public class GenericSymbolicCreationException : Exception + { + } + #endregion + + public abstract class GenericSymbol + { + #region Enumerations + public enum TAddressType + { + // Do not change the order - these are priority based with + // the most important symbol type appearing with a larger + // value + EAddressTypeUnknown = -1, + EAddressTypeReadOnlySymbol = 0, + EAddressTypeKernelGlobalVariable, + EAddressTypeSubObject, + EAddressTypeLabel, + EAddressTypeRAMSymbol, + EAddressTypeROMSymbol, + } + + public enum TSourceType + { + ESourceTypeFileSymbol = 0, + ESourceTypeFileMap + } + + public enum TInstructionSet + { + EInstructionSetARM = 0, + EInstructionSetTHUMB + } + #endregion + + #region Public constants + public const int KNullEntryAddress = 0; + public const string KNonMatchingObjectName = "Unknown Object"; + public const string KNonMatchingSymbolName = "Unknown Symbol"; + #endregion + + #region Constructors + protected GenericSymbol( GenericSymbolCollection aCollection ) + { + iCollection = aCollection; + } + #endregion + + #region Abstract API + public abstract TSourceType SourceType { get; } + + public abstract bool Parse( string aLine ); + #endregion + + #region Framework API + public virtual bool FallsWithinDomain(long aAddress) + { + return (aAddress >= Address && aAddress <= EndAddress); + } + + public virtual bool IsSubObject + { + get + { + bool ret = ( AddressType == TAddressType.EAddressTypeSubObject ); + return ret; + } + } + + public virtual bool IsLabel + { + get + { + bool ret = ( AddressType == TAddressType.EAddressTypeLabel ); + return ret; + } + } + + public virtual bool IsSymbol + { + get + { + bool ret = ( Collection.BaseAddress == 0 || AddressType == TAddressType.EAddressTypeRAMSymbol || AddressType == TAddressType.EAddressTypeROMSymbol ); + return ret; + } + } + + public virtual MemoryModel.TMemoryModelType MemoryModelType // Guess + { + get + { + return iStaticMemoryModelType; + } + } + + public virtual TAddressType AddressType + { + get + { + TAddressType ret = TAddressType.EAddressTypeUnknown; + + if ( Address >= 0xF8000000 && Address < 0xFFEFFFFF ) + { + // ROM Symbol, Moving Memory Model + ret = TAddressType.EAddressTypeROMSymbol; + } + else if ( Address >= 0xF4000000 && Address < 0xF7FFFFFF ) + { + // RAM Symbol, Moving Memory Model + ret = TAddressType.EAddressTypeRAMSymbol; + } + else if ( Address >= 0x64000000 && Address < 0x64FFFFFF ) + { + // Kernel global, Moving Memory Model + ret = TAddressType.EAddressTypeKernelGlobalVariable; + } + else if ( Address >= 0xc8000000 && Address < 0xC8FFFFFF) + { + // Kernel global, Multiple Memory Model + ret = TAddressType.EAddressTypeKernelGlobalVariable; + } + else if ( Address >= 0x80000000 && Address < 0x8FFFFFFF ) + { + // ROM Symbol, Multiple Memory Model + ret = TAddressType.EAddressTypeROMSymbol; + } + else if ( Address >= 0x3C000000 && Address < 0x3DFFFFFF ) + { + // RAM Symbol, Moving Memory Model [1gb] + ret = TAddressType.EAddressTypeRAMSymbol; + } + else if ( Address >= 0x70000000 && Address < 0x7FFFFFFF ) + { + // RAM Symbol, Moving Memory Model [2gb] + ret = TAddressType.EAddressTypeRAMSymbol; + } + else if ( Address < 0x10000000 ) + { + // A non-fixed up ROFS symbol entry + ret = TAddressType.EAddressTypeRAMSymbol; + } + + // These can over-ride the previous items... + if ( iSymbol.IndexOf("Image$$ER_RO$$") >= 0 ) + { + ret = TAddressType.EAddressTypeReadOnlySymbol; + } + else if ( iSymbol.IndexOf("__sub_object(") > 0 ) + { + ret = TAddressType.EAddressTypeSubObject; + } + else if ( ret != TAddressType.EAddressTypeKernelGlobalVariable ) + { + bool containsBrackets = iSymbol.Contains( "(" ) && iSymbol.Contains( ")" ); + if ( !containsBrackets ) + { + ret = TAddressType.EAddressTypeLabel; + } + } + + return ret; + } + } + #endregion + + #region API + public static string UnknownOffset() + { + string text = "[+ ??????]"; + return text; + } + + public uint Offset( uint aInstructionAddress ) + { + uint baseAddressOffset = aInstructionAddress - System.Convert.ToUInt32( Address ); + return baseAddressOffset; + } + + public string OffsetAsString( uint aInstructionAddress ) + { + uint baseAddressOffset = Offset( aInstructionAddress ); + string text = "[+ 0x" + baseAddressOffset.ToString( "x4" ) + "]"; + return text; + } + #endregion + + #region Properties + public TInstructionSet InstructionSet + { + get + { + TInstructionSet ret = TInstructionSet.EInstructionSetARM; + // + if ( ( iFlags & TFlags.EFlagsIsThumb ) == TFlags.EFlagsIsThumb ) + { + ret = TInstructionSet.EInstructionSetTHUMB; + } + // + return ret; + } + } + + public long BaseAddress + { + get { return iCollection.BaseAddress; } + } + + public long Address + { + get + { + long address = BaseAddress + iOffsetAddress; + return address; + } + } + + public long EndAddress + { + get + { + long ret = BaseAddress + iOffsetEndAddress; + return ret; + } + } + + public long Size + { + get { return iSize; } + set + { + System.Diagnostics.Debug.Assert( value >= 0 ); + iSize = value; + + // We need to update the end address + if ( iSize > 0 ) + { + long address = OffsetAddress; + OffsetEndAddress = address + iSize - 1; + } + else + { + OffsetEndAddress = OffsetAddress; + } + + System.Diagnostics.Debug.Assert( iOffsetEndAddress >= OffsetAddress ); + } + } + + public AddressRange AddressRange + { + get { return new AddressRange( Address, EndAddress ); } + } + + public string Symbol + { + get { return iSymbol; } + set + { + iSymbol = value; + if ( StartsWithAny( KVTableOrTypeInfoPrefixes, value ) ) + { + iFlags |= TFlags.EFlagsVTable; + } + } + } + + public string SymbolNameWithoutVTablePrefix + { + get + { + StringBuilder ret = new StringBuilder( Symbol ); + // + ret = ret.Replace( "vtable for ", string.Empty ); + ret = ret.Replace( "typeinfo for ", string.Empty ); + ret = ret.Replace( "typeinfo name for ", string.Empty ); + // + return ret.ToString(); + } + } + + public string Object + { + get { return iObject; } + set { iObject = value; } + } + + public string ObjectWithoutSection + { + get + { + string ret = string.Empty; + // + if ( Object != null ) + { + ret = Object; + // + int bracketPos = ret.IndexOf( "(" ); + if ( bracketPos > 0 ) + { + ret = ret.Substring( 0, bracketPos ).Trim(); + } + } + + // Casing looks odd and it can also confuse + // hash table look ups in dependent code. + //ret = SymbianUtils.Strings.StringCaser.PrettyCase( ret ); + return ret; + } + } + + public GenericSymbolCollection Collection + { + get { return iCollection; } + } + + public bool IsUnknownSymbol + { + get + { + bool ret = Symbol.StartsWith( KNonMatchingSymbolName ) && + ( OffsetAddress == GenericSymbol.KNullEntryAddress ); + return ret; + } + } + + public bool IsVTable + { + get + { + bool ret = ( iFlags & TFlags.EFlagsVTable ) == TFlags.EFlagsVTable; + return ret; + } + } + #endregion + + #region Internal enumerations + [Flags] + private enum TFlags : byte + { + EFlagsNone = 0, + EFlagsVTable = 1, + EFlagsIsThumb = 2, + }; + #endregion + + #region Internal properties + internal long OffsetAddress + { + get { return iOffsetAddress; } + set + { + long remainder = value & 0x1; + if ( remainder != 0 ) + { + iFlags |= TFlags.EFlagsIsThumb; + } + else + { + iFlags &= ~TFlags.EFlagsIsThumb; + } + + iOffsetAddress = value & 0xFFFFFFFE; + + // If we've not yet decided upon the type of memory model, + // now is the time to work it out. + if ( iOffsetAddress > 0 && iStaticMemoryModelType == MemoryModel.TMemoryModelType.EMemoryModelUnknown ) + { + long address = Address; + iStaticMemoryModelType = MemoryModel.TypeByAddress( address ); + } + } + } + + private long OffsetEndAddress + { + set { iOffsetEndAddress = value; } + } + #endregion + + #region Internal constants + protected const int KBaseHex = 16; + private static readonly string[] KVTableOrTypeInfoPrefixes = new string[] { "vtable for ", "typeinfo for ", "typeinfo name for " }; + #endregion + + #region From System.Object + public override string ToString() + { + string ret = string.Format( "{0:x8} {1:x4} {2} [{3}]", Address, Size, Symbol, Object ); + return ret; + } + + public string ToStringForStream() + { + StringBuilder ret = new StringBuilder(); + // + ret.Append( Address.ToString( "x8" ) ); + ret.Append( " " ); + ret.Append( Size.ToString( "x4" ) ); + ret.Append( " " ); + ret.Append( Symbol.PadRight( 40, ' ' ) ); + ret.Append( " " ); + ret.Append( Object ); + // + return ret.ToString(); + } + + public static bool StartsWithAny( string[] aPrefixes, string aText ) + { + bool ret = false; + // + foreach ( string p in aPrefixes ) + { + if ( aText.StartsWith( p ) ) + { + ret = true; + break; + } + } + // + return ret; + } + #endregion + + #region Data members + protected long iSize; + #endregion + + #region Internal data members + private long iOffsetAddress; + private long iOffsetEndAddress; + private string iSymbol = string.Empty; + private string iObject = string.Empty; + private TFlags iFlags = TFlags.EFlagsNone; + private readonly GenericSymbolCollection iCollection; + private static MemoryModel.TMemoryModelType iStaticMemoryModelType = MemoryModel.TMemoryModelType.EMemoryModelUnknown; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Internal/Future Plans.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Internal/Future Plans.txt Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +Requirements +============ + +1) Unified GenericSymbol class - not virtual + - represents individual symbol + - must support dynamic relocation by way of GenericSymbolCollection + +2) Unified GenericSymbolCollection class - not virtual + - represents collection of symbols + - must have a PC-side underlying source file name (e.g. .symbol, .map) + - must have a PC-side underlying binary file (e.g. \epoc32\release\armv5\urel\Sysstart.exe, \epoc32\release\armv5\urel\euser.dll) + - must have an address range, which is sorted and easily indexable in order to find corresponding GenericSymbol + - must support dynamic relocation + - collection and CodeSeg will have 1:1 mapping + - must be able to tag a collection as "in use" so that it's contents can be serialized + - must be able to mark a collection is permanent, i.e. it does not need or support relocation + + +3) Unified SymbolEngine class - not virtual + - represents a set of 'collections' + - must be able to discard unused collections + - must be able to serialize tagged collections + - SymbolEngines can be layered - so that one symbol engine can build upon another + - must be able to list all collections. If layered, then that means providing iteration on the underlying child symbol engines. + - must be able to load and unload specific collections. + - an unloaded collection does not necessarily mean totally discarded. It may just mean that it cannot be used to provide + symbol lookups. + +4) Separation of symbol sources (map/symbol/sym/zip) from actual symbol & collection content + +5) Must be able to easily plug in new symbol sources without impacting other parsers/sources. + +6) Once symbol source data is in memory, then must be able to obtain different views on the data without needing to reparse/reload + the symbol source. + + For example, in the case of NICD/System CoreDump stack reconstruction, we need to create call stacks for multiple thread + simultaneously. Currently we must serialize access to the symbol engine so that only one stack is reconstructed at any given + time because we cannot dynamically load and unload multiple relocatable symbol sources simultaneously. + +7) "Resolving" a dynamically-loaded symbol source needs to be a common operation for all source types. We must somehow support a number + of resolution methods and all sources should be able to provide resolver implementation that allows 'resolution meta-data' to be + created for any symbol sources that they have loaded. + + +Use Cases +========= + +a) Need to be able to zip up all the symbol source files. + +b) Asked to read a core rom symbol file, two rofs symbols and 3 map files. + +c) Parsing NICD/CoreDump style crash data where serveral stacks all require reconstruction. + + + + + +1) Reading a symbol file fully populates a source diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/SearchAndReplace/SymbolicSearchAndReplaceParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/SearchAndReplace/SymbolicSearchAndReplaceParser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,193 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Specialized; +using System.Text.RegularExpressions; +using System.IO; +using System.Text; +using SymbianUtils; +using SymbolLib.Engines; +using SymbolLib.CodeSegDef; + +namespace SymbolLib.SearchAndReplace +{ + public class SymbolicSearchAndReplaceParser : AsyncTextFileReader + { + #region Constructors & destructor + public SymbolicSearchAndReplaceParser( SymbolManager aSymbolManager, string aSourceFile, string aDestinationFile ) + : this( aSymbolManager, aSourceFile, aDestinationFile, string.Empty ) + { + } + + public SymbolicSearchAndReplaceParser( SymbolManager aSymbolManager, string aSourceFile, string aDestinationFile, string aPrefix ) + : base( aSourceFile, new AsyncTextReaderPrefix( aPrefix ), true ) + { + iSymbolManager = aSymbolManager; + iWriter = new StreamWriter( aDestinationFile, false ); + } + #endregion + + #region API + public void SearchAndReplace() + { + base.AsyncRead(); + } + #endregion + + #region Properties + public SymbolManager SymbolManager + { + get { return iSymbolManager; } + } + #endregion + + #region From AsyncTextReaderBase + protected override void HandleFilteredLine( string aLine ) + { + const string KHexChars = "abcdefABCDEF1234567890"; + + int startPos = 0; + StringBuilder line = new StringBuilder(); + + CodeSegDefinition def = iSymbolManager.ROFSEngine.DefinitionParser.ParseAndResolveDefinition( aLine ); + if ( def != null ) + { + SymbolManager.LoadDynamicCodeSegment( def, TSynchronicity.ESynchronous ); + line.Append( aLine ); + } + else + { + // Look through the line looking for 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f in runs of 8 characters + MatchCollection collection = iAddressRegEx.Matches( aLine ); + if ( collection != null && collection.Count > 0 ) + { + foreach ( Match m in collection ) + { + // Now get the stack address + CaptureCollection captures = m.Captures; + foreach ( Capture capture in captures ) + { + string matchText = capture.Value.Trim(); + + // Take all the initial text + int capturePos = capture.Index; + + // Check whether it is a discrete word + bool checkForSymbolMatch = true; + if ( capturePos > 0 ) + { + // Check previous character wasn't a match from our group + char prevCharacter = aLine[ capturePos - 1 ]; + checkForSymbolMatch = ( KHexChars.IndexOf( prevCharacter ) < 0 ); + } + if ( checkForSymbolMatch && ( capturePos + matchText.Length < aLine.Length ) ) + { + // Check next character too + char nextCharacter = aLine[ capturePos + matchText.Length ]; + checkForSymbolMatch = ( KHexChars.IndexOf( nextCharacter ) < 0 ); + } + + // Take any preceeding text... + if ( capturePos > 0 ) + { + int length = capturePos - startPos; + line.Append( aLine.Substring( startPos, length ) ); + startPos = capturePos; + } + + // Always store the original text + line.Append( matchText ); + + // Decide if we can try to find a symbol... + if ( checkForSymbolMatch ) + { + // And now take the text as a symbol (if we have + // a match). + long address = SymbianUtils.NumberBaseUtils.TextToDecimalNumber( matchText, NumberBaseUtils.TNumberBase.EHex ); + Generics.GenericSymbol symbol = iSymbolManager.EntryByAddress( address ); + + if ( symbol != null ) + { + line.Append( " [ " + symbol.Symbol + " ]" ); + } + else if ( iSymbolManager.AddressInRange( address ) ) + { + line.Append( " [ #UNKNOWN# ]" ); + } + } + else + { + // Not a match, just take the original match text and move on... + } + + startPos += matchText.Length; + } + } + } + + // Remember to add anything that is left at the end... + string remainder = aLine.Substring( startPos ); + line.Append( remainder ); + } + + iWriter.WriteLine( line.ToString() ); + } + + protected override void HandleReadCompleted() + { + try + { + if ( iWriter != null ) + { + iWriter.Close(); + } + iWriter = null; + } + finally + { + base.HandleReadCompleted(); + } + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + if ( iWriter != null ) + { + iWriter.Close(); + } + iWriter = null; + } + finally + { + base.CleanupManagedResources(); + } + } + #endregion + + #region Data members + private readonly SymbolManager iSymbolManager; + private static Regex iAddressRegEx = new Regex( @"[a-fA-F0-9]{8}", RegexOptions.IgnoreCase ); + private StreamWriter iWriter; + #endregion + } +} + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/Comparison/MapFileAddressRangeComparer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/Comparison/MapFileAddressRangeComparer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbolLib.Sources.Symbol.File; +using SymbolLib.Sources.Map.File; + +namespace SymbolLib.Sources.Map.Comparison +{ + class MapFileAddressRangeComparer : IComparer + { + #region IComparer Members + int IComparer.Compare( MapFile aLeft, MapFile aRight ) + { + int ret = -1; + // + if ( aLeft == null || aRight == null ) + { + if ( aRight == null ) + { + ret = 1; + } + } + else + { + ret = aLeft.AddressRangeStart.CompareTo( aRight.AddressRangeStart ); + } + // + return ret; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/Engine/MapFileEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/Engine/MapFileEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,236 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; +using SymbolLib.CodeSegDef; +using SymbolLib.Generics; +using SymbolLib.Engines; +using SymbolLib.Sources.Map.File; +using SymbolLib.Sources.Map.Parser; +using SymbolLib.Sources.Map.Symbol; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; + +namespace SymbolLib.Sources.Map.Engine +{ + internal class MapFileEngine : GenericSymbolEngine, SymbolEntryCreator + { + #region Events + public event AsyncReaderBase.Observer Observer; + #endregion + + #region Constructor & destructor + public MapFileEngine( ITracer aTracer ) + : base( aTracer ) + { + } + #endregion + + #region API + public static bool IsMapFile( string aFileName ) + { + string extension = Path.GetExtension( aFileName ).ToLower(); + return ( extension == CodeSegDefinition.KMapFileExtension ); + } + + internal bool IsLoaded( CodeSegDefinition aDefinition ) + { + bool ret = iMapFile.HostBinaryFileName == aDefinition.ImageFileNameAndPath; + return ret; + } + + internal void LoadFromFile( string aMapFileName, TSynchronicity aSynchronicity ) + { + iMapFileName = aMapFileName; + iMapFile = MapFile.NewByHostMapFileName( aMapFileName ); + // + iParser = new MapFileParser( this, aMapFileName, this ); + iParser.Tag = this; + iParser.iObserver += new SymbianUtils.AsyncReaderBase.Observer( Parser_Observer ); + iParser.SymbolCreated += new MapFileParser.SymbolCreatedHandler( Parser_SymbolCreated ); + iParser.BaseAddressHandler += new MapFileParser.MapFileBaseAddressHandler( Parser_BaseAddressHandler ); + iParser.Read( aSynchronicity ); + } + + internal void Load( CodeSegDefinition aDefinition ) + { + iMapFile.Fixup( aDefinition ); + } + + internal bool Unload( CodeSegDefinition aDefinition ) + { + return true; + } + + internal void UnloadAll() + { + } + #endregion + + #region Properties + public MapFile MapFile + { + get { return iMapFile; } + } + + public string MapFileName + { + get { return iMapFileName; } + } + #endregion + + #region From GenericSymbolEngine + public override void Reset() + { + // Do nothing - we cannot unload our only file. This is taken + // care of by parent class. + iMapFile = null; + iParser = null; + iMapFileName = string.Empty; + } + + public override bool IsReady + { + get + { + return true; + } + } + + public override bool IsLoaded( string aFileName ) + { + bool ret = MapFileName == aFileName; + return ret; + } + + public override GenericSymbolCollection this[ int aIndex ] + { + get + { + return iMapFile; + } + } + + public override AddressRange Range + { + get + { + return iMapFile.AddressRange; + } + } + + internal override void UnloadUntagged() + { + + } + #endregion + + #region From IGenericSymbolCollectionStatisticsInterface + public override int NumberOfCollections + { + get + { + return 1; + } + } + #endregion + + #region From SymbolEntryCreator + public MapSymbol CreateSymbol() + { + return MapSymbol.New( iMapFile ); + } + #endregion + + #region Map file parser observer + private void Parser_Observer( SymbianUtils.AsyncReaderBase.TEvent aEvent, SymbianUtils.AsyncReaderBase aSender ) + { + if ( Observer != null ) + { + Observer( aEvent, aSender ); + } + + if ( aEvent == SymbianUtils.AsyncReaderBase.TEvent.EReadingComplete ) + { + iMapFile.EnsureAllEntriesHaveSize(); + iMapFile.Sort(); + + int x = 0; + if ( x != 0 ) + { + iMapFile.Dump(); + } + + iParser = null; + } + } + + private void Parser_SymbolCreated( MapSymbol aSymbol ) + { + bool addItem = true; + + if ( iMapFile.Count > 0 ) + { + int lastEntryIndex = iMapFile.Count - 1; + MapSymbol lastEntry = (MapSymbol) iMapFile[ lastEntryIndex ]; + // + long lastEntrySize = lastEntry.Size; + long newEntrySize = aSymbol.Size; + // + if ( lastEntry.Address == aSymbol.Address ) + { + if ( lastEntrySize == 0 && newEntrySize > 0 ) + { + // Remove an entry with zero size to replace it with a better definition... + iMapFile.RemoveAt( lastEntryIndex ); + } + else if ( newEntrySize == 0 && lastEntrySize > 0 ) + { + // Don't replace an entry with zero size when we already + // have a good item. + addItem = false; + } + } + } + + if ( addItem ) + { + iMapFile.Add( this, aSymbol ); + } + } + + private void Parser_BaseAddressHandler( uint aBaseAddress ) + { + iMapFile.GlobalBaseAddress = aBaseAddress; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private MapFile iMapFile = null; + private MapFileParser iParser = null; + private string iMapFileName = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/Engine/MapFileEngineCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/Engine/MapFileEngineCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,361 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; +using SymbolLib.CodeSegDef; +using SymbolLib.Generics; +using SymbolLib.Engines; +using SymbolLib.Sources.Map.Symbol; +using SymbolLib.Sources.Map.File; +using SymbolLib.Sources.Map.Parser; + +namespace SymbolLib.Sources.Map.Engine +{ + internal class MapFileEngineCollection : GenericSymbolEngine + { + #region Delegates & Events + public event AsyncReaderBase.Observer Observer; + #endregion + + #region Constructors & destructor + internal MapFileEngineCollection( ITracer aTracer ) + : base( aTracer ) + { + iCodeSegResolver = new CodeSegResolver( aTracer ); + iCodeSegParser = new CodeSegDefinitionParser( iCodeSegResolver ); + } + #endregion + + #region API + public static TFileType IsSupported( string aFileName ) + { + TFileType ret = TFileType.EFileNotSupported; + // + try + { + using ( StreamReader reader = new StreamReader( aFileName ) ) + { + const int maxLines = 100; + // + bool foundHeader = false; + bool foundBody = false; + // + int lineCounter = 0; + string line = reader.ReadLine(); + while ( line != null && !( foundHeader && foundBody ) && lineCounter < maxLines ) + { + if ( line.StartsWith( "ARM Linker, RVCT" ) ) + { + foundHeader = true; + } + else if ( line.Contains( "Symbol Name" ) && line.Contains( "Value" ) && line.Contains( "Object" ) && line.Contains( "Section" ) ) + { + foundBody = true; + } + + line = reader.ReadLine(); + ++lineCounter; + } + // + if ( foundBody && foundHeader ) + { + ret = TFileType.EFileMap; + } + } + } + catch ( Exception ) + { + } + // + return ret; + } + + public MapFileEngine LoadFromFile( string aMapFileName, TSynchronicity aSynchronicity ) + { + // Check if already exists + MapFileEngine engine = null; + // + lock ( this ) + { + engine = FindByMapFileName( aMapFileName ); + if ( engine != null ) + { + iFiles.Remove( engine ); + } + + engine = new MapFileEngine( this ); + engine.Observer += new AsyncReaderBase.Observer( MapEngine_ObserverProxy ); + engine.LoadFromFile( aMapFileName, aSynchronicity ); + iFiles.Add( engine ); + } + + return engine; + } + + public bool Load( CodeSegDefinition aDefinition, TSynchronicity aSynchronicity ) + { + bool ret = false; + // + if ( string.IsNullOrEmpty( aDefinition.MapFileName ) || !aDefinition.MapFileExists ) + { + } + else + { + // First pass - try to find map engine that matches the specified + // PC file name. + string mapFileName = aDefinition.MapFileName; + if ( aDefinition.MapFileExists ) + { + System.Diagnostics.Debug.WriteLine( " LOAD {M}: " + aDefinition.ToString() ); + + MapFileEngine engine = FindByMapFileName( mapFileName ); + if ( engine != null ) + { + engine.Load( aDefinition ); + ret = true; + } + else + { + // Map file engine doesn't exist for the specified code segment. + // Can we load it from file? + engine = LoadFromFile( aDefinition.MapFileName, aSynchronicity ); + if ( engine != null ) + { + engine.Load( aDefinition ); + ret = true; + } + } + } + } + // + return ret; + } + + public bool Unload( CodeSegDefinition aDefinition ) + { + bool ret = false; + // + foreach ( MapFileEngine engine in iFiles ) + { + if ( engine.Unload( aDefinition ) ) + { + ret = true; + break; + } + } + // + return ret; + } + + public void UnloadAll() + { + foreach ( MapFileEngine engine in iFiles ) + { + engine.UnloadAll(); + } + } + + public bool IsLoaded( CodeSegDefinition aDefinition ) + { + bool ret = false; + // + foreach ( MapFileEngine engine in iFiles ) + { + if ( engine.IsLoaded( aDefinition ) ) + { + ret = true; + break; + } + } + // + return ret; + } + + public string MapFileName( int aIndex ) + { + return iFiles[ aIndex ].MapFileName; + } + #endregion + + #region Properties + public int MapFileCount + { + get { return iFiles.Count; } + } + + public CodeSegResolver CodeSegResolver + { + get { return iCodeSegResolver; } + } + + public CodeSegDefinitionParser CodeSegParser + { + get { return iCodeSegParser; } + } + + public GenericSymbolEngine MapFileEngineAt( int aIndex ) + { + return iFiles[ aIndex ]; + } + + public string[] BinaryFileNames + { + get + { + List fileNames = new List( iFiles.Count ); + // + foreach ( MapFileEngine engine in iFiles ) + { + // Map files only contain symbols for one binary + fileNames.Add( engine[ 0 ].HostBinaryFileName ); + } + // + return fileNames.ToArray(); + } + } + + public string[] MapFileNames + { + get + { + List fileNames = new List( iFiles.Count ); + // + foreach ( MapFileEngine engine in iFiles ) + { + fileNames.Add( engine.MapFileName ); + } + // + return fileNames.ToArray(); + } + } + #endregion + + #region From GenericSymbolEngine + public override void Reset() + { + iFiles.Clear(); + iCodeSegResolver.Clear(); + } + + public override bool IsLoaded( string aFileName ) + { + MapFileEngine engine = FindByMapFileName( aFileName ); + return engine != null; + } + + public override bool IsReady + { + get + { + int readyCount = 0; + // + foreach ( MapFileEngine engine in iFiles ) + { + if ( engine.IsReady ) + { + ++readyCount; + } + } + // + return ( readyCount == iFiles.Count ); + } + } + + public override GenericSymbolCollection this[ int aIndex ] + { + get + { + // Map files contain only a single symbol collection; + GenericSymbolCollection ret = iFiles[ aIndex ][ 0 ]; + return ret; + } + } + + public override AddressRange Range + { + get + { + AddressRange ret = new AddressRange(); + // + foreach ( MapFileEngine engine in iFiles ) + { + ret.Update( engine.Range ); + } + // + return ret; + } + } + + internal override void UnloadUntagged() + { + } + #endregion + + #region From IGenericSymbolCollectionStatisticsInterface + public override int NumberOfCollections + { + get + { + // Map files contain only a single symbol collection + int count = iFiles.Count; + return count; + } + } + #endregion + + #region Event handlers + private void MapEngine_ObserverProxy( SymbianUtils.AsyncReaderBase.TEvent aEvent, SymbianUtils.AsyncReaderBase aSender ) + { + if ( Observer != null ) + { + Observer( aEvent, aSender ); + } + } + #endregion + + #region Internal methods + private MapFileEngine FindByMapFileName( string aFileName ) + { + MapFileEngine ret = null; + // + foreach ( MapFileEngine engine in iFiles ) + { + if ( engine.MapFileName.ToLower() == aFileName.ToLower() ) + { + ret = engine; + break; + } + } + // + return ret; + } + #endregion + + #region Data members + private readonly CodeSegResolver iCodeSegResolver; + private readonly CodeSegDefinitionParser iCodeSegParser; + private List iFiles = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/File/MapFile.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/File/MapFile.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,238 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using SymbolLib.CodeSegDef; +using SymbolLib.Generics; +using SymbolLib.Sources.Map.Symbol; +using SymbianUtils.Range; + +namespace SymbolLib.Sources.Map.File +{ + internal class MapFile : GenericSymbolCollection + { + #region Static constructors + public static MapFile NewByHostMapFileName( string aMapFileNameAndPath ) + { + // The specified file should end in .map + System.Diagnostics.Debug.Assert( aMapFileNameAndPath.ToUpper().EndsWith( ".MAP" ) ); + + // Get rid of map file extension. + string binaryFileName = aMapFileNameAndPath.Substring( 0, aMapFileNameAndPath.Length - 4 ); + MapFile ret = new MapFile( binaryFileName, aMapFileNameAndPath ); + return ret; + } + + #endregion + + #region Constructors + private MapFile( string aHostBinaryName, string aHostMapFileName ) + : base( aHostBinaryName ) + { + base.SourceFile = aHostMapFileName; + + // Make the dummy entry in case we obtain no further symbols + MapSymbol dummy = MapSymbol.NewUnknown( this ); + iEntries.Add( dummy ); + } + #endregion + + #region API + public void EnsureAllEntriesHaveSize() + { + int count = Count; + +#if DEBUG + // Debug support + int x = 0; + if ( x != 0 ) + { + string line = string.Empty; + for ( int i = 0; i < count; i++ ) + { + GenericSymbol entry = iEntries[ i ]; + line = i.ToString( "d8" ) + " [" + entry.Address.ToString( "x8" ) + "-" + entry.EndAddress.ToString( "x8" ) + "] " + entry.Symbol.ToString(); + System.Diagnostics.Debug.WriteLine( line ); + } + } +#endif + + // Now go through the entries and update their sizes (if they don't have one) + for ( int i = 1; i < count; i++ ) + { + GenericSymbol entry = iEntries[ i ]; + GenericSymbol previousEntry = iEntries[ i - 1 ]; + // + if ( previousEntry.Size == 0 ) + { + long calculatedPreviousEntrySize = ( entry.Address - previousEntry.Address ) - 1; + if ( calculatedPreviousEntrySize > 0 ) + { + previousEntry.Size = calculatedPreviousEntrySize; + } + } + } + } + + public void Fixup( CodeSegDefinition aDefinition ) + { + // Work out base address offset based upon global address and code segment + // placement address. + uint baseAddress = aDefinition.AddressStart; + BaseAddress = baseAddress; + iFixedUpRange = aDefinition.AddressRange; + + base.RebuildAddressRange(); + } + #endregion + + #region Properties + public override AddressRange AddressRange + { + get { return iFixedUpRange; } + } + + internal uint GlobalBaseAddress + { + get { return iGlobalBaseAddress; } + set + { + iGlobalBaseAddress = value; + } + } + #endregion + + #region From GenericSymbolCollection + public override void Add( GenericSymbolEngine aEngine, GenericSymbol aSymbol ) + { + // We don't take data symbols, just code + MapSymbol symbol = (MapSymbol) aSymbol; + MapSymbol.TType type = symbol.Type; + + if ( type == MapSymbol.TType.EThumbCode || type == MapSymbol.TType.EARMCode ) + { + // Don't take code entries with no size + if ( aSymbol.Size > 0 ) + { + // Make sure we remove the null symbol if this is the first 'valid' symbol for + // the collection. + if ( Count == 1 && this[ 0 ].IsUnknownSymbol ) + { + RemoveAt( 0 ); + } + + iEntries.Add( aSymbol ); + } + else + { +#if TRACE + System.Diagnostics.Debug.WriteLine( "Discarding zero size entry: " + aSymbol.ToString() ); +#endif + } + } + } + + public override void Remove( GenericSymbol aSymbol ) + { + iEntries.Remove( aSymbol ); + } + + public override void RemoveAt( int aIndex ) + { + iEntries.RemoveAt( aIndex ); + } + + public override void Sort() + { + iEntries.Sort( new GenericSymbolComparer() ); + } + + public override int Count + { + get { return iEntries.Count; } + } + + public override System.Collections.IEnumerator CreateEnumerator() + { + return new MapFileEnumerator( this ); + } + + public override System.Collections.Generic.IEnumerator CreateGenericEnumerator() + { + return new MapFileEnumerator( this ); + } + + public override GenericSymbol this[ int aIndex ] + { + get + { + return iEntries[ aIndex ]; + } + } + + public override long AddressRangeStart + { + get { return iFixedUpRange.Min; } + } + + public override long AddressRangeEnd + { + get { return iFixedUpRange.Max; } + } + + public override GenericSymbol SymbolForAddress( long aAddress ) + { +#if DEBUG + int x = 0; + if ( x > 0 ) + { + base.Dump( aAddress ); + } +#endif + GenericSymbol ret = null; + // + foreach ( GenericSymbol symbol in this ) + { + if ( symbol.FallsWithinDomain( aAddress ) ) + { + ret = symbol; + break; + } + } + // + return ret; + } + #endregion + + #region From System.Object + public override string ToString() + { + StringBuilder ret = new StringBuilder(); + ret.Append( iFixedUpRange.ToString() ); + return ret.ToString(); + } + #endregion + + #region Data members + private uint iGlobalBaseAddress = 0; + private AddressRange iFixedUpRange = new AddressRange(); + private List iEntries = new List( 50 ); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/File/MapFileEnumerator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/File/MapFileEnumerator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using SymbolLib.Generics; + +namespace SymbolLib.Sources.Map.File +{ + internal class MapFileEnumerator : IEnumerator + { + #region Constructors & destructor + public MapFileEnumerator( MapFile aMapFile ) + { + iMapFile = aMapFile; + } + #endregion + + #region IEnumerator Members + public void Reset() + { + iCurrentIndex = -1; + } + + public object Current + { + get + { + return iMapFile[ iCurrentIndex ]; + } + } + + public bool MoveNext() + { + return ( ++iCurrentIndex < iMapFile.Count ); + } + #endregion + + #region From IEnumerator + GenericSymbol IEnumerator.Current + { + get { return iMapFile[ iCurrentIndex ]; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly MapFile iMapFile; + private int iCurrentIndex = -1; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/Parser/MapFileParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/Parser/MapFileParser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,179 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.IO; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbolLib.Generics; +using SymbolLib.Sources.Map.File; +using SymbolLib.Sources.Map.Symbol; +using SymbolLib.Sources.Map.Engine; + +namespace SymbolLib.Sources.Map.Parser +{ + #region SymbolEntryCreator interface + internal interface SymbolEntryCreator + { + MapSymbol CreateSymbol(); + } + #endregion + + internal class MapFileParser : AsyncTextFileReader + { + #region Delegates & events + public delegate void SymbolCreatedHandler( MapSymbol aSymbol ); + public event SymbolCreatedHandler SymbolCreated; + + public delegate void MapFileBaseAddressHandler( uint aBaseAddress ); + public event MapFileBaseAddressHandler BaseAddressHandler; + #endregion + + #region Constructors & destructor + public MapFileParser( SymbolEntryCreator aEntryCreator, string aMapFileName, ITracer aTracer ) + : base( aMapFileName, aTracer ) + { + iEntryCreator = aEntryCreator; + } + #endregion + + #region API + public void Read( TSynchronicity aSynchronicity ) + { + base.StartRead( aSynchronicity ); + } + #endregion + + #region Properties + #endregion + + #region From AsyncTextReaderBase + protected override void HandleFilteredLine( string aLine ) + { + if ( aLine == "Global Symbols" ) + { + iState = TState.EInGlobalRegion; + } + else if ( aLine == "Local Symbols" ) + { + iState = TState.EInLocalRegion; + } + else + { + switch( iState ) + { + case TState.EInUnknownRegion: + break; + case TState.EInLocalRegion: + ParseLineRegionLocal( aLine ); + break; + case TState.EInGlobalRegion: + ParseLineRegionGlobal( aLine ); + break; + case TState.EComplete: + System.Diagnostics.Debug.Assert(false); + break; + } + } + } + #endregion + + #region Local & global (high level) line handlers + private void ParseLineRegionLocal( string aLine ) + { + } + + private void ParseLineRegionGlobal( string aLine ) + { + switch( iStateGlobal ) + { + case TGlobalState.EWaitingForImage_ER_RO_Base: + ParseGlobalBaseAddress( aLine ); + break; + case TGlobalState.EProcessingSymbols: + ParseGlobalSymbol( aLine ); + break; + default: + break; + } + } + #endregion + + #region Global section line parse methods + private void ParseGlobalBaseAddress( string aLine ) + { + try + { + // Image$$ER_RO$$Base 0x00008000 Number 0 anon$$obj.o(linker$$defined$$symbols) + MapSymbol baseOffsetEntry = iEntryCreator.CreateSymbol(); + + // Keep trying to parse until we are successful. First time we succeed + // we use the symbol address as the global offset address within the map + // file (typically 0x8000) + bool parsedOkay = baseOffsetEntry.Parse( aLine ); + if ( parsedOkay && baseOffsetEntry.Address > 0 && BaseAddressHandler != null ) + { + BaseAddressHandler( (uint) baseOffsetEntry.Address ); + iStateGlobal = TGlobalState.EProcessingSymbols; + } + } + catch(GenericSymbolicCreationException) + { + } + } + + private void ParseGlobalSymbol( string aLine ) + { + try + { + // Image$$ER_RO$$Base 0x00008000 Number 0 anon$$obj.o(linker$$defined$$symbols) + MapSymbol symbol = iEntryCreator.CreateSymbol(); + bool parsedOkay = symbol.Parse( aLine ); + if ( parsedOkay && SymbolCreated != null ) + { + SymbolCreated( symbol ); + } + } + catch(GenericSymbolicCreationException) + { + } + } + #endregion + + #region Internal enumerations + private enum TState + { + EInUnknownRegion = 0, + EInLocalRegion, + EInGlobalRegion, + EComplete + } + + private enum TGlobalState + { + EWaitingForImage_ER_RO_Base = 0, + EProcessingSymbols + } + #endregion + + #region Data members + private readonly SymbolEntryCreator iEntryCreator; + private TState iState = TState.EInUnknownRegion; + private TGlobalState iStateGlobal = TGlobalState.EWaitingForImage_ER_RO_Base; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/Symbol/MapSymbol.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Map/Symbol/MapSymbol.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,152 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using SymbolLib.Generics; +using SymbolLib.Sources.Map.File; +using SymbolLib.Sources.Map.Engine; + +namespace SymbolLib.Sources.Map.Symbol +{ + internal class MapSymbol : GenericSymbol + { + #region Enumerations + public enum TType + { + EUnknown = 0, + EARMCode, + EThumbCode, + EData, + ENumber, + ESection + } + #endregion + + #region Static Constructors + public static MapSymbol New( MapFile aFile ) + { + return new MapSymbol( aFile ); + } + + public static MapSymbol NewUnknown( MapFile aFile ) + { + MapSymbol symbol = new MapSymbol( aFile ); + // + symbol.iType = TType.EARMCode; + symbol.Size = 0; + symbol.OffsetAddress = GenericSymbol.KNullEntryAddress; + symbol.Symbol = GenericSymbol.KNonMatchingSymbolName; + // + if ( aFile.HostBinaryFileName.Length > 0 ) + { + symbol.Object = Path.GetFileName( aFile.HostBinaryFileName ); + } + else + { + symbol.Object = GenericSymbol.KNonMatchingObjectName; + } + // + return symbol; + } + #endregion + + #region Constructors & destructor + private MapSymbol( MapFile aFile ) + : base( aFile ) + { + } + #endregion + + #region Properties + public TType Type + { + get { return iType; } + private set { iType = value; } + } + #endregion + + #region From GenericSymbol + public override bool Parse( string aLine ) + { + Match m = KMapParserRegex.Match( aLine ); + if ( m.Success ) + { + GroupCollection groups = m.Groups; + // + uint globalBaseAddress = MapFile.GlobalBaseAddress; + // + Object = groups[ "Binary" ].Value; + Type = TypeByString( groups[ "Type" ].Value ); + Symbol = groups[ "Function" ].Value; + OffsetAddress = long.Parse( groups[ "Address" ].Value, System.Globalization.NumberStyles.HexNumber ) - globalBaseAddress; + Size = long.Parse( groups[ "Size" ].Value ); + } + // + return m.Success; + } + + public override TSourceType SourceType + { + get { return GenericSymbol.TSourceType.ESourceTypeFileMap; } + } + #endregion + + #region Internal constants + private const string KDummySymbolName = "[Unknown Symbol]"; + private static readonly Regex KMapParserRegex = new Regex( + "(?:\\s*)(?.+?)(?:\\s+)0x(?
[A-Fa-f0-9]{8})"+ + "(?:\\s+)(?(?:Data|Section|Number|ARM Code|Thumb Code))"+ + "(?:\\s+)(?\\d+)(?:\\s+)(?.+)", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + ); + #endregion + + #region Internal methods + private static TType TypeByString( string aTypeAsString ) + { + TType ret = TType.EUnknown; + // + if ( aTypeAsString == "ARM Code" ) + ret = TType.EARMCode; + else if ( aTypeAsString == "Thumb Code" ) + ret = TType.EThumbCode; + else if ( aTypeAsString == "Section" ) + ret = TType.ESection; + else if ( aTypeAsString == "Data" ) + ret = TType.EData; + else if ( aTypeAsString == "Number" ) + ret = TType.ENumber; + // + return ret; + } + #endregion + + #region Internal properties + private MapFile MapFile + { + get { return (Sources.Map.File.MapFile) Collection; } + } + #endregion + + #region Data members + private TType iType = TType.EUnknown; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Collection/SymbolsForBinaryCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Collection/SymbolsForBinaryCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,154 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; +using SymbolLib.Sources.Symbol.File; +using SymbolLib.Sources.Symbol.Comparison; + +namespace SymbolLib.Sources.Symbol.Collection +{ + public class SymbolsForBinaryCollection : IEnumerable + { + #region Constructors & destructor + public SymbolsForBinaryCollection() + : this( 50 ) + { + } + + public SymbolsForBinaryCollection( int aGranularity ) + { + iSymbolsForBinaries = new List( aGranularity ); + } + #endregion + + #region API + public void Clear() + { + lock ( iSymbolsForBinaries ) + { + iSymbolsForBinaries.Clear(); + } + } + + public void Add( SymbolsForBinary aEntry ) + { + lock ( iSymbolsForBinaries ) + { + if ( !iSymbolsForBinaries.Contains( aEntry ) ) + { + iSymbolsForBinaries.Add( aEntry ); + } + } + } + + public void Add( SymbolsForBinaryCollection aCollection ) + { + foreach ( SymbolsForBinary entry in aCollection ) + { + Add( entry ); + } + } + + public void Remove( SymbolsForBinary aFile ) + { + iSymbolsForBinaries.Remove( aFile ); + } + + public void RemoveLast() + { + // Dump the last collection - only ever called when + // the parser detects a collection with zero entries + lock ( iSymbolsForBinaries ) + { + if ( Count == 0 ) + { + throw new ArgumentOutOfRangeException( "No last entry to remove" ); + } + + iSymbolsForBinaries.RemoveAt( Count - 1 ); + } + } + + public void Sort() + { + // Sort the collections into some kind of address order + if ( Count > 0 ) + { + SymbolsForBinaryCompareByAddress comparer = new SymbolsForBinaryCompareByAddress(); + try + { + lock ( iSymbolsForBinaries ) + { + iSymbolsForBinaries.Sort( comparer ); + } + } + catch ( Exception ) + { + SymbianUtils.SymDebug.SymDebugger.Break(); + } + } + } + #endregion + + #region Properties + public int Count + { + get { return iSymbolsForBinaries.Count; } + } + + public SymbolsForBinary this[ int aIndex ] + { + get + { + lock ( iSymbolsForBinaries ) + { + return iSymbolsForBinaries[ aIndex ]; + } + } + } + + public SymbolsForBinary LastCollection + { + get + { + lock ( iSymbolsForBinaries ) + { + SymbolsForBinary ret = this[ Count - 1 ]; + return ret; + } + } + } + #endregion + + #region From IEnumerable + IEnumerator IEnumerable.GetEnumerator() + { + return new SymbolsForBinaryCollectionEnumerator( this ); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return new SymbolsForBinaryCollectionEnumerator( this ); + } + #endregion + + #region Data members + private readonly List iSymbolsForBinaries; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Collection/SymbolsForBinaryCollectionEnumerator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Collection/SymbolsForBinaryCollectionEnumerator.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections; +using System.Collections.Generic; +using SymbolLib.Sources.Symbol.File; + +namespace SymbolLib.Sources.Symbol.Collection +{ + internal class SymbolsForBinaryCollectionEnumerator : IEnumerator + { + #region Constructors & destructor + public SymbolsForBinaryCollectionEnumerator( SymbolsForBinaryCollection aCollection ) + { + iCollection = aCollection; + } + #endregion + + #region IEnumerator Members + public void Reset() + { + iCurrentIndex = -1; + } + + public object Current + { + get + { + return iCollection[ iCurrentIndex ]; + } + } + + public bool MoveNext() + { + return ( ++iCurrentIndex < iCollection.Count ); + } + #endregion + + #region From IEnumerator + SymbolsForBinary IEnumerator.Current + { + get { return iCollection[ iCurrentIndex ]; } + } + #endregion + + #region From IDisposable + public void Dispose() + { + } + #endregion + + #region Data members + private readonly SymbolsForBinaryCollection iCollection; + private int iCurrentIndex = -1; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Comparison/SymbolCollectionAddressRangeComparer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Comparison/SymbolCollectionAddressRangeComparer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbolLib.Sources.Symbol.File; + +namespace SymbolLib.Sources.Symbol.Comparison +{ + class SymbolsForBinaryCompareByAddress : IComparer + { + #region IComparer Members + int IComparer.Compare( SymbolsForBinary aLeft, SymbolsForBinary aRight ) + { + int ret = -1; + // + if ( aLeft == null || aRight == null ) + { + if ( aRight == null ) + { + ret = 1; + } + } + else + { + ret = aLeft.AddressRangeStart.CompareTo( aRight.AddressRangeStart ); + } + // + return ret; + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Engine/SymbolFileEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Engine/SymbolFileEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,541 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; +using SymbianUtils.FileSystem; +using SymbianUtils.FileSystem.Utilities; +using SymbolLib.Generics; +using SymbolLib.CodeSegDef; +using SymbolLib.Sources.Symbol.Symbol; +using SymbolLib.Sources.Symbol.File; +using SymbolLib.Sources.Symbol.Parser; +using SymbolLib.Sources.Symbol.Collection; + +namespace SymbolLib.Sources.Symbol.Engine +{ + internal class SymbolFileEngine : GenericSymbolEngine, SymbolCollectionCreator, SymbolEntryCreator + { + #region Events + public event AsyncReaderBase.Observer Observer; + #endregion + + #region Enumerations + public enum TActivationType + { + EImmediate, + EOnDemand + } + #endregion + + #region Constructors + public SymbolFileEngine( ITracer aTracer, TActivationType aActivationType, bool aAllowNonRomSymbols ) + : base( aTracer ) + { + iAllowNonRomSymbols = aAllowNonRomSymbols; + iActivationType = aActivationType; + } + #endregion + + #region API + public static bool IsSymbolFile( string aFileName ) + { + string extension = Path.GetExtension( aFileName ).ToLower(); + return ( extension == KSymbolFileExtensionPrimary ); + } + + public SymbolsForBinary ReadFirstCollection( string aFileName ) + { + bool isValid = false; + return ReadFirstCollection( aFileName, out isValid ); + } + + public SymbolsForBinary ReadFirstCollection( string aFileName, out bool aIsSymbolFile ) + { + iCurrentBinary = null; + iSymbolFileName = aFileName; + // + iParser = new SymbolFileParser( this, this, aFileName, this ); + iParser.CollectionCompleted += new SymbolLib.Sources.Symbol.Parser.SymbolFileParser.CollectionCompletedHandler( Parser_CollectionCompletedSingleOnly ); + iParser.SymbolCreated += new SymbolLib.Sources.Symbol.Parser.SymbolFileParser.SymbolCreatedHandler( Parser_SymbolCreated ); + iParser.Read( TSynchronicity.ESynchronous ); + // + SymbolsForBinary ret = null; + if ( iAllSymbols.Count > 0 ) + { + ret = iAllSymbols[ 0 ]; + aIsSymbolFile = true; + } + + // Did we see any collections whatsoever (all be they data or code?) + aIsSymbolFile = iParser.ContainedAtLeastOneCollectionFileName; + + return ret; + } + + public void LoadFromFile( string aSymbolFileName, TSynchronicity aSynchronicity ) + { + iSymbolFileName = aSymbolFileName; + // + iParser = new SymbolFileParser( this, this, aSymbolFileName, this ); + iParser.Tag = this; + iParser.iObserver += new SymbianUtils.AsyncReaderBase.Observer( ParserEventHandler ); + iParser.CollectionCompleted += new SymbolLib.Sources.Symbol.Parser.SymbolFileParser.CollectionCompletedHandler( Parser_CollectionCompleted ); + iParser.SymbolCreated += new SymbolLib.Sources.Symbol.Parser.SymbolFileParser.SymbolCreatedHandler( Parser_SymbolCreated ); + iParser.Read( aSynchronicity ); + } + + public bool IsLoaded( CodeSegDefinition aDefinition ) + { + // In ROM, variation might mean that the file name + // doesn't match the definition name from the actual run-time code + // segments loaded by a process... + // + // If we don't find a file name match, but we do find an address match + // then we'll treat it as "good enough" + bool activated = false; + string searchingFor = aDefinition.ImageFileName.ToLower(); + string searchingForWithoutExtension = FSUtilities.StripAllExtensions( searchingFor ); + + // Try to promote a symbol + foreach ( SymbolsForBinary file in iActivatedSymbols ) + { + string entryName = System.IO.Path.GetFileName( file.HostBinaryFileName ).ToLower(); + if ( entryName == searchingFor ) + { + activated = true; + break; + } + else if ( file.AddressRangeStart == aDefinition.AddressStart && file.AddressRangeEnd == aDefinition.AddressEnd ) + { + // E.g: ROM.symbol says: "From \epoc32\release\armv5\urel\xxx.22.dll" + // runtime code seg says: "xxx.dll" + // We must use the base address instead... + + activated = true; + break; + } + else + { + // Try a fuzzy match + string entryNameWithoutExtension = FSUtilities.StripAllExtensions( entryName ); + if ( entryNameWithoutExtension.Contains( searchingForWithoutExtension ) ) + { + // Also make sure the base addresses are the same + if ( file.AddressRangeStart == aDefinition.AddressStart ) + { + // Fuzzy match + activated = true; + break; + } + } + } + } + + return activated; + } + + public bool Load( CodeSegDefinition aDefinition ) + { + bool activated = false; + string searchingFor = aDefinition.EnvironmentFileName.ToLower(); + if ( string.IsNullOrEmpty( searchingFor ) ) + { + // Try to use on-target name instead, if valid + searchingFor = aDefinition.ImageFileName.ToLower(); + } + + // Try to promote a symbol + foreach( SymbolsForBinary file in iIdleSymbols ) + { + string entryName = System.IO.Path.GetFileName( file.HostBinaryFileName ).ToLower(); + if ( entryName == searchingFor ) + { +#if DEBUG + System.Diagnostics.Debug.WriteLine( " LOAD {S}: " + aDefinition.ToString() ); +#endif + + // Fix up the symbols in this collection + file.Fixup( aDefinition.AddressStart ); + + // Update ranges + iRange.UpdateMin( file.AddressRangeStart ); + iRange.UpdateMax( file.AddressRangeEnd ); + + // Housekeeping + iActivatedSymbols.Add( file ); + iIdleSymbols.Remove( file ); + iActivatedSymbols.Sort(); + + // Even though the symbols for this binary may not be explicitly referenced + // they are definitely required by the callee, therefore we tag them + // immediately. + file.Tagged = true; + + // Indicate we loaded the code seg from a symbol file + aDefinition.Source = CodeSegDefinition.TSourceType.ESourceWasSymbolFile; + + activated = true; + break; + } + } + + return activated; + } + + public bool Unload( CodeSegDefinition aDefinition ) + { + bool suspended = false; + string searchingFor = aDefinition.EnvironmentFileName.ToLower(); + + // Try to promote a symbol + foreach( SymbolsForBinary file in iActivatedSymbols ) + { + string entryName = System.IO.Path.GetFileName( file.HostBinaryFileName ).ToLower(); + if ( entryName == searchingFor ) + { +#if DEBUG + System.Diagnostics.Debug.WriteLine( " UNLOAD {S}: " + aDefinition.ToString() ); +#endif + // + iActivatedSymbols.Remove( file ); + iIdleSymbols.Add( file ); + // + iRange.UpdateMin( file.AddressRangeStart ); + iRange.UpdateMax( file.AddressRangeEnd ); + // + suspended = true; + + // NB: We don't untag the file since it was obviously needed at + // some point. + break; + } + } + + return suspended; + } + + public void UnloadAll() + { + iActivatedSymbols.Clear(); + iIdleSymbols.Clear(); + // + foreach( SymbolsForBinary file in iAllSymbols ) + { + iIdleSymbols.Add( file ); + } + } + #endregion + + #region Properties + public string SymbolFileName + { + get { return iSymbolFileName; } + } + + public bool AllowNonRomSymbols + { + get { return iAllowNonRomSymbols; } + } + + public int Progress + { + get + { + int prog = 0; + // + if ( iParser != null ) + { + prog = iParser.Progress; + } + // + return prog; + } + } + + public string[] BinaryFileNames + { + get + { + List fileNames = new List( AllSymbols.Count ); + // + foreach ( GenericSymbolCollection collection in AllSymbols ) + { + fileNames.Add( collection.HostBinaryFileName ); + } + // + return fileNames.ToArray(); + } + } + + public SymbolsForBinaryCollection AllSymbols + { + get { return iAllSymbols; } + } + #endregion + + #region From GenericSymbolEngine + public override void Reset() + { + iActivatedSymbols.Clear(); + iIdleSymbols.Clear(); + iAllSymbols.Clear(); + iSymbolFileName = string.Empty; + iCurrentBinary = null; + iRange = new AddressRange(); + } + + public override bool IsLoaded( string aFileName ) + { + return ( aFileName.ToLower() == iSymbolFileName.ToLower() ); + } + + public override bool IsReady + { + get + { + bool ready = ( SymbolFileName.Length > 0 ); + // + if ( ready && iParser != null ) + { + ready = iParser.IsReady; + } + // + return ready; + } + } + + public override GenericSymbolCollection this[ int aIndex ] + { + get + { + return iActivatedSymbols[ aIndex ]; + } + } + + public override void SaveTaggedCollections( string aFileName ) + { + // We override this so that we search through 'iAllSymbols' rather + // than just the activated symbols (which would be the case if we + // used the base class version of this method). + using ( StreamWriter writer = new StreamWriter( aFileName, false ) ) + { + foreach ( GenericSymbolCollection collection in iAllSymbols ) + { + if ( collection.Tagged ) + { + System.Diagnostics.Debug.WriteLine( "STORING: " + collection.HostBinaryFileName ); + collection.WriteToStream( writer ); + } + } + } + } + + public override AddressRange Range + { + get + { + return iRange; + } + } + + internal override void UnloadUntagged() + { + + } + #endregion + + #region From IGenericSymbolCollectionStatisticsInterface + public override int NumberOfCollections + { + get { return iActivatedSymbols.Count; } + } + #endregion + + #region AsyncReaderBase observer + private void ParserEventHandler( SymbianUtils.AsyncReaderBase.TEvent aEvent, SymbianUtils.AsyncReaderBase aObject ) + { + if ( Observer != null ) + { + Observer( aEvent, aObject ); + } + + if ( aEvent == AsyncReaderBase.TEvent.EReadingComplete ) + { + iActivatedSymbols.Sort(); + iParser = null; + } + } + #endregion + + #region Parser observer - for normal parsing + private bool Parser_CollectionCompleted( SymbolsForBinary aCollection ) + { + // Check whether the collection contains any item. If it doesn't, ditch it. + // Remove empty collections or sort completed ones. + bool takeCollection = false; + int count = aCollection.Count; + if ( count > 0 ) + { + // Check whether the collection contains at least 2 symbols, and if not + // does the one and only symbol just have a length of zero? + if ( count == 1 ) + { + GenericSymbol symbol = aCollection.FirstSymbol; + takeCollection = ( symbol.Size > 0 ) || symbol.IsUnknownSymbol; + } + else + { + takeCollection = true; + } + } + + // If its okay to take the collection, let's sort it and activate if necessary. + if ( takeCollection ) + { +#if INSPECT_SYMBOL_DATA + using ( StreamWriter writer = new StreamWriter( @"C:\Temp\OldSymbols\" + Path.GetFileName( aCollection.HostBinaryFileName ) + ".symbol" ) ) + { + aCollection.WriteToStream( writer ); + } +#endif + // All the symbol collections - whether they are loaded or idle. + iAllSymbols.Add( aCollection ); + + // Then put the collection in the correct container depending on + // activation type. + if ( iActivationType == TActivationType.EImmediate ) + { + aCollection.Sort(); + iActivatedSymbols.Add( aCollection ); + // + iRange.UpdateMin( aCollection.AddressRangeStart ); + iRange.UpdateMax( aCollection.AddressRangeEnd ); + } + else if ( iActivationType == TActivationType.EOnDemand ) + { + ThreadPool.QueueUserWorkItem( new WaitCallback( SortCollection ), aCollection ); + iIdleSymbols.Add( aCollection ); + } + } + else + { + //System.Diagnostics.Debug.WriteLine( "Discarded Symbol Collection: " + aCollection.TargetBinary ); + //System.Diagnostics.Debug.WriteLine( " " ); + } + + iCurrentBinary = null; + return SymbolFileParser.KCollectionCompletedAndContinueParsing; + } + + private void Parser_SymbolCreated( SymbolSymbol aSymbol ) + { + // 1) We accept symbols with an address of zero, providing that their size is greater + // than zero. + // + // 2) We accept symbols with an address greater than zero, irrespective of their size. + if ( ( aSymbol.Address >= 0 || aSymbol.Size > 0 ) || // 1 + ( aSymbol.Address == 0 && aSymbol.Size > 0 ) // 2 + ) + { + iCurrentBinary.Add( this, aSymbol, AllowNonRomSymbols ); + } + else + { + System.Diagnostics.Debug.WriteLine( " Discarded symbol: " + aSymbol ); + } + } + #endregion + + #region Parser observer - for peeking at a symbol file's first collection + private bool Parser_CollectionCompletedSingleOnly( SymbolLib.Sources.Symbol.File.SymbolsForBinary aCollection ) + { + // Call our standard function to handle the collection + Parser_CollectionCompleted( aCollection ); + + // Indicate no more parsing required + bool ret = SymbolFileParser.KCollectionCompletedAndContinueParsing; + if ( aCollection.Count > 0 && iAllSymbols.Count > 0 ) + { + ret = SymbolFileParser.KCollectionCompletedAndAbortParsing; + } + // + return ret; + } + #endregion + + #region SymbolCollectionCreator interface + public SymbolsForBinary CreateCollection( string aHostFileName ) + { + iCurrentBinary = new SymbolsForBinary( aHostFileName ); + iCurrentBinary.SourceFile = SymbolFileName; + return iCurrentBinary; + } + #endregion + + #region SymbolEntryCreator interface + public SymbolSymbol CreateSymbol() + { + return SymbolSymbol.New( iCurrentBinary ); + } + #endregion + + #region Internal methods + private void CalculateRange() + { + iRange.Reset(); + // + foreach( SymbolsForBinary file in iActivatedSymbols ) + { + iRange.UpdateMin( file.AddressRangeStart ); + iRange.UpdateMax( file.AddressRangeEnd ); + } + } + + private void SortCollection( object aCollection ) + { + SymbolsForBinary symbols = aCollection as SymbolsForBinary; + if ( symbols != null ) + { + symbols.Sort(); + } + } + #endregion + + #region Internal constants + private const string KSymbolFileExtensionPrimary = ".symbol"; + #endregion + + #region Data members + private readonly TActivationType iActivationType; + private readonly bool iAllowNonRomSymbols; + private string iSymbolFileName = string.Empty; + private SymbolsForBinary iCurrentBinary = null; + private SymbolFileParser iParser = null; + private AddressRange iRange = new AddressRange(); + private SymbolsForBinaryCollection iAllSymbols = new SymbolsForBinaryCollection(); + private SymbolsForBinaryCollection iIdleSymbols = new SymbolsForBinaryCollection(); + private SymbolsForBinaryCollection iActivatedSymbols = new SymbolsForBinaryCollection(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Engine/SymbolFileEngineCollection.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Engine/SymbolFileEngineCollection.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,326 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbianUtils.Tracer; +using SymbolLib.Generics; +using SymbolLib.CodeSegDef; +using SymbolLib.Sources.Symbol.Symbol; +using SymbolLib.Sources.Symbol.File; +using SymbolLib.Sources.Symbol.Parser; +using SymbolLib.Sources.Symbol.Collection; + +namespace SymbolLib.Sources.Symbol.Engine +{ + public class SymbolFileEngineCollection : GenericSymbolEngine + { + #region Delegates & Events + public event AsyncReaderBase.Observer Observer; + #endregion + + #region Constructorss + internal SymbolFileEngineCollection( ITracer aTracer, SymbolFileEngine.TActivationType aActivationType, bool aAllowNonRomSymbols ) + : base( aTracer ) + { + iActivationType = aActivationType; + iAllowNonRomSymbols = aAllowNonRomSymbols; + } + #endregion + + #region API + public static bool IsSymbolFile( string aFileName ) + { + return SymbolFileEngine.IsSymbolFile( aFileName ); + } + + public void LoadFromFile( string aSymbolFileName, TSynchronicity aSynchronicity ) + { + // Check if already exists + SymbolFileEngine engine = null; + // + lock ( this ) + { + engine = EngineByFileName( aSymbolFileName ); + if ( engine != null ) + { + iFiles.Remove( engine ); + } + } + + engine = new SymbolFileEngine( this, iActivationType, iAllowNonRomSymbols ); + + lock ( this ) + { + iFiles.Add( engine ); + } + + engine.Observer += new AsyncReaderBase.Observer( SymbolEngine_ObserverProxy ); + engine.LoadFromFile( aSymbolFileName, aSynchronicity ); + } + + public bool Load( CodeSegDefinition aDefinition ) + { + bool ret = false; + // + foreach ( SymbolFileEngine engine in iFiles ) + { + if ( engine.Load( aDefinition ) ) + { + ret = true; + break; + } + } + // + return ret; + } + + public bool Unload( CodeSegDefinition aDefinition ) + { + bool ret = false; + // + foreach ( SymbolFileEngine engine in iFiles ) + { + if ( engine.Unload( aDefinition ) ) + { + ret = true; + break; + } + } + // + return ret; + } + + public void UnloadAll() + { + foreach ( SymbolFileEngine engine in iFiles ) + { + engine.UnloadAll(); + } + } + + public bool IsLoaded( CodeSegDefinition aDefinition ) + { + bool ret = false; + // + foreach ( SymbolFileEngine engine in iFiles ) + { + if ( engine.IsLoaded( aDefinition ) ) + { + ret = true; + break; + } + } + // + return ret; + } + + public string SymbolFileName( int aIndex ) + { + return iFiles[ aIndex ].SymbolFileName; + } + #endregion + + #region Properties + public int SymbolFileCount + { + get { return iFiles.Count; } + } + + public GenericSymbolEngine SymbolFileEngineAt( int aIndex ) + { + return iFiles[ aIndex ]; + } + + public string[] BinaryFileNames + { + get + { + List fileNames = new List( AllSymbols.Count ); + // + foreach ( GenericSymbolCollection collection in AllSymbols ) + { + fileNames.Add( collection.HostBinaryFileName ); + } + // + return fileNames.ToArray(); + } + } + + public string[] SymbolFileNames + { + get + { + List fileNames = new List( iFiles.Count ); + // + foreach ( SymbolFileEngine engine in iFiles ) + { + fileNames.Add( engine.SymbolFileName ); + } + // + return fileNames.ToArray(); + } + } + + public SymbolsForBinaryCollection AllSymbols + { + get + { + SymbolsForBinaryCollection ret = new SymbolsForBinaryCollection(); + // + foreach ( SymbolFileEngine engine in iFiles ) + { + ret.Add( engine.AllSymbols ); + } + // + return ret; + } + } + #endregion + + #region From GenericSymbolEngine + public override void Reset() + { + iFiles.Clear(); + } + + public override bool IsLoaded( string aFileName ) + { + SymbolFileEngine engine = EngineByFileName( aFileName ); + return engine != null; + } + + public override bool IsReady + { + get + { + int readyCount = 0; + // + foreach ( SymbolFileEngine engine in iFiles ) + { + if ( engine.IsReady ) + { + ++readyCount; + } + } + // + return ( readyCount == iFiles.Count ); + } + } + + public override GenericSymbolCollection this[ int aIndex ] + { + get + { + GenericSymbolCollection ret = null; + // + foreach ( SymbolFileEngine engine in iFiles ) + { + int count = engine.NumberOfCollections; + if ( aIndex < count ) + { + ret = engine[ aIndex ]; + break; + } + else + { + aIndex -= count; + } + } + // + return ret; + } + } + + public override AddressRange Range + { + get + { + AddressRange ret = new AddressRange(); + // + foreach ( SymbolFileEngine engine in iFiles ) + { + ret.Update( engine.Range ); + } + // + return ret; + } + } + + internal override void UnloadUntagged() + { + + } + #endregion + + #region From IGenericSymbolCollectionStatisticsInterface + public override int NumberOfCollections + { + get + { + int count = 0; + // + foreach ( SymbolFileEngine engine in iFiles ) + { + count += engine.NumberOfCollections; + } + // + return count; + } + } + #endregion + + #region Event handlers + private void SymbolEngine_ObserverProxy( SymbianUtils.AsyncReaderBase.TEvent aEvent, SymbianUtils.AsyncReaderBase aSender ) + { + if ( Observer != null ) + { + Observer( aEvent, aSender ); + } + } + #endregion + + #region Internal methods + private SymbolFileEngine EngineByFileName( string aFileName ) + { + SymbolFileEngine ret = null; + // + foreach ( SymbolFileEngine engine in iFiles ) + { + if ( engine.SymbolFileName.ToLower() == aFileName.ToLower() ) + { + ret = engine; + break; + } + } + // + return ret; + } + #endregion + + #region Data members + private readonly SymbolFileEngine.TActivationType iActivationType; + private readonly bool iAllowNonRomSymbols; + private List iFiles = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/File/SymbolsForBinary.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/File/SymbolsForBinary.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,611 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using SymbianUtils; +using SymbianUtils.Range; +using SymbolLib.Generics; +using SymbolLib.Sources.Symbol.Symbol; + +namespace SymbolLib.Sources.Symbol.File +{ + public class SymbolsForBinary : GenericSymbolCollection + { + #region Construct & destruct + public SymbolsForBinary( string aHostFileName ) + : base( aHostFileName ) + { + // Add default unknown entry + SymbolSymbol nullEntry = SymbolSymbol.NewUnknown( this ); + iEntries.Add( nullEntry ); + } + #endregion + + #region Properties + internal GenericSymbol InternalLastSymbol + { + get + { + // We don't want to return the last symbol + GenericSymbol ret = base.LastSymbol; + // + if ( ret != null && ret.IsUnknownSymbol ) + { + ret = null; + } + // + return ret; + } + } + #endregion + + #region API + internal void Add( GenericSymbolEngine aEngine, GenericSymbol aSymbol, bool aAllowNonRomSymbols ) + { + System.Diagnostics.Debug.Assert( aSymbol is SymbolSymbol ); + + // Check for Image$$ER_RO$$Base or Image$$ER_RO$$Limit. + // This symbol is emitted for user-side code and can be used to work around some maksym problems. + string symbolName = aSymbol.Symbol; + if ( symbolName.StartsWith( KSymbolNameImageBaseOrLimitPrefix ) ) + { + bool isBase = symbolName.Contains( "Base" ); + + // If we've just seen the base entry, but we already have some stored symbols, then + // probably this is a maksym problem that we must try to work around. + if ( isBase ) + { + int count = iEntries.Count; + if ( count > 0 && !iEntries[ 0 ].IsUnknownSymbol ) + { + // Discard all the entries we've seen so far because most likely + // they are invalid. + System.Diagnostics.Debug.WriteLine( string.Format( "Discarding {0} invalid symbols for library: {1}", count, base.HostBinaryFileName ) ); + iEntries.Clear(); + + // At this point, we need to reset the base address because any symbols that have gone + // before are invalid. + iFlags &= ~TFlags.EFlagsHaveSeenFirstSymbol; + } + } + else + { + // Reached the limit - stop storing symbols at this point as everything else is likely data. + iFlags |= TFlags.EFlagsDisallowFurtherSymbolsForCollection; + } + } + + // Don't save the entry if we're in disabled state. + bool newAdditionsDisabled = ( iFlags & TFlags.EFlagsDisallowFurtherSymbolsForCollection ) == TFlags.EFlagsDisallowFurtherSymbolsForCollection; + if ( !newAdditionsDisabled ) + { + // Whether or not we keep the entry + bool addEntry = false; + + // Set base address + UpdateCollectionBaseAddressBasedUponFirstSymbol( aSymbol ); + + GenericSymbol lastSymbol = InternalLastSymbol; + if ( lastSymbol != null ) + { + if ( lastSymbol.Address > aSymbol.Address ) + { + // Work-around for maksym problem where it fails to parse some MAP files correctly. + } + else + { + // If we have a last symbol, and it's address is prior to that of the new symbol, we can + // try to update the last symbol's size (if it needs it updating - the method will check that). + UpdateLengthOfPreviousSymbol( aSymbol ); + + // Check to see if we already have a symbol within this address range + bool overlappingSymbol = LastSymbolSharesSameAddressRange( aSymbol ); + if ( overlappingSymbol ) + { + // They overlap - which one do we keep? + addEntry = FilterOutCommonAddressEntry( lastSymbol, aSymbol ); + } + else + { + addEntry = TakeEntry( aSymbol, aAllowNonRomSymbols ); + } + } + } + else + { + addEntry = TakeEntry( aSymbol, aAllowNonRomSymbols ); + } + + // If we need to keep the symbol, then save it now... + if ( addEntry ) + { + DoAddEntry( aSymbol ); + } + } + } + + internal void Fixup( long aNewBaseAddress ) + { + BaseAddress = aNewBaseAddress; + if ( aNewBaseAddress != 0 ) + { + iFlags |= TFlags.EFlagsHaveDoneFixup; + } + + base.RebuildAddressRange(); + } + #endregion + + #region From GenericSymbolCollection + public override void WriteToStream( StreamWriter aWriter ) + { + if ( ( iFlags & TFlags.EFlagsHaveDoneFixup ) == TFlags.EFlagsHaveDoneFixup ) + { + long originalBaseAddress = BaseAddress; + try + { + // For fixed up symbol collections, i.e. those with a base address of zero + // that have subsequently been fixed up at runtime (rofs) then we + // must ensure we write base addresses of zero again when externalising + // the symbol data. + BaseAddress = 0; + base.WriteToStream( aWriter ); + } + finally + { + BaseAddress = originalBaseAddress; + } + } + else + { + base.WriteToStream( aWriter ); + } + } + + public override void Add( GenericSymbolEngine aEngine, GenericSymbol aSymbol ) + { + Add( aEngine, aSymbol, true ); + } + + public override void Remove( GenericSymbol aSymbol ) + { + iEntries.Remove( aSymbol ); + } + + public override void RemoveAt( int aIndex ) + { + iEntries.RemoveAt( aIndex ); + } + + public override int Count + { + get + { + return iEntries.Count; + } + } + + public override void Sort() + { + iEntries.Sort( new GenericSymbolComparer() ); +#if PROFILING + System.DateTime startTime = DateTime.Now; + System.DateTime endTime = DateTime.Now; + long tickDuration = ( ( endTime.Ticks - startTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( "SORT TIME " + tickDuration.ToString( "d6" ) ); +#endif + } + + public override GenericSymbol SymbolForAddress( long aAddress ) + { +#if DEBUG + int x = 0; + if ( x > 0 ) + { + base.Dump( aAddress ); + } +#endif + GenericSymbol ret = null; + // + AddressFindingComparer comparer = new AddressFindingComparer(); + SymbolSymbol temp = SymbolSymbol.NewUnknown( (uint) aAddress, 0, string.Empty ); + int pos = iEntries.BinarySearch( temp, comparer ); + if ( pos >= 0 && pos < iEntries.Count ) + { + ret = iEntries[ pos ]; + System.Diagnostics.Debug.Assert( ret.AddressRange.Contains( aAddress ) ); + } + // + return ret; + } + + public override IEnumerator CreateEnumerator() + { + IEnumerator self = (IEnumerator) this; + return self; + } + + public override IEnumerator CreateGenericEnumerator() + { + foreach ( GenericSymbol sym in iEntries ) + { + yield return sym; + } + } + + public override GenericSymbol this[ int aIndex ] + { + get + { + return iEntries[ aIndex ]; + } + } + #endregion + + #region Internal enumerations + [Flags] + private enum TFlags + { + EFlagsNone = 0, + EFlagsCalculateLengthOfPreviousSymbol = 1, + EFlagsDisallowFurtherSymbolsForCollection = 2, + EFlagsHaveSeenFirstSymbol = 4, + EFlagsHaveDoneFixup = 8 + } + #endregion + + #region Internal constants + private const string KSymbolNameImageBaseOrLimitPrefix = "Image$$ER_RO$$"; + private const long KMaxDifferenceBetweenConsecutiveSymbols = 1024 * 64; + #endregion + + #region Internal methods + private void UpdateCollectionBaseAddressBasedUponFirstSymbol( GenericSymbol aSymbol ) + { + // If we are not processing the first Symbol in the collection, then we + // can rely on the base address being set. Otherwise, we are + // defining the base address itself. + if ( !( ( iFlags & TFlags.EFlagsHaveSeenFirstSymbol ) == TFlags.EFlagsHaveSeenFirstSymbol ) ) + { + // Set collection base address to symbol starting address + BaseAddress = aSymbol.Address; + + // Since this is the first symbol in the collection, and we're going to use + // its address as the offset (base) address for the entire collection, + // if we just set the collection base address to the symbol's address and + // the continue, this entry will be double offset (the new offset for the collection + // + the offset of the symbol itself). We must therefore set the symbol's offset + // address to zero. + SymbolSymbol realSymbol = (SymbolSymbol) aSymbol; + realSymbol.ResetOffsetAddress( 0 ); + + // Make sure we set a flag so that we don't attempt to do this again. + iFlags |= TFlags.EFlagsHaveSeenFirstSymbol; + } + } + + private void UpdateLengthOfPreviousSymbol( GenericSymbol aNewSymbol ) + { + bool clearFlag = false; + // + if ( ( iFlags & TFlags.EFlagsCalculateLengthOfPreviousSymbol ) == TFlags.EFlagsCalculateLengthOfPreviousSymbol ) + { + // Must have some existing symbol. + System.Diagnostics.Debug.Assert( Count > 0 ); + + // Last symbol must have bad size? + GenericSymbol previousSymbol = InternalLastSymbol; + System.Diagnostics.Debug.Assert( previousSymbol.Size == 0 ); + + // The new symbol must be exactly the same address as the last symbol + // (in which case, the new symbol must have a valid size or else we're + // unable to do anything sensible with it) + // + // OR + // + // The new symbol must be after the last symbol. It cannot be before. + System.Diagnostics.Debug.Assert( aNewSymbol.Address >= previousSymbol.Address ); + if ( aNewSymbol.Address == previousSymbol.Address ) + { + if ( aNewSymbol.Size > 0 ) + { + // Okay, the new symbol has a valid size, the old one didn't. + clearFlag = true; + previousSymbol.Size = aNewSymbol.Size; + } + else + { + // Hmm, neither the last or new symbol have a valid size. + // Nothing we can do in this case... + } + } + else + { + // Need to work out the length of the previous symbol by comparing the + // address of this symbol against it. + // + // Only do this if the region type hasn't changed. + MemoryModel.TMemoryModelRegion previousType = MemoryModel.RegionByAddress( previousSymbol.Address, aNewSymbol.MemoryModelType ); + MemoryModel.TMemoryModelRegion regionType = MemoryModel.RegionByAddress( aNewSymbol.Address, aNewSymbol.MemoryModelType ); + if ( regionType == previousType ) + { + // If this new symbol and the old symbol have the same address, then + // also check the size of the previous symbol. If it was zero, then discard it + // and keep this new entry. Otherwise, discard this new one instead. + long delta = aNewSymbol.Address - previousSymbol.Address; + if ( delta > 1 ) + { + // It's okay, this symbol had a later address than the last one + // This is normal. + previousSymbol.Size = delta; + } + else + { + // This is not good. Two symbols both have the same address. + iEntries.Remove( previousSymbol ); + } + } + + clearFlag = true; + } + } + + if ( clearFlag ) + { + iFlags &= ~TFlags.EFlagsCalculateLengthOfPreviousSymbol; + } + } + + private void DoAddEntry( GenericSymbol aSymbol ) + { + // Make sure we remove the null symbol if this is the first 'valid' symbol for + // the collection. + if ( OnlyContainsDefaultSymbol ) + { + RemoveAt( 0 ); + } + + // If the symbol has no size, then try to work it out next time around + if ( aSymbol.Size == 0 ) + { + iFlags |= TFlags.EFlagsCalculateLengthOfPreviousSymbol; + } + + // Save it + iEntries.Add( aSymbol ); + } + + private bool LastSymbolSharesSameAddressRange( GenericSymbol aSymbol ) + { + bool ret = false; + // + GenericSymbol last = InternalLastSymbol; + if ( last != null && last.FallsWithinDomain( aSymbol.Address ) ) + { + ret = true; + } + // + return ret; + } + + private bool FilterOutCommonAddressEntry( GenericSymbol aLast, GenericSymbol aNew ) + { + bool acceptNew = false; + // + if ( aLast.IsUnknownSymbol ) + { + // Always discard the unknown symbol in preference of anything better + iEntries.Remove( aLast ); + acceptNew = true; + } + else if ( aNew.Size > 0 ) + { + if ( aLast.Size == 0 ) + { + // New is 'better' because it contains proper sizing information + iEntries.Remove( aLast ); + acceptNew = true; + } + else if ( aLast.Size < aNew.Size ) + { + // New is 'better' because it is bigger + iEntries.Remove( aLast ); + acceptNew = true; + } + else if ( aLast.Size == aNew.Size ) + { + // Both the same size. Take symbols over everything else. + if ( aNew.IsSymbol && !aLast.IsSymbol ) + { + // Keep the symbol (new) + iEntries.Remove( aLast ); + acceptNew = true; + } + else if ( !aNew.IsSymbol && aLast.IsSymbol ) + { + // Keep the symbol (last) + acceptNew = false; + } + else + { + // Take higher priority... + if ( aNew.AddressType > aLast.AddressType ) + { + iEntries.Remove( aLast ); + acceptNew = true; + } + else + { + acceptNew = false; + } + } + } + } + else if ( aLast.Size > 0 ) + { + // Last is 'better' because the new entry doesn't have any size + acceptNew = false; + } + else if ( aLast.Size == 0 && aNew.Size == 0 ) + { + // Both entries have no size and the same address. We cannot + // accept both, therefore we make an arbitrary decision about + // which to keep. + if ( aLast.IsSubObject && !aNew.IsSubObject ) + { + // Discard the sub object (last) + iEntries.Remove( aLast ); + acceptNew = true; + } + else if ( aNew.IsSubObject && !aLast.IsSubObject ) + { + // Discard the sub object (new) + acceptNew = false; + } + else if ( aNew.IsSymbol && !aLast.IsSymbol ) + { + // Keep the symbol (new) + iEntries.Remove( aLast ); + acceptNew = true; + } + else if ( !aNew.IsSymbol && aLast.IsSymbol ) + { + // Keep the symbol (last) + acceptNew = false; + } + else + { + // Couldn't make a good decision. Junk the new entry + acceptNew = false; + } + } + // + return acceptNew; + } + + private bool IsEntryReallyData( GenericSymbol aSymbol ) + { + bool isData = false; + + // Check to see if its from a data= IBY entry... + string baseName = Path.GetFileName( HostBinaryFileName ).ToLower(); + string symbolName = aSymbol.Symbol.ToLower(); + + if ( symbolName == baseName && aSymbol.Size == 0 ) + { + // Its from a data entry + isData = true; + + // Data entries only consist of a single symbol (the data itself) + iFlags |= TFlags.EFlagsDisallowFurtherSymbolsForCollection; + } + + return isData; + } + + private bool TakeEntry( GenericSymbol aSymbol, bool aAllowNonRomSymbols ) + { + bool take = IsEntryReallyData( aSymbol ); + + if ( !take ) + { + // We'll take the entry if all we have at the moment is + // the default entry or then no entries at all. + if ( OnlyContainsDefaultSymbol || iEntries.Count == 0 ) + { + take = true; + } + else + { + GenericSymbol last = LastSymbol; + System.Diagnostics.Debug.Assert( last != null ); + GenericSymbol.TAddressType addressType = aSymbol.AddressType; + // + switch ( addressType ) + { + // We always take these... + case GenericSymbol.TAddressType.EAddressTypeROMSymbol: + take = true; + break; + + // We sometimes take these... + case GenericSymbol.TAddressType.EAddressTypeRAMSymbol: + take = aAllowNonRomSymbols; + break; + + case GenericSymbol.TAddressType.EAddressTypeLabel: + take = true; + break; + case GenericSymbol.TAddressType.EAddressTypeSubObject: + take = ( aSymbol.Size > 0 ) || ( last.EndAddress < aSymbol.Address ); + break; + + // We never take these + default: + case GenericSymbol.TAddressType.EAddressTypeReadOnlySymbol: + case GenericSymbol.TAddressType.EAddressTypeUnknown: + case GenericSymbol.TAddressType.EAddressTypeKernelGlobalVariable: + break; + } + } + } + // + return take; + } + + private bool OnlyContainsDefaultSymbol + { + get + { + bool ret = ( Count == 1 && this[ 0 ].IsUnknownSymbol ); + return ret; + } + } + #endregion + + #region Data members + private TFlags iFlags = TFlags.EFlagsNone; + private List iEntries = new List( 200 ); + #endregion + } + + #region Internal classes + internal class AddressFindingComparer : IComparer + { + public int Compare( GenericSymbol aLeft, GenericSymbol aRight ) + { + int ret = -1; + // + AddressRange lr = aLeft.AddressRange; + AddressRange rr = aRight.AddressRange; + // + if ( lr.Contains( rr ) || rr.Contains( lr ) ) + { + ret = 0; + } + else + { + ret = lr.CompareTo( rr ); + } + // + return ret; + } + } + #endregion +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Parser/SymbolFileParser.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Parser/SymbolFileParser.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,240 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using SymbianUtils; +using SymbianUtils.Tracer; +using SymbolLib.Generics; +using SymbolLib.Sources.Symbol.File; +using SymbolLib.Sources.Symbol.Engine; +using SymbolLib.Sources.Symbol.Symbol; +using SymbolLib.Sources.Symbol.Collection; + +namespace SymbolLib.Sources.Symbol.Parser +{ + #region SymbolCollectionCreator interface + internal interface SymbolCollectionCreator + { + SymbolsForBinary CreateCollection( string aHostFileName ); + } + #endregion + + #region SymbolEntryCreator interface + internal interface SymbolEntryCreator + { + SymbolSymbol CreateSymbol(); + } + #endregion + + internal class SymbolFileParser : AsyncTextFileReader + { + #region Delegates & events + public delegate void CollectionCreatedHandler( SymbolsForBinary aCollection ); + public event CollectionCreatedHandler CollectionCreated; + + public delegate bool CollectionCompletedHandler( SymbolsForBinary aCollection ); + public event CollectionCompletedHandler CollectionCompleted; + + public delegate void SymbolCreatedHandler( SymbolSymbol aSymbol ); + public event SymbolCreatedHandler SymbolCreated; + #endregion + + #region Constructors + internal SymbolFileParser( SymbolCollectionCreator aCollectionCreator, SymbolEntryCreator aEntryCreator, string aFileName, ITracer aTracer ) + : base( aFileName, aTracer ) + { + iCollectionCreator = aCollectionCreator; + iEntryCreator = aEntryCreator; + } + #endregion + + #region Constants + public const bool KCollectionCompletedAndAbortParsing = false; + public const bool KCollectionCompletedAndContinueParsing = true; + #endregion + + #region Parsing API + public void Read( TSynchronicity aSynchronicity ) + { + base.StartRead( aSynchronicity ); + } + #endregion + + #region Properties + public bool ContainedAtLeastOneCollectionFileName + { + get { return iContainedAtLeastOneCollectionFileName; } + } + #endregion + + #region From AsyncTextReader + protected override bool ImmediateAbort() + { + return iImmediateAbort; + } + + protected override void HandleReadStarted() + { +#if PROFILING + System.DateTime startTime = DateTime.Now; + + using ( System.IO.StreamReader reader = new StreamReader( this.FileName ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + line = reader.ReadLine(); + } + } + + System.DateTime endTime = DateTime.Now; + long tickDuration = ( ( endTime.Ticks - startTime.Ticks ) / 100 ); + System.Diagnostics.Debug.WriteLine( "SIMPLE READ COMPLETE - " + tickDuration.ToString( "d6" ) ); +#endif + + base.HandleReadStarted(); + } + + protected override void HandleFilteredLine( string aLine ) + { + if ( aLine != null ) + { + int len = aLine.Length; + if ( len > 5 && aLine.Substring( 0, 5 ) == "From " ) + { + aLine = aLine.Substring( 5 ).TrimStart(); + HandleStartOfNewCollection( aLine ); + } + else + { + HandleSymbolLine( aLine ); + } + } + } + + protected override void HandleReadCompleted() + { + try + { + OnCollectionCompleted( iCurrentCollection ); + } + finally + { + base.HandleReadCompleted(); + } + } + + protected override void HandleReadException( Exception aException ) + { + base.HandleReadException( aException ); + // + System.Windows.Forms.MessageBox.Show( aException.StackTrace, aException.Message ); + } + #endregion + + #region Internal methods + private void OnCollectionCreated( SymbolsForBinary aCollection ) + { + if ( CollectionCreated != null && aCollection != null ) + { + CollectionCreated( aCollection ); + } + } + + private void OnCollectionCompleted( SymbolsForBinary aCollection ) + { + if ( CollectionCompleted != null && aCollection != null ) + { + // If returns immediate abort then we will stop parsing + // straight away. + iImmediateAbort = ( CollectionCompleted( aCollection ) == KCollectionCompletedAndAbortParsing ); + } + } + + private void HandleStartOfNewCollection( string aHostFileName ) + { + // Current collection is now complete + OnCollectionCompleted( iCurrentCollection ); + + // We will create the new collection once we see the first symbol + iCurrentCollection = null; + + // Cache the name of the new collection + iCurrentCollectionHostFileName = aHostFileName; + + // We've seen at least one "From" line. + iContainedAtLeastOneCollectionFileName = true; + } + + private void HandleSymbolLine( string aLine ) + { + try + { + // If we have not yet made a collection for this symbol, then do so now + CreateNewCollection(); + + SymbolSymbol entry = iEntryCreator.CreateSymbol(); + bool entryOk = entry.Parse( aLine ); + if ( entryOk && SymbolCreated != null ) + { + + // Notify that we created a symbol + SymbolCreated( entry ); + } + } + catch( GenericSymbolicCreationException ) + { +#if TRACE + System.Diagnostics.Debug.WriteLine( "SymbolParseException: " + aLine ); +#endif + } + } + + private void CreateNewCollection() + { + if ( iCurrentCollection == null ) + { + System.Diagnostics.Debug.Assert( !string.IsNullOrEmpty( iCurrentCollectionHostFileName ) ); + + // Combine symbol file drive letter with binary name from the symbol file itself. + string hostBinaryFileName = Path.GetPathRoot( base.FileName ); + if ( iCurrentCollectionHostFileName.StartsWith( @"\" ) ) + { + iCurrentCollectionHostFileName = iCurrentCollectionHostFileName.Substring( 1 ); + } + hostBinaryFileName = Path.Combine( hostBinaryFileName, iCurrentCollectionHostFileName ); + + iCurrentCollection = iCollectionCreator.CreateCollection( hostBinaryFileName ); + OnCollectionCreated( iCurrentCollection ); + iCurrentCollectionHostFileName = string.Empty; + } + } + #endregion + + #region Data members + private SymbolsForBinary iCurrentCollection = null; + private readonly SymbolEntryCreator iEntryCreator; + private readonly SymbolCollectionCreator iCollectionCreator; + private bool iImmediateAbort = false; + private string iCurrentCollectionHostFileName = string.Empty; + private bool iContainedAtLeastOneCollectionFileName = false; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Symbol/SymbolSymbol.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Sources/Symbol/Symbol/SymbolSymbol.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,172 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text.RegularExpressions; +using SymbolLib.Generics; +using SymbolLib.Sources.Symbol.File; + +namespace SymbolLib.Sources.Symbol.Symbol +{ + public class SymbolSymbol : GenericSymbol + { + #region Constructors + public static SymbolSymbol New( GenericSymbolCollection aCollection ) + { + return new SymbolSymbol( aCollection ); + } + + public static SymbolSymbol NewUnknown() + { + return NewUnknown( new SymbolsForBinary( string.Empty ) ); + } + + public static SymbolSymbol NewUnknown( uint aAddress, uint aSize, string aObject ) + { + SymbolSymbol ret = NewUnknown(); + // + ret.OffsetAddress = aAddress; + ret.Size = aSize; + ret.Object = aObject; + // + return ret; + } + + public static SymbolSymbol NewUnknown( GenericSymbolCollection aCollection ) + { + SymbolSymbol symbol = new SymbolSymbol( aCollection ); + // + symbol.OffsetAddress = GenericSymbol.KNullEntryAddress; + symbol.Symbol = GenericSymbol.KNonMatchingSymbolName; + if ( aCollection.HostBinaryFileName.Length > 0 ) + { + symbol.Object = Path.GetFileName( aCollection.HostBinaryFileName ); + } + else + { + symbol.Object = GenericSymbol.KNonMatchingObjectName; + } + // + return symbol; + } + #endregion + + #region Internal constructors + private SymbolSymbol( GenericSymbolCollection aCollection ) + : base( aCollection ) + { + } + + private SymbolSymbol( string aSymbolName ) + : this( aSymbolName, 0 ) + { + } + + private SymbolSymbol( string aSymbolName, uint aAddress ) + : base( new SymbolsForBinary( string.Empty ) ) + { + Symbol = aSymbolName; + OffsetAddress = aAddress; + } + #endregion + + #region API + public void ResetOffsetAddress( long aOffset ) + { + // This resets the offset address + OffsetAddress = aOffset; + + // This resets the OffsetEndAddress + Size = Size; + } + #endregion + + #region From GenericSymbol + public override bool Parse( string aLine ) + { + bool ret = false; + // + Match m = KSimpleSymbolRegEx.Match( aLine ); + if ( m.Success ) + { + ret = ExtractFromMatch( m ); + } + // + return ret; + } + + public override TSourceType SourceType + { + get { return GenericSymbol.TSourceType.ESourceTypeFileSymbol; } + } + #endregion + + #region Internal methods + private bool ExtractFromMatch( Match aMatch ) + { + bool ret = false; + // + long baseAddress = Collection.BaseAddress; + long address = uint.Parse( aMatch.Groups[ "Address" ].Value, System.Globalization.NumberStyles.HexNumber ); + long offsetAddress = address - baseAddress; + if ( address < baseAddress ) + { + ret = false; + } + else + { + OffsetAddress = offsetAddress; + Size = uint.Parse( aMatch.Groups[ "Size" ].Value, System.Globalization.NumberStyles.HexNumber ); + + string symbolAndObject = aMatch.Groups[ "SymbolAndObject" ].Value; + ParseSymbolText( symbolAndObject ); + + System.Diagnostics.Debug.Assert( Address >= 0 ); + System.Diagnostics.Debug.Assert( Address <= EndAddress ); + + ret = true; + } + // + return ret; + } + #endregion + + #region Internal constants + private static readonly Regex KSimpleSymbolRegEx = new Regex( "(?
[A-Fa-f0-9]{8}) \\s+ (?[A-Fa-f0-9]{4,}) \\s+ (?.+)", + RegexOptions.CultureInvariant + | RegexOptions.Compiled + ); + #endregion + + #region Internal methods + protected void ParseSymbolText( string aText ) + { + int splitPos = aText.LastIndexOf( ' ' ); + if ( splitPos > 0 ) + { + Symbol = aText.Substring( 0, splitPos ).TrimEnd(); + Object = aText.Substring( splitPos ).TrimStart(); + } + else + { + Symbol = aText; + Object = string.Empty; + } + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/SymbolLib.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/SymbolLib.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,215 @@ + + + Local + 9.0.30729 + 2.0 + {C657DF4B-FA67-47DD-89FC-A45583646184} + Debug + AnyCPU + + + + + SymbolLib + + + JScript + Grid + IE50 + false + Library + SymbolLib + OnBuildSuccess + + + + + + + 2.0 + + + bin\Debug\ + false + 285212672 + false + + + DEBUG;TRACE + + + true + 4096 + false + + + false + false + false + false + 4 + full + prompt + + + bin\Release\ + false + 285212672 + false + + + TRACE + + + false + 4096 + false + + + true + false + false + false + 4 + none + prompt + + + + System + + + System.Data + + + System.Drawing + + + System.Windows.Forms + + + System.XML + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + + + + + + Code + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + Code + + + Code + + + Code + + + Code + + + + Code + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + Code + + + Code + + + Code + + + + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/SymbolLib.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/SymbolLib.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ + + + 7.10.6030 + Debug + AnyCPU + + + + + + + 0 + ProjectFiles + 0 + + + false + false + false + false + false + + + Project + + + + + + + + + + + false + + + false + false + false + false + false + + + Project + + + + + + + + + + + false + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/SymbolLib.prjx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/SymbolLib.prjx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/SymbolLib.suo Binary file crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/SymbolLib.suo has changed diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Utils/SymbolAddressRange.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbolLib/Utils/SymbolAddressRange.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Collections.Generic; +using SymbolLib.Generics; +using SymbianUtils.Range; + +namespace SymbolLib.Utils +{ + public class SymbolAddressRange : AddressRangeCollection + { + #region Constructors + public SymbolAddressRange( GenericSymbolCollection aCollection ) + { + foreach ( GenericSymbol sym in aCollection ) + { + base.Add( sym.AddressRange ); + } + } + #endregion + + #region API + public bool IsWithinRange( long aValue ) + { + return base.Contains( (uint) aValue ); + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Common/Engine/CrashAnalyserEngine.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Common/Engine/CrashAnalyserEngine.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,75 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80} + Library + Properties + CrashAnalyserEngine + CrashAnalyserEngine + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + UserControl + + + CATab.cs + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8} + SymbianTree + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Common/Engine/Engine/CAEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Common/Engine/Engine/CAEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,177 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Reflection; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.Tracer; +using SymbianUtils.PluginManager; +using SymbianDebugLib.Engine; +using CrashAnalyserEngine.Plugins; +using CrashAnalyserEngine.Interfaces; + +namespace CrashAnalyserEngine.Engine +{ + public class CAEngine : DisposableObject, IEnumerable, ITracer + { + #region Constructors + public CAEngine( string[] aCommandLineArgs ) + { + iDebugEngine = new DbgEngine( this ); + iCommandLineArgs = aCommandLineArgs; + + // Create settings + iSettings = new XmlSettings( "CASettings.xml" ); + iSettings.Restore(); + } + #endregion + + #region API + #endregion + + #region Properties + public XmlSettings Settings + { + get { return iSettings; } + } + + public string[] CommandLineArguments + { + get { return iCommandLineArgs; } + } + + /// + /// The main debug engine instance is owned by the engine and is shared + /// amongst all that need it. + /// + public DbgEngine DebugEngine + { + get { return iDebugEngine; } + } + + public IEngineUIManager UIManager + { + get { return iUIManager; } + set + { + iUIManager = value; + + // Now we can create the sub-engines + LoadPlugins(); + } + } + + public CAPlugin this[ string aName ] + { + get + { + CAPlugin ret = null; + // + foreach ( CAPlugin plugin in iPlugins ) + { + string name = plugin.Name.ToUpper(); + if ( name == aName.ToUpper() ) + { + ret = plugin; + break; + } + } + // + return ret; + } + } + #endregion + + #region Internal methods + private void LoadPlugins() + { + object[] parameters = new object[ 1 ]; + parameters[ 0 ] = this; + // + iPlugins.Load( parameters ); + // + NotifyAllLoaded(); + } + + private void NotifyAllLoaded() + { + foreach ( CAPlugin plugin in iPlugins ) + { + plugin.AllPluginsLoaded(); + } + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + return iPlugins.GetEnumerator(); + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return iPlugins.GetEnumerator(); + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + if ( iUIManager != null ) + { + iUIManager.UITrace( aMessage ); + } + } + + public void Trace( string aFormat, params object[] aParams ) + { + Trace( string.Format( aFormat, aParams ) ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + if ( iPlugins != null ) + { + iPlugins.Unload(); + iPlugins = null; + } + // + iDebugEngine.Dispose(); + } + } + #endregion + + #region Data members + private readonly XmlSettings iSettings; + private readonly string[] iCommandLineArgs; + private readonly DbgEngine iDebugEngine; + private IEngineUIManager iUIManager = null; + private PluginManager iPlugins = new PluginManager(1); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Common/Engine/Interfaces/IEngineUIManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Common/Engine/Interfaces/IEngineUIManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using CrashAnalyserEngine.Tabs; + +namespace CrashAnalyserEngine.Interfaces +{ + public interface IEngineUIManager + { + /// + /// Add a menu item + /// + void UIManagerMenuItemAdd( TEngineUIMenuPane aPane, string aCaption, UIMenuItemClickHandler aClickHandler, object aTag ); + + /// + /// Add a menu item that is associated with a specific host element (usually an IToolStripHost) + /// + void UIManagerMenuItemAdd( TEngineUIMenuPane aPane, string aCaption, UIMenuItemClickHandler aClickHandler, object aTag, CATab aHost ); + + /// + /// Creates a new tab + /// + /// + void UIManagerContentAdd( CATab aTab ); + + /// + /// Removes a tab + /// + /// + void UIManagerContentClose( CATab aTab ); + + /// + /// Information about the runtime version + /// + Version UIVersion + { + get; + } + + /// + /// Command line arguments passed to runtime + /// + string UICommandLineArguments + { + get; + } + + /// + /// Whether the UI runs in silent mode + /// + bool UIIsSilent + { + get; + } + + void UITrace( string aMessage ); + + void UITrace( string aFormat, params object[] aParams ); + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Common/Engine/Interfaces/IEngineUIMenu.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Common/Engine/Interfaces/IEngineUIMenu.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace CrashAnalyserEngine.Interfaces +{ + public delegate void UIMenuItemClickHandler( object aTag, string aCaption ); + + public enum TEngineUIMenuPane + { + EFileSaveAs, + EFileNew + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Common/Engine/Plugins/CAPlugin.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Common/Engine/Plugins/CAPlugin.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Reflection; +using SymbianDebugLib.Engine; +using SymbianUtils.Settings; +using SymbianUtils.PluginManager; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Interfaces; + +namespace CrashAnalyserEngine.Plugins +{ + public abstract class CAPlugin + { + #region Enumerations + public enum TType + { + ETypeEngine = 0, + ETypeUi + } + #endregion + + #region Constructors + protected CAPlugin( CAEngine aEngine, string aName ) + { + iEngine = aEngine; + iName = aName; + } + #endregion + + #region Constants + public const int KErrCommandLineNone = 0; + public const int KErrCommandLineGeneral = -1; + public const int KErrCommandLinePluginNotFound = -2; + public const int KErrCommandLinePluginArgumentsMissing = -3; + public const int KErrCommandLinePluginArgumentsInvalid = -4; + public const int KErrCommandLinePluginArgumentsFileNotFound = -5; + public const int KErrCommandLinePluginArgumentsFileInvalid = -6; + public const int KErrCommandLinePluginSinkNotAvailable = -7; + #endregion + + #region Framework API + public virtual void AllPluginsLoaded() + { + } + + public virtual bool IsCommandLineHandler( string aName ) + { + return false; + } + + public virtual int RunCommandLineOperations() + { + return 0; + } + + public abstract TType Type + { + get; + } + #endregion + + #region API + #endregion + + #region Properties + public string Name + { + get { return iName; } + } + + public XmlSettings Settings + { + get { return iEngine.Settings; } + } + + public CAEngine UIEngine + { + get { return iEngine; } + } + + public IEngineUIManager UIManager + { + get { return UIEngine.UIManager; } + } + + public DbgEngine DebugEngine + { + get { return iEngine.DebugEngine; } + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region Data members + private readonly CAEngine iEngine; + private readonly string iName; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Common/Engine/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Common/Engine/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "52bd461c-646f-4948-9cc7-ef98bed8181e" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Common/Engine/Tabs/CATab.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Common/Engine/Tabs/CATab.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CrashAnalyserEngine.Tabs +{ + partial class CATab + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Component Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + } + + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Common/Engine/Tabs/CATab.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Common/Engine/Tabs/CATab.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; + +namespace CrashAnalyserEngine.Tabs +{ + public partial class CATab : UserControl + { + #region Constructors + protected CATab() + { + InitializeComponent(); + } + #endregion + + #region Properties + [Category( "Tab" )] + public string Title + { + get { return base.Text; } + set { base.Text = value; } + } + #endregion + + #region Framework methods + protected virtual void RegisterMenuItems() + { + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private string iTitle = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Console/CACommandLineEntryPoint.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Console/CACommandLineEntryPoint.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Plugins; +using SymbianUtils.FileSystem; +using SymbianUtils.FileSystem.Utilities; + +namespace CrashAnalyserConsole +{ + class EntryPoint + { + static int Main( string[] aArguments ) + { + int error = 0; + // + using ( FSLog log = new FSLog( true ) ) + { + try + { + FSUtilities.ClearTempPath(); + // + CACommandLineUI commandLineUi = new CACommandLineUI( aArguments, log ); + error = commandLineUi.Run(); + // + if ( error != CrashAnalyserEngine.Plugins.CAPlugin.KErrCommandLineNone ) + { + SymbianUtils.SymDebug.SymDebugger.Break(); + } + } + catch ( Exception e ) + { + log.TraceAlways( "CrashAnalyserConsole.Main() - EXCEPTION: " + e.Message ); + log.TraceAlways( "CrashAnalyserConsole.Main() - STACK: " + e.StackTrace ); + SymbianUtils.SymDebug.SymDebugger.Break(); + error = -1; + } + // + if ( error != 0 ) + { + log.TraceAlways( "CA completed with error: " + error ); + } + } + + if ( System.Diagnostics.Debugger.IsAttached ) + { + System.Console.Write( "PRESS ANY KEY" ); + System.Console.ReadKey(); + } + // + return error; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Console/CACommandLineUI.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Console/CACommandLineUI.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,210 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using System.Data; +using CrashAnalyserEngine.Tabs; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Interfaces; +using CrashAnalyserEngine.Plugins; +using SymbianXmlInputLib.Elements; +using SymbianXmlInputLib.Parser; +using SymbianXmlInputLib.Parser.Nodes; +using SymbianUtils.FileSystem; + +namespace CrashAnalyserConsole +{ + internal class CACommandLineUI : IEngineUIManager + { + #region Constructors & destructor + public CACommandLineUI( string[] aArguments, FSLog aLog ) + { + iLog = aLog; + + // Create engine + iEngine = new CAEngine( aArguments ); + + // Work out if we are in verbose mode + CheckArgsForVerbose(); + + // Associate engine and UI with one another - this causes + // plugins to be loaded + iEngine.UIManager = this; + } + #endregion + + #region API + public int Run() + { + iLog.TraceAlways( "[CmdExe] Run() - START" ); + int error = CAPlugin.KErrCommandLineNone; + // + CAPlugin plugin = LocatePlugin(); + iLog.TraceAlways( "[CmdExe] Run() - plugin: " + plugin ); + if ( plugin != null ) + { + iLog.TraceAlways( "[CmdExe] Run() - executing plugin command line operations..." ); + error = plugin.RunCommandLineOperations(); + } + else + { + iLog.TraceAlways( "[CmdExe] Run() - plugin not found!" ); + error = CAPlugin.KErrCommandLinePluginNotFound; + } + // + iLog.TraceAlways( "[CmdExe] Run() - END - error: " + error ); + return error; + } + #endregion + + #region Properties + public bool Verbose + { + get { return iLog.Verbose; } + private set + { + iLog.Verbose = value; + iLog.TraceAlways( "[CmdExe] Verbose Mode: " + value.ToString() ); + } + } + #endregion + + #region IEngineUIManager Members + public void UIManagerMenuItemAdd( TEngineUIMenuPane aPane, string aCaption, UIMenuItemClickHandler aClickHandler, object aTag ) + { + } + + public void UIManagerMenuItemAdd( TEngineUIMenuPane aPane, string aCaption, UIMenuItemClickHandler aClickHandler, object aTag, CATab aHost ) + { + } + + public void UIManagerContentAdd( CATab aTab ) + { + } + + public void UIManagerContentClose( CATab aTab ) + { + } + + public Version UIVersion + { + get { return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; } + } + + public string UICommandLineArguments + { + get { return Environment.CommandLine; } + } + + public bool UIIsSilent + { + get { return true; } + } + + public void UITrace( string aMessage ) + { + iLog.Trace( aMessage ); + } + + public void UITrace( string aFormat, params object[] aParams ) + { + string msg = string.Format( aFormat, aParams ); + UITrace( msg ); + } + #endregion + + #region Internal constants + private const string KParamVerbose = "-V"; + private const string KParamPlugin = "-PLUGIN"; + #endregion + + #region Internal methods + private void CheckArgsForVerbose() + { + string[] args = iEngine.CommandLineArguments; + for ( int i = 0; i < args.Length; i++ ) + { + string cmd = args[ i ].Trim().ToUpper(); + string nextArg = ( i < args.Length - 1 ? args[ i + 1 ].Trim().ToUpper() : string.Empty ); + // + try + { + if ( cmd == KParamVerbose ) + { + Verbose = true; + break; + } + } + catch ( Exception ) + { + } + } + } + + private CAPlugin LocatePlugin() + { + // -nogui -plugin CRASH_ANALYSIS -input d:\ca_fullsummary.xml + CAPlugin ret = null; + // + string[] args = iEngine.CommandLineArguments; + for( int i=0; i + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8} + Exe + Properties + CrashAnalyserConsole + CrashAnalyserConsole + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {56ECA873-7D1D-45E7-A583-A5388D753321} + SymbianXmlInputLib + + + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80} + CrashAnalyserEngine + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Console/CrashAnalyserConsole.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Console/CrashAnalyserConsole.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,8 @@ + + + C:\Tool Demo Files\2. Crash Data\File71 - Sys Core Dump\User + -plugin CRASH_ANALYSIS -input input.xml -PROGRESS + Project + d:\My Documents\Visual Studio 2008\Apps\CrashAnalyser\App\bin\Debug\CrashAnalyserConsole.exe + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Console/CrashAnalyserConsole.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Console/CrashAnalyserConsole.sln Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,422 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashAnalyserConsole", "CrashAnalyserConsole.csproj", "{C723AA40-3F22-4E77-92FB-437C5C2F0BD8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debug Library", "Debug Library", "{2732FBB1-E515-4DDA-A70A-B34CE869CB21}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{604FB4F9-0C98-4D20-BF2E-C4D0898B1B7F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{268835BA-8944-490B-8675-31E7F85176A5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{87A37075-51F6-4D05-9D22-756AEA611F60}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PerfToolsSharedLibraries", "PerfToolsSharedLibraries", "{22667FF0-120A-480C-BF4D-1E4939C89F22}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{D8DAA636-2E62-4CDC-98A9-29523D296FEC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{C1B06919-BC36-4022-8E2D-823676328271}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianUtils", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianUtils\SymbianUtils.csproj", "{F6F4CE69-E73A-4917-97ED-B114DE90C92E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SymbianNativeTools", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianNativeTools\SymbianNativeTools.vcproj", "{34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianParserLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianParserLib\SymbianParserLib.csproj", "{925A4DB0-85BD-4157-933F-5BFB93FB4DA1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianXmlInputLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianXmlInputLib\SymbianXmlInputLib.csproj", "{56ECA873-7D1D-45E7-A583-A5388D753321}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianCodeLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianCodeLib\SymbianCodeLib.csproj", "{A041EDFE-A120-4100-A0A6-FB1984D80815}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\SymbianStackLib.csproj", "{3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStructuresLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStructuresLib\SymbianStructuresLib.csproj", "{D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianTree", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianTree\SymbianTree.csproj", "{2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "File Formats", "File Formats", "{4B8FB099-C9F4-442B-B132-7F0DD4D77E07}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashItemLib", "..\..\Libraries\Engine\CrashItemLib\CrashItemLib.csproj", "{A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engines", "Engines", "{17F16EB8-BCD2-4272-B5F0-BC0E4B143CDD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{891FA26E-4F8F-4CF5-A638-A2B5D101846B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DExcPlugin", "..\..\Libraries\File Formats\Plugins\DExcPlugin\DExcPlugin.csproj", "{B75A7857-BA19-4A73-AACD-9F4D60C048F7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashAnalyserEngine", "..\Common\Engine\CrashAnalyserEngine.csproj", "{F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{973F4051-745D-469A-A07C-D5C33B77F119}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Exe", "Exe", "{4A28BB65-9912-4573-B354-771A185A9942}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{4FC4A8C4-0E18-4180-AAE5-050640F2A583}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAPluginCrashAnalysis", "..\Plugins\CAPluginCrashAnalyser\CAPluginCrashAnalysis.csproj", "{29D6410E-E739-4810-A582-501C807D12F0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashXmlPlugin", "..\..\Libraries\File Formats\Plugins\CrashXmlPlugin\CrashXmlPlugin.csproj", "{284BC871-EAE3-4D8F-8DFF-6C953E1B119D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianDebugLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\SymbianDebugLib.csproj", "{796DD82D-9E7D-476D-B700-086CD9A893DA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Code", "Code", "{0287281D-42F7-480E-B46F-487A10F4C612}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianInstructionLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianInstructionLib\SymbianInstructionLib.csproj", "{EB93FD74-17C6-44B2-8384-4D58DC210F77}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianImageLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianImageLib\SymbianImageLib.csproj", "{A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CLPluginImg", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianCodeLib\Plugins\CLPluginSymbianOS\CLPluginImg.csproj", "{3878E434-8B76-4127-BA89-68A90DA6E69A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{1F52FD03-0D26-4947-A53D-BC89DEA43335}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Stack", "Stack", "{401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntCode", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntCode\DbgEntCode.csproj", "{E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntSymbol", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntSymbol\DbgEntSymbol.csproj", "{51C62A41-992E-4158-8A32-228ED49BF71D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackAlgorithmAccurate", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\Plugins\Accurate\SymbianStackAlgorithmAccurate.csproj", "{EF406EC5-04F3-45CA-BD01-686ACBD91C49}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackAlgorithmBasic", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\Plugins\Basic\SymbianStackAlgorithmBasic.csproj", "{958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackAlgorithmHeuristic", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\Plugins\Heuristic\SymbianStackAlgorithmHeuristic.csproj", "{19F87778-8320-42AC-BD00-FD23FC4D2828}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Symbols", "Symbols", "{2A640D76-41DA-44B1-A510-5EF0FA08D542}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginMap", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\Plugins\SLPluginMap\SLPluginMap.csproj", "{2E619377-8639-49F9-9494-4FAD25CBC05E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginObey", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\Plugins\SLPluginObey\SLPluginObey.csproj", "{4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginSymbol", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\Plugins\SLPluginSymbol\SLPluginSymbol.csproj", "{E921F00D-5F82-454E-9CBE-59381C48781C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Trace", "Trace", "{A3FB325F-A50E-472D-9AF1-103D0D926C4A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianSymbolLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\SymbianSymbolLib.csproj", "{6054A36B-F8A9-406F-B6CE-B531CC2AEADC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Debug|Win32.ActiveCfg = Debug|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Release|Any CPU.Build.0 = Release|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Release|Win32.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.Build.0 = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Win32.ActiveCfg = Release|Any CPU + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Win32.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Win32.Build.0 = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Any CPU.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Mixed Platforms.Build.0 = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Win32.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Win32.Build.0 = Release|Win32 + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Win32.ActiveCfg = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Any CPU.Build.0 = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Win32.ActiveCfg = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Win32.ActiveCfg = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Any CPU.Build.0 = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Win32.ActiveCfg = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Any CPU.Build.0 = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Win32.ActiveCfg = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Win32.ActiveCfg = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Any CPU.Build.0 = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Win32.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Win32.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.Build.0 = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Win32.ActiveCfg = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Win32.ActiveCfg = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Any CPU.Build.0 = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Win32.ActiveCfg = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Any CPU.Build.0 = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Win32.ActiveCfg = Release|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Debug|Win32.ActiveCfg = Debug|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Release|Any CPU.Build.0 = Release|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Release|Win32.ActiveCfg = Release|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Debug|Win32.ActiveCfg = Debug|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Release|Any CPU.Build.0 = Release|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Release|Win32.ActiveCfg = Release|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Debug|Win32.ActiveCfg = Debug|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Release|Any CPU.Build.0 = Release|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Release|Win32.ActiveCfg = Release|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Debug|Win32.ActiveCfg = Debug|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Release|Any CPU.Build.0 = Release|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Release|Win32.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Win32.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Any CPU.Build.0 = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Win32.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Win32.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Any CPU.Build.0 = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Win32.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Any CPU.Build.0 = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Win32.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Win32.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Any CPU.Build.0 = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Win32.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Any CPU.Build.0 = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Win32.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Win32.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Any CPU.Build.0 = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Win32.ActiveCfg = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Win32.ActiveCfg = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Any CPU.Build.0 = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Win32.ActiveCfg = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Win32.ActiveCfg = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Any CPU.ActiveCfg = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Any CPU.Build.0 = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Win32.ActiveCfg = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Win32.ActiveCfg = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Any CPU.Build.0 = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Win32.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Any CPU.Build.0 = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Win32.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Win32.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Any CPU.Build.0 = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Win32.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Any CPU.Build.0 = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Win32.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Win32.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Any CPU.Build.0 = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Win32.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {4A28BB65-9912-4573-B354-771A185A9942} = {C1B06919-BC36-4022-8E2D-823676328271} + {973F4051-745D-469A-A07C-D5C33B77F119} = {C1B06919-BC36-4022-8E2D-823676328271} + {4FC4A8C4-0E18-4180-AAE5-050640F2A583} = {C1B06919-BC36-4022-8E2D-823676328271} + {D8DAA636-2E62-4CDC-98A9-29523D296FEC} = {22667FF0-120A-480C-BF4D-1E4939C89F22} + {87A37075-51F6-4D05-9D22-756AEA611F60} = {604FB4F9-0C98-4D20-BF2E-C4D0898B1B7F} + {4B8FB099-C9F4-442B-B132-7F0DD4D77E07} = {604FB4F9-0C98-4D20-BF2E-C4D0898B1B7F} + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC} = {268835BA-8944-490B-8675-31E7F85176A5} + {268835BA-8944-490B-8675-31E7F85176A5} = {87A37075-51F6-4D05-9D22-756AEA611F60} + {2732FBB1-E515-4DDA-A70A-B34CE869CB21} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {1F52FD03-0D26-4947-A53D-BC89DEA43335} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {0287281D-42F7-480E-B46F-487A10F4C612} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {2A640D76-41DA-44B1-A510-5EF0FA08D542} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {A3FB325F-A50E-472D-9AF1-103D0D926C4A} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {796DD82D-9E7D-476D-B700-086CD9A893DA} = {2732FBB1-E515-4DDA-A70A-B34CE869CB21} + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054} = {2732FBB1-E515-4DDA-A70A-B34CE869CB21} + {51C62A41-992E-4158-8A32-228ED49BF71D} = {2732FBB1-E515-4DDA-A70A-B34CE869CB21} + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8} = {4A28BB65-9912-4573-B354-771A185A9942} + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1} = {1F52FD03-0D26-4947-A53D-BC89DEA43335} + {56ECA873-7D1D-45E7-A583-A5388D753321} = {1F52FD03-0D26-4947-A53D-BC89DEA43335} + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} = {1F52FD03-0D26-4947-A53D-BC89DEA43335} + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8} = {1F52FD03-0D26-4947-A53D-BC89DEA43335} + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} = {1F52FD03-0D26-4947-A53D-BC89DEA43335} + {A041EDFE-A120-4100-A0A6-FB1984D80815} = {0287281D-42F7-480E-B46F-487A10F4C612} + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8} = {0287281D-42F7-480E-B46F-487A10F4C612} + {EB93FD74-17C6-44B2-8384-4D58DC210F77} = {0287281D-42F7-480E-B46F-487A10F4C612} + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB} = {0287281D-42F7-480E-B46F-487A10F4C612} + {3878E434-8B76-4127-BA89-68A90DA6E69A} = {0287281D-42F7-480E-B46F-487A10F4C612} + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3} = {401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0} + {EF406EC5-04F3-45CA-BD01-686ACBD91C49} = {401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0} + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20} = {401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0} + {19F87778-8320-42AC-BD00-FD23FC4D2828} = {401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0} + {17F16EB8-BCD2-4272-B5F0-BC0E4B143CDD} = {4B8FB099-C9F4-442B-B132-7F0DD4D77E07} + {891FA26E-4F8F-4CF5-A638-A2B5D101846B} = {4B8FB099-C9F4-442B-B132-7F0DD4D77E07} + {B75A7857-BA19-4A73-AACD-9F4D60C048F7} = {891FA26E-4F8F-4CF5-A638-A2B5D101846B} + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D} = {891FA26E-4F8F-4CF5-A638-A2B5D101846B} + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80} = {973F4051-745D-469A-A07C-D5C33B77F119} + {29D6410E-E739-4810-A582-501C807D12F0} = {4FC4A8C4-0E18-4180-AAE5-050640F2A583} + {2E619377-8639-49F9-9494-4FAD25CBC05E} = {2A640D76-41DA-44B1-A510-5EF0FA08D542} + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8} = {2A640D76-41DA-44B1-A510-5EF0FA08D542} + {E921F00D-5F82-454E-9CBE-59381C48781C} = {2A640D76-41DA-44B1-A510-5EF0FA08D542} + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC} = {2A640D76-41DA-44B1-A510-5EF0FA08D542} + EndGlobalSection +EndGlobal diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Console/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Console/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "3a1eb858-6a4c-4d6c-875b-518ed89424b5" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.1.0" )] +[assembly: AssemblyFileVersion( "1.0.1.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Console/bin/Debug/Readme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Console/bin/Debug/Readme.txt Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Symbian Foundation License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +INSTALLATION INSTRUCTIONS +========================= + +This tool requires the MicroSoft .NET v2.0 RunTime. + +You can download this from MicroSoft's website: + +http://www.microsoft.com/downloads/details.aspx?familyid=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en + + + +CHANGES +======= + +1.01 +---- + +FIX: Stability improvements when parsing Mobile Crash BIN files +FIX: General stability improvements +FIX: Stability improvements when utilising Nokia flash files +FIX: Accurate stack algorithm improvements when binaries uses VFP instructions +FEATURE: Logging to file is now supported +IMPROVEMENT: Workaround for some malformed symbol files that contain invalid symbol sequences (affects Qt binaries in particular). +IMPROVEMENT: More reliable symbolic lookup +IMPROVEMENT: Drastically improved symbolic lookup performance +IMPROVEMENT: General accurate stack reconstruction improvements + +1.00 +---- + +- First release \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Console/bin/Debug/Tools/ArmDisasm.exe Binary file crashanalysercmd/UI/Console/bin/Debug/Tools/ArmDisasm.exe has changed diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Console/bin/Debug/Tools/uputil.exe Binary file crashanalysercmd/UI/Console/bin/Debug/Tools/uputil.exe has changed diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/CACommandLineEntryPoint.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/CACommandLineEntryPoint.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Collections.Generic; +using System.Text; +using SymbianUtils.FileSystem; +using SymbianUtils.FileSystem.Utilities; +using CrashAnalyserServerExe.Engine; + +namespace CrashAnalyserServerExe +{ + class EntryPoint + { + static int Main( string[] aArguments ) + { + int error = CACmdLineException.KErrNone; + // + using ( FSLog log = new FSLog( true ) ) + { + try + { + FSUtilities.ClearTempPath(); + // + CACommandLineUI commandLineUi = new CACommandLineUI( aArguments, log ); + error = commandLineUi.Run(); + // + if ( error != CACmdLineException.KErrNone ) + { + SymbianUtils.SymDebug.SymDebugger.Break(); + } + } + catch ( Exception e ) + { + log.TraceAlways( "CrashAnalyserServerExe.Main() - EXCEPTION: " + e.Message ); + log.TraceAlways( "CrashAnalyserServerExe.Main() - STACK: " + e.StackTrace ); + SymbianUtils.SymDebug.SymDebugger.Break(); + error = -1; + } + // + if ( error != 0 ) + { + log.TraceAlways( "CA completed with error: " + error ); + } + } + // + return error; + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/CACommandLineUI.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/CACommandLineUI.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using System.Data; +using SymbianDebugLib.Engine; +using SymbianXmlInputLib.Elements; +using SymbianXmlInputLib.Parser; +using SymbianXmlInputLib.Parser.Nodes; +using SymbianUtils.FileSystem; +using SymbianUtils.Tracer; +using SymbianUtils; +using CrashAnalyserServerExe.Engine; + +namespace CrashAnalyserServerExe +{ + internal class CACommandLineUI : DisposableObject, ITracer + { + #region Constructors + public CACommandLineUI( string[] aArguments, FSLog aLog ) + { + iLog = aLog; + + // Create engine + iDebugEngine = new DbgEngine( this ); + + // Work out if we are in verbose mode + CheckArgsForVerbose(); + + // Create main command line engine + iEngine = new CACmdLineEngine( iDebugEngine ); + } + #endregion + + #region API + public int Run() + { + iLog.TraceAlways( "[SvrExe] Run() - START" ); + // + int error = CACmdLineException.KErrNone; + try + { + error = iEngine.RunCommandLineOperations(); + } + finally + { + iLog.TraceAlways( "[SvrExe] Run() - END - error: " + error ); + } + // + return error; + } + #endregion + + #region Properties + public bool Verbose + { + get { return iLog.Verbose; } + private set + { + iLog.Verbose = value; + iLog.TraceAlways( "[SvrExe] Verbose Mode: " + value.ToString() ); + } + } + #endregion + + #region Internal constants + private const string KParamVerbose = "-V"; + #endregion + + #region Internal methods + private void CheckArgsForVerbose() + { + bool ret = Environment.CommandLine.Contains( KParamVerbose ); + this.Verbose = ret; + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + iLog.Trace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + string msg = string.Format( aFormat, aParams ); + Trace( msg ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iEngine.Dispose(); + } + } + #endregion + + #region Data members + private readonly DbgEngine iDebugEngine; + private readonly FSLog iLog; + private readonly CACmdLineEngine iEngine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/CrashAnalyserServerExe.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/CrashAnalyserServerExe.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,83 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8} + Exe + Properties + CrashAnalyserServerExe + CrashAnalyserServerExe + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {56ECA873-7D1D-45E7-A583-A5388D753321} + SymbianXmlInputLib + + + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC} + CrashItemLib + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/CrashAnalyserServerExe.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/CrashAnalyserServerExe.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,8 @@ + + + C:\Tool Demo Files\2. Crash Data\File63\Bins\ + -PROGRESS + Project + d:\My Documents\Visual Studio 2008\Apps\CrashAnalyser\App\bin\Debug\CrashAnalyserServerExe.exe + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/CrashAnalyserServerExe.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/CrashAnalyserServerExe.sln Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,549 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashAnalyserServerExe", "CrashAnalyserServerExe.csproj", "{C723AA40-3F22-4E77-92FB-437C5C2F0BD8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debug Library", "Debug Library", "{2732FBB1-E515-4DDA-A70A-B34CE869CB21}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{604FB4F9-0C98-4D20-BF2E-C4D0898B1B7F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{268835BA-8944-490B-8675-31E7F85176A5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{87A37075-51F6-4D05-9D22-756AEA611F60}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PerfToolsSharedLibraries", "PerfToolsSharedLibraries", "{22667FF0-120A-480C-BF4D-1E4939C89F22}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rd Party", "3rd Party", "{1E4DE160-DF3B-4DB3-B221-C524E69596AE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{D8DAA636-2E62-4CDC-98A9-29523D296FEC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{2AA08696-7506-4F27-AA81-C244DD2B67B7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{C1B06919-BC36-4022-8E2D-823676328271}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianUtils", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianUtils\SymbianUtils.csproj", "{F6F4CE69-E73A-4917-97ED-B114DE90C92E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SymbianNativeTools", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianNativeTools\SymbianNativeTools.vcproj", "{34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianParserLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianParserLib\SymbianParserLib.csproj", "{925A4DB0-85BD-4157-933F-5BFB93FB4DA1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianXmlInputLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianXmlInputLib\SymbianXmlInputLib.csproj", "{56ECA873-7D1D-45E7-A583-A5388D753321}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianCodeLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianCodeLib\SymbianCodeLib.csproj", "{A041EDFE-A120-4100-A0A6-FB1984D80815}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\SymbianStackLib.csproj", "{3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStructuresLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStructuresLib\SymbianStructuresLib.csproj", "{D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianTree", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianTree\SymbianTree.csproj", "{2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "File Formats", "File Formats", "{4B8FB099-C9F4-442B-B132-7F0DD4D77E07}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashItemLib", "..\..\Libraries\Engine\CrashItemLib\CrashItemLib.csproj", "{A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engines", "Engines", "{17F16EB8-BCD2-4272-B5F0-BC0E4B143CDD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{891FA26E-4F8F-4CF5-A638-A2B5D101846B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileCrashPlugin", "..\..\Libraries\File Formats\Plugins\MobileCrashPlugin\MobileCrashPlugin.csproj", "{C80A53E9-DE4C-4D81-83EF-1515702D3616}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileCrashLib", "..\..\Libraries\File Formats\Engines\MobileCrashLib\MobileCrashLib.csproj", "{00DA206A-9DA2-4B2E-A376-05CAB2881ABA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianDebugLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\SymbianDebugLib.csproj", "{796DD82D-9E7D-476D-B700-086CD9A893DA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Code", "Code", "{0287281D-42F7-480E-B46F-487A10F4C612}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianInstructionLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianInstructionLib\SymbianInstructionLib.csproj", "{EB93FD74-17C6-44B2-8384-4D58DC210F77}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianImageLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianImageLib\SymbianImageLib.csproj", "{A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CLPluginImg", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianCodeLib\Plugins\CLPluginSymbianOS\CLPluginImg.csproj", "{3878E434-8B76-4127-BA89-68A90DA6E69A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CLPluginNokiaFpsx", "..\..\..\PerfToolsSharedLibraries\Engine\NokiaFpsxCLPlugin\CLPluginNokiaFpsx.csproj", "{26A14AD0-F517-45DB-874F-C71A0A8D4D5C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NokiaFlashUpdateLibrary", "..\..\..\PerfToolsSharedLibraries\Engine\NokiaFlashUpdateLib\NokiaFlashUpdateLib.vcproj", "{971A1AD8-4142-422F-A196-7E07DC73D60A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NokiaArmDisassemblyEngine", "..\..\..\PerfToolsSharedLibraries\Engine\NokiaArmDisassembler\Dll\NokiaArmDisassemblerLib.vcproj", "{3C0CECE5-1C07-463F-A216-4E5D13750CC9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NokiaArmDisassembler", "..\..\..\PerfToolsSharedLibraries\Engine\NokiaArmDisassembler\Plugin\NokiaArmDisassembler.csproj", "{BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{1F52FD03-0D26-4947-A53D-BC89DEA43335}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Stack", "Stack", "{401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntCode", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntCode\DbgEntCode.csproj", "{E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntSymbol", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntSymbol\DbgEntSymbol.csproj", "{51C62A41-992E-4158-8A32-228ED49BF71D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackAlgorithmAccurate", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\Plugins\Accurate\SymbianStackAlgorithmAccurate.csproj", "{EF406EC5-04F3-45CA-BD01-686ACBD91C49}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackAlgorithmBasic", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\Plugins\Basic\SymbianStackAlgorithmBasic.csproj", "{958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackAlgorithmHeuristic", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\Plugins\Heuristic\SymbianStackAlgorithmHeuristic.csproj", "{19F87778-8320-42AC-BD00-FD23FC4D2828}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Symbols", "Symbols", "{2A640D76-41DA-44B1-A510-5EF0FA08D542}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginMap", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\Plugins\SLPluginMap\SLPluginMap.csproj", "{2E619377-8639-49F9-9494-4FAD25CBC05E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginObey", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\Plugins\SLPluginObey\SLPluginObey.csproj", "{4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginSymbol", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\Plugins\SLPluginSymbol\SLPluginSymbol.csproj", "{E921F00D-5F82-454E-9CBE-59381C48781C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginZip", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\Plugins\SLPluginZip\SLPluginZip.csproj", "{BDD4E602-AC36-473A-98D0-FE062213548A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Trace", "Trace", "{A3FB325F-A50E-472D-9AF1-103D0D926C4A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianOSTLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianOSTLib\SymbianOSTLib.csproj", "{3A44B9C6-1248-4739-AF09-E6961F85B1C5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianTraceLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianTraceLib\SymbianTraceLib.csproj", "{295412DA-8B51-4820-B6B0-63EA3949E3CB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntMetaDataConfig", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntMetaDataConfig\DbgEntMetaDataConfig.csproj", "{E50DC404-4F0E-4E90-B548-AB737A862C70}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntKeyBindings", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntKeyBindings\DbgEntKeyBindings.csproj", "{A7036A24-40DF-4349-AE25-2CFB54743728}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntTrace", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntTrace\DbgEntTrace.csproj", "{9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianSymbolLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\SymbianSymbolLib.csproj", "{6054A36B-F8A9-406F-B6CE-B531CC2AEADC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianZipLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianZipLib\SymbianZipLib.csproj", "{0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashInfoFilePlugin", "..\..\Libraries\File Formats\Plugins\CrashInfoFilePlugin\CrashInfoFilePlugin.csproj", "{38D6EA43-2CA2-4637-9487-B3D5B5938558}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Debug|Win32.ActiveCfg = Debug|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Release|Any CPU.Build.0 = Release|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8}.Release|Win32.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.Build.0 = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Win32.ActiveCfg = Release|Any CPU + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Win32.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Win32.Build.0 = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Any CPU.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Mixed Platforms.Build.0 = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Win32.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Win32.Build.0 = Release|Win32 + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Win32.ActiveCfg = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Any CPU.Build.0 = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Win32.ActiveCfg = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Win32.ActiveCfg = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Any CPU.Build.0 = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Win32.ActiveCfg = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Any CPU.Build.0 = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Win32.ActiveCfg = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Win32.ActiveCfg = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Any CPU.Build.0 = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Win32.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Win32.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.Build.0 = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Win32.ActiveCfg = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Win32.ActiveCfg = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Any CPU.Build.0 = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Win32.ActiveCfg = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Any CPU.Build.0 = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Win32.ActiveCfg = Release|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Debug|Win32.ActiveCfg = Debug|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Release|Any CPU.Build.0 = Release|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Release|Win32.ActiveCfg = Release|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Debug|Win32.ActiveCfg = Debug|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Release|Any CPU.Build.0 = Release|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Release|Win32.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Win32.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Any CPU.Build.0 = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Win32.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Win32.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Any CPU.Build.0 = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Win32.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Any CPU.Build.0 = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Win32.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Win32.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Any CPU.Build.0 = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Win32.ActiveCfg = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Any CPU.Build.0 = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Win32.ActiveCfg = Release|Any CPU + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Win32.ActiveCfg = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Win32.Build.0 = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Any CPU.ActiveCfg = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Mixed Platforms.Build.0 = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Win32.ActiveCfg = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Win32.Build.0 = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Win32.Build.0 = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Any CPU.ActiveCfg = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Mixed Platforms.Build.0 = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Win32.ActiveCfg = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Win32.Build.0 = Release|Win32 + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Win32.ActiveCfg = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Any CPU.Build.0 = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Win32.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Any CPU.Build.0 = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Win32.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Win32.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Any CPU.Build.0 = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Win32.ActiveCfg = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Win32.ActiveCfg = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Any CPU.Build.0 = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Win32.ActiveCfg = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Win32.ActiveCfg = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Any CPU.ActiveCfg = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Any CPU.Build.0 = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Win32.ActiveCfg = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Win32.ActiveCfg = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Any CPU.Build.0 = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Win32.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Any CPU.Build.0 = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Win32.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Win32.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Any CPU.Build.0 = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Win32.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Any CPU.Build.0 = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Win32.ActiveCfg = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Win32.ActiveCfg = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Any CPU.Build.0 = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Win32.ActiveCfg = Release|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Debug|Win32.ActiveCfg = Debug|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Release|Any CPU.Build.0 = Release|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Release|Win32.ActiveCfg = Release|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Debug|Win32.ActiveCfg = Debug|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Release|Any CPU.Build.0 = Release|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Release|Win32.ActiveCfg = Release|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Release|Any CPU.Build.0 = Release|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Release|Win32.ActiveCfg = Release|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Release|Any CPU.Build.0 = Release|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Release|Win32.ActiveCfg = Release|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Release|Any CPU.Build.0 = Release|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Release|Win32.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Win32.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Any CPU.Build.0 = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Win32.ActiveCfg = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Win32.ActiveCfg = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Any CPU.Build.0 = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Win32.ActiveCfg = Release|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Debug|Win32.ActiveCfg = Debug|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Release|Any CPU.Build.0 = Release|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Release|Win32.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {C723AA40-3F22-4E77-92FB-437C5C2F0BD8} = {C1B06919-BC36-4022-8E2D-823676328271} + {D8DAA636-2E62-4CDC-98A9-29523D296FEC} = {22667FF0-120A-480C-BF4D-1E4939C89F22} + {1E4DE160-DF3B-4DB3-B221-C524E69596AE} = {22667FF0-120A-480C-BF4D-1E4939C89F22} + {2AA08696-7506-4F27-AA81-C244DD2B67B7} = {22667FF0-120A-480C-BF4D-1E4939C89F22} + {268835BA-8944-490B-8675-31E7F85176A5} = {604FB4F9-0C98-4D20-BF2E-C4D0898B1B7F} + {87A37075-51F6-4D05-9D22-756AEA611F60} = {604FB4F9-0C98-4D20-BF2E-C4D0898B1B7F} + {4B8FB099-C9F4-442B-B132-7F0DD4D77E07} = {604FB4F9-0C98-4D20-BF2E-C4D0898B1B7F} + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC} = {268835BA-8944-490B-8675-31E7F85176A5} + {2732FBB1-E515-4DDA-A70A-B34CE869CB21} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {1F52FD03-0D26-4947-A53D-BC89DEA43335} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {0287281D-42F7-480E-B46F-487A10F4C612} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {2A640D76-41DA-44B1-A510-5EF0FA08D542} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {A3FB325F-A50E-472D-9AF1-103D0D926C4A} = {D8DAA636-2E62-4CDC-98A9-29523D296FEC} + {796DD82D-9E7D-476D-B700-086CD9A893DA} = {2732FBB1-E515-4DDA-A70A-B34CE869CB21} + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054} = {2732FBB1-E515-4DDA-A70A-B34CE869CB21} + {51C62A41-992E-4158-8A32-228ED49BF71D} = {2732FBB1-E515-4DDA-A70A-B34CE869CB21} + {E50DC404-4F0E-4E90-B548-AB737A862C70} = {2732FBB1-E515-4DDA-A70A-B34CE869CB21} + {A7036A24-40DF-4349-AE25-2CFB54743728} = {2732FBB1-E515-4DDA-A70A-B34CE869CB21} + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C} = {2732FBB1-E515-4DDA-A70A-B34CE869CB21} + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1} = {1F52FD03-0D26-4947-A53D-BC89DEA43335} + {56ECA873-7D1D-45E7-A583-A5388D753321} = {1F52FD03-0D26-4947-A53D-BC89DEA43335} + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} = {1F52FD03-0D26-4947-A53D-BC89DEA43335} + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8} = {1F52FD03-0D26-4947-A53D-BC89DEA43335} + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} = {1F52FD03-0D26-4947-A53D-BC89DEA43335} + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71} = {1F52FD03-0D26-4947-A53D-BC89DEA43335} + {A041EDFE-A120-4100-A0A6-FB1984D80815} = {0287281D-42F7-480E-B46F-487A10F4C612} + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8} = {0287281D-42F7-480E-B46F-487A10F4C612} + {EB93FD74-17C6-44B2-8384-4D58DC210F77} = {0287281D-42F7-480E-B46F-487A10F4C612} + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB} = {0287281D-42F7-480E-B46F-487A10F4C612} + {3878E434-8B76-4127-BA89-68A90DA6E69A} = {0287281D-42F7-480E-B46F-487A10F4C612} + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C} = {0287281D-42F7-480E-B46F-487A10F4C612} + {971A1AD8-4142-422F-A196-7E07DC73D60A} = {0287281D-42F7-480E-B46F-487A10F4C612} + {3C0CECE5-1C07-463F-A216-4E5D13750CC9} = {0287281D-42F7-480E-B46F-487A10F4C612} + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D} = {0287281D-42F7-480E-B46F-487A10F4C612} + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3} = {401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0} + {EF406EC5-04F3-45CA-BD01-686ACBD91C49} = {401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0} + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20} = {401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0} + {19F87778-8320-42AC-BD00-FD23FC4D2828} = {401E7776-BFBE-49D5-A4C5-7B10CDC6A2F0} + {17F16EB8-BCD2-4272-B5F0-BC0E4B143CDD} = {4B8FB099-C9F4-442B-B132-7F0DD4D77E07} + {891FA26E-4F8F-4CF5-A638-A2B5D101846B} = {4B8FB099-C9F4-442B-B132-7F0DD4D77E07} + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA} = {17F16EB8-BCD2-4272-B5F0-BC0E4B143CDD} + {C80A53E9-DE4C-4D81-83EF-1515702D3616} = {891FA26E-4F8F-4CF5-A638-A2B5D101846B} + {38D6EA43-2CA2-4637-9487-B3D5B5938558} = {891FA26E-4F8F-4CF5-A638-A2B5D101846B} + {2E619377-8639-49F9-9494-4FAD25CBC05E} = {2A640D76-41DA-44B1-A510-5EF0FA08D542} + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8} = {2A640D76-41DA-44B1-A510-5EF0FA08D542} + {E921F00D-5F82-454E-9CBE-59381C48781C} = {2A640D76-41DA-44B1-A510-5EF0FA08D542} + {BDD4E602-AC36-473A-98D0-FE062213548A} = {2A640D76-41DA-44B1-A510-5EF0FA08D542} + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC} = {2A640D76-41DA-44B1-A510-5EF0FA08D542} + {3A44B9C6-1248-4739-AF09-E6961F85B1C5} = {A3FB325F-A50E-472D-9AF1-103D0D926C4A} + {295412DA-8B51-4820-B6B0-63EA3949E3CB} = {A3FB325F-A50E-472D-9AF1-103D0D926C4A} + EndGlobalSection +EndGlobal diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/Engine/CACmdLineEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/Engine/CACmdLineEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,910 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Xml; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Source; +using CrashItemLib.Crash.Processes; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Summarisable; +using CrashItemLib.Sink; +using CrashItemLib.Engine; +using CrashItemLib.Engine.Sources; +using CrashItemLib.Engine.Interfaces; +using CrashItemLib.PluginAPI; +using SymbianUtils.FileSystem.Utilities; +using SymbianXmlInputLib.Parser; +using SymbianXmlInputLib.Parser.Nodes; +using SymbianXmlInputLib.Elements; +using SymbianXmlInputLib.Elements.Types.Category; +using SymbianXmlInputLib.Elements.Types.FileSystem; +using SymbianXmlInputLib.Elements.Types.Command; +using SymbianDebugLib; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; +using SymbianUtils; +using SymbianUtils.Tracer; +using CrashItemLib.Crash.InfoSW; + +namespace CrashAnalyserServerExe.Engine +{ + internal class CACmdLineEngine : DisposableObject, ITracer, ICIEngineUI + { + #region Constructors + public CACmdLineEngine( DbgEngine aDebugEngine ) + { + iDebugEngine = aDebugEngine; + iInputs = new CACmdLineInputParameters( aDebugEngine ); + iCrashItemEngine = new CIEngine( aDebugEngine, this as ICIEngineUI ); + } + #endregion + + #region API + public int RunCommandLineOperations() + { + Trace( "[CA Cmd] START " ); + Trace( string.Empty ); + Trace( "[CA Cmd] command line: " + System.Environment.CommandLine ); + Trace( "[CA Cmd] command wd: " + System.Environment.CurrentDirectory ); + Trace( "[CA Cmd] proc count: " + System.Environment.ProcessorCount ); + Trace( "[CA Cmd] sysdir: " + System.Environment.SystemDirectory ); + Trace( "[CA Cmd] version: " + System.Environment.Version.ToString() ); + Trace( string.Empty ); + + int error = CACmdLineException.KErrNone; + + // + try + { + if (!iInputs.ParseCommandLine()) + { + throw new CACmdLineException("Error while parsing command line", CACmdLineException.KErrCommandLineError); + } + + // We expect to see an "-input" parameter + iReportProgress = CheckForProgressParameter(); + + // Switch off UI output at the debug engine level + iDebugEngine.UiMode = TDbgUiMode.EUiDisabled; + + // Next, attempt to prime the crash engine with every source we + // identified from the input specification. The goal is to + // create all the needed Crash Item Source objects for each input file. + // Any inputs which we don't support will not have an associated source and + // will be flagged accordingly within the CACmdLineFileSource object. + TryToPrimeSources(); + + // Next, prime the debug engine will all the debug meta-data inputs. + // Again, individual error messages will be associated with each meta-data + // input. + TryToPrimeDbgEngine(); + + // Next, we invoke the crash engine to process all the crash item sources we + // created during the prime step. Exceptions are caught and associated + // messages & diagnostics are created at the input-file level. + TryToIdentifyCrashes(); + + // Next, we start the output phase. Any 'valid' crash containers are serialized + // to xml. Any input files which could not be processed have 'dummy' containers + // created for them, and these are also serialised to 'failed' CI files. + // If the CI Sink plugin is unavailable, then we cannot create any CI output. + // In this situation, we throw an exception which is caught below. + TryToCreateOutput(); + } + catch ( CACmdLineException cmdLineException ) + { + error = cmdLineException.ErrorCode; + // + Trace( "[CA Cmd] " + cmdLineException.Message + " " + cmdLineException.StackTrace ); + } + catch ( Exception generalException ) + { + error = CACmdLineException.KErrGeneral; + // + Trace( "[CA Cmd] " + generalException.Message + " " + generalException.StackTrace ); + } + + Trace( "[CA Cmd] - operation complete: " + error ); + return error; + } + #endregion + + #region Properties + public string CommandLineArguments + { + get { return Environment.CommandLine; } + } + + public CIEngine CrashItemEngine + { + get { return iCrashItemEngine; } + } + #endregion + + #region Event handlers + private void DbgEngine_EntityPrimingStarted( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + Trace( "[CA Cmd] Priming debug meta-data: " + aEntity.FullName ); + + // Emit progress banner + if ( iReportProgress ) + { + Print( "Reading debug meta-data..." ); + } + } + + private void DbgEngine_EntityPrimingProgress( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + if ( aContext != null ) + { + if ( aContext.GetType() == typeof( int ) ) + { + int value = (int) aContext; + Trace( "[CA Cmd] Priming debug meta-data progress: {0:d3}% {1}", value, aEntity.FullName ); + + // If reporting progress, then output something so the carbide extension is aware + // of what is going on in the background. + if ( iReportProgress ) + { + string msg = string.Format( "{1:d3}%, {0}", aEntity.FullName, value ); + Print( msg ); + } + } + } + } + + private void DbgEngine_EntityPrimingComplete( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + Trace( "[CA Cmd] Primed debug meta-data: " + aEntity.FullName ); + } + + private void CrashItemEngine_SourceObserver( CIEngine.TSourceEvent aEvent, CIEngineSource aSource, object aParameter ) + { + if ( iReportProgress ) + { + string msg = string.Empty; + // + switch ( aEvent ) + { + case CIEngine.TSourceEvent.EEventSourceReady: + msg = string.Format( "Reading file: [{0}], progress: 100%", aSource.FileName ); + break; + case CIEngine.TSourceEvent.EEventSourceProgress: + if ( aParameter != null && aParameter is int ) + { + msg = string.Format( "Reading file: [{0}], progress: {1:d3}%", aSource.FileName, (int) aParameter ); + } + break; + default: + break; + } + + // Output a message only if we have one + if ( string.IsNullOrEmpty( msg ) == false ) + { + Print( msg ); + } + } + } + #endregion + + #region Internal constants + private const string KCrashItemSinkName = "CRASH INFO FILE"; + private const string KParamProgress = "-PROGRESS"; + #endregion + + #region Internal methods + private bool CheckForProgressParameter() + { + bool report = this.CommandLineArguments.Contains( KParamProgress ); + return report; + } + + private CISink FindSink() + { + Trace( "[CA Cmd] FindSink() - START" ); + CISink ret = null; + // + CISinkManager sinkManager = iCrashItemEngine.SinkManager; + foreach ( CISink sink in sinkManager ) + { + Trace( "[CA Cmd] FindSink() - found sink: " + sink.Name ); + + if ( sink.Name.ToUpper().Contains( KCrashItemSinkName ) ) + { + ret = sink; + break; + } + } + // + Trace( "[CA Cmd] FindSink() - END - ret: " + ret ); + return ret; + } + + private void TryToPrimeSources() + { + Trace( "[CA Cmd] TryToPrimeSources() - START" ); + CrashItemEngine.ClearAll(); + + // Prime engine with source files + CACmdLineFSEntityList sourceFileNames = iInputs.SourceFiles; + int progress = -1; + int count = sourceFileNames.Count; + + // Emit progress banner + if ( iReportProgress ) + { + Print( "Locating crash files..." ); + } + + for ( int i = 0; i < count; i++ ) + { + CACmdLineFileSource file = sourceFileNames[ i ]; + // + try + { + // We prime each file individually. If an exception is thrown then we + // record an appropriate error in the associated file object. + Trace( "[CA Cmd] TryToPrimeSources() - priming: " + file ); + + bool primeSuccess = CrashItemEngine.Prime( file ); + + // Report progress as we work through the sources + if ( iReportProgress ) + { + float newProgress = ( ( (float) i + 1 ) / (float) count ) * 100.0f; + if ( (int) newProgress != progress || i == count - 1 ) + { + progress = (int) newProgress; + Print( string.Format( "{0:d3}%", progress ) ); + } + } + + Trace( "[CA Cmd] TryToPrimeSources() - primed result: " + primeSuccess ); + } + catch ( Exception sourcePrimerException ) + { + file.AddError( "Error Identifying Source Type", "There was an error when attempting to identify the source file type. The file could not be processed." ); + file.AddDiagnostic( "Crash Primer Exception Message", sourcePrimerException.Message ); + file.AddDiagnostic( "Crash Primer Exception Stack", sourcePrimerException.StackTrace ); + } + } + + AssociateInputFilesWithCrashItemSources(); + Trace( "[CA Cmd] TryToPrimeSources() - END" ); + } + + private void TryToPrimeDbgEngine() + { + DbgEngine debugEngine = iDebugEngine; + // + Exception primerException = null; + CACmdLineFSEntityList metaDataFiles = iInputs.MetaDataFiles; + // + try + { + debugEngine.Clear(); + + foreach ( CACmdLineFSEntity entry in metaDataFiles ) + { + Trace( "[CA Cmd] Seeding debug meta engine with entry: " + entry.Name ); + DbgEntity entity = debugEngine.Add( entry.Name ); + if ( entity != null ) + { + Trace( "[CA Cmd] Entry type detected as: [" + entity.CategoryName + "]" ); + entity.Tag = entry; + } + else + { + Trace( "[CA Cmd] Entry not handled: " + entry.Name ); + entry.AddError( "Meta-Data File Not Supported", "The file \'" + entry.Name + "\' is of unknown origin." ); + } + } + + // Listen to prime events + try + { + Trace( "[CA Cmd] Starting prime operation... " ); + debugEngine.EntityPrimingStarted += new DbgEngine.EventHandler( DbgEngine_EntityPrimingStarted ); + debugEngine.EntityPrimingProgress += new DbgEngine.EventHandler( DbgEngine_EntityPrimingProgress ); + debugEngine.EntityPrimingComplete += new DbgEngine.EventHandler( DbgEngine_EntityPrimingComplete ); + debugEngine.Prime( TSynchronicity.ESynchronous ); + Trace( "[CA Cmd] Debug meta data priming completed successfully." ); + } + finally + { + debugEngine.EntityPrimingStarted -= new DbgEngine.EventHandler( DbgEngine_EntityPrimingStarted ); + debugEngine.EntityPrimingProgress -= new DbgEngine.EventHandler( DbgEngine_EntityPrimingProgress ); + debugEngine.EntityPrimingComplete -= new DbgEngine.EventHandler( DbgEngine_EntityPrimingComplete ); + } + } + catch ( Exception exception ) + { + Trace( "[CA Cmd] Debug meta data priming exception: " + exception.Message + ", " + exception.StackTrace ); + primerException = exception; + } + + // Go through each debug entity and check it for errors. Add diagnostics + // and error messages where appropriate. + foreach ( DbgEntity entity in debugEngine ) + { + string name = entity.FullName; + // + CACmdLineFSEntity file = metaDataFiles[ name ]; + file.Clear(); + // + if ( entity.PrimerResult.PrimedOkay ) + { + if ( !entity.Exists ) + { + file.AddError( "Meta-Data File Missing", string.Format( "The file \'{0}\' could not be found.", file.Name ) ); + } + else if ( entity.IsUnsupported ) + { + file.AddError( "Meta-Data File Not Supported", string.Format( "The file \'{0}\' is of unknown origin.", file.Name ) ); + } + } + else + { + // Add error + file.AddError( "Meta-Data Read Error", entity.PrimerResult.PrimeErrorMessage ); + + // And diagnostic information + Exception exception = entity.PrimerResult.PrimeException != null ? entity.PrimerResult.PrimeException : primerException; + if ( exception != null ) + { + file.AddDiagnostic( "Meta-Data Exception Message", entity.PrimerResult.PrimeException.Message ); + file.AddDiagnostic( "Meta-Data Exception Stack", entity.PrimerResult.PrimeException.StackTrace ); + } + else + { + file.AddDiagnostic( "Meta-Data Unknown Failure", "No exception occurred at the primer or entity level?" ); + } + } + } + } + + private void TryToIdentifyCrashes() + { + Exception crashEngineException = null; + // + try + { + iCrashItemEngine.SourceObservers += new CIEngine.CIEngineSourceObserver( CrashItemEngine_SourceObserver ); + iCrashItemEngine.IdentifyCrashes( TSynchronicity.ESynchronous ); + } + catch ( Exception exception ) + { + crashEngineException = exception; + } + finally + { + iCrashItemEngine.SourceObservers -= new CIEngine.CIEngineSourceObserver( CrashItemEngine_SourceObserver ); + } + + // Check each source in the engine and create messages based upon it's + // state at the end of processing. + foreach ( CACmdLineFileSource file in iInputs.SourceFiles ) + { + if ( file.Source != null ) + { + CIEngineSource source = file.Source; + switch ( source.State ) + { + case CIEngineSource.TState.EStateReady: + // Success case - the source resulted in the creation of at least one container + file.AddDiagnostic( "Source Read Successfully", string.Format( "{0} crash container(s) created", source.ContainerCount ) ); + break; + case CIEngineSource.TState.EStateReadyNoItems: + file.AddWarning( "Source File Contains No Crashes", "The input data was read successfully but contains no crash information." ); + break; + case CIEngineSource.TState.EStateReadyCorrupt: + file.AddError( "Source File is Corrupt", "The input data is invalid or corrupt." ); + break; + case CIEngineSource.TState.EStateUninitialised: + file.AddError( "Source File not Read", "The input data was never read." ); + file.AddDiagnostic( "Source State Invalid", "Source is still in unitialised state, even though reading is complete?" ); + break; + case CIEngineSource.TState.EStateProcessing: + file.AddDiagnostic( "Source State Invalid", "Source is still in processing state, even though reading is complete?" ); + break; + default: + break; + } + } + else + { + file.AddError( "File is Not Supported", "There file type is not recognized and was not processed." ); + } + + // Add in details of any exception + if ( crashEngineException != null ) + { + file.AddDiagnostic( "Crash Identification Exception Message", crashEngineException.Message ); + file.AddDiagnostic( "Crash Identification Exception Stack", crashEngineException.StackTrace ); + } + } + } + + private void TryToCreateOutput() + { + CACmdLineFSEntityList inputFiles = iInputs.SourceFiles; + // + CISink sink = FindSink(); + if ( sink == null ) + { + throw new CACmdLineException( "CI Output Plugin Not Available", CACmdLineException.KErrSinkNotAvailable ); + } + + CACmdLineFSEntityList sourceFileNames = iInputs.SourceFiles; + int progress = -1; + int count = sourceFileNames.Count; + + // Emit progress banner + if ( iReportProgress ) + { + Print( "Creating CI content..." ); + } + + for ( int i = 0; i < count; i++ ) + { + CACmdLineFileSource file = sourceFileNames[ i ]; + + System.Console.WriteLine("Starting to process file " +file.Name); + + // If the file has a corresponding source then we know that crash item recognised it. + // Otherwise, we skip it. + if ( file.Source != null ) + { + // We copy and remove all the file-level messages. These will be added to the container + // (where appropriate) or then to an output entry otherwise. + CACmdLineMessage[] fileMessages = file.ToArray(); + file.Clear(); + + // At this point, the input file is guaranteed to have an associated container. In + // the current mobile crash file format, there will be a 1:1 mapping, i.e. each file + // will contain a single crash report ("container") and therefore if symbols were + // found for just a single container (within the file) then it's good enough to treat + // the file as archivable. + foreach ( CIContainer container in file.Containers ) + { + // Firstly, add any meta-data errors/messages/warnings to this container + // as crash item message entries + AddMetaDataMessagesToContainer( container ); + + SetArchiveFileName(file.Name, container, sink); + + foreach (CIMessage message in container.Messages) + { + if (message.Type == CrashItemLib.Crash.Messages.CIMessage.TType.ETypeError) + { + container.Status = CIContainer.TStatus.EStatusErrorContainer; + } + } + // Now we can try to serialize the container to CI. This method will + // not throw an exception. + // + // If the operation succeeds, then the input file will have an associated + // container object (and associated xml output file name) and we need not + // do anymore. + // + // If it fails, then the input file will not be assigned the container + // object and therefore, later on, we'll invoke the CI Sink directly to + // create a stub 'FAILED' CI output file. + // + // NB: If Symbols were not available for the specified container, then + // we don't create a CI file but instead callback to a helper that + // will move the file to another temporary location for later repeat + // processing + bool hasSymbols = ContainsSymbols( container ); + + if (container.Status == CIContainer.TStatus.EStatusErrorContainer) //normally don't output containers with errors + { + file.State = CACmdLineFileSource.TState.EStateUninitialized; + if (iInputs.DecodeWithoutSymbols) //with force mode, output no matter what + { + TryToCreateOutput(sink, container, file, fileMessages); + } + } + else if (hasSymbols || IsSymbollessMobileCrash( container )) + { + file.State = CACmdLineFileSource.TState.EStateProcessedAndReadyToBeArchived; + TryToCreateOutput(sink, container, file, fileMessages); + } + else if (IsSymbollessMobileCrash(container)) //Crash api and registration files do not need symbols + { + + file.State = CACmdLineFileSource.TState.EStateProcessedAndReadyToBeArchived; + TryToCreateOutput(sink, container, file, fileMessages); + } + else + { + file.State = CACmdLineFileSource.TState.EStateSkippedDueToMissingSymbols; + if (iInputs.DecodeWithoutSymbols) //with force mode, output no matter what + { + //remove this to prevent .corrupt_ci creation! + TryToCreateOutput(sink, container, file, fileMessages); + } + } + } + } + else + { + file.State = CACmdLineFileSource.TState.EStateSkippedDueToNotBeingRecognized; + } + + // Move file to final location + MoveProcessedFile( file ); + + // Report progress as we work through the sources + if ( iReportProgress ) + { + float newProgress = ( ( (float) i + 1 ) / (float) count ) * 100.0f; + if ( (int) newProgress != progress || i == count - 1 ) + { + progress = (int) newProgress; + Print( string.Format( "{0:d3}%", progress ) ); + } + } + } + } + + + private void SetArchiveFileName(string aFileFullPath, CIContainer aContainer, CISink sink) + { + string fileName = Path.GetFileName(aFileFullPath); + + //add romid to filename if not already there + CIInfoSW info = (CIInfoSW) aContainer.ChildByType( typeof( CIInfoSW ) ); + if (info != null) + { + //RomID + if (info.ImageCheckSum != 0) + { + string romid = info.ImageCheckSum.ToString("x8"); + + if (fileName.Length < 8 || fileName.Substring(0, 8) != romid) + { + fileName = romid + "_" + fileName; + + } + } + } + + + string basename = Path.GetFileNameWithoutExtension(fileName); + string extension = Path.GetExtension(aFileFullPath); + + string archiveNamePath = Path.Combine(iInputs.ArchivePath, fileName); //Path.GetFileName(iInputs.ArchivePath)); + int counter = 1; + while (File.Exists(archiveNamePath)) + { + archiveNamePath = Path.Combine(iInputs.ArchivePath, basename + "_" + counter.ToString() + extension); + counter++; + } + + iInputs.SinkParameters.OperationData1 = (Object)archiveNamePath; + iBinFileArchivePathName = archiveNamePath; + + } + + + private void TryToCreateOutput( CISink aXmlSink, CIContainer aContainer, CACmdLineFileSource aFile, CACmdLineMessage[] aMessagesToAdd ) + { + Trace( "[CA Cmd] TryToCreateOutput() - START - container source: {0}", aContainer.Source.MasterFileName ); + + // By the time we are outputting a container, there should no longer be any messages + // associated with the file. + System.Diagnostics.Debug.Assert( aFile.Count == 0 ); + + // Check whether the file contained any errors or + // messages of it own. + if ( aMessagesToAdd.Length > 0 ) + { + // Copy warnings, messages and errors into crash item container. + // Diagnostic messages are not copied. + CACmdLineFSEntity.CopyMessagesToContainer( aMessagesToAdd, aContainer ); + } + + // This is where we will record the output attempt + CACmdLineFileSource.OutputEntry outputEntry = null; + // + try + { + // Finish preparing the sink parameters + CISinkSerializationParameters sinkParams = iInputs.SinkParameters; + sinkParams.Container = aContainer; + + // Perform serialization + Trace( "[CA Cmd] TryToCreateOutput() - serializing..." ); + object output = aXmlSink.Serialize( sinkParams ); + Trace( "[CA Cmd] TryToCreateOutput() - serialization returned: " + output ); + + if ( aFile != null ) + { + // Create new output + string outputFileName = output is string ? (string) output : string.Empty; + + // Save output file name + outputEntry = aFile.AddOutput( aContainer, outputFileName, TOutputStatus.ESuccess ); + } + + // Merge in any diagnostic messages that were left into the output entry. + // This ensure we output diagnostics in the final manifest data. + outputEntry.AddRange( aMessagesToAdd, CACmdLineMessage.TType.ETypeDiagnostic ); + } + catch ( Exception outputException ) + { + Trace( "[CA Cmd] TryToCreateOutput() - outputException.Message: " + outputException.Message ); + Trace( "[CA Cmd] TryToCreateOutput() - outputException.StackTrace: " + outputException.StackTrace ); + + if ( aFile != null ) + { + // Something went wrong with CI serialisation for the specified container. + outputEntry = aFile.AddOutput( aContainer, string.Empty, TOutputStatus.EFailed ); + // + outputEntry.AddError( "Could not Create CI", "CI output could not be created" ); + outputEntry.AddDiagnostic( "CI Sink Exception Message", outputException.Message ); + outputEntry.AddDiagnostic( "CI Sink Exception Stack", outputException.StackTrace ); + + // Since we didn't manage to sink the container to CI successfully, we must + // make sure we don't lose any associated messages from the original file. + // Merge these into the output entry also. + outputEntry.AddRange( aMessagesToAdd ); + } + } + } + + private void AssociateInputFilesWithCrashItemSources() + { + CACmdLineFSEntityList sourceFileNames = iInputs.SourceFiles; + + // Emit progress banner + if ( iReportProgress ) + { + Print( "Categorizing files..." ); + } + + // Check each source in the engine and try to map it back onto an input source + // file name. The goal is to identify input files which have no corresponding crash engine + // source. These files are unsupported. + CIEngineSourceCollection sources = iCrashItemEngine.Sources; + int count = sources.Count; + int progress = -1; + for( int i=0; i metaDataFiles = iInputs.MetaDataFiles; + foreach ( CACmdLineFSEntity file in metaDataFiles ) + { + file.CopyMessagesToContainer( aContainer ); + } + } + + + private bool ContainsSymbols( CIContainer aContainer ) + { + bool retval = false; + if (aContainer.FileNames.Length > 1) + { + retval = true; + } + return retval; + + } + + private bool IsSymbollessMobileCrash(CIContainer aContainer) + { + bool retval = false; + + + foreach (CIMessage message in aContainer.Messages) + { + if (message.Title == "MobileCrash content type") + { + if (message.Description.Trim() == "registration") + { + retval = true; + } + else if (message.Description.Trim() == "alive") + { + retval = true; + } + else if (message.Description.Trim() == "report") + { + retval = true; + } + } + } + + + return retval; + } + + + /*private bool ContainsSymbols( CIContainer aContainer ) + { + // Symbols can be registered as the global level, or then per-process. + bool ret = ( aContainer.SymbolDictionary.Count > 0 ); + if ( ret == false ) + { + // Check at process level + CISummarisableEntityList summaries = aContainer.Summaries; + foreach ( CISummarisableEntity entity in summaries.ChildrenByType() ) + { + CIProcess process = entity.Process; + if ( process != null ) + { + ret = ( process.SymbolDictionary.Count > 0 ); + if ( ret == true ) + { + break; + } + } + } + } + // + return ret; + }*/ + + private void MoveProcessedFile( CACmdLineFileSource aFile ) + { + string skippedTarget = Path.Combine(iInputs.SkippedPath, Path.GetFileName(iBinFileArchivePathName)); + string errorTarget = Path.Combine(iInputs.ErrorPath, Path.GetFileName(iBinFileArchivePathName)); + + switch ( aFile.State ) + { + case CACmdLineFileSource.TState.EStateProcessedAndReadyToBeArchived: + MoveFile(aFile, iBinFileArchivePathName); + break; + case CACmdLineFileSource.TState.EStateSkippedDueToMissingSymbols: + MoveFile(aFile, skippedTarget); + break; + case CACmdLineFileSource.TState.EStateSkippedDueToNotBeingRecognized: + MoveFile(aFile, errorTarget); + break; + default: + MoveFile(aFile, errorTarget); + break; + } + } + + private void MoveFile(CACmdLineFileSource aFile, string aTargetPath) + { + string newName = aTargetPath; + + //Name availability has already been checked before starting decoding for archive location + //If file is going to skipped, its name may need changing + if (File.Exists(newName)) + { + int counter = 1; + string original_name = newName; + while (File.Exists(newName)) + { + string basepath = Path.GetDirectoryName(original_name); + string basename = Path.GetFileNameWithoutExtension(original_name); + string extension = Path.GetExtension(original_name); + + newName = Path.Combine(basepath, basename + "_" + counter.ToString() + extension); + counter++; + } + + } + + // Move the file. + System.Console.WriteLine("Moving file " + aFile.Name + " to " + newName); + if (!iInputs.TestWithoutMovingFiles) + { + File.Move(aFile.Name, newName); + if (!File.Exists(newName)) + { + System.Console.WriteLine("Error: unable to move file " +aFile.Name +" to " +newName ); + } + + } + + + } + + #endregion + + #region Output methods + public void Print( string aMessage ) + { + System.Console.WriteLine( aMessage ); + } + #endregion + + #region From ITracer + public void Trace( string aMessage ) + { + System.Console.WriteLine("MANUAL TRACE:" +aMessage); + iDebugEngine.Trace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + string msg = string.Format( aFormat, aParams ); + Trace( msg ); + } + #endregion + + #region From ICIEngineUI + void ICIEngineUI.CITrace( string aMessage ) + { + Trace( aMessage ); + } + + void ICIEngineUI.CITrace( string aFormat, params object[] aParameters ) + { + Trace( aFormat, aParameters ); + } + #endregion + + #region From DisposableObject + protected override void CleanupManagedResources() + { + try + { + base.CleanupManagedResources(); + } + finally + { + iCrashItemEngine.Dispose(); + } + } + #endregion + + #region Data members + private readonly DbgEngine iDebugEngine; + private readonly CIEngine iCrashItemEngine; + private readonly CACmdLineInputParameters iInputs; + private bool iReportProgress = false; + private string iBinFileArchivePathName = string.Empty; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/Engine/Exceptions/CACmdLineException.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/Engine/Exceptions/CACmdLineException.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; + +namespace CrashAnalyserServerExe.Engine +{ + internal class CACmdLineException : Exception + { + #region Constants + public const int KErrNone = 0; + public const int KErrGeneral = -1; + public const int KErrSinkNotAvailable = -2; + public const int KErrCommandLineError = -3; + #endregion + + #region Constructors + public CACmdLineException( string aMessage ) + : this( aMessage, KErrGeneral ) + { + } + + public CACmdLineException( string aMessage, Exception aInnerException ) + : this( aMessage, aInnerException, KErrGeneral ) + { + } + + public CACmdLineException( string aMessage, Exception aInnerException, int aErrorCode ) + : base( aMessage, aInnerException ) + { + iErrorCode = aErrorCode; + } + + public CACmdLineException( string aMessage, int aErrorCode ) + : base( aMessage ) + { + iErrorCode = aErrorCode; + } + #endregion + + #region API + #endregion + + #region Properties + public int ErrorCode + { + get { return iErrorCode; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly int iErrorCode; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/Engine/Files/CACmdLineFSEntity.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/Engine/Files/CACmdLineFSEntity.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; + +namespace CrashAnalyserServerExe.Engine +{ + internal class CACmdLineFSEntity : CACmdLineMessageList + { + #region Constructors + public CACmdLineFSEntity() + { + } + #endregion + + #region API + #endregion + + #region Properties + public FileInfo File + { + get { return iFile; } + set { iFile = value; } + } + + public DirectoryInfo Directory + { + get { return iDirectory; } + set { iDirectory = value; } + } + + public bool IsFile + { + get { return ( iFile != null ); } + } + + public bool IsDirectory + { + get { return ( iDirectory != null); } + } + + public string Name + { + get + { + StringBuilder ret = new StringBuilder(); + // + if ( IsDirectory ) + { + ret.Append( Directory.FullName ); + } + else if ( IsFile ) + { + ret.Append( File.FullName ); + } + // + return ret.ToString(); + } + } + + public bool Exists + { + get + { + bool ret = false; + // + if ( IsDirectory ) + { + ret = Directory.Exists; + } + else if ( IsFile ) + { + ret = File.Exists; + } + // + return ret; + } + } + + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + + internal string NameUC + { + get + { + string ret = this.Name.ToUpper(); + return ret; + } + } + #endregion + + #region Operators + public static implicit operator FileInfo( CACmdLineFSEntity aFile ) + { + return aFile.iFile; + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region Data members + private object iTag = null; + private FileInfo iFile = null; + private DirectoryInfo iDirectory = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/Engine/Files/CACmdLineFSEntityList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/Engine/Files/CACmdLineFSEntityList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,168 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; + +namespace CrashAnalyserServerExe.Engine +{ + internal class CACmdLineFSEntityList : IComparer, IEnumerable where T : CACmdLineFSEntity, new() + { + #region Constructors + public CACmdLineFSEntityList() + { + } + #endregion + + #region API + public void Add( FileInfo aFile ) + { + T entry = new T(); + entry.File = aFile; + // + AddInSortedOrder( entry ); + } + + public void Add( DirectoryInfo aDir ) + { + T entry = new T(); + entry.Directory = aDir; + // + AddInSortedOrder( entry ); + } + + public void AddRange( FileInfo[] aFiles ) + { + foreach ( FileInfo file in aFiles ) + { + Add( file ); + } + } + + public bool Contains( string aFileName ) + { + CACmdLineFSEntity ret = this[ aFileName ]; + return ret != null; + } + + public void AddToAll( CACmdLineMessage aMessage ) + { + foreach ( CACmdLineFSEntity file in iFiles ) + { + file.Add( aMessage ); + } + } + + public T[] ToArray() + { + return iFiles.ToArray(); + } + #endregion + + #region Properties + public int Count + { + get { return iFiles.Count; } + } + + public T this[ int aIndex ] + { + get { return iFiles[ aIndex ]; } + } + + public T this[ string aFileName ] + { + get + { + T temp = new T(); + temp.File = new FileInfo( aFileName ); + // + int pos = iFiles.BinarySearch( temp, this ); + // + T ret = null; + if ( pos >= 0 ) + { + ret = iFiles[ pos ]; + } + // + return ret; + } + } + #endregion + + #region Internal methods + private void AddInSortedOrder( T aEntry ) + { + string fileName = aEntry.NameUC; + // + int pos = iFiles.BinarySearch( aEntry, this ); + if ( pos < 0 ) + { + pos = ~pos; + iFiles.Insert( pos, aEntry ); + } + else + { + throw new ArgumentException( "Specified file already exists: " + aEntry ); + } + } + #endregion + + #region Operators + public static implicit operator string[]( CACmdLineFSEntityList aList ) + { + List ret = new List(); + foreach ( T file in aList ) + { + ret.Add( file.Name ); + } + return ret.ToArray(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( T file in iFiles ) + { + yield return file; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( T file in iFiles ) + { + yield return file; + } + } + #endregion + + #region From IComparer + public int Compare( T aLeft, T aRight ) + { + int ret = aLeft.NameUC.CompareTo( aRight.NameUC ); + return ret; + } + #endregion + + #region Data members + private List iFiles = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/Engine/Files/CACmdLineFileSource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/Engine/Files/CACmdLineFileSource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,228 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.Crash.Container; +using CrashItemLib.Engine.Sources; + +namespace CrashAnalyserServerExe.Engine +{ + internal class CACmdLineFileSource : CACmdLineFSEntity, IEnumerable + { + #region Internal enumerations + public enum TState + { + EStateUninitialized = -1, + EStateProcessedAndReadyToBeArchived = 0, + EStateSkippedDueToMissingSymbols, + EStateSkippedDueToNotBeingRecognized + } + #endregion + + #region Constructors + public CACmdLineFileSource() + { + } + #endregion + + #region API + public OutputEntry AddOutput( CIContainer aContainer, string aFileName, TOutputStatus aStatus ) + { + OutputEntry output = new OutputEntry( aContainer, aFileName, aStatus ); + iOutputs.Add( output ); + return output; + } + + public void Add( CIContainer aContainer ) + { + // If we're adding a container, then it must be because + // there wasn't a source associated with this file (crash engine + // could not understand input file). + System.Diagnostics.Debug.Assert( iSource == null ); + + if ( iContainers == null ) + { + iContainers = new CIContainerCollection(); + } + iContainers.Add( aContainer ); + } + #endregion + + #region Properties + public CIEngineSource Source + { + get { return iSource; } + set { iSource = value; } + } + + public int OutputCount + { + get { return iOutputs.Count; } + } + + public OutputEntry this[ int aIndex ] + { + get { return iOutputs[ aIndex ]; } + } + + public OutputEntry[] Outputs + { + get { return iOutputs.ToArray(); } + } + + public int ContainerCount + { + get + { + int ret = 0; + // + if ( Source != null ) + { + ret = Source.ContainerCount; + } + else if ( iContainers != null ) + { + ret = iContainers.Count; + } + // + return ret; + } + } + + public IEnumerable Containers + { + get + { + CIContainerCollection ret = iContainers; + // + if ( Source != null ) + { + return Source; + } + else if ( ret == null ) + { + ret = new CIContainerCollection(); + } + // + return ret; + } + } + + public TState State + { + get { return iState; } + set { iState = value; } + } + #endregion + + #region Internal methods + #endregion + + #region Output class + public class OutputEntry : CACmdLineMessageList + { + #region Constructors + internal OutputEntry( CIContainer aContainer, string aOutputFileName, TOutputStatus aXmlOutputStatus ) + { + iContainer = aContainer; + iXmlOutputStatus = aXmlOutputStatus; + iOutputFileName = aOutputFileName; + } + #endregion + + #region Properties + public CIContainer Container + { + get { return iContainer; } + } + + public TOutputStatus Status + { + get + { + // There are two different statuses. One is the container-level status, + // i.e. whether the container refers to a 'real' crash or just a dummy (i.e. a 'failed' xml file). + // + // Then, there is the actual success associated with whether or not we could write + // the xml output. + TOutputStatus ret = iXmlOutputStatus; + // + if ( ret == TOutputStatus.ESuccess ) + { + // Check container level status then... + if ( Container.Status == CIContainer.TStatus.EStatusDefault ) + { + ret = TOutputStatus.ESuccess; + } + else if ( Container.Status == CIContainer.TStatus.EStatusErrorContainer ) + { + ret = TOutputStatus.EFailed; + } + } + // + return ret; + } + } + + public string OutputFileName + { + get { return iOutputFileName; } + } + #endregion + + #region Data members + private readonly TOutputStatus iXmlOutputStatus; + private readonly CIContainer iContainer; + private readonly string iOutputFileName; + #endregion + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( CIContainer container in Containers ) + { + yield return container; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIContainer container in Containers ) + { + yield return container; + } + } + #endregion + + #region Data members + private TState iState = TState.EStateUninitialized; + private CIEngineSource iSource = null; + private List iOutputs = new List(); + private CIContainerCollection iContainers = null; + #endregion + } + + public enum TOutputStatus + { + ESuccess = 0, + EFailed + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/Engine/Inputs/CACmdLineInputParameters.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/Engine/Inputs/CACmdLineInputParameters.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,322 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Reflection; +using System.Collections.Generic; +using SymbianUtils.Tracer; +using CrashItemLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Container; +using CrashItemLib.PluginAPI; +using SymbianUtils.FileSystem.Utilities; +using SymbianXmlInputLib.Parser; +using SymbianXmlInputLib.Parser.Nodes; +using SymbianXmlInputLib.Elements; +using SymbianXmlInputLib.Elements.Types.Category; +using SymbianXmlInputLib.Elements.Types.Extension; +using SymbianXmlInputLib.Elements.Types.FileSystem; +using SymbianXmlInputLib.Elements.Types.Command; +using CrashItemLib.Sink; +using System.Text.RegularExpressions; +using System.Globalization; + + +namespace CrashAnalyserServerExe.Engine +{ + internal class CACmdLineInputParameters + { + #region Constructors + public CACmdLineInputParameters( ITracer aTracer ) + { + iTracer = aTracer; + + Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly(); + iAppPath = Path.GetDirectoryName( myAssembly.Location ); + + // CHECKME: + // Source files are identified from command line current working directory. + DirectoryInfo sourceDir = new DirectoryInfo( Environment.CurrentDirectory ); + iSources.AddRange( sourceDir.GetFiles( "*.bin", SearchOption.TopDirectoryOnly ) ); + + // CHECKME: + // Read selge.ini from tool directory or CWD + FindDebugMetaDataFile( KDebugMetaDataFileSelgeIni ); + + // CHECKME: + // Read selge_event.ini from tool directory or CWD + FindDebugMetaDataFile( KDebugMetaDataFileSelgeEventIni ); + + // Sink parameters are fairly simple + Version version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + string commandLine = System.Environment.CommandLine; + iSinkParams = new CISinkSerializationParameters( version, commandLine ); + iSinkParams.DetailLevel = CISinkSerializationParameters.TDetailLevel.EFull; + iSinkParams.FileExtensionFailed = ".corrupt_ci"; + iSinkParams.FileExtensionFailed = ".ci"; + + // CHECKME: + // The output data is written to the same directory as the input file. + iSinkParams.OutputDirectory = sourceDir; + } + #endregion + + #region Command line parsing + public bool ParseCommandLine() + { + bool retval = true; + string commandLine = System.Environment.CommandLine; + + string ppattern = @"\s*(-.\s*[^-]*)"; + MatchCollection matches = Regex.Matches(commandLine, ppattern, RegexOptions.None); + if (matches.Count < 1) + { + PrintCommandHelp(); + System.Console.WriteLine("Error: No valid parameters given"); + throw new CACmdLineException("Error: No valid parameters given", CACmdLineException.KErrCommandLineError); + } + foreach (Match parameter in matches) + { + Regex pparser = new Regex(@"(?-.)\s*(?.*)"); + + Match m = pparser.Match(parameter.ToString()); + if (m.Success) + { + GroupCollection groups = m.Groups; + string paramId = m.Result("${id}").Trim(); + string paramContent = m.Result("${content}").Trim(); + + if (paramId == "-a") + { + ArchivePath = paramContent; + } + if (paramId == "-s") + { + SkippedPath = paramContent; + ErrorPath = paramContent + @"\errors"; + } + if (paramId == "-f") + { + DecodeWithoutSymbols = true; + } + if (paramId == "-t") + { + TestWithoutMovingFiles = true; + } + + } + else + { + System.Console.WriteLine("Error: No parameters found"); + retval = false; + } + + } + + //Parameter scanning finished - validate content + if (ArchivePath == string.Empty) + { + System.Console.WriteLine("Error: No archive path given"); + retval = false; + } + else if (!Directory.Exists(ArchivePath)) + { + System.Console.WriteLine("Error: Archive path " + ArchivePath +" cannot be found"); + retval = false; + + } + if (SkippedPath == string.Empty) + { + System.Console.WriteLine("Error: No skipped file path given"); + retval = false; + } + else if (!Directory.Exists(SkippedPath)) + { + System.Console.WriteLine("Error: Skipped path " + SkippedPath + " cannot be found"); + retval = false; + } + else //skipped path exists, create error path if not there + { + if (!Directory.Exists(ErrorPath)) + { + Directory.CreateDirectory(ErrorPath); + } + + } + + //make sure paths are absolute + iArchivePath = Path.GetFullPath(iArchivePath); + iSkippedPath = Path.GetFullPath(iSkippedPath); + iErrorPath = Path.GetFullPath(iErrorPath); + + //add weekly division + DateTime today = DateTime.Now; + CultureInfo culInfo = CultureInfo.CurrentCulture; + int weekNum = culInfo.Calendar.GetWeekOfYear(today, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday); + int year = culInfo.Calendar.GetYear(today); + + iArchivePath = iArchivePath + @"\" + year + "_" + weekNum.ToString().PadLeft(2, '0'); + iSkippedPath = iSkippedPath + @"\" + year + "_" + weekNum.ToString().PadLeft(2, '0'); + iErrorPath = iErrorPath + @"\" + year + "_" + weekNum.ToString().PadLeft(2, '0'); + + + if (TestWithoutMovingFiles) + { + System.Console.WriteLine("Test mode parameter -t given: Not moving any files!" ); + retval = true; + } + else if (retval) //Archive & skipped directories exsits, clean up paths and add week numbers + { + + if (!Directory.Exists(iArchivePath)) + { + Directory.CreateDirectory(iArchivePath); + } + if (!Directory.Exists(iSkippedPath)) + { + Directory.CreateDirectory(iSkippedPath); + } + if (!Directory.Exists(iErrorPath)) + { + Directory.CreateDirectory(iErrorPath); + } + } + else + { + PrintCommandHelp(); + } + System.Console.WriteLine("Using archive path " + ArchivePath + ", skipped path " + SkippedPath + " and error path " + ErrorPath); + + + return retval; + } + + private void PrintCommandHelp() + { + System.Console.WriteLine("Command line parameters:"); + System.Console.WriteLine("-a C:\\folderarchive\\ --Location where to move files to permanent archive"); + System.Console.WriteLine("-s C:\\folder\\skipped\\ --Location whére to put skipped files to wait reprocessing"); + System.Console.WriteLine("-f --Force decoding even if files are without symbols"); + System.Console.WriteLine("-t --Test mode, will not move any files, ignores -a and -s"); + + } + + #endregion + + #region API + #endregion + + #region Properties + public CISinkSerializationParameters SinkParameters + { + get { return iSinkParams; } + } + + public CACmdLineFSEntityList SourceFiles + { + get { return iSources; } + } + + public CACmdLineFSEntityList MetaDataFiles + { + get { return iMetaData; } + } + + public string ArchivePath + { + get { return iArchivePath; } + set { iArchivePath = value; } + } + public string SkippedPath + { + get { return iSkippedPath; } + set { iSkippedPath = value; } + } + public string ErrorPath + { + get { return iErrorPath; } + set { iErrorPath = value; } + } + public bool DecodeWithoutSymbols + { + get { return iDecodeWithoutSymbols; } + set { iDecodeWithoutSymbols = value; } + } + public bool TestWithoutMovingFiles + { + get { return iTestWithoutMovingFiles; } + set { iTestWithoutMovingFiles = value; } + } + + #endregion + + #region Internal constants + private const string KDebugMetaDataFileSelgeIni = "selge.ini"; + private const string KDebugMetaDataFileSelgeEventIni = "selge_event.ini"; + #endregion + + #region Internal methods + private void FindDebugMetaDataFile( string aFileName ) + { + // First try current working directory, and if not, then try application path. + DirectoryInfo sourceDir = new DirectoryInfo( Environment.CurrentDirectory ); + + string fileName = Path.Combine( sourceDir.FullName, aFileName ); + FileInfo file = new FileInfo( fileName ); + if ( file.Exists ) + { + iMetaData.Add( file ); + } + else + { + // Try app path + fileName = Path.Combine(iAppPath, aFileName); + file = new FileInfo( fileName ); + if ( file.Exists ) + { + iMetaData.Add( file ); + } + else + { + iTracer.Trace( "WARNING: Could not find debug meta data file: " + aFileName ); + } + } + } + #endregion + + + #region Data members + private readonly ITracer iTracer; + private readonly string iAppPath; + private readonly CISinkSerializationParameters iSinkParams; + private CACmdLineFSEntityList iMetaData = new CACmdLineFSEntityList(); + private CACmdLineFSEntityList iSources = new CACmdLineFSEntityList(); + + private string iArchivePath = string.Empty; + private string iSkippedPath = string.Empty; + private string iErrorPath = string.Empty; + private bool iTestWithoutMovingFiles = false; + private bool iDecodeWithoutSymbols = false; + + + + + + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/Engine/Messages/CACmdLineMessage.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/Engine/Messages/CACmdLineMessage.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,99 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; + +namespace CrashAnalyserServerExe.Engine +{ + internal class CACmdLineMessage + { + #region Enumerations + public enum TType + { + ETypeMessage = 0, + ETypeWarning, + ETypeError, + ETypeDiagnostic + } + #endregion + + #region Constructors + public CACmdLineMessage( TType aType, string aTitle, string aDescription ) + { + iType = aType; + iTitle = aTitle; + iDescription = aDescription; + } + #endregion + + #region API + public void CopyToContainer( CIContainer aContainer ) + { + // Diagnostics never appear in the crash item itself. + if ( Type != TType.ETypeDiagnostic ) + { + CIMessage msg = null; + // + if ( Type == TType.ETypeMessage ) + { + msg = CIMessage.NewMessage( aContainer ); + } + else if ( Type == TType.ETypeWarning ) + { + msg = new CIMessageWarning( aContainer ); + } + else if ( Type == TType.ETypeError ) + { + msg = new CIMessageError( aContainer ); + } + + // Build details & add to container + msg.Title = this.Title; + msg.Description = this.Description; + aContainer.Messages.Add( msg ); + } + } + #endregion + + #region Properties + public TType Type + { + get { return iType; } + } + + public string Title + { + get { return iTitle; } + } + + public string Description + { + get { return iDescription; } + } + #endregion + + #region Data members + private readonly TType iType; + private readonly string iTitle; + private readonly string iDescription; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/Engine/Messages/CACmdLineMessageList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/Engine/Messages/CACmdLineMessageList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; + +namespace CrashAnalyserServerExe.Engine +{ + internal class CACmdLineMessageList : IEnumerable + { + #region Constructors + public CACmdLineMessageList() + { + } + #endregion + + #region API + public void Clear() + { + iMessages.Clear(); + } + + public void ClearErrorsAndWarnings() + { + for( int i=iMessages.Count; i>=0; i-- ) + { + CACmdLineMessage msg = iMessages[ i ]; + // + bool remove = true; + switch( msg.Type ) + { + default: + case CACmdLineMessage.TType.ETypeError: + case CACmdLineMessage.TType.ETypeMessage: + case CACmdLineMessage.TType.ETypeWarning: + break; + case CACmdLineMessage.TType.ETypeDiagnostic: + remove = false; + break; + } + // + if ( remove ) + { + iMessages.RemoveAt( i ); + } + } + } + + public void AddError( string aTitle, string aDescription ) + { + Add( aTitle, aDescription, CACmdLineMessage.TType.ETypeError ); + } + + public void AddWarning( string aTitle, string aDescription ) + { + Add( aTitle, aDescription, CACmdLineMessage.TType.ETypeWarning ); + } + + public void AddMessage( string aTitle, string aDescription ) + { + Add( aTitle, aDescription, CACmdLineMessage.TType.ETypeMessage ); + } + + public void AddDiagnostic( string aTitle, string aDescription ) + { + Add( aTitle, aDescription, CACmdLineMessage.TType.ETypeDiagnostic ); + } + + public void Add( CACmdLineMessage aMessage ) + { + iMessages.Add( aMessage ); + } + + public void AddRange( IEnumerable aMessages ) + { + foreach ( CACmdLineMessage msg in aMessages ) + { + Add( msg ); + } + } + + public void AddRange( IEnumerable aMessages, CACmdLineMessage.TType aOnlyOfType ) + { + foreach ( CACmdLineMessage msg in aMessages ) + { + if ( msg.Type == aOnlyOfType ) + { + Add( msg ); + } + } + } + + public void CopyMessagesToContainer( CIContainer aContainer ) + { + CopyMessagesToContainer( iMessages, aContainer ); + } + + public static void CopyMessagesToContainer( IEnumerable aMessages, CIContainer aContainer ) + { + foreach ( CACmdLineMessage msg in aMessages ) + { + msg.CopyToContainer( aContainer ); + } + } + + public CACmdLineMessage[] ToArray() + { + return iMessages.ToArray(); + } + #endregion + + #region Properties + public bool IsEmtpy + { + get + { + return iMessages.Count == 0; + } + } + + public int Count + { + get { return iMessages.Count; } + } + #endregion + + #region Internal methods + private int CountByType( CACmdLineMessage.TType aType ) + { + int count = 0; + // + iMessages.ForEach( delegate( CACmdLineMessage aMessage ) + { + if ( aMessage.Type == CACmdLineMessage.TType.ETypeError ) + { + ++count; + } + } + ); + // + return count; + } + + private void Add( string aTitle, string aDescription, CACmdLineMessage.TType aType ) + { + CACmdLineMessage msg = new CACmdLineMessage( aType, aTitle, aDescription ); + Add( msg ); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( CACmdLineMessage msg in iMessages ) + { + yield return msg; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CACmdLineMessage msg in iMessages ) + { + yield return msg; + } + } + #endregion + + #region Data members + private List iMessages = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/Engine/Source/CACmdLineSource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/Engine/Source/CACmdLineSource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Source; + +namespace CrashAnalyserServerExe.Engine +{ + internal class CACmdLineSource : CISource + { + #region Constructors + public CACmdLineSource( FileInfo aFile ) + : base( aFile ) + { + } + #endregion + + #region From CISource + public override Version ImplementorVersion + { + get { return new Version( 0, 0 ); } + } + + public override string ImplementorName + { + get { return string.Empty; } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/CrashServer/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/CrashServer/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies)." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "3a1eb858-6a4c-4d6c-875b-518ed89424b5" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/App.ico Binary file crashanalysercmd/UI/Graphical/App.ico has changed diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/CrashAnalyser.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/CrashAnalyser.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,196 @@ + + + Local + 9.0.30729 + 2.0 + {20255E8D-09BB-4524-8E10-66B22ACC6662} + Debug + AnyCPU + App.ico + + + CrashAnalyser + + + JScript + Grid + IE50 + false + WinExe + CrashAnalyser + OnBuildSuccess + CrashAnalyser.EntryPoint + + + + + 2.0 + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + bin\Debug\ + false + 285212672 + false + + + TRACE;DEBUG;NEW_UI + + + true + 4096 + false + + + false + false + false + false + 4 + full + prompt + true + + + bin\Release\ + false + 285212672 + false + + + TRACE + + + false + 4096 + false + + + true + false + false + false + 4 + none + prompt + + + + System + + + System.Data + + + + + System.Drawing + + + + System.Windows.Forms + + + System.XML + + + + + + Code + + + Form + + + CAGraphicalUI.cs + + + Code + + + + + + True + True + Resources.resx + + + + CAGraphicalUI.cs + Designer + + + Designer + ResXFileCodeGenerator + Resources.Designer.cs + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {14175109-E40C-4BBA-9691-498EF118C8A0} + SymbianTabStripLib + + + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822} + SymbianUtilsUi + + + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80} + CrashAnalyserEngine + + + + + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/CrashAnalyser.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/CrashAnalyser.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ + + + 7.10.3077 + Debug + AnyCPU + + + + + + + 0 + ProjectFiles + 0 + publish\ + + + + + + + + + en-US + false + + + + + false + false + false + false + false + + + Project + + + + + + + + + C:\ + true + + + false + false + false + false + false + + + Project + + + + + + + + + + + true + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/CrashAnalyserUi.sln --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/CrashAnalyserUi.sln Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,822 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAPluginNICD", "..\Plugins\CAPluginNICD\CAPluginNICD.csproj", "{860BF3C3-FF86-4C35-9325-137886AC7FD6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAPluginCrashAnalysis", "..\Plugins\CAPluginCrashAnalyser\CAPluginCrashAnalysis.csproj", "{29D6410E-E739-4810-A582-501C807D12F0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashAnalyserEngine", "..\Common\Engine\CrashAnalyserEngine.csproj", "{F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashItemLib", "..\..\Libraries\Engine\CrashItemLib\CrashItemLib.csproj", "{A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreDumpLib", "..\..\Libraries\File Formats\Engines\CoreDumpLib\CoreDumpLib.csproj", "{F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileCrashLib", "..\..\Libraries\File Formats\Engines\MobileCrashLib\MobileCrashLib.csproj", "{00DA206A-9DA2-4B2E-A376-05CAB2881ABA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashXmlPlugin", "..\..\Libraries\File Formats\Plugins\CrashXmlPlugin\CrashXmlPlugin.csproj", "{284BC871-EAE3-4D8F-8DFF-6C953E1B119D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DExcPlugin", "..\..\Libraries\File Formats\Plugins\DExcPlugin\DExcPlugin.csproj", "{B75A7857-BA19-4A73-AACD-9F4D60C048F7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileCrashPlugin", "..\..\Libraries\File Formats\Plugins\MobileCrashPlugin\MobileCrashPlugin.csproj", "{C80A53E9-DE4C-4D81-83EF-1515702D3616}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashItemUiLib", "..\..\Libraries\UI\CrashItemUiLib\CrashItemUiLib.csproj", "{A2B52E74-358B-45A9-9291-46E66D552C4C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianCodeLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianCodeLib\SymbianCodeLib.csproj", "{A041EDFE-A120-4100-A0A6-FB1984D80815}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianDebugLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\SymbianDebugLib.csproj", "{796DD82D-9E7D-476D-B700-086CD9A893DA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SymbianNativeTools", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianNativeTools\SymbianNativeTools.vcproj", "{34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianParserLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianParserLib\SymbianParserLib.csproj", "{925A4DB0-85BD-4157-933F-5BFB93FB4DA1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\SymbianStackLib.csproj", "{3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStructuresLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStructuresLib\SymbianStructuresLib.csproj", "{D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianTree", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianTree\SymbianTree.csproj", "{2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianUtils", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianUtils\SymbianUtils.csproj", "{F6F4CE69-E73A-4917-97ED-B114DE90C92E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianXmlInputLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianXmlInputLib\SymbianXmlInputLib.csproj", "{56ECA873-7D1D-45E7-A583-A5388D753321}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianZipLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianZipLib\SymbianZipLib.csproj", "{0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianDebugLibUi", "..\..\..\PerfToolsSharedLibraries\UI\SymbianDebugUiLib\SymbianDebugLibUi.csproj", "{6C30B8C1-BF87-4626-8125-D5681B22347C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackLibUi", "..\..\..\PerfToolsSharedLibraries\UI\SymbianStackUiLib\SymbianStackLibUi.csproj", "{458E350D-35D8-46AB-978A-3BF12B8B87D7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStructuresUiLib", "..\..\..\PerfToolsSharedLibraries\UI\SymbianStructuresUiLib\SymbianStructuresUiLib.csproj", "{ED2F7C37-45E0-4F9A-A235-DD17B8C5C499}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianTabStripLib", "..\..\..\PerfToolsSharedLibraries\UI\SymbianTabStripLib\SymbianTabStripLib.csproj", "{14175109-E40C-4BBA-9691-498EF118C8A0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianUtilsUi", "..\..\..\PerfToolsSharedLibraries\UI\SymbianUtilsUi\SymbianUtilsUi.csproj", "{48F86FA3-3B42-4826-8D06-E8F2E0E7B822}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianWizardLib", "..\..\..\PerfToolsSharedLibraries\UI\SymbianWizardLib\SymbianWizardLib.csproj", "{AC323F51-47D6-46BE-8E06-7A75F4C5348D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PerfToolsSharedLibraries", "PerfToolsSharedLibraries", "{4654AB6E-7AB1-488F-8760-B076925DF4AF}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{02997FF5-9EF8-458A-8B82-9F7CFCC2F643}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rd Party", "3rd Party", "{142B69D1-345E-4135-9949-97936927092F}" + ProjectSection(SolutionItems) = preProject + ..\..\..\PerfToolsSharedLibraries\3rd Party\XPTable\bin\Debug\XPTable.dll = ..\..\..\PerfToolsSharedLibraries\3rd Party\XPTable\bin\Debug\XPTable.dll + ..\..\..\PerfToolsSharedLibraries\3rd Party\ZedGraph\zedgraph_dll_v5.1.5\ZedGraph.dll = ..\..\..\PerfToolsSharedLibraries\3rd Party\ZedGraph\zedgraph_dll_v5.1.5\ZedGraph.dll + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{5A5C8F75-8628-4D40-B724-2447841347A5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Debug Library", "Debug Library", "{A5D10EAE-21DC-4C73-8B88-FD77EF2C0BD2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{80F86CFC-08C9-4060-8E08-AD6F55739AF7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{F43AFA49-0A80-4493-9537-11B0834841B0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "File Formats", "File Formats", "{3CE0F027-A3A3-4C6D-B2D8-AE74203F73CD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{D756A058-E992-4D9B-99A0-5FDE25730702}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{01B1F836-CB1C-4FAB-B8E1-ED8AFE1DFDF6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugin", "Plugin", "{EC824253-93F1-4773-978D-4DCCDEC46500}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{A5F8A76C-414D-41B0-8F55-EB5672029589}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Exe", "Exe", "{A7DCB0FF-ED06-4CD1-AE5D-358EAD6141B1}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{99549E93-8643-4B6D-AE0A-BCAD73B188D6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{D7461F3F-9EF4-4B58-AC27-2821D76116D2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashDebuggerLib", "..\..\Libraries\Engine\CrashDebuggerLib\CrashDebuggerLib.csproj", "{F852F144-7AFC-4F56-A8F1-D7E85E25C9AA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashAnalyser", "CrashAnalyser.csproj", "{20255E8D-09BB-4524-8E10-66B22ACC6662}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAPluginRawStackUi", "..\Plugins\CAPluginRawStackUi\CAPluginRawStackUi.csproj", "{C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAPluginRawStack", "..\Plugins\CAPluginRawStack\CAPluginRawStack.csproj", "{B5D6067D-FAD0-490B-9563-408A28411C47}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Stack", "Stack", "{FB1FD438-5B4F-4F3F-A2A5-83C4FDB335D1}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Code", "Code", "{E3824912-78BF-4313-8D97-73D24CEBE460}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianInstructionLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianInstructionLib\SymbianInstructionLib.csproj", "{EB93FD74-17C6-44B2-8384-4D58DC210F77}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianSymbolLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\SymbianSymbolLib.csproj", "{6054A36B-F8A9-406F-B6CE-B531CC2AEADC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Symbols", "Symbols", "{396F86FF-A808-48ED-A64D-56EEB60B5BBB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginMap", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\Plugins\SLPluginMap\SLPluginMap.csproj", "{2E619377-8639-49F9-9494-4FAD25CBC05E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginObey", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\Plugins\SLPluginObey\SLPluginObey.csproj", "{4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginSymbol", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\Plugins\SLPluginSymbol\SLPluginSymbol.csproj", "{E921F00D-5F82-454E-9CBE-59381C48781C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SLPluginZip", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianSymbolLib\Plugins\SLPluginZip\SLPluginZip.csproj", "{BDD4E602-AC36-473A-98D0-FE062213548A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{0C40C3AD-6202-4284-B614-CE508D4865F2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianImageLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianImageLib\SymbianImageLib.csproj", "{A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CLPluginImg", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianCodeLib\Plugins\CLPluginSymbianOS\CLPluginImg.csproj", "{3878E434-8B76-4127-BA89-68A90DA6E69A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntCode", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntCode\DbgEntCode.csproj", "{E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntSymbol", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntSymbol\DbgEntSymbol.csproj", "{51C62A41-992E-4158-8A32-228ED49BF71D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CLPluginNokiaFpsx", "..\..\..\PerfToolsSharedLibraries\Engine\NokiaFpsxCLPlugin\CLPluginNokiaFpsx.csproj", "{26A14AD0-F517-45DB-874F-C71A0A8D4D5C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NokiaFlashUpdateLibrary", "..\..\..\PerfToolsSharedLibraries\Engine\NokiaFlashUpdateLib\NokiaFlashUpdateLib.vcproj", "{971A1AD8-4142-422F-A196-7E07DC73D60A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NokiaArmDisassemblyEngine", "..\..\..\PerfToolsSharedLibraries\Engine\NokiaArmDisassembler\Dll\NokiaArmDisassemblerLib.vcproj", "{3C0CECE5-1C07-463F-A216-4E5D13750CC9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NokiaArmDisassembler", "..\..\..\PerfToolsSharedLibraries\Engine\NokiaArmDisassembler\Plugin\NokiaArmDisassembler.csproj", "{BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackAlgorithmAccurate", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\Plugins\Accurate\SymbianStackAlgorithmAccurate.csproj", "{EF406EC5-04F3-45CA-BD01-686ACBD91C49}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackAlgorithmHeuristic", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\Plugins\Heuristic\SymbianStackAlgorithmHeuristic.csproj", "{19F87778-8320-42AC-BD00-FD23FC4D2828}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianStackAlgorithmBasic", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianStackLib\Plugins\Basic\SymbianStackAlgorithmBasic.csproj", "{958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAPluginCrashAnalysisUi", "..\Plugins\CAPluginCrashAnalyserUi\CAPluginCrashAnalysisUi.csproj", "{86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CAPluginNICDUi", "..\Plugins\CAPluginNICDUi\CAPluginNICDUi.csproj", "{A349F611-7ADE-48FD-AC31-726878FD6052}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashDebuggerUiLib", "..\..\Libraries\UI\CrashDebuggerUiLib\CrashDebuggerUiLib.csproj", "{76242EA7-92DF-4926-8789-2C718B5D9A66}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntMetaDataConfig", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntMetaDataConfig\DbgEntMetaDataConfig.csproj", "{E50DC404-4F0E-4E90-B548-AB737A862C70}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntKeyBindings", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntKeyBindings\DbgEntKeyBindings.csproj", "{A7036A24-40DF-4349-AE25-2CFB54743728}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianOSTLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianOSTLib\SymbianOSTLib.csproj", "{3A44B9C6-1248-4739-AF09-E6961F85B1C5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Trace", "Trace", "{ED7151EE-68D8-48E2-9713-F78D39397F77}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbgEntTrace", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianDebugLib\Plugins\DbgEntTrace\DbgEntTrace.csproj", "{9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SymbianTraceLib", "..\..\..\PerfToolsSharedLibraries\Engine\SymbianTraceLib\SymbianTraceLib.csproj", "{295412DA-8B51-4820-B6B0-63EA3949E3CB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrashInfoFilePlugin", "..\..\Libraries\File Formats\Plugins\CrashInfoFilePlugin\CrashInfoFilePlugin.csproj", "{38D6EA43-2CA2-4637-9487-B3D5B5938558}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CoreDumpPlugin", "..\..\Libraries\File Formats\Plugins\CoreDumpPlugin\CoreDumpPlugin.csproj", "{925A3566-593D-475F-BD50-EAFEC70F2C2D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|Win32 = Debug|Win32 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {860BF3C3-FF86-4C35-9325-137886AC7FD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {860BF3C3-FF86-4C35-9325-137886AC7FD6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {860BF3C3-FF86-4C35-9325-137886AC7FD6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {860BF3C3-FF86-4C35-9325-137886AC7FD6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {860BF3C3-FF86-4C35-9325-137886AC7FD6}.Debug|Win32.ActiveCfg = Debug|Any CPU + {860BF3C3-FF86-4C35-9325-137886AC7FD6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {860BF3C3-FF86-4C35-9325-137886AC7FD6}.Release|Any CPU.Build.0 = Release|Any CPU + {860BF3C3-FF86-4C35-9325-137886AC7FD6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {860BF3C3-FF86-4C35-9325-137886AC7FD6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {860BF3C3-FF86-4C35-9325-137886AC7FD6}.Release|Win32.ActiveCfg = Release|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Debug|Win32.ActiveCfg = Debug|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Release|Any CPU.Build.0 = Release|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {29D6410E-E739-4810-A582-501C807D12F0}.Release|Win32.ActiveCfg = Release|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Debug|Win32.ActiveCfg = Debug|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Release|Any CPU.Build.0 = Release|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80}.Release|Win32.ActiveCfg = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Any CPU.Build.0 = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC}.Release|Win32.ActiveCfg = Release|Any CPU + {F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94}.Debug|Win32.ActiveCfg = Debug|Any CPU + {F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94}.Release|Any CPU.Build.0 = Release|Any CPU + {F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94}.Release|Win32.ActiveCfg = Release|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Debug|Win32.ActiveCfg = Debug|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Release|Any CPU.Build.0 = Release|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA}.Release|Win32.ActiveCfg = Release|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Debug|Win32.ActiveCfg = Debug|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Release|Any CPU.Build.0 = Release|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D}.Release|Win32.ActiveCfg = Release|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Debug|Win32.ActiveCfg = Debug|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Release|Any CPU.Build.0 = Release|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B75A7857-BA19-4A73-AACD-9F4D60C048F7}.Release|Win32.ActiveCfg = Release|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Debug|Win32.ActiveCfg = Debug|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Release|Any CPU.Build.0 = Release|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C80A53E9-DE4C-4D81-83EF-1515702D3616}.Release|Win32.ActiveCfg = Release|Any CPU + {A2B52E74-358B-45A9-9291-46E66D552C4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2B52E74-358B-45A9-9291-46E66D552C4C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2B52E74-358B-45A9-9291-46E66D552C4C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A2B52E74-358B-45A9-9291-46E66D552C4C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A2B52E74-358B-45A9-9291-46E66D552C4C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A2B52E74-358B-45A9-9291-46E66D552C4C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2B52E74-358B-45A9-9291-46E66D552C4C}.Release|Any CPU.Build.0 = Release|Any CPU + {A2B52E74-358B-45A9-9291-46E66D552C4C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A2B52E74-358B-45A9-9291-46E66D552C4C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A2B52E74-358B-45A9-9291-46E66D552C4C}.Release|Win32.ActiveCfg = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Any CPU.Build.0 = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A041EDFE-A120-4100-A0A6-FB1984D80815}.Release|Win32.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Debug|Win32.ActiveCfg = Debug|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Any CPU.Build.0 = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {796DD82D-9E7D-476D-B700-086CD9A893DA}.Release|Win32.ActiveCfg = Release|Any CPU + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Win32.ActiveCfg = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Debug|Win32.Build.0 = Debug|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Any CPU.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Mixed Platforms.Build.0 = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Win32.ActiveCfg = Release|Win32 + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8}.Release|Win32.Build.0 = Release|Win32 + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Debug|Win32.ActiveCfg = Debug|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Any CPU.Build.0 = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1}.Release|Win32.ActiveCfg = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Debug|Win32.ActiveCfg = Debug|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Any CPU.Build.0 = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3}.Release|Win32.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Debug|Win32.ActiveCfg = Debug|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Any CPU.Build.0 = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6}.Release|Win32.ActiveCfg = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Debug|Win32.ActiveCfg = Debug|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Any CPU.Build.0 = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8}.Release|Win32.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Any CPU.Build.0 = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F6F4CE69-E73A-4917-97ED-B114DE90C92E}.Release|Win32.ActiveCfg = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Debug|Win32.ActiveCfg = Debug|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Any CPU.Build.0 = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {56ECA873-7D1D-45E7-A583-A5388D753321}.Release|Win32.ActiveCfg = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Debug|Win32.ActiveCfg = Debug|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Any CPU.Build.0 = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71}.Release|Win32.ActiveCfg = Release|Any CPU + {6C30B8C1-BF87-4626-8125-D5681B22347C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6C30B8C1-BF87-4626-8125-D5681B22347C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6C30B8C1-BF87-4626-8125-D5681B22347C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6C30B8C1-BF87-4626-8125-D5681B22347C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6C30B8C1-BF87-4626-8125-D5681B22347C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {6C30B8C1-BF87-4626-8125-D5681B22347C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6C30B8C1-BF87-4626-8125-D5681B22347C}.Release|Any CPU.Build.0 = Release|Any CPU + {6C30B8C1-BF87-4626-8125-D5681B22347C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6C30B8C1-BF87-4626-8125-D5681B22347C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6C30B8C1-BF87-4626-8125-D5681B22347C}.Release|Win32.ActiveCfg = Release|Any CPU + {458E350D-35D8-46AB-978A-3BF12B8B87D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {458E350D-35D8-46AB-978A-3BF12B8B87D7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {458E350D-35D8-46AB-978A-3BF12B8B87D7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {458E350D-35D8-46AB-978A-3BF12B8B87D7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {458E350D-35D8-46AB-978A-3BF12B8B87D7}.Debug|Win32.ActiveCfg = Debug|Any CPU + {458E350D-35D8-46AB-978A-3BF12B8B87D7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {458E350D-35D8-46AB-978A-3BF12B8B87D7}.Release|Any CPU.Build.0 = Release|Any CPU + {458E350D-35D8-46AB-978A-3BF12B8B87D7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {458E350D-35D8-46AB-978A-3BF12B8B87D7}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {458E350D-35D8-46AB-978A-3BF12B8B87D7}.Release|Win32.ActiveCfg = Release|Any CPU + {ED2F7C37-45E0-4F9A-A235-DD17B8C5C499}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ED2F7C37-45E0-4F9A-A235-DD17B8C5C499}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ED2F7C37-45E0-4F9A-A235-DD17B8C5C499}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {ED2F7C37-45E0-4F9A-A235-DD17B8C5C499}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {ED2F7C37-45E0-4F9A-A235-DD17B8C5C499}.Debug|Win32.ActiveCfg = Debug|Any CPU + {ED2F7C37-45E0-4F9A-A235-DD17B8C5C499}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ED2F7C37-45E0-4F9A-A235-DD17B8C5C499}.Release|Any CPU.Build.0 = Release|Any CPU + {ED2F7C37-45E0-4F9A-A235-DD17B8C5C499}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {ED2F7C37-45E0-4F9A-A235-DD17B8C5C499}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {ED2F7C37-45E0-4F9A-A235-DD17B8C5C499}.Release|Win32.ActiveCfg = Release|Any CPU + {14175109-E40C-4BBA-9691-498EF118C8A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14175109-E40C-4BBA-9691-498EF118C8A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14175109-E40C-4BBA-9691-498EF118C8A0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {14175109-E40C-4BBA-9691-498EF118C8A0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {14175109-E40C-4BBA-9691-498EF118C8A0}.Debug|Win32.ActiveCfg = Debug|Any CPU + {14175109-E40C-4BBA-9691-498EF118C8A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14175109-E40C-4BBA-9691-498EF118C8A0}.Release|Any CPU.Build.0 = Release|Any CPU + {14175109-E40C-4BBA-9691-498EF118C8A0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {14175109-E40C-4BBA-9691-498EF118C8A0}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {14175109-E40C-4BBA-9691-498EF118C8A0}.Release|Win32.ActiveCfg = Release|Any CPU + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822}.Debug|Any CPU.Build.0 = Debug|Any CPU + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822}.Debug|Win32.ActiveCfg = Debug|Any CPU + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822}.Release|Any CPU.ActiveCfg = Release|Any CPU + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822}.Release|Any CPU.Build.0 = Release|Any CPU + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822}.Release|Win32.ActiveCfg = Release|Any CPU + {AC323F51-47D6-46BE-8E06-7A75F4C5348D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC323F51-47D6-46BE-8E06-7A75F4C5348D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC323F51-47D6-46BE-8E06-7A75F4C5348D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {AC323F51-47D6-46BE-8E06-7A75F4C5348D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {AC323F51-47D6-46BE-8E06-7A75F4C5348D}.Debug|Win32.ActiveCfg = Debug|Any CPU + {AC323F51-47D6-46BE-8E06-7A75F4C5348D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC323F51-47D6-46BE-8E06-7A75F4C5348D}.Release|Any CPU.Build.0 = Release|Any CPU + {AC323F51-47D6-46BE-8E06-7A75F4C5348D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {AC323F51-47D6-46BE-8E06-7A75F4C5348D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {AC323F51-47D6-46BE-8E06-7A75F4C5348D}.Release|Win32.ActiveCfg = Release|Any CPU + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA}.Debug|Win32.ActiveCfg = Debug|Any CPU + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA}.Release|Any CPU.Build.0 = Release|Any CPU + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA}.Release|Win32.ActiveCfg = Release|Any CPU + {20255E8D-09BB-4524-8E10-66B22ACC6662}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20255E8D-09BB-4524-8E10-66B22ACC6662}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20255E8D-09BB-4524-8E10-66B22ACC6662}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {20255E8D-09BB-4524-8E10-66B22ACC6662}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {20255E8D-09BB-4524-8E10-66B22ACC6662}.Debug|Win32.ActiveCfg = Debug|Any CPU + {20255E8D-09BB-4524-8E10-66B22ACC6662}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20255E8D-09BB-4524-8E10-66B22ACC6662}.Release|Any CPU.Build.0 = Release|Any CPU + {20255E8D-09BB-4524-8E10-66B22ACC6662}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {20255E8D-09BB-4524-8E10-66B22ACC6662}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {20255E8D-09BB-4524-8E10-66B22ACC6662}.Release|Win32.ActiveCfg = Release|Any CPU + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE}.Debug|Win32.ActiveCfg = Debug|Any CPU + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE}.Release|Any CPU.Build.0 = Release|Any CPU + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE}.Release|Win32.ActiveCfg = Release|Any CPU + {B5D6067D-FAD0-490B-9563-408A28411C47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B5D6067D-FAD0-490B-9563-408A28411C47}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B5D6067D-FAD0-490B-9563-408A28411C47}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {B5D6067D-FAD0-490B-9563-408A28411C47}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {B5D6067D-FAD0-490B-9563-408A28411C47}.Debug|Win32.ActiveCfg = Debug|Any CPU + {B5D6067D-FAD0-490B-9563-408A28411C47}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B5D6067D-FAD0-490B-9563-408A28411C47}.Release|Any CPU.Build.0 = Release|Any CPU + {B5D6067D-FAD0-490B-9563-408A28411C47}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {B5D6067D-FAD0-490B-9563-408A28411C47}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {B5D6067D-FAD0-490B-9563-408A28411C47}.Release|Win32.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Debug|Win32.ActiveCfg = Debug|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Any CPU.Build.0 = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EB93FD74-17C6-44B2-8384-4D58DC210F77}.Release|Win32.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Debug|Win32.ActiveCfg = Debug|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Any CPU.Build.0 = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC}.Release|Win32.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Debug|Win32.ActiveCfg = Debug|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Any CPU.Build.0 = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2E619377-8639-49F9-9494-4FAD25CBC05E}.Release|Win32.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Debug|Win32.ActiveCfg = Debug|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Any CPU.Build.0 = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8}.Release|Win32.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Any CPU.Build.0 = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E921F00D-5F82-454E-9CBE-59381C48781C}.Release|Win32.ActiveCfg = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Debug|Win32.ActiveCfg = Debug|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Any CPU.Build.0 = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BDD4E602-AC36-473A-98D0-FE062213548A}.Release|Win32.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Any CPU.Build.0 = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB}.Release|Win32.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Debug|Win32.ActiveCfg = Debug|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Any CPU.Build.0 = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3878E434-8B76-4127-BA89-68A90DA6E69A}.Release|Win32.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Any CPU.Build.0 = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054}.Release|Win32.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Debug|Win32.ActiveCfg = Debug|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Any CPU.Build.0 = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {51C62A41-992E-4158-8A32-228ED49BF71D}.Release|Win32.ActiveCfg = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Any CPU.Build.0 = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C}.Release|Win32.ActiveCfg = Release|Any CPU + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Win32.ActiveCfg = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Debug|Win32.Build.0 = Debug|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Any CPU.ActiveCfg = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Mixed Platforms.Build.0 = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Win32.ActiveCfg = Release|Win32 + {971A1AD8-4142-422F-A196-7E07DC73D60A}.Release|Win32.Build.0 = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Mixed Platforms.Build.0 = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Win32.ActiveCfg = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Debug|Win32.Build.0 = Debug|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Any CPU.ActiveCfg = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Mixed Platforms.ActiveCfg = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Mixed Platforms.Build.0 = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Win32.ActiveCfg = Release|Win32 + {3C0CECE5-1C07-463F-A216-4E5D13750CC9}.Release|Win32.Build.0 = Release|Win32 + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Debug|Win32.ActiveCfg = Debug|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Any CPU.Build.0 = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D}.Release|Win32.ActiveCfg = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Debug|Win32.ActiveCfg = Debug|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Any CPU.Build.0 = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EF406EC5-04F3-45CA-BD01-686ACBD91C49}.Release|Win32.ActiveCfg = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Debug|Win32.ActiveCfg = Debug|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Any CPU.Build.0 = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {19F87778-8320-42AC-BD00-FD23FC4D2828}.Release|Win32.ActiveCfg = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Debug|Win32.ActiveCfg = Debug|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Any CPU.ActiveCfg = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Any CPU.Build.0 = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20}.Release|Win32.ActiveCfg = Release|Any CPU + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3}.Debug|Win32.ActiveCfg = Debug|Any CPU + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3}.Release|Any CPU.Build.0 = Release|Any CPU + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3}.Release|Win32.ActiveCfg = Release|Any CPU + {A349F611-7ADE-48FD-AC31-726878FD6052}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A349F611-7ADE-48FD-AC31-726878FD6052}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A349F611-7ADE-48FD-AC31-726878FD6052}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A349F611-7ADE-48FD-AC31-726878FD6052}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A349F611-7ADE-48FD-AC31-726878FD6052}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A349F611-7ADE-48FD-AC31-726878FD6052}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A349F611-7ADE-48FD-AC31-726878FD6052}.Release|Any CPU.Build.0 = Release|Any CPU + {A349F611-7ADE-48FD-AC31-726878FD6052}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A349F611-7ADE-48FD-AC31-726878FD6052}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A349F611-7ADE-48FD-AC31-726878FD6052}.Release|Win32.ActiveCfg = Release|Any CPU + {76242EA7-92DF-4926-8789-2C718B5D9A66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76242EA7-92DF-4926-8789-2C718B5D9A66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76242EA7-92DF-4926-8789-2C718B5D9A66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {76242EA7-92DF-4926-8789-2C718B5D9A66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {76242EA7-92DF-4926-8789-2C718B5D9A66}.Debug|Win32.ActiveCfg = Debug|Any CPU + {76242EA7-92DF-4926-8789-2C718B5D9A66}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76242EA7-92DF-4926-8789-2C718B5D9A66}.Release|Any CPU.Build.0 = Release|Any CPU + {76242EA7-92DF-4926-8789-2C718B5D9A66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {76242EA7-92DF-4926-8789-2C718B5D9A66}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {76242EA7-92DF-4926-8789-2C718B5D9A66}.Release|Win32.ActiveCfg = Release|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Debug|Win32.ActiveCfg = Debug|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Release|Any CPU.Build.0 = Release|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {E50DC404-4F0E-4E90-B548-AB737A862C70}.Release|Win32.ActiveCfg = Release|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Debug|Win32.ActiveCfg = Debug|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Release|Any CPU.Build.0 = Release|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A7036A24-40DF-4349-AE25-2CFB54743728}.Release|Win32.ActiveCfg = Release|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Debug|Win32.ActiveCfg = Debug|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Release|Any CPU.Build.0 = Release|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3A44B9C6-1248-4739-AF09-E6961F85B1C5}.Release|Win32.ActiveCfg = Release|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Debug|Win32.ActiveCfg = Debug|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Release|Any CPU.Build.0 = Release|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C}.Release|Win32.ActiveCfg = Release|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Debug|Win32.ActiveCfg = Debug|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Release|Any CPU.Build.0 = Release|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {295412DA-8B51-4820-B6B0-63EA3949E3CB}.Release|Win32.ActiveCfg = Release|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Debug|Win32.ActiveCfg = Debug|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Release|Any CPU.Build.0 = Release|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {38D6EA43-2CA2-4637-9487-B3D5B5938558}.Release|Win32.ActiveCfg = Release|Any CPU + {925A3566-593D-475F-BD50-EAFEC70F2C2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {925A3566-593D-475F-BD50-EAFEC70F2C2D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {925A3566-593D-475F-BD50-EAFEC70F2C2D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {925A3566-593D-475F-BD50-EAFEC70F2C2D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {925A3566-593D-475F-BD50-EAFEC70F2C2D}.Debug|Win32.ActiveCfg = Debug|Any CPU + {925A3566-593D-475F-BD50-EAFEC70F2C2D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {925A3566-593D-475F-BD50-EAFEC70F2C2D}.Release|Any CPU.Build.0 = Release|Any CPU + {925A3566-593D-475F-BD50-EAFEC70F2C2D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {925A3566-593D-475F-BD50-EAFEC70F2C2D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {925A3566-593D-475F-BD50-EAFEC70F2C2D}.Release|Win32.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D7461F3F-9EF4-4B58-AC27-2821D76116D2} = {A5F8A76C-414D-41B0-8F55-EB5672029589} + {99549E93-8643-4B6D-AE0A-BCAD73B188D6} = {A5F8A76C-414D-41B0-8F55-EB5672029589} + {A7DCB0FF-ED06-4CD1-AE5D-358EAD6141B1} = {A5F8A76C-414D-41B0-8F55-EB5672029589} + {860BF3C3-FF86-4C35-9325-137886AC7FD6} = {D7461F3F-9EF4-4B58-AC27-2821D76116D2} + {29D6410E-E739-4810-A582-501C807D12F0} = {D7461F3F-9EF4-4B58-AC27-2821D76116D2} + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE} = {D7461F3F-9EF4-4B58-AC27-2821D76116D2} + {B5D6067D-FAD0-490B-9563-408A28411C47} = {D7461F3F-9EF4-4B58-AC27-2821D76116D2} + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3} = {D7461F3F-9EF4-4B58-AC27-2821D76116D2} + {A349F611-7ADE-48FD-AC31-726878FD6052} = {D7461F3F-9EF4-4B58-AC27-2821D76116D2} + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80} = {99549E93-8643-4B6D-AE0A-BCAD73B188D6} + {3CE0F027-A3A3-4C6D-B2D8-AE74203F73CD} = {80F86CFC-08C9-4060-8E08-AD6F55739AF7} + {F43AFA49-0A80-4493-9537-11B0834841B0} = {80F86CFC-08C9-4060-8E08-AD6F55739AF7} + {D756A058-E992-4D9B-99A0-5FDE25730702} = {80F86CFC-08C9-4060-8E08-AD6F55739AF7} + {01B1F836-CB1C-4FAB-B8E1-ED8AFE1DFDF6} = {3CE0F027-A3A3-4C6D-B2D8-AE74203F73CD} + {EC824253-93F1-4773-978D-4DCCDEC46500} = {3CE0F027-A3A3-4C6D-B2D8-AE74203F73CD} + {F5D7CFC3-05DE-438C-B6BC-5AEE98B77D94} = {01B1F836-CB1C-4FAB-B8E1-ED8AFE1DFDF6} + {00DA206A-9DA2-4B2E-A376-05CAB2881ABA} = {01B1F836-CB1C-4FAB-B8E1-ED8AFE1DFDF6} + {B75A7857-BA19-4A73-AACD-9F4D60C048F7} = {EC824253-93F1-4773-978D-4DCCDEC46500} + {C80A53E9-DE4C-4D81-83EF-1515702D3616} = {EC824253-93F1-4773-978D-4DCCDEC46500} + {284BC871-EAE3-4D8F-8DFF-6C953E1B119D} = {EC824253-93F1-4773-978D-4DCCDEC46500} + {38D6EA43-2CA2-4637-9487-B3D5B5938558} = {EC824253-93F1-4773-978D-4DCCDEC46500} + {925A3566-593D-475F-BD50-EAFEC70F2C2D} = {EC824253-93F1-4773-978D-4DCCDEC46500} + {A2B52E74-358B-45A9-9291-46E66D552C4C} = {F43AFA49-0A80-4493-9537-11B0834841B0} + {76242EA7-92DF-4926-8789-2C718B5D9A66} = {F43AFA49-0A80-4493-9537-11B0834841B0} + {02997FF5-9EF8-458A-8B82-9F7CFCC2F643} = {4654AB6E-7AB1-488F-8760-B076925DF4AF} + {5A5C8F75-8628-4D40-B724-2447841347A5} = {4654AB6E-7AB1-488F-8760-B076925DF4AF} + {142B69D1-345E-4135-9949-97936927092F} = {4654AB6E-7AB1-488F-8760-B076925DF4AF} + {E3824912-78BF-4313-8D97-73D24CEBE460} = {02997FF5-9EF8-458A-8B82-9F7CFCC2F643} + {0C40C3AD-6202-4284-B614-CE508D4865F2} = {02997FF5-9EF8-458A-8B82-9F7CFCC2F643} + {FB1FD438-5B4F-4F3F-A2A5-83C4FDB335D1} = {02997FF5-9EF8-458A-8B82-9F7CFCC2F643} + {A5D10EAE-21DC-4C73-8B88-FD77EF2C0BD2} = {02997FF5-9EF8-458A-8B82-9F7CFCC2F643} + {396F86FF-A808-48ED-A64D-56EEB60B5BBB} = {02997FF5-9EF8-458A-8B82-9F7CFCC2F643} + {ED7151EE-68D8-48E2-9713-F78D39397F77} = {02997FF5-9EF8-458A-8B82-9F7CFCC2F643} + {A041EDFE-A120-4100-A0A6-FB1984D80815} = {E3824912-78BF-4313-8D97-73D24CEBE460} + {34CD3FB3-ABA7-4FA9-A30A-ACA8973039F8} = {E3824912-78BF-4313-8D97-73D24CEBE460} + {EB93FD74-17C6-44B2-8384-4D58DC210F77} = {E3824912-78BF-4313-8D97-73D24CEBE460} + {A9B6DAEB-B3B8-4A73-9200-6C1FCDE3E3AB} = {E3824912-78BF-4313-8D97-73D24CEBE460} + {3878E434-8B76-4127-BA89-68A90DA6E69A} = {E3824912-78BF-4313-8D97-73D24CEBE460} + {26A14AD0-F517-45DB-874F-C71A0A8D4D5C} = {E3824912-78BF-4313-8D97-73D24CEBE460} + {971A1AD8-4142-422F-A196-7E07DC73D60A} = {E3824912-78BF-4313-8D97-73D24CEBE460} + {3C0CECE5-1C07-463F-A216-4E5D13750CC9} = {E3824912-78BF-4313-8D97-73D24CEBE460} + {BE471BC2-DD55-46B9-80FA-ADE4C325EA1D} = {E3824912-78BF-4313-8D97-73D24CEBE460} + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} = {0C40C3AD-6202-4284-B614-CE508D4865F2} + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8} = {0C40C3AD-6202-4284-B614-CE508D4865F2} + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} = {0C40C3AD-6202-4284-B614-CE508D4865F2} + {56ECA873-7D1D-45E7-A583-A5388D753321} = {0C40C3AD-6202-4284-B614-CE508D4865F2} + {0B246F3F-62D3-4732-86D2-3EC1F3ADBD71} = {0C40C3AD-6202-4284-B614-CE508D4865F2} + {925A4DB0-85BD-4157-933F-5BFB93FB4DA1} = {0C40C3AD-6202-4284-B614-CE508D4865F2} + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3} = {FB1FD438-5B4F-4F3F-A2A5-83C4FDB335D1} + {EF406EC5-04F3-45CA-BD01-686ACBD91C49} = {FB1FD438-5B4F-4F3F-A2A5-83C4FDB335D1} + {19F87778-8320-42AC-BD00-FD23FC4D2828} = {FB1FD438-5B4F-4F3F-A2A5-83C4FDB335D1} + {958A6E2A-FEC7-4A7D-AB1D-58E368A08F20} = {FB1FD438-5B4F-4F3F-A2A5-83C4FDB335D1} + {458E350D-35D8-46AB-978A-3BF12B8B87D7} = {5A5C8F75-8628-4D40-B724-2447841347A5} + {ED2F7C37-45E0-4F9A-A235-DD17B8C5C499} = {5A5C8F75-8628-4D40-B724-2447841347A5} + {14175109-E40C-4BBA-9691-498EF118C8A0} = {5A5C8F75-8628-4D40-B724-2447841347A5} + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822} = {5A5C8F75-8628-4D40-B724-2447841347A5} + {AC323F51-47D6-46BE-8E06-7A75F4C5348D} = {5A5C8F75-8628-4D40-B724-2447841347A5} + {6C30B8C1-BF87-4626-8125-D5681B22347C} = {5A5C8F75-8628-4D40-B724-2447841347A5} + {796DD82D-9E7D-476D-B700-086CD9A893DA} = {A5D10EAE-21DC-4C73-8B88-FD77EF2C0BD2} + {E9ADC66E-C2DB-4CDD-B443-9053B6FC1054} = {A5D10EAE-21DC-4C73-8B88-FD77EF2C0BD2} + {51C62A41-992E-4158-8A32-228ED49BF71D} = {A5D10EAE-21DC-4C73-8B88-FD77EF2C0BD2} + {E50DC404-4F0E-4E90-B548-AB737A862C70} = {A5D10EAE-21DC-4C73-8B88-FD77EF2C0BD2} + {A7036A24-40DF-4349-AE25-2CFB54743728} = {A5D10EAE-21DC-4C73-8B88-FD77EF2C0BD2} + {9DE83DBF-827E-4A6D-BEA4-D6CCA7AA874C} = {A5D10EAE-21DC-4C73-8B88-FD77EF2C0BD2} + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC} = {D756A058-E992-4D9B-99A0-5FDE25730702} + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA} = {D756A058-E992-4D9B-99A0-5FDE25730702} + {20255E8D-09BB-4524-8E10-66B22ACC6662} = {A7DCB0FF-ED06-4CD1-AE5D-358EAD6141B1} + {6054A36B-F8A9-406F-B6CE-B531CC2AEADC} = {396F86FF-A808-48ED-A64D-56EEB60B5BBB} + {2E619377-8639-49F9-9494-4FAD25CBC05E} = {396F86FF-A808-48ED-A64D-56EEB60B5BBB} + {4C6F0ECF-A5DC-47D0-BB11-F06E1C86A6C8} = {396F86FF-A808-48ED-A64D-56EEB60B5BBB} + {E921F00D-5F82-454E-9CBE-59381C48781C} = {396F86FF-A808-48ED-A64D-56EEB60B5BBB} + {BDD4E602-AC36-473A-98D0-FE062213548A} = {396F86FF-A808-48ED-A64D-56EEB60B5BBB} + {3A44B9C6-1248-4739-AF09-E6961F85B1C5} = {ED7151EE-68D8-48E2-9713-F78D39397F77} + {295412DA-8B51-4820-B6B0-63EA3949E3CB} = {ED7151EE-68D8-48E2-9713-F78D39397F77} + EndGlobalSection +EndGlobal diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/EntryPoint.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/EntryPoint.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Text; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using System.Data; +using SymbianUtils; +using SymbianUtils.Settings; +using SymbianUtils.FileSystem.Utilities; +using SymbianUtilsUi.Dialogs; +using CrashAnalyser.UI; +using CrashAnalyserEngine.Engine; + +namespace CrashAnalyser +{ + public static class EntryPoint + { + #region Application entry point + [STAThread] + static void Main() + { + // Create UI manager which will act as application context + try + { + FSUtilities.ClearTempPath(); + CAGraphicalUIManager uiManager = new CAGraphicalUIManager(); + uiManager.Run(); + } + catch ( Exception exception ) + { + SymExceptionDialog dialog = new SymExceptionDialog(); + dialog.Exception = exception; + dialog.ShowDialog(); + } + } + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/Menu/CAMenuItem.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/Menu/CAMenuItem.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Windows.Forms; +using CrashAnalyserEngine.Interfaces; +using SymbianUtils.Settings; + +namespace CrashAnalyser.Menu +{ + internal class CAMenuItem + { + #region Constructors + public CAMenuItem( CAMenuManager aManager, string aCaption, UIMenuItemClickHandler aClickHandler, object aTag ) + { + iManager = aManager; + iClickHandler = aClickHandler; + iTag = aTag; + // + iItem = new ToolStripMenuItem( aCaption ); + iItem.Click += new EventHandler( Item_Click ); + } + #endregion + + #region API + public void Activate() + { + iItem.Visible = true; + } + + public void Deactivate() + { + iItem.Visible = false; + } + #endregion + + #region Properties + #endregion + + #region Operators + public static implicit operator ToolStripMenuItem( CAMenuItem aItem ) + { + return aItem.iItem; + } + #endregion + + #region Event handlers + private void Item_Click( object sender, EventArgs e ) + { + if ( iClickHandler != null ) + { + iClickHandler( iTag, iItem.Text ); + } + } + #endregion + + #region Data members + private readonly CAMenuManager iManager; + private readonly object iTag; + private readonly ToolStripMenuItem iItem; + private readonly UIMenuItemClickHandler iClickHandler; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/Menu/CAMenuItemList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/Menu/CAMenuItemList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Windows.Forms; +using SymbianUtils.Settings; + +namespace CrashAnalyser.Menu +{ + internal class CAMenuItemList + { + #region Constructors + public CAMenuItemList( CAMenuManager aManager ) + { + iManager = aManager; + } + #endregion + + #region API + public void Add( CAMenuItem aItem ) + { + iItems.Add( aItem ); + } + + public void Activate() + { + foreach ( CAMenuItem item in iItems ) + { + item.Activate(); + } + } + + public void Deactivate() + { + foreach ( CAMenuItem item in iItems ) + { + item.Deactivate(); + } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly CAMenuManager iManager; + private List iItems = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/Menu/CAMenuManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/Menu/CAMenuManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,149 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Windows.Forms; +using SymbianUtils.Settings; +using SymbianTabStripLib.Tabs; +using SymbianTabStripLib.Pages; +using SymbianTabStripLib.Manager; +using CrashAnalyserEngine.Interfaces; +using CrashAnalyserEngine.Tabs; + +namespace CrashAnalyser.Menu +{ + internal class CAMenuManager + { + #region Constructors + public CAMenuManager( XmlSettings aSettings, MenuStrip aMenu, TabStripManager aTabStripManager ) + { + iSettings = aSettings; + iMenuBar = aMenu; + iTabStripManager = aTabStripManager; + + // Listen to tab changes + iTabStripManager.TabStrip.SelectedTabChanged += new TabStrip.TabHandler( TabStrip_SelectedTabChanged ); + } + #endregion + + #region API + public void Add( ToolStripMenuItem aParent, string aCaption, UIMenuItemClickHandler aClickHandler, object aTag, CATab aHost ) + { + CAMenuItem item = new CAMenuItem( this, aCaption, aClickHandler, aTag ); + + if ( aHost != null ) + { + // Find a menu list for the corresponding tab + CAMenuItemList list = this[ aHost ]; + if ( list == null ) + { + list = new CAMenuItemList( this ); + iDictionary.Add( aHost, list ); + } + + // Add the item to the list + list.Add( item ); + } + else + { + // Not associated with a specific tab, so most likely a top-level + // plugin menu item that is always visible + } + + aParent.DropDownItems.Add( item ); + } + #endregion + + #region Properties + public XmlSettings Settings + { + get { return iSettings; } + } + + public MenuStrip MenuBar + { + get { return iMenuBar; } + } + #endregion + + #region Event handlers + private void TabStrip_SelectedTabChanged( TabStripTab aTab ) + { + TabStripPage page = aTab.Page; + if ( page != null ) + { + // Get the corresponding tab host + Control mainControl = aTab.Page.Body; + CATab host = mainControl as CATab; + if ( host != null ) + { + // Map tab host back to our tab type + CAMenuItemList menuItems = this[ host ]; + if ( menuItems != null ) + { + Activate( menuItems ); + } + } + } + } + #endregion + + #region Internal methods + private CAMenuItemList this[ CATab aHost ] + { + get + { + CAMenuItemList ret = null; + // + if ( iDictionary.ContainsKey( aHost ) ) + { + ret = iDictionary[ aHost ]; + } + // + return ret; + } + } + + private void Activate( CAMenuItemList aList ) + { + if ( iActiveList != null ) + { + iActiveList.Deactivate(); + iActiveList = null; + } + // + iActiveList = aList; + // + if ( iActiveList != null ) + { + iActiveList.Activate(); + } + } + #endregion + + #region Data members + private readonly XmlSettings iSettings; + private readonly MenuStrip iMenuBar; + private readonly TabStripManager iTabStripManager; + private CAMenuItemList iActiveList = null; + private Dictionary iDictionary = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/Properties/Resources.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/Properties/Resources.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.1433 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CrashAnalyser.Properties { + using System; + + + // + // A strongly-typed resource class, for looking up localized strings, etc. + // + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + // + // Returns the cached ResourceManager instance used by this class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CrashAnalyser.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + // + // Overrides the current thread's CurrentUICulture property for all + // resource lookups using this strongly typed resource class. + // + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/Properties/Resources.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/Properties/Resources.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/UI/CAGraphicalUI.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/UI/CAGraphicalUI.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,215 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CrashAnalyser.UI +{ + partial class CAGraphicalUI + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.iMenu = new System.Windows.Forms.MenuStrip(); + this.iMenu_File = new System.Windows.Forms.ToolStripMenuItem(); + this.iMenu_File_New = new System.Windows.Forms.ToolStripMenuItem(); + this.iMenu_File_SaveAs = new System.Windows.Forms.ToolStripMenuItem(); + this.iMenu_File_ExitSep = new System.Windows.Forms.ToolStripSeparator(); + this.iMenu_File_Exit = new System.Windows.Forms.ToolStripMenuItem(); + this.iMenu_Help = new System.Windows.Forms.ToolStripMenuItem(); + this.iMenu_Help_About = new System.Windows.Forms.ToolStripMenuItem(); + this.iLbl_Title = new System.Windows.Forms.Label(); + this.iLbl_Copyright = new System.Windows.Forms.Label(); + this.iTabStrip = new SymbianTabStripLib.Tabs.TabStrip(); + this.iTabStripPageManager = new SymbianTabStripLib.Pages.TabStripPageManager(); + this.iMenu.SuspendLayout(); + this.SuspendLayout(); + // + // iMenu + // + this.iMenu.Items.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.iMenu_File, + this.iMenu_Help} ); + this.iMenu.Location = new System.Drawing.Point( 0, 0 ); + this.iMenu.Name = "iMenu"; + this.iMenu.Size = new System.Drawing.Size( 792, 24 ); + this.iMenu.TabIndex = 0; + this.iMenu.Text = "Main Menu"; + // + // iMenu_File + // + this.iMenu_File.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.iMenu_File_New, + this.iMenu_File_SaveAs, + this.iMenu_File_ExitSep, + this.iMenu_File_Exit} ); + this.iMenu_File.Name = "iMenu_File"; + this.iMenu_File.Size = new System.Drawing.Size( 35, 20 ); + this.iMenu_File.Text = "&File"; + this.iMenu_File.DropDownOpening += new System.EventHandler( this.iMenu_File_DropDownOpening ); + // + // iMenu_File_New + // + this.iMenu_File_New.Name = "iMenu_File_New"; + this.iMenu_File_New.ShortcutKeyDisplayString = ""; + this.iMenu_File_New.Size = new System.Drawing.Size( 136, 22 ); + this.iMenu_File_New.Text = "&New..."; + // + // iMenu_File_SaveAs + // + this.iMenu_File_SaveAs.Name = "iMenu_File_SaveAs"; + this.iMenu_File_SaveAs.Size = new System.Drawing.Size( 136, 22 ); + this.iMenu_File_SaveAs.Text = "Save &As..."; + // + // iMenu_File_ExitSep + // + this.iMenu_File_ExitSep.Name = "iMenu_File_ExitSep"; + this.iMenu_File_ExitSep.Size = new System.Drawing.Size( 133, 6 ); + // + // iMenu_File_Exit + // + this.iMenu_File_Exit.Name = "iMenu_File_Exit"; + this.iMenu_File_Exit.Size = new System.Drawing.Size( 136, 22 ); + this.iMenu_File_Exit.Text = "E&xit"; + this.iMenu_File_Exit.Click += new System.EventHandler( this.iMenu_File_Exit_Click ); + // + // iMenu_Help + // + this.iMenu_Help.DropDownItems.AddRange( new System.Windows.Forms.ToolStripItem[] { + this.iMenu_Help_About} ); + this.iMenu_Help.Name = "iMenu_Help"; + this.iMenu_Help.Size = new System.Drawing.Size( 40, 20 ); + this.iMenu_Help.Text = "&Help"; + // + // iMenu_Help_About + // + this.iMenu_Help_About.Name = "iMenu_Help_About"; + this.iMenu_Help_About.Size = new System.Drawing.Size( 114, 22 ); + this.iMenu_Help_About.Text = "About"; + // + // iLbl_Title + // + this.iLbl_Title.Anchor = ( (System.Windows.Forms.AnchorStyles) ( ( System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right ) ) ); + this.iLbl_Title.AutoSize = true; + this.iLbl_Title.BackColor = System.Drawing.Color.Transparent; + this.iLbl_Title.Font = new System.Drawing.Font( "Tahoma", 8.25F, System.Drawing.FontStyle.Bold ); + this.iLbl_Title.ForeColor = System.Drawing.Color.White; + this.iLbl_Title.Location = new System.Drawing.Point( 645, 535 ); + this.iLbl_Title.Name = "iLbl_Title"; + this.iLbl_Title.Size = new System.Drawing.Size( 92, 13 ); + this.iLbl_Title.TabIndex = 2; + this.iLbl_Title.Text = "Crash Analyser"; + // + // iLbl_Copyright + // + this.iLbl_Copyright.Anchor = ( (System.Windows.Forms.AnchorStyles) ( ( System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right ) ) ); + this.iLbl_Copyright.AutoSize = true; + this.iLbl_Copyright.BackColor = System.Drawing.Color.Transparent; + this.iLbl_Copyright.Font = new System.Drawing.Font( "Tahoma", 8.25F ); + this.iLbl_Copyright.ForeColor = System.Drawing.Color.White; + this.iLbl_Copyright.Location = new System.Drawing.Point( 645, 551 ); + this.iLbl_Copyright.Name = "iLbl_Copyright"; + this.iLbl_Copyright.Size = new System.Drawing.Size( 136, 13 ); + this.iLbl_Copyright.TabIndex = 2; + this.iLbl_Copyright.Text = "(c) Nokia Corporation 2009"; + // + // iTabStrip + // + this.iTabStrip.Location = new System.Drawing.Point( 0, 24 ); + this.iTabStrip.Name = "iTabStrip"; + this.iTabStrip.PageManager = this.iTabStripPageManager; + this.iTabStrip.Size = new System.Drawing.Size( 792, 19 ); + this.iTabStrip.TabIndex = 8; + this.iTabStrip.Text = "iTabStrip"; + this.iTabStrip.TabCloseRequestReceiver += new SymbianTabStripLib.Tabs.TabStrip.TabHandler( this.TabStrip_TabCloseRequestReceiver ); + // + // iTabStripPageManager + // + this.iTabStripPageManager.Anchor = ( (System.Windows.Forms.AnchorStyles) ( ( ( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom ) + | System.Windows.Forms.AnchorStyles.Left ) + | System.Windows.Forms.AnchorStyles.Right ) ) ); + this.iTabStripPageManager.BackColor = System.Drawing.SystemColors.ButtonFace; + this.iTabStripPageManager.Location = new System.Drawing.Point( 0, 43 ); + this.iTabStripPageManager.Name = "iTabStripPageManager"; + this.iTabStripPageManager.Size = new System.Drawing.Size( 792, 533 ); + this.iTabStripPageManager.TabIndex = 9; + this.iTabStripPageManager.TabStrip = this.iTabStrip; + this.iTabStripPageManager.Visible = false; + // + // CAGraphicalUI + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 792, 573 ); + this.Controls.Add( this.iTabStrip ); + this.Controls.Add( this.iTabStripPageManager ); + this.Controls.Add( this.iLbl_Copyright ); + this.Controls.Add( this.iLbl_Title ); + this.Controls.Add( this.iMenu ); + this.IsMdiContainer = true; + this.MainMenuStrip = this.iMenu; + this.MinimumSize = new System.Drawing.Size( 800, 600 ); + this.Name = "CAGraphicalUI"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Crash Analyser"; + this.Load += new System.EventHandler( this.CAGraphicalUI_Load ); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler( this.CAGraphicalUI_FormClosing ); + this.Resize += new System.EventHandler( this.CAGraphicalUI_Resize ); + this.LocationChanged += new System.EventHandler( this.CAGraphicalUI_LocationChanged ); + this.iMenu.ResumeLayout( false ); + this.iMenu.PerformLayout(); + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.MenuStrip iMenu; + private System.Windows.Forms.ToolStripMenuItem iMenu_File; + private System.Windows.Forms.ToolStripMenuItem iMenu_File_Exit; + private System.Windows.Forms.ToolStripMenuItem iMenu_File_New; + private System.Windows.Forms.ToolStripMenuItem iMenu_Help; + private System.Windows.Forms.ToolStripMenuItem iMenu_Help_About; + private System.Windows.Forms.Label iLbl_Title; + private System.Windows.Forms.Label iLbl_Copyright; + private SymbianTabStripLib.Tabs.TabStrip iTabStrip; + private SymbianTabStripLib.Pages.TabStripPageManager iTabStripPageManager; + private System.Windows.Forms.ToolStripMenuItem iMenu_File_SaveAs; + private System.Windows.Forms.ToolStripSeparator iMenu_File_ExitSep; + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/UI/CAGraphicalUI.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/UI/CAGraphicalUI.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,204 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using CrashAnalyserEngine.Interfaces; +using CrashAnalyserEngine.Plugins; +using CrashAnalyserEngine.Tabs; +using CrashAnalyser.Menu; +using CrashAnalyserEngine.Engine; +using SymbianTabStripLib.Manager; + +namespace CrashAnalyser.UI +{ + internal partial class CAGraphicalUI : Form, IEngineUIManager + { + #region Constructors + public CAGraphicalUI( CAEngine aEngine ) + { + iEngine = aEngine; + + // Must call this to ensure that UI components are created before + // we load the crash analyser plugins. + InitializeComponent(); + + // Create tab manager to oversee all tab items + iTabManager = new TabStripManager( iTabStrip, this ); + iTabManager.AutoHide = true; + + // Listen for tab change events + iMenuManager = new CAMenuManager( iEngine.Settings, iMenu, iTabManager ); + + // Now it's safe to do this - the menu items that each plugin hangs off of + // will have been created + iEngine.UIManager = this; + + // Restore settings needed to position & size form + iEngine.Settings.Load( "GraphicalUI", this ); + } + #endregion + + #region API + #endregion + + #region Event handlers + private void iMenu_File_DropDownOpening( object sender, EventArgs e ) + { + ShowOrHideMenu( iMenu_File, iMenu_File_SaveAs ); + ShowOrHideMenu( iMenu_File, iMenu_File_New ); + + // Hide the separator if no save as or new menu item + iMenu_File_ExitSep.Visible = ( iMenu_File_SaveAs.DropDownItems.Count > 0 || iMenu_File_New.DropDownItems.Count > 0 ); + } + + private void iMenu_File_Exit_Click( object sender, EventArgs e ) + { + this.Close(); + } + + private void CAGraphicalUI_Load( object sender, EventArgs e ) + { + } + + private void CAGraphicalUI_FormClosing( object sender, FormClosingEventArgs e ) + { + iEngine.Settings.Save( "GraphicalUI", this ); + } + + private void TabStrip_TabCloseRequestReceiver( SymbianTabStripLib.Tabs.TabStripTab aTab ) + { + if ( aTab.Page != null && aTab.Page.Body != null ) + { + CATab body = aTab.Page.Body as CATab; + if ( body != null ) + { + UIManagerContentClose( body ); + } + } + } + + private void CAGraphicalUI_LocationChanged( object sender, EventArgs e ) + { + + } + + private void CAGraphicalUI_Resize( object sender, EventArgs e ) + { + + } + #endregion + + #region Internal methods + private void SetLabelVisibility( bool aVisible ) + { + iLbl_Title.Visible = aVisible; + iLbl_Copyright.Visible = aVisible; + } + + private void ShowOrHideMenu( ToolStripMenuItem aParent, ToolStripMenuItem aMenu ) + { + int count = aMenu.DropDownItems.Count; + bool added = aParent.DropDownItems.Contains( aMenu ); + aMenu.Visible = ( count > 0 ); + } + #endregion + + #region IEngineUIManager Members + public void UIManagerContentAdd( CATab aTab ) + { + iTabManager.Add( aTab ); + SetLabelVisibility( iTabManager.TabCount > 0 ); + } + + public void UIManagerContentClose( CATab aTab ) + { + iTabManager.Remove( aTab ); + SetLabelVisibility( iTabManager.TabCount == 0 ); + } + + public void UIManagerMenuItemAdd( TEngineUIMenuPane aPane, string aCaption, UIMenuItemClickHandler aClickHandler, object aTag ) + { + UIManagerMenuItemAdd( aPane, aCaption, aClickHandler, aTag, null ); + } + + public void UIManagerMenuItemAdd( TEngineUIMenuPane aPane, string aCaption, UIMenuItemClickHandler aClickHandler, object aTag, CATab aHost ) + { + ToolStripMenuItem parent = null; + // + switch ( aPane ) + { + case TEngineUIMenuPane.EFileNew: + parent = iMenu_File_New; + break; + case TEngineUIMenuPane.EFileSaveAs: + parent = iMenu_File_SaveAs; + break; + } + // + if ( parent != null ) + { + iMenuManager.Add( parent, aCaption, aClickHandler, aTag, aHost ); + } + } + + public Version UIVersion + { + get { return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; } + } + + public string UICommandLineArguments + { + get { return Environment.CommandLine; } + } + + public bool UIIsSilent + { + get { return false; } + } + + public void UITrace( string aMessage ) + { + if ( iDebug ) + { + StringBuilder text = new StringBuilder( aMessage ); + text.Insert( 0, string.Format( "[{0:x6}] ", System.Threading.Thread.CurrentThread.ManagedThreadId ) ); + // + System.Diagnostics.Debug.WriteLine( text.ToString() ); + } + } + + public void UITrace( string aFormat, params object[] aParams ) + { + string msg = string.Format( aFormat, aParams ); + UITrace( msg ); + } + #endregion + + #region Data members + private bool iDebug = true; + private readonly CAEngine iEngine; + private readonly CAMenuManager iMenuManager; + private readonly TabStripManager iTabManager; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/UI/CAGraphicalUI.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/UI/CAGraphicalUI.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 98, 17 + + + 48 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/UI/CAGraphicalUIManager.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/UI/CAGraphicalUIManager.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using System.Data; +using System.Windows.Forms; +using SymbianUtils.Settings; +using SymbianUtilsUi.Dialogs; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Plugins; + +namespace CrashAnalyser.UI +{ + public class CAGraphicalUIManager : ApplicationContext + { + #region Constructors + public CAGraphicalUIManager() + { + Application.ApplicationExit += new EventHandler( Application_ApplicationExit ); + + // Create engine + iEngine = new CAEngine( new string[] {} ); + } + #endregion + + #region API + public void Run() + { + // Enable visual styles if supported + if ( OSFeature.Feature.IsPresent( OSFeature.Themes ) ) + { + Application.EnableVisualStyles(); + Application.DoEvents(); + } + + CAGraphicalUI graphicalUi = new CAGraphicalUI( iEngine ); + + // Run the UI asynchronously + base.MainForm = graphicalUi; + Application.Run( this ); + } + #endregion + + #region Properties + #endregion + + #region Event handlers + protected override void OnMainFormClosed( object aSender, EventArgs aArgs ) + { + if ( aSender is CAGraphicalUI ) + { + } + + base.OnMainFormClosed( aSender, aArgs ); + Application.Exit(); + } + + private void Application_ApplicationExit( object aSender, EventArgs aArgs ) + { + try + { + if ( iEngine.Settings != null ) + { + iEngine.Settings.Store(); + } + } + catch ( Exception ) + { + } + } + #endregion + + #region Internal methods + #endregion + + #region From ApplicationContext + protected override void Dispose( bool disposing ) + { + try + { + base.Dispose( disposing ); + } + finally + { + if ( disposing ) + { + iEngine.Dispose(); + } + } + } + #endregion + + #region Data members + private readonly CAEngine iEngine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/bin/Debug/Readme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/bin/Debug/Readme.txt Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,107 @@ +Crash Analyser (c) 2008 Symbian Ltd +=================================== + +Written by Alex.Wilbur@symbian.com + +Portions of this tool are copyright (c) their respective owners. +See SupportingLibraries.txt for further information. + + +INSTALLATION INSTRUCTIONS +========================= + +This tool requires the MicroSoft .NET v2.0 RunTime. + +You can download this from MicroSoft's website: + +http://www.microsoft.com/downloads/details.aspx?familyid=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en + +CHANGES +======= + +0.51 +---- +- Various mobile crash related fixes +- Minor tweaks to internal stack walking algorithms + + +0.50 +---- +- Implemented new stack walking algorithm, which can accurately decode function calls + providing that a core rom image is supplied. The tool uses the arm instructions + in conjunction with symbol data in order to accurately walk the function call + chain. Thanks to TomG for the implementation details! +- Totally re-wrote the symbolic configuration editor - you no longer have to supply + core/rofs symbol files specifically. The tool will work out which is which. +- Added better XREF integration into the call stack viewer. +- Fixed some bugs in the symbol engine relating to labels overriding function addresses +- Fixed some bugs in the ROFS symbol engine that had crept in since 0.30 +- Fixed a bug in raw stack data that resulted in dynamic codesegments not being correctly identified +- More standards compliant Core Dump support. + + +0.40 +---- +- Added early version of NICD viewer + + +0.31 +---- +- Bug fixes to engines +- Added support for new MC fields up to version 9 of the file format + + +0.30 +---- +- GUI fixes +- added SymbianWizardLib +- extended SymbianZipLib + + +0.27 +---- +- updated sharpziplib to latest version +- escape key no longer closes wizard +- added support for new mobile crash fields +- work around mobile crash sometimes capturing the wrong stack +- prevent zip files from containing zero-length symbol files +- better handling of exception types for D_EXC and MobileCrash files (CoreDump was okay) +- fixed some cosmetic UI issues + + +0.26 +---- +- better detection and handling of corrupt mobile crash files +- close core dump file handles after parsing is complete +- include offset information in register tooltips and clipboard operations +- save as zip feature for mobile crash files no longer includes 'tmp' files + + +0.25 +---- +- added better CPSR viewer +- fix for ELF core dump exception info (it was previously missing) +- put a work around in for a core dump string defect + + +0.24 +---- +- fix for string table note problem with ELF core dump + + +0.23 +---- +- better IOP with mobile crash, and some mobile crash-specific bug fixes + + +0.22 +---- +- bug fixes +- save symbols now only saves used symbol info + + +0.21 +---- +- fixed a bug relating to loading of ROFS symbol file symbols +- exception when parsing some symbol files (timing related) +- fixed mobile crash "extra information" inability to load XPTable dll diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/bin/Debug/SupportingLibraries.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/bin/Debug/SupportingLibraries.txt Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,31 @@ +XPTable (c) Mathew Hall +======================= +http://www.codeproject.com/cs/miscctrl/XPTable.asp +http://sourceforge.net/projects/xptable/ + +/* + * Copyright © 2005, Mathew Hall + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + */ + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Graphical/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Graphical/build.xml Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,32 @@ + + + BootMonitorFTPlugin build file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CAPluginCrashAnalysis.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CAPluginCrashAnalysis.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,97 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {29D6410E-E739-4810-A582-501C807D12F0} + Library + Properties + CAPAnalysis + CACrashAnalysis.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {2BE440C1-E5F6-4F5D-B533-0F745CAA65A8} + SymbianTree + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {56ECA873-7D1D-45E7-A583-A5388D753321} + SymbianXmlInputLib + + + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC} + CrashItemLib + + + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80} + CrashAnalyserEngine + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CAPluginCrashAnalysis.csproj.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CAPluginCrashAnalysis.csproj.user Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/CACmdLineEngine.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/CACmdLineEngine.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,841 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Xml; +using System.Collections.Generic; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Source; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Sink; +using CrashItemLib.Engine; +using CrashItemLib.Engine.Sources; +using CrashItemLib.PluginAPI; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Plugins; +using CrashAnalyserEngine.Interfaces; +using SymbianUtils.FileSystem.Utilities; +using SymbianXmlInputLib.Parser; +using SymbianXmlInputLib.Parser.Nodes; +using SymbianXmlInputLib.Elements; +using SymbianXmlInputLib.Elements.Types.Category; +using SymbianXmlInputLib.Elements.Types.FileSystem; +using SymbianXmlInputLib.Elements.Types.Command; +using CAPCrashAnalysis.Plugin; +using CAPCrashAnalysis.CommandLine.Progress; +using SymbianDebugLib; +using SymbianDebugLib.Engine; +using SymbianDebugLib.Entity; +using SymbianUtils; + +namespace CAPCrashAnalysis.CommandLine +{ + internal class CACmdLineEngine + { + #region Constructors + public CACmdLineEngine( CAPluginCrashAnalysis aEngine ) + { + iEngine = aEngine; + iInputs = new CACmdLineInputParameters( aEngine ); + } + #endregion + + #region API + public bool IsCommandLineHandler( string aName ) + { + bool ret = ( aName.ToUpper() == KPluginCommandLineName ); + return ret; + } + + public int RunCommandLineOperations() + { + UITrace( "[CA Cmd] START " ); + UITrace( string.Empty ); + UITrace( "[CA Cmd] command line: " + System.Environment.CommandLine ); + UITrace( "[CA Cmd] command wd: " + System.Environment.CurrentDirectory ); + UITrace( "[CA Cmd] proc count: " + System.Environment.ProcessorCount ); + UITrace( "[CA Cmd] sysdir: " + System.Environment.SystemDirectory ); + UITrace( "[CA Cmd] version: " + System.Environment.Version.ToString() ); + UITrace( string.Empty ); + + int error = CAPlugin.KErrCommandLineNone; + // + try + { + // We expect to see an "-input" parameter + string inputFileName = ExtractCommandLineInputParameter( CommandLineArguments ); + bool generateReport = CheckForReportParameter( CommandLineArguments ); + iProgressReporter.Enabled = CheckForProgressParameter( CommandLineArguments ); + iProgressReporter.Detailed = CheckForProgressDetailedParameter(CommandLineArguments); + + // If no file was found then inputFileName will be an empty string. + if ( string.IsNullOrEmpty( inputFileName ) ) + { + throw new CACmdLineException( "Input file parameter missing", CAPlugin.KErrCommandLinePluginArgumentsMissing ); + } + else if ( !FSUtilities.Exists( inputFileName ) ) + { + throw new CACmdLineException( "Input file not found", CAPlugin.KErrCommandLinePluginArgumentsFileNotFound ); + } + else + { + // Switch off UI output at the debug engine level + iEngine.DebugEngine.UiMode = TDbgUiMode.EUiDisabled; + + // Reading the input file will throw an exception upon error. + // This is caught below and mapped onto an error code. There's nothing + // else we can do in this situation. + ReadInputFile( inputFileName ); + + // At this point we have enough information to identify the exact total + // number of progress reporting steps that will follow during the + // rest of the processing operation. + CalculateNumberOfOperationSteps(); + + // Next, attempt to prime the crash engine with every source we + // identified from the input specification. The goal is to + // create all the needed Crash Item Source objects for each input file. + // Any inputs which we don't support will not have an associated source and + // will be flagged accordingly within the CACmdLineFileSource object. + TryToPrimeSources(); + + // Now link the input files with crash source objects + AssociateInputFilesWithCrashItemSources(); + + // Next, prime the debug engine will all the debug meta-data inputs. + // Again, individual error messages will be associated with each meta-data + // input. + // + // We don't need to do this for summary operations + if ( iInputs.SinkParameters.DetailLevel != CISinkSerializationParameters.TDetailLevel.ESummary ) + { + TryToPrimeDbgEngine(); + } + + // Next we print out progress steps for skipped files, because those + // files are count to total steps. + PrintOutSkippepFiles(); + + // Next, we invoke the crash engine to process all the crash item sources we + // created during the prime step. Exceptions are caught and associated + // messages & diagnostics are created at the input-file level. + TryToIdentifyCrashes(); + + // Next, we start the output phase. Any 'valid' crash containers are serialized + // to xml. Any input files which could not be processed have 'dummy' containers + // created for them, and these are also serialised to 'failed' XML files. + // If the XML Sink plugin is unavailable, then we cannot create any XML output. + // In this situation, we throw an exception which is caught below. + TryToCreateXmlOutput(); + + // Finally, we want to create the XML manifest/report data, which we'll emit + // via standard output. + if ( generateReport ) + { + CreateAndEmitXmlReport(); + } + } + } + catch ( CACmdLineException cmdLineException ) + { + error = cmdLineException.ErrorCode; + // + UITrace( "[CA Cmd] " + cmdLineException.Message + " " + cmdLineException.StackTrace ); + } + catch ( Exception generalException ) + { + error = CAPlugin.KErrCommandLineGeneral; + // + UITrace( "[CA Cmd] " + generalException.Message + " " + generalException.StackTrace ); + } + + UITrace( "[CA Cmd] - operation complete: " + error ); + return error; + } + #endregion + + #region Properties + public string[] CommandLineArguments + { + get { return iEngine.UIEngine.CommandLineArguments; } + } + + public CIEngine CrashItemEngine + { + get { return iEngine.CrashItemEngine; } + } + #endregion + + #region Event handlers + private void DbgEngine_EntityPrimingStarted( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + UITrace( "[CA Cmd] Priming debug meta-data: " + aEntity.FullName ); + + iProgressReporter.StepBegin("Priming debug meta-data: " + aEntity.FullName, aEntity.FullName, 100); + } + + private void DbgEngine_EntityPrimingProgress( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + if ( aContext != null ) + { + if ( aContext.GetType() == typeof( int ) ) + { + int value = (int) aContext; + UITrace( "[CA Cmd] Priming debug meta-data progress: {0:d3}% {1}", value, aEntity.FullName ); + + // If reporting progress, then output something so the carbide extension is aware + // of what is going on in the background. + iProgressReporter.StepProgress(string.Empty, value, aEntity.FullName); + } + } + } + + private void DbgEngine_EntityPrimingComplete( DbgEngine aEngine, DbgEntity aEntity, object aContext ) + { + iProgressReporter.StepEnd(string.Empty, aEntity.FullName); + UITrace( "[CA Cmd] Primed debug meta-data: " + aEntity.FullName ); + } + + private void CrashItemEngine_SourceObserver( CIEngine.TSourceEvent aEvent, CIEngineSource aSource, object aParameter ) + { + string msg = string.Empty; + // + switch ( aEvent ) + { + case CIEngine.TSourceEvent.EEventSourceStateChanged: + if ( aSource.State == CIEngineSource.TState.EStateProcessing ) + { + iProgressReporter.StepBegin("Processing crash file: " + aSource.FileName, aSource.FileName, 100); + } + break; + case CIEngine.TSourceEvent.EEventSourceReady: + iProgressReporter.StepEnd(string.Empty, aSource.FileName); + break; + case CIEngine.TSourceEvent.EEventSourceProgress: + if ( aParameter != null && aParameter is int ) + { + iProgressReporter.StepProgress(string.Empty, (int)aParameter, aSource.FileName); + } + break; + default: + break; + } + } + #endregion + + #region Internal constants + private const string KParamReport = "-REPORT"; + private const string KParamProgress = "-PROGRESS"; + private const string KParamProgressDetailed = "-PROGRESS_DETAILS"; + private const string KPluginCommandLineName = "CRASH_ANALYSIS"; + private const string KPluginInputParameter = "-INPUT"; + private const string KPluginInputFileDocumentRootNode = "crash_analysis"; + + // Step keys for progress reporting + private const string KStepKeyReadingInputXml = "READING_INPUT_XML"; + private const string KStepKeyPrimingSources = "PRIMING_SOURCES"; + private const string KStepKeyWritingOutputXml = "WRITING_OUTPUT_XML"; + private const string KStepKeyCategorizingInputFiles = "CATEGORIZING_INPUT_FILES"; + #endregion + + #region Internal methods + private string ExtractCommandLineInputParameter( string[] aArgs ) + { + string ret = string.Empty; + + // -nogui -plugin CRASH_ANALYSIS -input d:\ca_fullsummary.xml + for( int i=0; i sourceFileNames = iInputs.SourceFiles; + int count = sourceFileNames.Count; + + // Emit progress banner + iProgressReporter.StepBegin( "Locating crash files...", KStepKeyPrimingSources, count ); + skippedFiles.Clear(); + for ( int i = 0; i < count; i++ ) + { + CACmdLineFileSource file = sourceFileNames[ i ]; + // + try + { + // We prime each file individually. If an exception is thrown then we + // record an appropriate error in the associated file object. + UITrace( "[CA Cmd] TryToPrimeSources() - priming: " + file ); + + bool primeSuccess = CrashItemEngine.Prime( file ); + if ( primeSuccess == false ) + { + skippedFiles.Add(file.Name); + } + + + UITrace( "[CA Cmd] TryToPrimeSources() - primed result: " + primeSuccess ); + } + catch ( Exception sourcePrimerException ) + { + file.AddError( "Error Identifying Source Type", "There was an error when attempting to identify the source file type. The file could not be processed." ); + file.AddDiagnostic( "Crash Primer Exception Message", sourcePrimerException.Message ); + file.AddDiagnostic( "Crash Primer Exception Stack", sourcePrimerException.StackTrace ); + } + + // Report progress as we work through the sources + iProgressReporter.StepProgress(string.Empty, i, KStepKeyPrimingSources); + } + + iProgressReporter.StepEnd( string.Empty, KStepKeyPrimingSources ); + + UITrace( "[CA Cmd] TryToPrimeSources() - END" ); + } + + private void TryToPrimeDbgEngine() + { + DbgEngine debugEngine = iEngine.DebugEngine; + // + Exception primerException = null; + CACmdLineFSEntityList metaDataFiles = iInputs.MetaDataFiles; + // + try + { + debugEngine.Clear(); + + foreach ( CACmdLineFSEntity entry in metaDataFiles ) + { + UITrace( "[CA Cmd] Seeding debug meta engine with entry: " + entry.Name ); + DbgEntity entity = debugEngine.Add( entry.Name ); + if ( entity != null ) + { + UITrace( "[CA Cmd] Entry type detected as: [" + entity.CategoryName + "]" ); + entity.Tag = entry; + } + else + { + UITrace( "[CA Cmd] Entry not handled: " + entry.Name ); + entry.AddError( "Meta-Data File Not Supported", "The file \'" + entry.Name + "\' is of unknown origin." ); + } + } + + // Listen to prime events + try + { + UITrace( "[CA Cmd] Starting prime operation... " ); + debugEngine.EntityPrimingStarted += new DbgEngine.EventHandler( DbgEngine_EntityPrimingStarted ); + debugEngine.EntityPrimingProgress += new DbgEngine.EventHandler( DbgEngine_EntityPrimingProgress ); + debugEngine.EntityPrimingComplete += new DbgEngine.EventHandler( DbgEngine_EntityPrimingComplete ); + debugEngine.Prime( TSynchronicity.ESynchronous ); + UITrace( "[CA Cmd] Debug meta data priming completed successfully." ); + } + finally + { + debugEngine.EntityPrimingStarted -= new DbgEngine.EventHandler( DbgEngine_EntityPrimingStarted ); + debugEngine.EntityPrimingProgress -= new DbgEngine.EventHandler( DbgEngine_EntityPrimingProgress ); + debugEngine.EntityPrimingComplete -= new DbgEngine.EventHandler( DbgEngine_EntityPrimingComplete ); + } + } + catch ( Exception exception ) + { + UITrace( "[CA Cmd] Debug meta data priming exception: " + exception.Message + ", " + exception.StackTrace ); + primerException = exception; + } + + // Go through each debug entity and check it for errors. Add diagnostics + // and error messages where appropriate. + foreach ( DbgEntity entity in debugEngine ) + { + string name = entity.FullName; + // + CACmdLineFSEntity file = metaDataFiles[ name ]; + file.Clear(); + // + if ( entity.PrimerResult.PrimedOkay ) + { + if ( !entity.Exists ) + { + file.AddError( "Meta-Data File Missing", string.Format( "The file \'{0}\' could not be found.", file.Name ) ); + } + else if ( entity.IsUnsupported ) + { + file.AddError( "Meta-Data File Not Supported", string.Format( "The file \'{0}\' is of unknown origin.", file.Name ) ); + } + } + else + { + // Add error + file.AddError( "Meta-Data Read Error", entity.PrimerResult.PrimeErrorMessage ); + + // And diagnostic information + Exception exception = entity.PrimerResult.PrimeException != null ? entity.PrimerResult.PrimeException : primerException; + if ( exception != null ) + { + file.AddDiagnostic( "Meta-Data Exception Message", entity.PrimerResult.PrimeException.Message ); + file.AddDiagnostic( "Meta-Data Exception Stack", entity.PrimerResult.PrimeException.StackTrace ); + } + else + { + file.AddDiagnostic( "Meta-Data Unknown Failure", "No exception occurred at the primer or entity level?" ); + } + } + } + } + + private void TryToIdentifyCrashes() + { + Exception crashEngineException = null; + // + try + { + iEngine.CrashItemEngine.SourceObservers += new CIEngine.CIEngineSourceObserver( CrashItemEngine_SourceObserver ); + iEngine.IdentifyCrashes( TSynchronicity.ESynchronous ); + } + catch ( Exception exception ) + { + crashEngineException = exception; + } + finally + { + iEngine.CrashItemEngine.SourceObservers -= new CIEngine.CIEngineSourceObserver( CrashItemEngine_SourceObserver ); + } + + // Check each source in the engine and create messages based upon it's + // state at the end of processing. + foreach ( CACmdLineFileSource file in iInputs.SourceFiles ) + { + if ( file.Source != null ) + { + CIEngineSource source = file.Source; + switch ( source.State ) + { + case CIEngineSource.TState.EStateReady: + // Success case - the source resulted in the creation of at least one container + file.AddDiagnostic( "Source Read Successfully", string.Format( "{0} crash container(s) created", source.ContainerCount ) ); + break; + case CIEngineSource.TState.EStateReadyNoItems: + file.AddWarning( "Source File Contains No Crashes", "The input data was read successfully but contains no crash information." ); + break; + case CIEngineSource.TState.EStateReadyCorrupt: + file.AddError( "Source File is Corrupt", "The input data is invalid or corrupt." ); + break; + case CIEngineSource.TState.EStateUninitialised: + file.AddError( "Source File not Read", "The input data was never read." ); + file.AddDiagnostic( "Source State Invalid", "Source is still in unitialised state, even though reading is complete?" ); + break; + case CIEngineSource.TState.EStateProcessing: + file.AddDiagnostic( "Source State Invalid", "Source is still in processing state, even though reading is complete?" ); + break; + default: + break; + } + } + else + { + file.AddError( "File is Not Supported", "There file type is not recognized and was not processed." ); + } + + // Add in details of any exception + if ( crashEngineException != null ) + { + file.AddDiagnostic( "Crash Identification Exception Message", crashEngineException.Message ); + file.AddDiagnostic( "Crash Identification Exception Stack", crashEngineException.StackTrace ); + } + } + } + + private void TryToCreateXmlOutput() + { + CACmdLineFSEntityList inputFiles = iInputs.SourceFiles; + // + CISink xmlSink = FindXmlSink(); + if ( xmlSink == null ) + { + throw new CACmdLineException( "XML Output Plugin Not Available", CAPlugin.KErrCommandLinePluginSinkNotAvailable ); + } + + CACmdLineFSEntityList sourceFileNames = iInputs.SourceFiles; + int count = sourceFileNames.Count; + + // Emit progress banner + iProgressReporter.StepBegin( "Creating crash XML content...", KStepKeyWritingOutputXml, count ); + + for ( int i = 0; i < count; i++ ) + { + CACmdLineFileSource file = sourceFileNames[ i ]; + + // If the file has a corresponding source then we know that crash item recognised it. + if ( file.Source == null ) + { + // File is not supported by crash item engine. Create dummy container which we'll + // serialize below. + CACmdLineSource cmdLineSource = new CACmdLineSource( file.File ); + CIContainer failedContainer = CIContainer.NewErrorContainer( CrashItemEngine, cmdLineSource ); + file.Add( failedContainer ); + } + + // We copy and remove all the file-level messages. These will be added to the container + // (where appropriate) or then to an output entry otherwise. + CACmdLineMessage[] fileMessages = file.ToArray(); + file.Clear(); + + // At this point, the input file is guaranteed to have associated containers. Either + // valid ones (created by crash item engine) or a single 'FAILED' one which we just + // added above. + foreach ( CIContainer container in file.Containers ) + { + // Firstly, add any meta-data errors/messages/warnings to this container + // as crash item message entries + AddMetaDataMessagesToContainer( container ); + + // Now we can try to serialize the container to XML. This method will + // not throw an exception. + // + // If the operation succeeds, then the input file will have an associated + // container object (and associated xml output file name) and we need not + // do anymore. + // + // If it fails, then the input file will not be assigned the container + // object and therefore, later on, we'll invoke the XML Sink directly to + // create a stub 'FAILED' XML output file. + TryToCreateXmlOutput( xmlSink, container, file, fileMessages ); + } + + // Report progress as we work through the sources + iProgressReporter.StepProgress(string.Empty, i, KStepKeyWritingOutputXml); + } + + iProgressReporter.StepEnd( string.Empty, KStepKeyWritingOutputXml ); + } + + private void TryToCreateXmlOutput( CISink aXmlSink, CIContainer aContainer, CACmdLineFileSource aFile, CACmdLineMessage[] aMessagesToAdd ) + { + UITrace( "[CA Cmd] TryToCreateXmlOutput() - START - container source: {0}", aContainer.Source.MasterFileName ); + + // By the time we are outputting a container, there should no longer be any messages + // associated with the file. + System.Diagnostics.Debug.Assert( aFile.Count == 0 ); + + // Check whether the file contained any errors or + // messages of it own. + if ( aMessagesToAdd.Length > 0 ) + { + // Copy warnings, messages and errors into crash item container. + // Diagnostic messages are not copied. + CACmdLineFSEntity.CopyMessagesToContainer( aMessagesToAdd, aContainer ); + } + + // This is where we will record the output attempt + CACmdLineFileSource.OutputEntry outputEntry = null; + // + try + { + // Finish preparing the sink parameters + CISinkSerializationParameters sinkParams = iInputs.SinkParameters; + sinkParams.Container = aContainer; + + // Perform serialization + UITrace( "[CA Cmd] TryToCreateXmlOutput() - serializing..." ); + object output = aXmlSink.Serialize( sinkParams ); + UITrace( "[CA Cmd] TryToCreateXmlOutput() - serialization returned: " + output ); + + if ( aFile != null ) + { + // Create new output + string outputFileName = output is string ? (string) output : string.Empty; + + // Save output file name + outputEntry = aFile.AddOutput( aContainer, outputFileName, TOutputStatus.ESuccess ); + } + + // Merge in any diagnostic messages that were left into the output entry. + // This ensure we output diagnostics in the final manifest data. + outputEntry.AddRange( aMessagesToAdd, CACmdLineMessage.TType.ETypeDiagnostic ); + } + catch ( Exception outputException ) + { + UITrace( "[CA Cmd] TryToCreateXmlOutput() - outputException.Message: " + outputException.Message ); + UITrace( "[CA Cmd] TryToCreateXmlOutput() - outputException.StackTrace: " + outputException.StackTrace ); + + if ( aFile != null ) + { + // Something went wrong with XML serialisation for the specified container. + outputEntry = aFile.AddOutput( aContainer, string.Empty, TOutputStatus.EFailed ); + // + outputEntry.AddError( "Could not Create XML", "XML output could not be created" ); + outputEntry.AddDiagnostic( "XML Sink Exception Message", outputException.Message ); + outputEntry.AddDiagnostic( "XML Sink Exception Stack", outputException.StackTrace ); + + // Since we didn't manage to sink the container to XML successfully, we must + // make sure we don't lose any associated messages from the original file. + // Merge these into the output entry also. + outputEntry.AddRange( aMessagesToAdd ); + } + } + } + + private void CreateAndEmitXmlReport() + { + CACmdLineManifestWriter writer = new CACmdLineManifestWriter( iInputs.SourceFiles ); + string xml = writer.Create(); + // + using( StringReader reader = new StringReader( xml ) ) + { + string line = reader.ReadLine(); + while ( line != null ) + { + System.Console.WriteLine( line ); + line = reader.ReadLine(); + } + } + } + + private void AssociateInputFilesWithCrashItemSources() + { + CACmdLineFSEntityList sourceFileNames = iInputs.SourceFiles; + CIEngineSourceCollection sources = iEngine.CrashItemEngine.Sources; + int count = sources.Count; + + // Emit progress banner + iProgressReporter.StepBegin( "Categorizing files...", KStepKeyCategorizingInputFiles, count ); + + // Check each source in the engine and try to map it back onto an input source + // file name. The goal is to identify input files which have no corresponding crash engine + // source. These files are unsupported. + for( int i=0; i 0 ) + { + foreach ( string skippedFile in skippedFiles ) + { + iProgressReporter.StepBegin( "Skipped non-crash file: " + skippedFile, skippedFile, 100 ); + iProgressReporter.StepEnd( "", skippedFile ); + } + } + } + + private void AddMetaDataMessagesToContainer( CIContainer aContainer ) + { + // All meta-data errors, warnings & messages are added as + // children of the container. + CACmdLineFSEntityList metaDataFiles = iInputs.MetaDataFiles; + foreach ( CACmdLineFSEntity file in metaDataFiles ) + { + file.CopyMessagesToContainer( aContainer ); + } + } + #endregion + + #region Data members + private readonly CAPluginCrashAnalysis iEngine; + private readonly CACmdLineInputParameters iInputs; + private CACmdLineProgressReporter iProgressReporter = new CACmdLineProgressReporter(); + List skippedFiles = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Exceptions/CACmdLineException.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Exceptions/CACmdLineException.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashAnalyserEngine.Plugins; + +namespace CAPCrashAnalysis.CommandLine +{ + internal class CACmdLineException : Exception + { + #region Constructors + public CACmdLineException( string aMessage ) + : this( aMessage, CAPlugin.KErrCommandLineGeneral ) + { + } + + public CACmdLineException( string aMessage, Exception aInnerException ) + : this( aMessage, aInnerException, CAPlugin.KErrCommandLineGeneral ) + { + } + + public CACmdLineException( string aMessage, Exception aInnerException, int aErrorCode ) + : base( aMessage, aInnerException ) + { + iErrorCode = aErrorCode; + } + + public CACmdLineException( string aMessage, int aErrorCode ) + : base( aMessage ) + { + iErrorCode = aErrorCode; + } + #endregion + + #region API + public static void CreateXmlErrorFile( Stream aStream, Exception aException ) + { + using ( aStream ) + { + } + } + #endregion + + #region Properties + public int ErrorCode + { + get { return iErrorCode; } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly int iErrorCode; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Files/CACmdLineFSEntity.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Files/CACmdLineFSEntity.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,138 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashAnalyserEngine.Plugins; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; + +namespace CAPCrashAnalysis.CommandLine +{ + internal class CACmdLineFSEntity : CACmdLineMessageList + { + #region Constructors + public CACmdLineFSEntity() + { + } + #endregion + + #region API + #endregion + + #region Properties + public FileInfo File + { + get { return iFile; } + set { iFile = value; } + } + + public DirectoryInfo Directory + { + get { return iDirectory; } + set { iDirectory = value; } + } + + public bool IsFile + { + get { return ( iFile != null ); } + } + + public bool IsDirectory + { + get { return ( iDirectory != null); } + } + + public string Name + { + get + { + StringBuilder ret = new StringBuilder(); + // + if ( IsDirectory ) + { + ret.Append( Directory.FullName ); + } + else if ( IsFile ) + { + ret.Append( File.FullName ); + } + // + return ret.ToString(); + } + } + + public bool Exists + { + get + { + bool ret = false; + // + if ( IsDirectory ) + { + ret = Directory.Exists; + } + else if ( IsFile ) + { + ret = File.Exists; + } + // + return ret; + } + } + + public object Tag + { + get { return iTag; } + set { iTag = value; } + } + + internal string NameUC + { + get + { + string ret = this.Name.ToUpper(); + return ret; + } + } + #endregion + + #region Operators + public static implicit operator FileInfo( CACmdLineFSEntity aFile ) + { + return aFile.iFile; + } + #endregion + + #region Internal methods + #endregion + + #region From System.Object + public override string ToString() + { + return Name; + } + #endregion + + #region Data members + private object iTag = null; + private FileInfo iFile = null; + private DirectoryInfo iDirectory = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Files/CACmdLineFSEntityList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Files/CACmdLineFSEntityList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashAnalyserEngine.Plugins; + +namespace CAPCrashAnalysis.CommandLine +{ + internal class CACmdLineFSEntityList : IComparer, IEnumerable where T : CACmdLineFSEntity, new() + { + #region Constructors + public CACmdLineFSEntityList() + { + } + #endregion + + #region API + public void Add( FileInfo aFile ) + { + T entry = new T(); + entry.File = aFile; + // + AddInSortedOrder( entry ); + } + + public void Add( DirectoryInfo aDir ) + { + T entry = new T(); + entry.Directory = aDir; + // + AddInSortedOrder( entry ); + } + + public void AddRange( FileInfo[] aFiles ) + { + foreach ( FileInfo file in aFiles ) + { + Add( file ); + } + } + + public bool Contains( string aFileName ) + { + CACmdLineFSEntity ret = this[ aFileName ]; + return ret != null; + } + + public void AddToAll( CACmdLineMessage aMessage ) + { + foreach ( CACmdLineFSEntity file in iFiles ) + { + file.Add( aMessage ); + } + } + + public T[] ToArray() + { + return iFiles.ToArray(); + } + #endregion + + #region Properties + public int Count + { + get { return iFiles.Count; } + } + + public T this[ int aIndex ] + { + get { return iFiles[ aIndex ]; } + } + + public T this[ string aFileName ] + { + get + { + T temp = new T(); + temp.File = new FileInfo( aFileName ); + // + int pos = iFiles.BinarySearch( temp, this ); + // + T ret = null; + if ( pos >= 0 ) + { + ret = iFiles[ pos ]; + } + // + return ret; + } + } + #endregion + + #region Internal methods + private void AddInSortedOrder( T aEntry ) + { + string fileName = aEntry.NameUC; + // + int pos = iFiles.BinarySearch( aEntry, this ); + if ( pos < 0 ) + { + pos = ~pos; + iFiles.Insert( pos, aEntry ); + } + else + { + throw new ArgumentException( "Specified file already exists: " + aEntry ); + } + } + #endregion + + #region Operators + public static implicit operator string[]( CACmdLineFSEntityList aList ) + { + List ret = new List(); + foreach ( T file in aList ) + { + ret.Add( file.Name ); + } + return ret.ToArray(); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( T file in iFiles ) + { + yield return file; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( T file in iFiles ) + { + yield return file; + } + } + #endregion + + #region From IComparer + public int Compare( T aLeft, T aRight ) + { + int ret = aLeft.NameUC.CompareTo( aRight.NameUC ); + return ret; + } + #endregion + + #region Data members + private List iFiles = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Files/CACmdLineFileSource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Files/CACmdLineFileSource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,212 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashAnalyserEngine.Plugins; +using CrashItemLib.Crash.Container; +using CrashItemLib.Engine.Sources; + +namespace CAPCrashAnalysis.CommandLine +{ + internal class CACmdLineFileSource : CACmdLineFSEntity, IEnumerable + { + #region Constructors + public CACmdLineFileSource() + { + } + #endregion + + #region API + public OutputEntry AddOutput( CIContainer aContainer, string aFileName, TOutputStatus aStatus ) + { + OutputEntry output = new OutputEntry( aContainer, aFileName, aStatus ); + iOutputs.Add( output ); + return output; + } + + public void Add( CIContainer aContainer ) + { + // If we're adding a container, then it must be because + // there wasn't a source associated with this file (crash engine + // could not understand input file). + System.Diagnostics.Debug.Assert( iSource == null ); + + if ( iContainers == null ) + { + iContainers = new CIContainerCollection(); + } + iContainers.Add( aContainer ); + } + #endregion + + #region Properties + public CIEngineSource Source + { + get { return iSource; } + set { iSource = value; } + } + + public int OutputCount + { + get { return iOutputs.Count; } + } + + public OutputEntry this[ int aIndex ] + { + get { return iOutputs[ aIndex ]; } + } + + public OutputEntry[] Outputs + { + get { return iOutputs.ToArray(); } + } + + public int ContainerCount + { + get + { + int ret = 0; + // + if ( Source != null ) + { + ret = Source.ContainerCount; + } + else if ( iContainers != null ) + { + ret = iContainers.Count; + } + // + return ret; + } + } + + public IEnumerable Containers + { + get + { + CIContainerCollection ret = iContainers; + // + if ( Source != null ) + { + return Source; + } + else if ( ret == null ) + { + ret = new CIContainerCollection(); + } + // + return ret; + } + } + #endregion + + #region Internal methods + #endregion + + #region Output class + public class OutputEntry : CACmdLineMessageList + { + #region Constructors + internal OutputEntry( CIContainer aContainer, string aOutputFileName, TOutputStatus aXmlOutputStatus ) + { + iContainer = aContainer; + iXmlOutputStatus = aXmlOutputStatus; + iOutputFileName = aOutputFileName; + } + #endregion + + #region Properties + public CIContainer Container + { + get { return iContainer; } + } + + public TOutputStatus Status + { + get + { + // There are two different statuses. One is the container-level status, + // i.e. whether the container refers to a 'real' crash or just a dummy (i.e. a 'failed' xml file). + // + // Then, there is the actual success associated with whether or not we could write + // the xml output. + TOutputStatus ret = iXmlOutputStatus; + // + if ( ret == TOutputStatus.ESuccess ) + { + // Check container level status then... + if ( Container.Status == CIContainer.TStatus.EStatusDefault ) + { + ret = TOutputStatus.ESuccess; + } + else if ( Container.Status == CIContainer.TStatus.EStatusErrorContainer ) + { + ret = TOutputStatus.EFailed; + } + } + // + return ret; + } + } + + public string OutputFileName + { + get { return iOutputFileName; } + } + #endregion + + #region Data members + private readonly TOutputStatus iXmlOutputStatus; + private readonly CIContainer iContainer; + private readonly string iOutputFileName; + #endregion + } + #endregion + + #region From IEnumerable + public new IEnumerator GetEnumerator() + { + foreach ( CIContainer container in Containers ) + { + yield return container; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CIContainer container in Containers ) + { + yield return container; + } + } + #endregion + + #region Data members + private CIEngineSource iSource = null; + private List iOutputs = new List(); + private CIContainerCollection iContainers = null; + #endregion + } + + public enum TOutputStatus + { + ESuccess = 0, + EFailed + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Inputs/CACmdLineInputParameters.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Inputs/CACmdLineInputParameters.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,316 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashAnalyserEngine.Plugins; +using CrashItemLib.Engine; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Container; +using CrashItemLib.PluginAPI; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Interfaces; +using CAPCrashAnalysis.Plugin; +using SymbianUtils.FileSystem.Utilities; +using SymbianXmlInputLib.Parser; +using SymbianXmlInputLib.Parser.Nodes; +using SymbianXmlInputLib.Elements; +using SymbianXmlInputLib.Elements.Types.Category; +using SymbianXmlInputLib.Elements.Types.Extension; +using SymbianXmlInputLib.Elements.Types.FileSystem; +using SymbianXmlInputLib.Elements.Types.Command; +using CrashItemLib.Sink; + +namespace CAPCrashAnalysis.CommandLine +{ + internal class CACmdLineInputParameters + { + #region Constructors + public CACmdLineInputParameters( CAPluginCrashAnalysis aEngine ) + { + iEngine = aEngine; + // + Version version = aEngine.UIManager.UIVersion; + string commandLine = aEngine.UIManager.UICommandLineArguments; + // + iSinkParams = new CISinkSerializationParameters( version, commandLine ); + } + #endregion + + #region API + public void Read( string aFileName ) + { + Trace( "[CmdInput] Read() - aFileName: " + aFileName ); + try + { + // First create the tree + SXILDocument doc = CreateDocumentTree( aFileName ); + + // Then convert it to the list of elements that we care about + ExtractData( doc ); + } + catch ( CACmdLineException cmdLineException ) + { + Trace( "[CmdInput] Read() - CACmdLineException: " + cmdLineException.Message + " " + cmdLineException.StackTrace ); + throw cmdLineException; + } + catch ( Exception generalException ) + { + Trace( "[CmdInput] Read() - generalException: " + generalException.Message + " " + generalException.StackTrace ); + throw new CACmdLineException( "Error reading input xml file", generalException, CAPlugin.KErrCommandLinePluginArgumentsFileInvalid ); + } + Trace( "[CmdInput] Read() - read OK: " + aFileName ); + } + #endregion + + #region Properties + public CISinkSerializationParameters SinkParameters + { + get { return iSinkParams; } + } + + public CACmdLineFSEntityList SourceFiles + { + get { return iSources; } + } + + public CACmdLineFSEntityList MetaDataFiles + { + get { return iMetaData; } + } + #endregion + + #region Internal constants + private const string KInputFileDocumentRootNode = "crash_analysis"; + private const string KInputFileCategorySource = "source"; + private const string KInputFileCategoryDebugMetaData = "debug_meta_data"; + private const string KInputFileCategoryParameters = "parameters"; + private const string KInputFileCategoryOutput = "output"; + private const string KInputFileCommandNameAnalysis = "analysis_type"; + private const string KInputFileCommandNameAnalysisFull = "FULL"; + private const string KInputFileCommandNameAnalysisSummary = "SUMMARY"; + #endregion + + #region Internal methods + private SXILDocument CreateDocumentTree( string aFileName ) + { + SXILDocument doc = new SXILDocument(); + + // Read input file into document + using ( SXILParser parser = new SXILParser( aFileName, KInputFileDocumentRootNode, doc ) ) + { + parser.CategoryAdd( KInputFileCategorySource, new SXILParserNodeFileSystem() ); + parser.CategoryAdd( KInputFileCategoryDebugMetaData, new SXILParserNodeFileSystem() ); + parser.CategoryAdd( KInputFileCategoryParameters, + new SXILParserNodeCommand(), + new SXILParserNodeExtension() + ); + parser.CategoryAdd( KInputFileCategoryOutput, new SXILParserNodeFileSystem() ); + parser.Parse(); + } + + return doc; + } + + private void ExtractData( SXILDocument aDocument ) + { + foreach ( SXILElement element in aDocument ) + { + if ( element is SXILElementCategory ) + { + SXILElementCategory category = (SXILElementCategory) element; + string name = category.Name.ToLower(); + // + switch ( name ) + { + case KInputFileCategorySource: + ExtractFileList( iSources, category ); + break; + case KInputFileCategoryDebugMetaData: + // The debug meta data engine doesn't support directories anymore + // so we have to expand all directories to files. + ExtractFileList( iMetaData, category ); + break; + case KInputFileCategoryParameters: + ExtractParameters( category ); + break; + case KInputFileCategoryOutput: + ExtractOutput( category ); + break; + } + } + } + + // We don't require debug meta data if performing a summary operation. Otherwise, we do. + if ( iMetaData.Count == 0 && iSinkParams.DetailLevel == CISinkSerializationParameters.TDetailLevel.EFull ) + { + Trace( "[CmdInput] ExtractData() - WARNING - no debug meta data supplied for full analysis." ); + } + + } + + private void ExtractFileList( CACmdLineFSEntityList aList, SXILElementCategory aCategory ) where T : CACmdLineFSEntity, new() + { + foreach ( SXILElement element in aCategory ) + { + if ( element is SXILElementFile ) + { + SXILElementFile file = (SXILElementFile) element; + Trace( "[CmdInput] ExtractFileList() - file: " + file ); + if ( !file.Exists ) + { + throw new FileNotFoundException( "File not found", file.Name ); + } + // + aList.Add( file ); + } + else if ( element is SXILElementDirectory ) + { + SXILElementDirectory dir = (SXILElementDirectory) element; + Trace( "[CmdInput] ExtractFileList() - dir: " + dir ); + if ( !dir.Exists ) + { + throw new DirectoryNotFoundException( "Directory not found: " + dir.Name ); + } + // + aList.AddRange( dir.Files ); + } + } + } + + private void ExtractParameters( SXILElementCategory aCategory ) + { + foreach ( SXILElement element in aCategory ) + { + if ( element is SXILElementExtension ) + { + SXILElementExtension entry = (SXILElementExtension) element; + // + string extension = entry.Name; + if ( !extension.StartsWith( "." ) ) + { + extension = "." + extension; + } + // + if ( entry.Type == SXILElementExtension.TType.ETypeFailure ) + { + Trace( "[CmdInput] ExtractFileList() - failed extension: " + extension ); + iSinkParams.FileExtensionFailed = extension; + } + else if ( entry.Type == SXILElementExtension.TType.ETypeSuccess ) + { + Trace( "[CmdInput] ExtractFileList() - success extension: " + extension ); + iSinkParams.FileExtensionSuccess = extension; + } + } + else if ( element is SXILElementCommand ) + { + SXILElementCommand entry = (SXILElementCommand) element; + // + if ( entry.Name == KInputFileCommandNameAnalysis ) + { + string type = entry.Details.Trim().ToUpper(); + Trace( "[CmdInput] ExtractFileList() - command: " + type ); + switch ( type ) + { + case KInputFileCommandNameAnalysisFull: + iSinkParams.DetailLevel = CISinkSerializationParameters.TDetailLevel.EFull; + break; + case KInputFileCommandNameAnalysisSummary: + iSinkParams.DetailLevel = CISinkSerializationParameters.TDetailLevel.ESummary; + break; + default: + throw new NotSupportedException( "Unsupported analysis type" ); + } + } + else + { + throw new NotSupportedException( "Unsupported command: " + entry.Name ); + } + } + } + } + + private void ExtractOutput( SXILElementCategory aCategory ) + { + // We either output to file or directory - if both are present then bail out + FileInfo savedFile = null; + DirectoryInfo savedDir = null; + // + foreach ( SXILElement element in aCategory ) + { + if ( element is SXILElementFile ) + { + if ( savedFile != null ) + { + throw new InvalidDataException( "Output file already specified" ); + } + else + { + SXILElementFile file = (SXILElementFile) element; + savedFile = file; + } + } + else if ( element is SXILElementDirectory ) + { + if ( savedDir != null ) + { + throw new InvalidDataException( "Output directory already specified" ); + } + else + { + SXILElementDirectory dir = (SXILElementDirectory) element; + savedDir = dir; + } + } + } + + // Ensure we have only one type + if ( savedFile != null && savedDir != null ) + { + throw new InvalidDataException( "Output must be EITHER file or directory" ); + } + else if ( savedFile != null ) + { + iSinkParams.OutputFile = savedFile; + } + else if ( savedDir != null ) + { + iSinkParams.OutputDirectory = savedDir; + } + } + + public void Trace( string aMessage ) + { + iEngine.UIManager.UITrace( aMessage ); + } + + public void Trace( string aFormat, params object[] aParams ) + { + iEngine.UIManager.UITrace( aFormat, aParams ); + } + #endregion + + #region Data members + private readonly CAPluginCrashAnalysis iEngine; + private readonly CISinkSerializationParameters iSinkParams; + private CACmdLineFSEntityList iMetaData = new CACmdLineFSEntityList(); + private CACmdLineFSEntityList iSources = new CACmdLineFSEntityList(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Messages/CACmdLineMessage.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Messages/CACmdLineMessage.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashAnalyserEngine.Plugins; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; + +namespace CAPCrashAnalysis.CommandLine +{ + internal class CACmdLineMessage + { + #region Enumerations + public enum TType + { + ETypeMessage = 0, + ETypeWarning, + ETypeError, + ETypeDiagnostic + } + #endregion + + #region Constructors + public CACmdLineMessage( TType aType, string aTitle, string aDescription ) + { + iType = aType; + iTitle = aTitle; + iDescription = aDescription; + } + #endregion + + #region API + public void CopyToContainer( CIContainer aContainer ) + { + // Diagnostics never appear in the crash item itself. + if ( Type != TType.ETypeDiagnostic ) + { + CIMessage msg = null; + // + if ( Type == TType.ETypeMessage ) + { + msg = CIMessage.NewMessage( aContainer ); + } + else if ( Type == TType.ETypeWarning ) + { + msg = new CIMessageWarning( aContainer ); + } + else if ( Type == TType.ETypeError ) + { + msg = new CIMessageError( aContainer ); + } + + // Build details & add to container + msg.Title = this.Title; + msg.Description = this.Description; + aContainer.Messages.Add( msg ); + } + } + #endregion + + #region Properties + public TType Type + { + get { return iType; } + } + + public string Title + { + get { return iTitle; } + } + + public string Description + { + get { return iDescription; } + } + #endregion + + #region Data members + private readonly TType iType; + private readonly string iTitle; + private readonly string iDescription; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Messages/CACmdLineMessageList.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Messages/CACmdLineMessageList.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,191 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashItemLib.Crash.Messages; +using CrashAnalyserEngine.Plugins; +using CrashItemLib.Crash.Container; + +namespace CAPCrashAnalysis.CommandLine +{ + internal class CACmdLineMessageList : IEnumerable + { + #region Constructors + public CACmdLineMessageList() + { + } + #endregion + + #region API + public void Clear() + { + iMessages.Clear(); + } + + public void ClearErrorsAndWarnings() + { + for( int i=iMessages.Count; i>=0; i-- ) + { + CACmdLineMessage msg = iMessages[ i ]; + // + bool remove = true; + switch( msg.Type ) + { + default: + case CACmdLineMessage.TType.ETypeError: + case CACmdLineMessage.TType.ETypeMessage: + case CACmdLineMessage.TType.ETypeWarning: + break; + case CACmdLineMessage.TType.ETypeDiagnostic: + remove = false; + break; + } + // + if ( remove ) + { + iMessages.RemoveAt( i ); + } + } + } + + public void AddError( string aTitle, string aDescription ) + { + Add( aTitle, aDescription, CACmdLineMessage.TType.ETypeError ); + } + + public void AddWarning( string aTitle, string aDescription ) + { + Add( aTitle, aDescription, CACmdLineMessage.TType.ETypeWarning ); + } + + public void AddMessage( string aTitle, string aDescription ) + { + Add( aTitle, aDescription, CACmdLineMessage.TType.ETypeMessage ); + } + + public void AddDiagnostic( string aTitle, string aDescription ) + { + Add( aTitle, aDescription, CACmdLineMessage.TType.ETypeDiagnostic ); + } + + public void Add( CACmdLineMessage aMessage ) + { + iMessages.Add( aMessage ); + } + + public void AddRange( IEnumerable aMessages ) + { + foreach ( CACmdLineMessage msg in aMessages ) + { + Add( msg ); + } + } + + public void AddRange( IEnumerable aMessages, CACmdLineMessage.TType aOnlyOfType ) + { + foreach ( CACmdLineMessage msg in aMessages ) + { + if ( msg.Type == aOnlyOfType ) + { + Add( msg ); + } + } + } + + public void CopyMessagesToContainer( CIContainer aContainer ) + { + CopyMessagesToContainer( iMessages, aContainer ); + } + + public static void CopyMessagesToContainer( IEnumerable aMessages, CIContainer aContainer ) + { + foreach ( CACmdLineMessage msg in aMessages ) + { + msg.CopyToContainer( aContainer ); + } + } + + public CACmdLineMessage[] ToArray() + { + return iMessages.ToArray(); + } + #endregion + + #region Properties + public bool IsEmtpy + { + get + { + return iMessages.Count == 0; + } + } + + public int Count + { + get { return iMessages.Count; } + } + #endregion + + #region Internal methods + private int CountByType( CACmdLineMessage.TType aType ) + { + int count = 0; + // + iMessages.ForEach( delegate( CACmdLineMessage aMessage ) + { + if ( aMessage.Type == CACmdLineMessage.TType.ETypeError ) + { + ++count; + } + } + ); + // + return count; + } + + private void Add( string aTitle, string aDescription, CACmdLineMessage.TType aType ) + { + CACmdLineMessage msg = new CACmdLineMessage( aType, aTitle, aDescription ); + Add( msg ); + } + #endregion + + #region From IEnumerable + public IEnumerator GetEnumerator() + { + foreach ( CACmdLineMessage msg in iMessages ) + { + yield return msg; + } + } + + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + foreach ( CACmdLineMessage msg in iMessages ) + { + yield return msg; + } + } + #endregion + + #region Data members + private List iMessages = new List(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Outputs/CACmdLineManifestWriter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Outputs/CACmdLineManifestWriter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Xml; +using System.Collections.Generic; +using CrashItemLib.Crash.Container; + +namespace CAPCrashAnalysis.CommandLine +{ + internal class CACmdLineManifestWriter + { + #region Constructors + public CACmdLineManifestWriter( CACmdLineFSEntityList aSourceFiles ) + { + iSourceFiles = aSourceFiles; + } + #endregion + + #region API + public string Create() + { + // This is where the XML will be stored + StringBuilder backBuffer = new StringBuilder(); + + // Create XML writer + XmlWriterSettings settings = new XmlWriterSettings(); + settings.Indent = true; + settings.IndentChars = " "; + settings.NewLineChars = System.Environment.NewLine; + settings.NewLineHandling = NewLineHandling.Replace; + settings.Encoding = Encoding.UTF8; + + using ( XmlWriter writer = XmlWriter.Create( backBuffer, settings ) ) + { + // Serialise manifest for each file + writer.WriteStartElement( KXmlRoot ); + + foreach ( CACmdLineFileSource file in iSourceFiles ) + { + System.Diagnostics.Debug.Assert( file.ContainerCount >= 1 ); + + foreach ( CACmdLineFileSource.OutputEntry outputEntry in file.Outputs ) + { + CIContainer container = outputEntry.Container; + string outputFile = outputEntry.OutputFileName; + + writer.WriteStartElement( KXmlNodeReport ); + + // Input element + writer.WriteStartElement( KXmlNodeReportInput ); + writer.WriteAttributeString( KXmlCmnName, file.Name ); + writer.WriteEndElement(); + + // Output element + if ( !string.IsNullOrEmpty( outputFile ) ) + { + writer.WriteStartElement( KXmlNodeReportOutput ); + writer.WriteAttributeString( KXmlCmnName, outputEntry.OutputFileName ); + writer.WriteEndElement(); + } + + // Status + string status = KXmlNodeReportStatusSuccess; + if ( outputEntry.Status == TOutputStatus.EFailed ) + { + status = KXmlNodeReportStatusFailure; + } + writer.WriteElementString( KXmlNodeReportStatus, status ); + + // Messages + foreach ( CACmdLineMessage msg in outputEntry ) + { + string typeName = KXmlNodeReportMsgMessage; + switch ( msg.Type ) + { + case CACmdLineMessage.TType.ETypeDiagnostic: + typeName = KXmlNodeReportMsgDiagnostic; + break; + case CACmdLineMessage.TType.ETypeWarning: + typeName = KXmlNodeReportMsgWarning; + break; + case CACmdLineMessage.TType.ETypeError: + typeName = KXmlNodeReportMsgError; + break; + default: + break; + } + writer.WriteStartElement( typeName ); + writer.WriteAttributeString( KXmlNodeReportMsgTitle, msg.Title ); + writer.WriteString( msg.Description ); + writer.WriteEndElement(); + } + + writer.WriteEndElement(); + } + } + + writer.WriteEndElement(); + } + + return backBuffer.ToString(); + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Internal constants + private const string KXmlRoot = "summary"; + private const string KXmlCmnName = "name"; + + private const string KXmlNodeReport = "report"; + private const string KXmlNodeReportInput = "input"; + private const string KXmlNodeReportOutput = "output"; + private const string KXmlNodeReportStatus = "status"; + private const string KXmlNodeReportStatusSuccess = "OK"; + private const string KXmlNodeReportStatusFailure = "ERROR"; + private const string KXmlNodeReportMsgTitle = "title"; + private const string KXmlNodeReportMsgError = "error"; + private const string KXmlNodeReportMsgWarning = "warning"; + private const string KXmlNodeReportMsgMessage= "message"; + private const string KXmlNodeReportMsgDiagnostic = "diagnostic"; + #endregion + + #region Data members + private readonly CACmdLineFSEntityList iSourceFiles; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Progress/CACmdLineProgressReporter.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Progress/CACmdLineProgressReporter.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,284 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.Xml; +using System.Collections.Generic; +using CrashItemLib.Crash.Container; + +namespace CAPCrashAnalysis.CommandLine.Progress +{ + internal class CACmdLineProgressReporter + { + #region Constructors + public CACmdLineProgressReporter() + { + } + #endregion + + #region API + public void StepBegin( string aMessage, string aKey ) + { + StepBegin( aMessage, aKey, KNotDefined ); + } + + public void StepBegin( string aMessage, string aKey, int aSubSteps ) + { + // Check preconditions + if ( string.IsNullOrEmpty( aMessage ) ) + { + throw new ArgumentException( "Step title cannot be undefined" ); + } + else if ( string.IsNullOrEmpty( aKey ) ) + { + throw new ArgumentException( "Step key cannot be undefined" ); + } + // + lock ( iSyncRoot ) + { + Step step = FindStep( aKey ); + if ( step != null ) + { + throw new ArgumentException( "The specified key already exists: " + aKey ); + } + + step = new Step( this, aKey, ++iCurrentStep, aSubSteps ); + step.StepBegin( aMessage ); + iActiveSteps.Add( aKey, step ); + } + } + + public void StepProgress( string aMessage, int aValue, string aKey ) + { + if (iDetailed) + { + lock (iSyncRoot) + { + Step step = FindStep(aKey); + if (step == null) + { + throw new ArgumentException("A step with the specified key was not found: " + aKey); + } + step.StepProgress(aMessage, aValue); + } + } + } + + public void StepEnd( string aMessage, string aKey ) + { + if ( string.IsNullOrEmpty( aKey ) ) + { + throw new ArgumentException( "Step key cannot be undefined" ); + } + lock ( iSyncRoot ) + { + Step step = FindStep( aKey ); + if ( step == null ) + { + throw new ArgumentException( "A step with the specified key was not found: " + aKey ); + } + step.StepEnd( aMessage ); + iActiveSteps.Remove( aKey ); + } + } + + public void PrintProgress( string aText, int aStepNumber ) + { + StringBuilder line = new StringBuilder(); + line.Append( "[CA PROGRESS]" ); + + lock ( iSyncRoot ) + { + line.Append( " " ); + line.Append( "{" ); + + // Put step count if available + if ( iTotalStepCount != KNotDefined ) + { + line.AppendFormat( "{0:d3}/{1:d3}", aStepNumber, iTotalStepCount ); + } + else + { + line.AppendFormat( "{0:d3}/???", aStepNumber, iTotalStepCount ); + } + + line.Append( "}" ); + line.AppendFormat( " {0}", aText ); + } + // + string text = line.ToString(); + PrintRaw( text ); + } + #endregion + + #region Properties + public bool Enabled + { + get { return iEnabled; } + set { iEnabled = value; } + } + + public bool Detailed + { + get { return iDetailed; } + set { iDetailed = value; iEnabled = value; } + } + + public int TotalNumberOfSteps + { + get + { + lock ( iSyncRoot ) + { + return iTotalStepCount; + } + } + set + { + lock ( iSyncRoot ) + { + iTotalStepCount = value; + } + } + } + #endregion + + #region Internal methods + private Step FindStep( string aKey ) + { + Step ret = null; + iActiveSteps.TryGetValue( aKey, out ret ); + return ret; + } + + private void PrintRaw( string aText ) + { + System.Console.WriteLine( aText ); + } + #endregion + + #region Internal constants + internal const int KNotDefined = -1; + #endregion + + #region Internal classes + private class Step + { + #region Constructors + public Step( CACmdLineProgressReporter aParent, string aKey, int aStepNumber, int aSubStepCount ) + { + iKey = aKey; + iParent = aParent; + iStepNumber = aStepNumber; + iSubStepCount = aSubStepCount; + } + #endregion + + #region API + public void StepBegin( string aMessage ) + { + StringBuilder message = new StringBuilder(); + message.Append( KPrefixStepBegin ); + // + if ( string.IsNullOrEmpty( aMessage ) == false ) + { + message.AppendFormat( " - {0}", aMessage ); + } + // + PrintProgress( message.ToString() ); + } + + public void StepProgress( string aMessage, int aValue ) + { + float newProgress = ( ( (float) aValue ) / (float) iSubStepCount ) * 100.0f; + if ( (int) newProgress != iLastProgressPercentage || aValue == iSubStepCount ) + { + iLastProgressPercentage = (int) newProgress; + iLastProgressMessage = aMessage; + ++iNumberOfProgressReportPackets; + + StringBuilder text = new StringBuilder(); + text.AppendFormat( "{0:d3}%", iLastProgressPercentage ); + + if ( string.IsNullOrEmpty( aMessage ) == false ) + { + text.Append( " " + aMessage ); + } + + PrintProgress( text.ToString() ); + } + } + + public void StepEnd( string aMessage ) + { + // If we didn't hit 100% completion, then emit a dummy + // progress event. + if ( iNumberOfProgressReportPackets > 0 && iSubStepCount != KNotDefined && iLastProgressPercentage < 100 ) + { + StepProgress( iLastProgressMessage, iSubStepCount ); + } + + // Now output end marker + StringBuilder message = new StringBuilder(); + message.Append( KPrefixStepEnd ); + // + if ( string.IsNullOrEmpty( aMessage ) == false ) + { + message.AppendFormat( " - {0}", aMessage ); + } + // + PrintProgress( message.ToString() ); + iParent.PrintRaw( string.Empty ); + } + #endregion + + #region Internal constants + private const string KPrefixStepBegin = "START"; + private const string KPrefixStepEnd = "END"; + #endregion + + #region Internal methods + private void PrintProgress( string aText ) + { + iParent.PrintProgress( aText, iStepNumber ); + } + #endregion + + #region Data members + private readonly string iKey; + private readonly int iStepNumber; + private readonly CACmdLineProgressReporter iParent; + private readonly int iSubStepCount; + private string iLastProgressMessage = string.Empty; + private int iLastProgressPercentage = KNotDefined; + private int iNumberOfProgressReportPackets = 0; + #endregion + } + #endregion + + #region Data members + private bool iEnabled = false; + private bool iDetailed = false; + private object iSyncRoot = new object(); + // + private int iTotalStepCount = KNotDefined; + private int iCurrentStep = 0; + // + private Dictionary iActiveSteps = new Dictionary(); + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Source/CACmdLineSource.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/CommandLine/Source/CACmdLineSource.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using CrashAnalyserEngine.Plugins; +using CrashItemLib.Crash.Messages; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Source; + +namespace CAPCrashAnalysis.CommandLine +{ + internal class CACmdLineSource : CISource + { + #region Constructors + public CACmdLineSource( FileInfo aFile ) + : base( aFile ) + { + } + #endregion + + #region From CISource + public override Version ImplementorVersion + { + get { return new Version( 0, 0 ); } + } + + public override string ImplementorName + { + get { return string.Empty; } + } + #endregion + + #region Properties + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/Plugin/CAPluginCrashAnalysis.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/Plugin/CAPluginCrashAnalysis.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Threading; +using SymbianUtils; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Plugins; +using CrashItemLib.Engine; +using CrashItemLib.Engine.Interfaces; +using CAPCrashAnalysis.CommandLine; + +namespace CAPCrashAnalysis.Plugin +{ + public class CAPluginCrashAnalysis : CAPlugin, ICIEngineUI + { + #region Constructors + public CAPluginCrashAnalysis( CAEngine aEngine ) + : base( aEngine, KPluginName ) + { + iCommandLineEngine = new CACmdLineEngine( this ); + iCrashItemEngine = new CIEngine( aEngine.DebugEngine, this ); + } + #endregion + + #region Constants + public const string KPluginName = "Crash File Analysis"; + #endregion + + #region API + public string GetSupportedCrashFileTypes() + { + return CrashItemEngine.PluginRegistry.GetSupportedCrashFileTypes(); + } + + public void PrimeSources( string[] aFileNames ) + { + // Seed up the crash item engine with all our file names + CrashItemEngine.ClearAll(); + foreach ( string file in aFileNames ) + { + CrashItemEngine.Prime( new System.IO.FileInfo( file ) ); + } + } + + public void IdentifyCrashes( TSynchronicity aSynchronicity ) + { + CrashItemEngine.IdentifyCrashes( aSynchronicity ); + } + #endregion + + #region From CAPlugin + public override bool IsCommandLineHandler( string aName ) + { + bool ret = iCommandLineEngine.IsCommandLineHandler( aName ); + return ret; + } + + public override int RunCommandLineOperations() + { + int error = iCommandLineEngine.RunCommandLineOperations(); + return error; + } + + public override CAPlugin.TType Type + { + get { return CAPlugin.TType.ETypeEngine; } + } + #endregion + + #region Properties + public CIEngine CrashItemEngine + { + get { return iCrashItemEngine; } + } + #endregion + + #region Event handlers + #endregion + + #region Internal methods + #endregion + + #region From ICIEngineUI + void ICIEngineUI.CITrace( string aMessage ) + { + base.UIEngine.UIManager.UITrace( aMessage ); + } + + void ICIEngineUI.CITrace( string aFormat, params object[] aParameters ) + { + base.UIEngine.UIManager.UITrace( aFormat, aParameters ); + } + #endregion + + #region Operators + public static implicit operator CIEngine( CAPluginCrashAnalysis aCrashFileEngine ) + { + return aCrashFileEngine.CrashItemEngine; + } + #endregion + + #region Data members + private readonly CIEngine iCrashItemEngine; + private readonly CACmdLineEngine iCommandLineEngine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyser/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia Corporation" )] +[assembly: AssemblyProduct( "" )] +[assembly: AssemblyCopyright( "Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.symbianfoundation.org/legal/sfl-v10.html." )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "78867f6e-31d6-4da4-8c0c-98d2cc625831" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/CAPluginCrashAnalysisUi.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/CAPluginCrashAnalysisUi.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,179 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {86BFD3B8-FA0E-4A58-A0DA-3252E164F4C3} + Library + Properties + CAPluginCrashAnalysisUi + CAPluginCrashAnalysisUi.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + False + ..\..\..\..\PerfToolsSharedLibraries\3rd Party\XPTable\bin\Debug\XPTable.dll + + + + + + UserControl + + + CATabCrashBase.cs + + + UserControl + + + CATabCrashContainerBase.cs + + + UserControl + + + CATabCrashSummarisableEntityBase.cs + + + UserControl + + + CATabCrashContainerExplorer.cs + + + UserControl + + + CATabCrashContainerSummary.cs + + + UserControl + + + CATabCrashViewer.cs + + + Form + + + CAWizardCrashAnalysis.cs + + + + + + + CATabCrashBase.cs + Designer + + + CATabCrashContainerBase.cs + Designer + + + CATabCrashSummarisableEntityBase.cs + Designer + + + CATabCrashContainerExplorer.cs + Designer + + + CATabCrashContainerSummary.cs + Designer + + + CATabCrashViewer.cs + Designer + + + CAWizardCrashAnalysis.cs + Designer + + + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {14175109-E40C-4BBA-9691-498EF118C8A0} + SymbianTabStripLib + + + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822} + SymbianUtilsUi + + + {AC323F51-47D6-46BE-8E06-7A75F4C5348D} + SymbianWizardLib + + + {A5B87D2F-E351-4B03-8BD0-9C8C91EDF1CC} + CrashItemLib + + + {A2B52E74-358B-45A9-9291-46E66D552C4C} + CrashItemUiLib + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {6C30B8C1-BF87-4626-8125-D5681B22347C} + SymbianDebugLibUi + + + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80} + CrashAnalyserEngine + + + {493283B2-3E74-4262-B0F2-1AAA0FD15F1D} + CAPluginCrashAnalysis + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Plugin/CAPluginCrashAnalysisUi.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Plugin/CAPluginCrashAnalysisUi.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Threading; +using System.Windows.Forms; +using CrashAnalyserEngine.Plugins; +using CrashItemLib.Engine; +using CrashItemLib.Engine.Interfaces; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Container; +using CrashItemLib.PluginAPI; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Interfaces; +using CAPluginCrashAnalysisUi.Wizards; +using CAPluginCrashAnalysisUi.Tabs; +using CAPCrashAnalysis.Plugin; +using SymbianUtils; + +namespace CAPluginCrashAnalysisUi.Plugin +{ + public class CAPluginCrashAnalysisUi : CAPluginCrashAnalysis + { + #region Constructors + public CAPluginCrashAnalysisUi( CAEngine aEngine ) + : base( aEngine ) + { + // Switch debug engine to UI mode + aEngine.DebugEngine.UiMode = SymbianDebugLib.TDbgUiMode.EUiEnabled; + RegisterMenuItems(); + } + #endregion + + #region API + #endregion + + #region From CAPlugin + public override CAPlugin.TType Type + { + get { return CAPlugin.TType.ETypeUi; } + } + #endregion + + #region Properties + #endregion + + #region Event handlers + private void Menu_File_New_CrashAnalyser_Click( object aTag, string aCaption ) + { + CAWizardCrashAnalysis wizard = new CAWizardCrashAnalysis( this ); + DialogResult result = wizard.ShowDialog(); + if ( result == DialogResult.OK ) + { + // Wizard was closed without error so prepare main summary form + // and register with UI. Only show the summary form if we have + // multiple crash items, otherwise just show the container explorer. + int count = CrashItemEngine.Count; + if ( count > 1 ) + { + CATabCrashContainerSummary control = new CATabCrashContainerSummary( this ); + base.UIManager.UIManagerContentAdd( control ); + } + else if ( count == 1 ) + { + CIContainer container = (CIContainer) CrashItemEngine[ 0 ]; + // + CATabCrashContainerExplorer control = new CATabCrashContainerExplorer( this, container ); + base.UIManager.UIManagerContentAdd( control ); + } + } + } + #endregion + + #region Internal constants + #endregion + + #region Internal methods + private void RegisterMenuItems() + { + // Register "new" menu item + base.UIManager.UIManagerMenuItemAdd( TEngineUIMenuPane.EFileNew, base.Name, new UIMenuItemClickHandler( Menu_File_New_CrashAnalyser_Click ), null ); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "CAPluginCrashAnalysisUi" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Symbian Software Ltd" )] +[assembly: AssemblyProduct( "CAPluginCrashAnalysisUi" )] +[assembly: AssemblyCopyright( "Copyright © Symbian Software Ltd 2008" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "0614db96-54d7-4287-ad69-c0da9fc26199" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashBase.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashBase.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginCrashAnalysisUi.Tabs +{ + partial class CATabCrashBase + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Component Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.SuspendLayout(); + // + // CATabCrashBase + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Font = new System.Drawing.Font( "Tahoma", 8F ); + this.Name = "CATabCrashBase"; + this.Size = new System.Drawing.Size( 0, 0 ); + this.ResumeLayout( false ); + + } + + #endregion + + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; +using System.Windows.Forms; +using CrashAnalyserEngine.Tabs; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Interfaces; +using CrashItemLib.Engine; +using CAPCrashAnalysis.Plugin; + +namespace CAPluginCrashAnalysisUi.Tabs +{ + internal partial class CATabCrashBase : CATab + { + #region Constructors + protected CATabCrashBase() + { + // For IDE designer only + InitializeComponent(); + } + + protected CATabCrashBase( CAPluginCrashAnalysis aSubEngine ) + { + iSubEngine = aSubEngine; + // + InitializeComponent(); + } + #endregion + + #region Properties + protected CAPluginCrashAnalysis SubEngine + { + get { return iSubEngine; } + } + + protected CIEngine CrashItemEngine + { + get { return SubEngine.CrashItemEngine; } + } + + protected IEngineUIManager UIManager + { + get { return SubEngine.UIEngine.UIManager; } + } + #endregion + + #region From CATab + protected override void RegisterMenuItems() + { + base.RegisterMenuItems(); + } + #endregion + + #region Event handlers + #endregion + + #region Event handlers + #endregion + + #region Internal methods + #endregion + + #region Data members + private CAPluginCrashAnalysis iSubEngine = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashBase.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashBase.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashContainerBase.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashContainerBase.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginCrashAnalysisUi.Tabs +{ + partial class CATabCrashContainerBase + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Component Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.SuspendLayout(); + // + // CATabCrashBase + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Name = "CATabCrashContainerBase"; + this.Size = new System.Drawing.Size( 0, 0 ); + this.ResumeLayout( false ); + + } + + #endregion + + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashContainerBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashContainerBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using CrashItemLib.Crash.Container; +using CrashItemLib.Sink; +using CrashAnalyserEngine.Interfaces; +using CAPCrashAnalysis.Plugin; + +namespace CAPluginCrashAnalysisUi.Tabs +{ + internal partial class CATabCrashContainerBase : CATabCrashBase + { + #region Constructors + protected CATabCrashContainerBase() + { + // For IDE designer only + InitializeComponent(); + } + + protected CATabCrashContainerBase( CAPluginCrashAnalysis aSubEngine, CIContainer aContainer ) + : base( aSubEngine ) + { + iContainer = aContainer; + // + InitializeComponent(); + // + RegisterMenuItems(); + } + #endregion + + #region API + #endregion + + #region Properties + [Browsable( false )] + [DesignerSerializationVisibility( DesignerSerializationVisibility.Hidden )] + protected CIContainer CIContainer + { + get { return iContainer; } + set { iContainer = value; } + } + #endregion + + #region From CATab + protected override void RegisterMenuItems() + { + base.RegisterMenuItems(); + // + CISinkManager sinkManager = base.CrashItemEngine.SinkManager; + foreach ( CISink sink in sinkManager ) + { + base.UIManager.UIManagerMenuItemAdd( CrashAnalyserEngine.Interfaces.TEngineUIMenuPane.EFileSaveAs, sink.Name, new UIMenuItemClickHandler( Menu_File_SaveAs_SinkFormat_Click ), sink, this ); + } + } + #endregion + + #region Event handlers + private void Menu_File_SaveAs_SinkFormat_Click( object aTag, string aCaption ) + { + if ( aTag is CISink ) + { + CISink sink = (CISink) aTag; + // + CISinkSerializationParameters parameters = new CISinkSerializationParameters( CIContainer, base.UIManager.UIVersion, base.UIManager.UICommandLineArguments ); + FolderBrowserDialog dialog = new FolderBrowserDialog(); + dialog.Description = "Save Location"; + // + if ( dialog.ShowDialog() == DialogResult.OK ) + { + parameters.OutputDirectory = new System.IO.DirectoryInfo( dialog.SelectedPath ); + // + sink.Serialize( parameters ); + } + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private CIContainer iContainer; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashContainerBase.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashContainerBase.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashSummarisableEntityBase.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashSummarisableEntityBase.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginCrashAnalysisUi.Tabs +{ + partial class CATabCrashSummarisableEntityBase + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Component Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.SuspendLayout(); + // + // CATabCrashBase + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Name = "CATabCrashSummarisableEntityBase"; + this.Size = new System.Drawing.Size( 0, 0 ); + this.ResumeLayout( false ); + + } + + #endregion + + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashSummarisableEntityBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashSummarisableEntityBase.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,81 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using CrashItemLib.Crash.Summarisable; +using CAPCrashAnalysis.Plugin; + +namespace CAPluginCrashAnalysisUi.Tabs +{ + internal partial class CATabCrashSummarisableEntityBase : CATabCrashBase + { + #region Constructors + protected CATabCrashSummarisableEntityBase() + { + // For IDE designer only + InitializeComponent(); + } + + protected CATabCrashSummarisableEntityBase( CAPluginCrashAnalysis aSubEngine, CISummarisableEntity aEntity ) + : base( aSubEngine ) + { + iEntity = aEntity; + // + InitializeComponent(); + // + base.Title = aEntity.Name; + // + RegisterMenuItems(); + } + #endregion + + #region Properties + [Browsable( false )] + [DesignerSerializationVisibility( DesignerSerializationVisibility.Hidden )] + protected CISummarisableEntity CISummarisableEntity + { + get { return iEntity; } + } + #endregion + + #region From CATab + protected override void RegisterMenuItems() + { + base.RegisterMenuItems(); + } + #endregion + + #region Event handlers + #endregion + + #region Event handlers + #endregion + + #region Internal methods + #endregion + + #region Data members + private CISummarisableEntity iEntity = null; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashSummarisableEntityBase.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/Base/CATabCrashSummarisableEntityBase.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerExplorer.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerExplorer.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginCrashAnalysisUi.Tabs +{ + partial class CATabCrashContainerExplorer + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Component Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.iCol_FileName = new XPTable.Models.TextColumn(); + this.iCol_SubRow_Line = new XPTable.Models.TextColumn(); + this.iCol_CrashCount = new XPTable.Models.TextColumn(); + this.iCtrl_Container = new CrashItemUiLib.Crash.Container.CICtrlContainer(); + this.SuspendLayout(); + // + // iCol_FileName + // + this.iCol_FileName.ContentWidth = 0; + this.iCol_FileName.Width = 24; + // + // iCol_SubRow_Line + // + this.iCol_SubRow_Line.ContentWidth = 0; + this.iCol_SubRow_Line.Text = "Line"; + this.iCol_SubRow_Line.Width = 40; + // + // iCol_CrashCount + // + this.iCol_CrashCount.ContentWidth = 0; + this.iCol_CrashCount.Text = "Count"; + this.iCol_CrashCount.Width = 40; + // + // iCtrl_Container + // + this.iCtrl_Container.Dock = System.Windows.Forms.DockStyle.Fill; + this.iCtrl_Container.Location = new System.Drawing.Point( 0, 0 ); + this.iCtrl_Container.Name = "iCtrl_Container"; + this.iCtrl_Container.Size = new System.Drawing.Size( 907, 679 ); + this.iCtrl_Container.TabIndex = 0; + // + // CATabCrashContainerExplorer + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add( this.iCtrl_Container ); + this.Name = "CATabCrashContainerExplorer"; + this.Size = new System.Drawing.Size( 907, 679 ); + this.Load += new System.EventHandler( this.CATabCrashContainerExplorer_Load ); + this.ResumeLayout( false ); + + } + + #endregion + + private XPTable.Models.TextColumn iCol_FileName; + private XPTable.Models.TextColumn iCol_CrashCount; + private XPTable.Models.TextColumn iCol_SubRow_Line; + private CrashItemUiLib.Crash.Container.CICtrlContainer iCtrl_Container; + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerExplorer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerExplorer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using CrashItemLib.Crash; +using CrashItemLib.Crash.Container; +using CAPCrashAnalysis.Plugin; + +namespace CAPluginCrashAnalysisUi.Tabs +{ + internal partial class CATabCrashContainerExplorer : CATabCrashContainerBase + { + #region Constructors + public CATabCrashContainerExplorer( CAPluginCrashAnalysis aSubEngine, CIContainer aContainer ) + : base( aSubEngine, aContainer ) + { + InitializeComponent(); + // + base.Title = "Crash Details - " + System.IO.Path.GetFileName( aContainer.Source.MasterFileName ); + } + #endregion + + #region Event handlers + #endregion + + #region Event handlers + private void CATabCrashContainerExplorer_Load( object sender, EventArgs e ) + { + // Get the primary summary... + iCtrl_Container.CIContainer = base.CIContainer; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerExplorer.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerExplorer.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerSummary.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerSummary.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,219 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginCrashAnalysisUi.Tabs +{ + partial class CATabCrashContainerSummary + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Component Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + XPTable.Models.DataSourceColumnBinder dataSourceColumnBinder1 = new XPTable.Models.DataSourceColumnBinder(); + this.iTLP = new System.Windows.Forms.TableLayoutPanel(); + this.iTable = new XPTable.Models.Table(); + this.iColModel = new XPTable.Models.ColumnModel(); + this.iCol_FileName = new XPTable.Models.TextColumn(); + this.iCol_SubRow_LineOrOtherThreadCount = new XPTable.Models.TextColumn(); + this.iCol_SubRow_ThreadName = new XPTable.Models.TextColumn(); + this.iCol_SubRow_ExitInfo = new XPTable.Models.TextColumn(); + this.iTableModel = new XPTable.Models.TableModel(); + this.iTLP_Buttons = new System.Windows.Forms.TableLayoutPanel(); + this.iBT_Open = new System.Windows.Forms.Button(); + this.iBT_Open_All = new System.Windows.Forms.Button(); + this.iBT_Close = new System.Windows.Forms.Button(); + this.iTLP.SuspendLayout(); + ( (System.ComponentModel.ISupportInitialize) ( this.iTable ) ).BeginInit(); + this.iTLP_Buttons.SuspendLayout(); + this.SuspendLayout(); + // + // iTLP + // + this.iTLP.ColumnCount = 1; + this.iTLP.ColumnStyles.Add( new System.Windows.Forms.ColumnStyle( System.Windows.Forms.SizeType.Percent, 100F ) ); + this.iTLP.Controls.Add( this.iTable, 0, 0 ); + this.iTLP.Controls.Add( this.iTLP_Buttons, 0, 1 ); + this.iTLP.Dock = System.Windows.Forms.DockStyle.Fill; + this.iTLP.Location = new System.Drawing.Point( 0, 0 ); + this.iTLP.Name = "iTLP"; + this.iTLP.RowCount = 2; + this.iTLP.RowStyles.Add( new System.Windows.Forms.RowStyle( System.Windows.Forms.SizeType.Percent, 100F ) ); + this.iTLP.RowStyles.Add( new System.Windows.Forms.RowStyle() ); + this.iTLP.Size = new System.Drawing.Size( 837, 483 ); + this.iTLP.TabIndex = 0; + // + // iTable + // + this.iTable.BorderColor = System.Drawing.Color.Black; + this.iTable.ColumnModel = this.iColModel; + this.iTable.DataMember = null; + this.iTable.DataSourceColumnBinder = dataSourceColumnBinder1; + this.iTable.Dock = System.Windows.Forms.DockStyle.Fill; + this.iTable.FullRowSelect = true; + this.iTable.HeaderFont = new System.Drawing.Font( "Tahoma", 6.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ( (byte) ( 0 ) ) ); + this.iTable.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.iTable.Location = new System.Drawing.Point( 3, 3 ); + this.iTable.Name = "iTable"; + this.iTable.NoItemsText = "No Crash Data available"; + this.iTable.NoItemsTextColor = System.Drawing.SystemColors.ControlText; + this.iTable.NoItemsTextFont = new System.Drawing.Font( "Tahoma", 8.25F ); + this.iTable.Size = new System.Drawing.Size( 831, 441 ); + this.iTable.TabIndex = 0; + this.iTable.TableModel = this.iTableModel; + this.iTable.Text = "iTable"; + this.iTable.UnfocusedBorderColor = System.Drawing.Color.Black; + this.iTable.SelectionChanged += new XPTable.Events.SelectionEventHandler( this.iTable_SelectionChanged ); + // + // iColModel + // + this.iColModel.Columns.AddRange( new XPTable.Models.Column[] { + this.iCol_FileName, + this.iCol_SubRow_LineOrOtherThreadCount, + this.iCol_SubRow_ThreadName, + this.iCol_SubRow_ExitInfo} ); + // + // iCol_FileName + // + this.iCol_FileName.ContentWidth = 0; + this.iCol_FileName.Text = "File Name"; + this.iCol_FileName.Width = 30; + // + // iCol_SubRow_LineOrOtherThreadCount + // + this.iCol_SubRow_LineOrOtherThreadCount.ContentWidth = 0; + this.iCol_SubRow_LineOrOtherThreadCount.Text = "Line"; + this.iCol_SubRow_LineOrOtherThreadCount.Width = 40; + // + // iCol_SubRow_ThreadName + // + this.iCol_SubRow_ThreadName.ContentWidth = 0; + this.iCol_SubRow_ThreadName.TakesUpSlack = true; + this.iCol_SubRow_ThreadName.Text = "Name"; + this.iCol_SubRow_ThreadName.Width = 607; + // + // iCol_SubRow_ExitInfo + // + this.iCol_SubRow_ExitInfo.ContentWidth = 0; + this.iCol_SubRow_ExitInfo.Text = "Exit Info"; + this.iCol_SubRow_ExitInfo.Width = 150; + // + // iTLP_Buttons + // + this.iTLP_Buttons.ColumnCount = 4; + this.iTLP_Buttons.ColumnStyles.Add( new System.Windows.Forms.ColumnStyle() ); + this.iTLP_Buttons.ColumnStyles.Add( new System.Windows.Forms.ColumnStyle() ); + this.iTLP_Buttons.ColumnStyles.Add( new System.Windows.Forms.ColumnStyle( System.Windows.Forms.SizeType.Percent, 100F ) ); + this.iTLP_Buttons.ColumnStyles.Add( new System.Windows.Forms.ColumnStyle() ); + this.iTLP_Buttons.Controls.Add( this.iBT_Open, 0, 0 ); + this.iTLP_Buttons.Controls.Add( this.iBT_Open_All, 1, 0 ); + this.iTLP_Buttons.Controls.Add( this.iBT_Close, 3, 0 ); + this.iTLP_Buttons.Dock = System.Windows.Forms.DockStyle.Fill; + this.iTLP_Buttons.Location = new System.Drawing.Point( 0, 447 ); + this.iTLP_Buttons.Margin = new System.Windows.Forms.Padding( 0 ); + this.iTLP_Buttons.Name = "iTLP_Buttons"; + this.iTLP_Buttons.RowCount = 1; + this.iTLP_Buttons.RowStyles.Add( new System.Windows.Forms.RowStyle() ); + this.iTLP_Buttons.Size = new System.Drawing.Size( 837, 36 ); + this.iTLP_Buttons.TabIndex = 1; + // + // iBT_Open + // + this.iBT_Open.Dock = System.Windows.Forms.DockStyle.Fill; + this.iBT_Open.Location = new System.Drawing.Point( 3, 3 ); + this.iBT_Open.Name = "iBT_Open"; + this.iBT_Open.Size = new System.Drawing.Size( 74, 30 ); + this.iBT_Open.TabIndex = 0; + this.iBT_Open.Text = "Open"; + this.iBT_Open.UseVisualStyleBackColor = true; + this.iBT_Open.Click += new System.EventHandler( this.iBT_Open_Click ); + // + // iBT_Open_All + // + this.iBT_Open_All.Dock = System.Windows.Forms.DockStyle.Fill; + this.iBT_Open_All.Location = new System.Drawing.Point( 83, 3 ); + this.iBT_Open_All.Name = "iBT_Open_All"; + this.iBT_Open_All.Size = new System.Drawing.Size( 89, 30 ); + this.iBT_Open_All.TabIndex = 1; + this.iBT_Open_All.Text = "Open All"; + this.iBT_Open_All.UseVisualStyleBackColor = true; + this.iBT_Open_All.Click += new System.EventHandler( this.iBT_Open_All_Click ); + // + // iBT_Close + // + this.iBT_Close.Dock = System.Windows.Forms.DockStyle.Fill; + this.iBT_Close.Location = new System.Drawing.Point( 784, 3 ); + this.iBT_Close.Name = "iBT_Close"; + this.iBT_Close.Size = new System.Drawing.Size( 50, 30 ); + this.iBT_Close.TabIndex = 2; + this.iBT_Close.Text = "Close"; + this.iBT_Close.UseVisualStyleBackColor = true; + this.iBT_Close.Click += new System.EventHandler( this.iBT_Close_Click ); + // + // CATabCrashContainerSummary + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add( this.iTLP ); + this.Font = new System.Drawing.Font( "Tahoma", 8.25F ); + this.Name = "CATabCrashContainerSummary"; + this.Size = new System.Drawing.Size( 837, 483 ); + this.Title = "Summary"; + this.Load += new System.EventHandler( this.CASubControlCrashSummary_Load ); + this.iTLP.ResumeLayout( false ); + ( (System.ComponentModel.ISupportInitialize) ( this.iTable ) ).EndInit(); + this.iTLP_Buttons.ResumeLayout( false ); + this.ResumeLayout( false ); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel iTLP; + private XPTable.Models.Table iTable; + private XPTable.Models.ColumnModel iColModel; + private XPTable.Models.TableModel iTableModel; + private System.Windows.Forms.TableLayoutPanel iTLP_Buttons; + private System.Windows.Forms.Button iBT_Open; + private System.Windows.Forms.Button iBT_Open_All; + private XPTable.Models.TextColumn iCol_FileName; + private XPTable.Models.TextColumn iCol_SubRow_ThreadName; + private XPTable.Models.TextColumn iCol_SubRow_LineOrOtherThreadCount; + private XPTable.Models.TextColumn iCol_SubRow_ExitInfo; + private System.Windows.Forms.Button iBT_Close; + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerSummary.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerSummary.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,183 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using CrashItemLib.Crash.Container; +using CrashItemLib.Crash.Source; +using CrashItemLib.Crash.Summarisable; +using XPTable.Models; +using CAPCrashAnalysis.Plugin; + +namespace CAPluginCrashAnalysisUi.Tabs +{ + internal partial class CATabCrashContainerSummary : CATabCrashBase + { + #region Constructors + public CATabCrashContainerSummary( CAPluginCrashAnalysis aSubEngine ) + : base( aSubEngine ) + { + InitializeComponent(); + } + #endregion + + #region Event handlers + private void CASubControlCrashSummary_Load( object sender, EventArgs e ) + { + UpdateTable(); + UpdateButtons(); + } + + private void iBT_Open_Click( object sender, EventArgs e ) + { + if ( iTable.SelectedIndicies.Length > 0 ) + { + int index = iTable.SelectedIndicies[ 0 ]; + CIContainer container = (CIContainer) iTableModel.Rows[ index ].Tag; + // + CATabCrashContainerExplorer control = new CATabCrashContainerExplorer( SubEngine, container ); + base.UIManager.UIManagerContentAdd( control ); + } + } + + private void iBT_Open_All_Click( object sender, EventArgs e ) + { + foreach ( CIContainer container in base.CrashItemEngine ) + { + CATabCrashContainerExplorer control = new CATabCrashContainerExplorer( SubEngine, container ); + base.UIManager.UIManagerContentAdd( control ); + } + } + + private void iBT_Close_Click( object sender, EventArgs e ) + { + base.UIManager.UIManagerContentClose( this ); + } + + private void iTable_SelectionChanged( object sender, XPTable.Events.SelectionEventArgs e ) + { + UpdateButtons(); + } + #endregion + + #region Internal methods + private void UpdateTable() + { + iTable.BeginUpdate(); + iTableModel.Rows.Clear(); + + foreach ( CIContainer item in base.CrashItemEngine ) + { + CISourceElement source = item.Source; + + // Main row + Row row = new Row(); + row.Tag = item; + + // Cell: crash source file name + Cell cFile = new Cell( source.MasterFileName ); + cFile.ForeColor = Color.Blue; + cFile.ColSpan = iColModel.Columns.Count; + cFile.Font = new Font( iTable.Font, FontStyle.Bold ); + row.Cells.Add( cFile ); + iTableModel.Rows.Add( row ); + + // Sub-row + int index = 1; + int numberOfNonCrashingThreads = 0; + CISummarisableEntityList list = item.Summaries; + foreach ( CISummarisableEntity entity in list ) + { + if ( entity.IsAbnormalTermination ) + { + Row subRow = new Row(); + subRow.Tag = item; + + // Spacer + subRow.Cells.Add( new Cell() ); + + // Sub-cell: line number of crash item within source file + Cell scLineNumber = new Cell( index.ToString() ); + if ( source.IsLineNumberAvailable ) + { + scLineNumber.Text = source.LineNumber.ToString(); + } + subRow.Cells.Add( scLineNumber ); + ++index; + + // Sub-cell: summary name (thread/stack name) + Cell scThreadName = new Cell( entity.Name ); + subRow.Cells.Add( scThreadName ); + + // Sub-cell: summary exit info (for threads) + if ( entity.IsAvailable( CISummarisableEntity.TElement.EElementThread ) ) + { + Cell scThreadExitInfo = new Cell( entity.Thread.ExitInfo.ToString() ); + subRow.Cells.Add( scThreadExitInfo ); + } + + // Save subrow as a child of main row. *MUST* do this + // after adding row to table model. + row.SubRows.Add( subRow ); + } + else + { + ++numberOfNonCrashingThreads; + } + } + + // If we saw other (non-crashed) threads, also include a count + if ( numberOfNonCrashingThreads > 0 ) + { + Row subRow = new Row(); + subRow.Tag = item; + + // Spacer + subRow.Cells.Add( new Cell() ); + + // Our text + string numberOfNonCrashingThreadsText = string.Format( "...plus {0} more running thread{1}", numberOfNonCrashingThreads, numberOfNonCrashingThreads != 1 ? "s" : string.Empty ); + Cell cell = new Cell( numberOfNonCrashingThreadsText ); + subRow.Cells.Add( cell ); + + // Spacer + subRow.Cells.Add( new Cell() ); + + // Spacer + subRow.Cells.Add( new Cell() ); + } + } + + iTable.EndUpdate(); + } + + private void UpdateButtons() + { + iBT_Open.Enabled = ( iTable.TableModel.Selections.SelectedIndicies.Length > 0 ); + iBT_Open_All.Enabled = ( iTable.TableModel.Rows.Count > 0 ); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerSummary.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashContainerSummary.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 128, 17 + + + 17, 17 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashViewer.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashViewer.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginCrashAnalysisUi.Tabs +{ + partial class CATabCrashViewer + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Component Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.iCol_FileName = new XPTable.Models.TextColumn(); + this.iCol_SubRow_Line = new XPTable.Models.TextColumn(); + this.iCol_CrashCount = new XPTable.Models.TextColumn(); + this.iCtrl_Summarisable = new CrashItemUiLib.Crash.Summarisable.CICtrlSummarisable(); + this.SuspendLayout(); + // + // iCol_FileName + // + this.iCol_FileName.ContentWidth = 0; + this.iCol_FileName.Width = 24; + // + // iCol_SubRow_Line + // + this.iCol_SubRow_Line.ContentWidth = 0; + this.iCol_SubRow_Line.Text = "Line"; + this.iCol_SubRow_Line.Width = 40; + // + // iCol_CrashCount + // + this.iCol_CrashCount.ContentWidth = 0; + this.iCol_CrashCount.Text = "Count"; + this.iCol_CrashCount.Width = 40; + // + // iCtrl_Summarisable + // + this.iCtrl_Summarisable.Dock = System.Windows.Forms.DockStyle.Fill; + this.iCtrl_Summarisable.Location = new System.Drawing.Point( 0, 0 ); + this.iCtrl_Summarisable.Name = "iCtrl_Summarisable"; + this.iCtrl_Summarisable.Size = new System.Drawing.Size( 907, 679 ); + this.iCtrl_Summarisable.TabIndex = 0; + // + // CATabCrashViewer + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add( this.iCtrl_Summarisable ); + this.Name = "CATabCrashViewer"; + this.Size = new System.Drawing.Size( 907, 679 ); + this.Load += new System.EventHandler( this.CATabCrashViewer_Load ); + this.ResumeLayout( false ); + + } + + #endregion + + private XPTable.Models.TextColumn iCol_FileName; + private XPTable.Models.TextColumn iCol_CrashCount; + private XPTable.Models.TextColumn iCol_SubRow_Line; + private CrashItemUiLib.Crash.Summarisable.CICtrlSummarisable iCtrl_Summarisable; + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashViewer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashViewer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using CrashItemLib.Crash.Summarisable; +using CAPCrashAnalysis.Plugin; + +namespace CAPluginCrashAnalysisUi.Tabs +{ + internal partial class CATabCrashViewer : CATabCrashSummarisableEntityBase + { + #region Constructors + public CATabCrashViewer( CAPluginCrashAnalysis aSubEngine, CISummarisableEntity aEntity ) + : base( aSubEngine, aEntity ) + { + InitializeComponent(); + // + base.Title = "Crash Details - " + aEntity.Name; + } + #endregion + + #region Properties + #endregion + + #region Event handlers + private void CATabCrashViewer_Load( object sender, EventArgs e ) + { + iCtrl_Summarisable.CISummarisableEntity = base.CISummarisableEntity; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashViewer.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Tabs/CATabCrashViewer.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Wizards/CAWizardCrashAnalysis.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Wizards/CAWizardCrashAnalysis.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,273 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginCrashAnalysisUi.Wizards +{ + partial class CAWizardCrashAnalysis + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.iWizard = new SymbianWizardLib.GUI.SymWizard(); + this.iPG_SourceFiles = new SymbianWizardLib.GUI.SymWizardPage(); + this.iPG_SourceFiles_FileList = new CrashItemUiLib.Controls.CIEngineSourceManager(); + this.iPG_SourceFiles_Header = new SymbianWizardLib.GUI.SymWizardHeaderSection(); + this.iPG_Processing = new SymbianWizardLib.GUI.SymWizardPage(); + this.iPG_Processing_Panel = new System.Windows.Forms.Panel(); + this.iPG_Processing_SplitCon = new System.Windows.Forms.SplitContainer(); + this.iPG_Processing_SourceList = new CrashItemUiLib.Controls.CIEngineSourceList(); + this.iPG_Processing_CrashList = new CrashItemUiLib.Controls.CIEngineCrashList(); + this.iPG_Processing_Header = new SymbianWizardLib.GUI.SymWizardHeaderSection(); + this.iPG_DebugEngine = new SymbianWizardLib.GUI.SymWizardPage(); + this.iPG_DebugEngine_Control = new SymbianDebugLibUi.Controls.DebugEngineControl(); + this.iPG_DebugEngine_Header = new SymbianWizardLib.GUI.SymWizardHeaderSection(); + this.iPG_SourceFiles.SuspendLayout(); + this.iPG_Processing.SuspendLayout(); + this.iPG_Processing_Panel.SuspendLayout(); + this.iPG_Processing_SplitCon.Panel1.SuspendLayout(); + this.iPG_Processing_SplitCon.Panel2.SuspendLayout(); + this.iPG_Processing_SplitCon.SuspendLayout(); + this.iPG_DebugEngine.SuspendLayout(); + this.SuspendLayout(); + // + // iWizard + // + this.iWizard.Dock = System.Windows.Forms.DockStyle.Fill; + this.iWizard.Location = new System.Drawing.Point( 0, 0 ); + this.iWizard.Margin = new System.Windows.Forms.Padding( 0 ); + this.iWizard.Name = "iWizard"; + this.iWizard.Pages.AddRange( new SymbianWizardLib.GUI.SymWizardPage[] { + this.iPG_SourceFiles, + this.iPG_DebugEngine, + this.iPG_Processing} ); + this.iWizard.Size = new System.Drawing.Size( 892, 673 ); + this.iWizard.TabIndex = 0; + this.iWizard.WizardClosedFromFinish += new SymbianWizardLib.GUI.SymWizard.WizardClosedFromFinishHandler( this.iWizard_WizardClosedFromFinish ); + // + // iPG_SourceFiles + // + this.iPG_SourceFiles.Controls.Add( this.iPG_SourceFiles_FileList ); + this.iPG_SourceFiles.Controls.Add( this.iPG_SourceFiles_Header ); + this.iPG_SourceFiles.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_SourceFiles.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_SourceFiles.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_SourceFiles.Name = "iPG_SourceFiles"; + this.iPG_SourceFiles.Size = new System.Drawing.Size( 892, 617 ); + this.iPG_SourceFiles.TabIndex = 3; + this.iPG_SourceFiles.Load += new System.EventHandler( this.iPG_SourceFiles_Load ); + this.iPG_SourceFiles.PageClosedFromButtonNext += new SymbianWizardLib.GUI.SymWizardPage.PageClosedFromButtonNextHandler( this.iPG_SourceFiles_PageClosedFromButtonNext ); + // + // iPG_SourceFiles_FileList + // + this.iPG_SourceFiles_FileList.DialogFilter = ""; + this.iPG_SourceFiles_FileList.DialogMultiselect = true; + this.iPG_SourceFiles_FileList.DialogTitle = "Select Crash Files"; + this.iPG_SourceFiles_FileList.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_SourceFiles_FileList.FileName = ""; + this.iPG_SourceFiles_FileList.Font = new System.Drawing.Font( "Tahoma", 8.25F ); + this.iPG_SourceFiles_FileList.Location = new System.Drawing.Point( 0, 74 ); + this.iPG_SourceFiles_FileList.Name = "iPG_SourceFiles_FileList"; + this.iPG_SourceFiles_FileList.Size = new System.Drawing.Size( 892, 543 ); + this.iPG_SourceFiles_FileList.TabIndex = 5; + this.iPG_SourceFiles_FileList.SourceListChanged += new CrashItemUiLib.Controls.CIEngineSourceManager.SourceListChangeHandler( this.iPG_SourceFiles_FileList_SourceListChanged ); + // + // iPG_SourceFiles_Header + // + this.iPG_SourceFiles_Header.BackColor = System.Drawing.SystemColors.Window; + this.iPG_SourceFiles_Header.Description = "Select a file or directory to analyse for crashes. You can also drag and drop fil" + + "es onto this page."; + this.iPG_SourceFiles_Header.Dock = System.Windows.Forms.DockStyle.Top; + this.iPG_SourceFiles_Header.Image = null; + this.iPG_SourceFiles_Header.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_SourceFiles_Header.Name = "iPG_SourceFiles_Header"; + this.iPG_SourceFiles_Header.Size = new System.Drawing.Size( 892, 74 ); + this.iPG_SourceFiles_Header.TabIndex = 4; + this.iPG_SourceFiles_Header.Title = "Crash File Analysis"; + // + // iPG_Processing + // + this.iPG_Processing.Controls.Add( this.iPG_Processing_Panel ); + this.iPG_Processing.Controls.Add( this.iPG_Processing_Header ); + this.iPG_Processing.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_Processing.IsFinishingPage = true; + this.iPG_Processing.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_Processing.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_Processing.Name = "iPG_Processing"; + this.iPG_Processing.Size = new System.Drawing.Size( 892, 617 ); + this.iPG_Processing.TabIndex = 3; + this.iPG_Processing.Load += new System.EventHandler( this.iPG_Processing_Load ); + this.iPG_Processing.PageShownFromButtonNext += new SymbianWizardLib.GUI.SymWizardPage.PageShownFromButtonNextHandler( this.iPG_Processing_PageShownFromButtonNext ); + this.iPG_Processing.Unload += new System.EventHandler( this.iPG_Processing_Unload ); + // + // iPG_Processing_Panel + // + this.iPG_Processing_Panel.Controls.Add( this.iPG_Processing_SplitCon ); + this.iPG_Processing_Panel.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_Processing_Panel.Location = new System.Drawing.Point( 0, 74 ); + this.iPG_Processing_Panel.Name = "iPG_Processing_Panel"; + this.iPG_Processing_Panel.Padding = new System.Windows.Forms.Padding( 3 ); + this.iPG_Processing_Panel.Size = new System.Drawing.Size( 892, 543 ); + this.iPG_Processing_Panel.TabIndex = 43; + // + // iPG_Processing_SplitCon + // + this.iPG_Processing_SplitCon.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_Processing_SplitCon.Location = new System.Drawing.Point( 3, 3 ); + this.iPG_Processing_SplitCon.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_Processing_SplitCon.Name = "iPG_Processing_SplitCon"; + this.iPG_Processing_SplitCon.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // iPG_Processing_SplitCon.Panel1 + // + this.iPG_Processing_SplitCon.Panel1.Controls.Add( this.iPG_Processing_SourceList ); + // + // iPG_Processing_SplitCon.Panel2 + // + this.iPG_Processing_SplitCon.Panel2.Controls.Add( this.iPG_Processing_CrashList ); + this.iPG_Processing_SplitCon.Size = new System.Drawing.Size( 886, 537 ); + this.iPG_Processing_SplitCon.SplitterDistance = 293; + this.iPG_Processing_SplitCon.TabIndex = 0; + // + // iPG_Processing_SourceList + // + this.iPG_Processing_SourceList.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_Processing_SourceList.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_Processing_SourceList.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_Processing_SourceList.Name = "iPG_Processing_SourceList"; + this.iPG_Processing_SourceList.Size = new System.Drawing.Size( 886, 293 ); + this.iPG_Processing_SourceList.TabIndex = 0; + // + // iPG_Processing_CrashList + // + this.iPG_Processing_CrashList.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_Processing_CrashList.Engine = null; + this.iPG_Processing_CrashList.Font = new System.Drawing.Font( "Tahoma", 8.25F ); + this.iPG_Processing_CrashList.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_Processing_CrashList.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_Processing_CrashList.Name = "iPG_Processing_CrashList"; + this.iPG_Processing_CrashList.Size = new System.Drawing.Size( 886, 240 ); + this.iPG_Processing_CrashList.TabIndex = 0; + // + // iPG_Processing_Header + // + this.iPG_Processing_Header.BackColor = System.Drawing.SystemColors.Window; + this.iPG_Processing_Header.Description = "Shows a list of all identified crash files, as well as their analysis status."; + this.iPG_Processing_Header.Dock = System.Windows.Forms.DockStyle.Top; + this.iPG_Processing_Header.Image = null; + this.iPG_Processing_Header.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_Processing_Header.Name = "iPG_Processing_Header"; + this.iPG_Processing_Header.Size = new System.Drawing.Size( 892, 74 ); + this.iPG_Processing_Header.TabIndex = 42; + this.iPG_Processing_Header.Title = "Crash Data Summary"; + // + // iPG_DebugEngine + // + this.iPG_DebugEngine.Controls.Add( this.iPG_DebugEngine_Control ); + this.iPG_DebugEngine.Controls.Add( this.iPG_DebugEngine_Header ); + this.iPG_DebugEngine.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_DebugEngine.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_DebugEngine.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_DebugEngine.Name = "iPG_DebugEngine"; + this.iPG_DebugEngine.Size = new System.Drawing.Size( 892, 617 ); + this.iPG_DebugEngine.TabIndex = 3; + this.iPG_DebugEngine.Load += new System.EventHandler( this.iPG_DebugEngine_Load ); + this.iPG_DebugEngine.PageClosedFromButtonNext += new SymbianWizardLib.GUI.SymWizardPage.PageClosedFromButtonNextHandler( this.iPG_DebugEngine_PageClosedFromButtonNext ); + // + // iPG_DebugEngine_Control + // + this.iPG_DebugEngine_Control.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_DebugEngine_Control.Location = new System.Drawing.Point( 0, 74 ); + this.iPG_DebugEngine_Control.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_DebugEngine_Control.Name = "iPG_DebugEngine_Control"; + this.iPG_DebugEngine_Control.Size = new System.Drawing.Size( 892, 543 ); + this.iPG_DebugEngine_Control.TabIndex = 42; + // + // iPG_DebugEngine_Header + // + this.iPG_DebugEngine_Header.BackColor = System.Drawing.SystemColors.Window; + this.iPG_DebugEngine_Header.Description = ""; + this.iPG_DebugEngine_Header.Dock = System.Windows.Forms.DockStyle.Top; + this.iPG_DebugEngine_Header.Image = null; + this.iPG_DebugEngine_Header.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_DebugEngine_Header.Name = "iPG_DebugEngine_Header"; + this.iPG_DebugEngine_Header.Size = new System.Drawing.Size( 892, 74 ); + this.iPG_DebugEngine_Header.TabIndex = 41; + this.iPG_DebugEngine_Header.Title = "Symbolic / Debug Meta-Data"; + // + // CAWizardCrashAnalysis + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 892, 673 ); + this.Controls.Add( this.iWizard ); + this.Font = new System.Drawing.Font( "Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ( (byte) ( 0 ) ) ); + this.MinimumSize = new System.Drawing.Size( 900, 700 ); + this.Name = "CAWizardCrashAnalysis"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Crash File Wizard"; + this.Load += new System.EventHandler( this.CAWizardCrashFile_Load ); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler( this.CAWizardCrashFile_FormClosing ); + this.iPG_SourceFiles.ResumeLayout( false ); + this.iPG_Processing.ResumeLayout( false ); + this.iPG_Processing_Panel.ResumeLayout( false ); + this.iPG_Processing_SplitCon.Panel1.ResumeLayout( false ); + this.iPG_Processing_SplitCon.Panel2.ResumeLayout( false ); + this.iPG_Processing_SplitCon.ResumeLayout( false ); + this.iPG_DebugEngine.ResumeLayout( false ); + this.ResumeLayout( false ); + + } + + #endregion + + private SymbianWizardLib.GUI.SymWizard iWizard; + private SymbianWizardLib.GUI.SymWizardPage iPG_SourceFiles; + private SymbianWizardLib.GUI.SymWizardHeaderSection iPG_SourceFiles_Header; + private CrashItemUiLib.Controls.CIEngineSourceManager iPG_SourceFiles_FileList; + private SymbianWizardLib.GUI.SymWizardPage iPG_DebugEngine; + private SymbianDebugLibUi.Controls.DebugEngineControl iPG_DebugEngine_Control; + private SymbianWizardLib.GUI.SymWizardHeaderSection iPG_DebugEngine_Header; + private SymbianWizardLib.GUI.SymWizardPage iPG_Processing; + private SymbianWizardLib.GUI.SymWizardHeaderSection iPG_Processing_Header; + private System.Windows.Forms.Panel iPG_Processing_Panel; + private System.Windows.Forms.SplitContainer iPG_Processing_SplitCon; + private CrashItemUiLib.Controls.CIEngineSourceList iPG_Processing_SourceList; + private CrashItemUiLib.Controls.CIEngineCrashList iPG_Processing_CrashList; + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Wizards/CAWizardCrashAnalysis.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Wizards/CAWizardCrashAnalysis.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,185 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Text; +using System.Windows.Forms; +using SymbianUtils; +using CrashItemLib.Engine.Sources; +using CAPCrashAnalysis.Plugin; + +namespace CAPluginCrashAnalysisUi.Wizards +{ + internal partial class CAWizardCrashAnalysis : Form + { + #region Constructors + public CAWizardCrashAnalysis( CAPluginCrashAnalysis aEngine ) + { + iEngine = aEngine; + // + InitializeComponent(); + } + #endregion + + #region Events + private void CAWizardCrashFile_Load( object sender, EventArgs e ) + { + } + + private void CAWizardCrashFile_FormClosing( object sender, FormClosingEventArgs e ) + { + } + + private void iWizard_WizardClosedFromFinish( SymbianWizardLib.Engine.SymWizardClosureEvent aEventArgs ) + { + DialogResult = DialogResult.OK; + } + #endregion + + #region Page - source files + private void PG_SourceFiles_UpdateWizardButtonState() + { + iWizard.ButtonNext.Enabled = ( iPG_SourceFiles_FileList.FileCount > 0 ); + } + + private void iPG_SourceFiles_Load( object aSender, EventArgs aArgs ) + { + // Seed file list dialog with file types. + string types = iEngine.GetSupportedCrashFileTypes(); + iPG_SourceFiles_FileList.DialogFilter = types; + + iEngine.Settings.Load( "CrashFileWizard_SourceFiles", iPG_SourceFiles_FileList ); + PG_SourceFiles_UpdateWizardButtonState(); + } + + private void iPG_SourceFiles_FileList_SourceListChanged( CrashItemUiLib.Controls.CIEngineSourceManager aControl, CrashItemUiLib.Controls.CIEngineSourceManager.TEvent aEvent ) + { + PG_SourceFiles_UpdateWizardButtonState(); + } + + private void iPG_SourceFiles_PageClosedFromButtonNext( SymbianWizardLib.Engine.SymWizardPageTransitionEvent aEventArgs ) + { + if ( iPG_SourceFiles_FileList.FileCount == 0 ) + { + aEventArgs.SuggestedNewPage = aEventArgs.CurrentPage; + } + else + { + List files = iPG_SourceFiles_FileList.FileNames; + iEngine.PrimeSources( files.ToArray() ); + + // Save settings + iEngine.Settings.Save( "CrashFileWizard_SourceFiles", iPG_SourceFiles_FileList ); + } + } + #endregion + + #region Page - debug engine + private void iPG_DebugEngine_Load( object aSender, EventArgs aArgs ) + { + iPG_DebugEngine_Control.Engine = iEngine.DebugEngine; + } + + private void iPG_DebugEngine_PageClosedFromButtonNext( SymbianWizardLib.Engine.SymWizardPageTransitionEvent aEventArgs ) + { + string errorText = string.Empty; + bool isReady = iPG_DebugEngine_Control.IsReadyToPrime( out errorText ); + if ( isReady ) + { + // Store the settings at this point as we are largely past the + // initial configuration + iEngine.Settings.Store(); + + // Also save debug engine configuration + iPG_DebugEngine_Control.XmlSettingsSave(); + + // Begin priming + iPG_DebugEngine_Control.Prime(); + } + else + { + MessageBox.Show( errorText, "Error" ); + aEventArgs.SuggestedNewPage = aEventArgs.CurrentPage; + } + } + #endregion + + #region Page - processing summary + private void iPG_Processing_Load( object aSender, EventArgs aArgs ) + { + // Observe crash item engine events + iPG_Processing_CrashList.Engine = iEngine.CrashItemEngine; + iEngine.CrashItemEngine.StateChanged += new CrashItemLib.Engine.CIEngine.CIEngineStateHandler( CrashItemEngine_StateHandler ); + } + + private void iPG_Processing_Unload( object sender, EventArgs e ) + { + // Triggers event unsubscriptions + iPG_Processing_SourceList.Sources = null; + iPG_Processing_CrashList.Engine = null; + iEngine.CrashItemEngine.StateChanged -= new CrashItemLib.Engine.CIEngine.CIEngineStateHandler( CrashItemEngine_StateHandler ); + } + + private void iPG_Processing_PageShownFromButtonNext( SymbianWizardLib.GUI.SymWizardPage aSender ) + { + // Prevent navigation + iWizard.ButtonNext.Enabled = false; + iWizard.ButtonBack.Enabled = false; + + // Set up controls to interact with crash engine + iPG_Processing_SourceList.Sources = iEngine.CrashItemEngine.Sources; + iPG_Processing_CrashList.Engine = iEngine.CrashItemEngine; + + // Start reading the crash files asynchronously. We'll allow + // the user to continue once the "processing complete" event + // is signalled. + iEngine.IdentifyCrashes( TSynchronicity.EAsynchronous ); + } + + private void CrashItemEngine_StateHandler( CrashItemLib.Engine.CIEngine.TState aState ) + { + if ( InvokeRequired ) + { + CrashItemLib.Engine.CIEngine.CIEngineStateHandler observer = new CrashItemLib.Engine.CIEngine.CIEngineStateHandler( CrashItemEngine_StateHandler ); + this.BeginInvoke( observer, new object[] { aState } ); + } + else + { + switch ( aState ) + { + case CrashItemLib.Engine.CIEngine.TState.EStateProcessingStarted: + break; + case CrashItemLib.Engine.CIEngine.TState.EStateProcessingComplete: + iWizard.ButtonNext.Enabled = true; + iWizard.ButtonBack.Enabled = true; + break; + } + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly CAPluginCrashAnalysis iEngine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Wizards/CAWizardCrashAnalysis.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginCrashAnalyserUi/Wizards/CAWizardCrashAnalysis.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICD/CAPluginNICD.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICD/CAPluginNICD.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,80 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {860BF3C3-FF86-4C35-9325-137886AC7FD6} + Library + Properties + CAPNICD + CAPluginNICD.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA} + CrashDebuggerLib + + + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80} + CrashAnalyserEngine + + + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICD/Plugin/CAPluginNICD.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICD/Plugin/CAPluginNICD.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Reflection; +using System.Windows.Forms; +using SymbianDebugLib.Engine; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Plugins; +using CrashDebuggerLib.Structures; + +namespace CAPluginNICD.Plugin +{ + public class CAPluginNICD : CAPlugin + { + #region Constructors + public CAPluginNICD( CAEngine aEngine ) + : base( aEngine, "Non-interactive Crash Debugger" ) + { + iCrashDebuggerInfo = new CrashDebuggerInfo( DebugEngine ); + } + #endregion + + #region From CAPlugin + public override CAPlugin.TType Type + { + get { return TType.ETypeUi; } + } + #endregion + + #region API + #endregion + + #region Properties + public CrashDebuggerInfo CrashDebuggerInfo + { + get { return iCrashDebuggerInfo; } + } + #endregion + + #region Data members + private readonly CrashDebuggerInfo iCrashDebuggerInfo; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICD/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICD/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "CAPluginNICD" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Symbian Software Ltd" )] +[assembly: AssemblyProduct( "CAPluginNICD" )] +[assembly: AssemblyCopyright( "Copyright © Symbian Software Ltd 2008" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "41bf0f5a-d67a-4fce-9403-11f6d5aeb0c5" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICDUi/CAPluginNICDUi.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICDUi/CAPluginNICDUi.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,129 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {A349F611-7ADE-48FD-AC31-726878FD6052} + Library + Properties + CAPluginNICDUi + CAPluginNICDUi.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + False + ..\..\..\..\PerfToolsSharedLibraries\3rd Party\XPTable\bin\Debug\XPTable.dll + + + + + + UserControl + + + CATabNICDViewer.cs + + + Form + + + CAWizardNICD.cs + + + + + + + CATabNICDViewer.cs + Designer + + + CAWizardNICD.cs + Designer + + + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {14175109-E40C-4BBA-9691-498EF118C8A0} + SymbianTabStripLib + + + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822} + SymbianUtilsUi + + + {AC323F51-47D6-46BE-8E06-7A75F4C5348D} + SymbianWizardLib + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {6C30B8C1-BF87-4626-8125-D5681B22347C} + SymbianDebugLibUi + + + {F852F144-7AFC-4F56-A8F1-D7E85E25C9AA} + CrashDebuggerLib + + + {76242EA7-92DF-4926-8789-2C718B5D9A66} + CrashDebuggerUiLib + + + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80} + CrashAnalyserEngine + + + {860BF3C3-FF86-4C35-9325-137886AC7FD6} + CAPluginNICD + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICDUi/Plugin/CAPluginNICDUi.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICDUi/Plugin/CAPluginNICDUi.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Threading; +using System.Windows.Forms; +using CrashAnalyserEngine.Plugins; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Interfaces; +using CAPluginNICDUi.Wizards; +using CAPluginNICDUi.Tabs; +using CAPluginNICD.Plugin; +using SymbianUtils; + +namespace CAPluginNICDUi.Plugin +{ + public class CAPluginNICDUi : CAPluginNICD.Plugin.CAPluginNICD + { + #region Constructors + public CAPluginNICDUi( CAEngine aEngine ) + : base( aEngine ) + { + // Switch debug engine to UI mode + aEngine.DebugEngine.UiMode = SymbianDebugLib.TDbgUiMode.EUiEnabled; + RegisterMenuItems(); + } + #endregion + + #region API + #endregion + + #region From CAPlugin + public override CAPlugin.TType Type + { + get { return CAPlugin.TType.ETypeUi; } + } + #endregion + + #region Properties + #endregion + + #region Event handlers + private void Menu_File_New_NICDAnalysis_Click( object aTag, string aCaption ) + { + CAWizardNICD wizard = new CAWizardNICD( this ); + DialogResult result = wizard.ShowDialog(); + if ( result == DialogResult.OK ) + { + CATabNICDViewer control = new CATabNICDViewer( this ); + base.UIManager.UIManagerContentAdd( control ); + } + } + #endregion + + #region Internal constants + #endregion + + #region Internal methods + private void RegisterMenuItems() + { + // Register "new" menu item + base.UIManager.UIManagerMenuItemAdd( TEngineUIMenuPane.EFileNew, base.Name, new UIMenuItemClickHandler( Menu_File_New_NICDAnalysis_Click ), null ); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICDUi/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICDUi/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "CAPluginNICDUi" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Symbian Software Ltd" )] +[assembly: AssemblyProduct( "CAPluginNICDUi" )] +[assembly: AssemblyCopyright( "Copyright © Symbian Software Ltd 2008" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "0614db96-54d7-4287-ad69-c0da9fc26199" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICDUi/Tabs/CATabNICDViewer.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICDUi/Tabs/CATabNICDViewer.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginNICDUi.Tabs +{ + partial class CATabNICDViewer + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Component Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.iCol_FileName = new XPTable.Models.TextColumn(); + this.iCol_SubRow_Line = new XPTable.Models.TextColumn(); + this.iCol_CrashCount = new XPTable.Models.TextColumn(); + this.iCtrl_CrashDebugger = new CrashDebuggerUiLib.CrashDebuggerControl(); + this.SuspendLayout(); + // + // iCol_FileName + // + this.iCol_FileName.ContentWidth = 0; + this.iCol_FileName.Width = 24; + // + // iCol_SubRow_Line + // + this.iCol_SubRow_Line.ContentWidth = 0; + this.iCol_SubRow_Line.Text = "Line"; + this.iCol_SubRow_Line.Width = 40; + // + // iCol_CrashCount + // + this.iCol_CrashCount.ContentWidth = 0; + this.iCol_CrashCount.Text = "Count"; + this.iCol_CrashCount.Width = 40; + // + // iCtrl_CrashDebugger + // + this.iCtrl_CrashDebugger.Dock = System.Windows.Forms.DockStyle.Fill; + this.iCtrl_CrashDebugger.Location = new System.Drawing.Point( 0, 0 ); + this.iCtrl_CrashDebugger.Name = "iCtrl_CrashDebugger"; + this.iCtrl_CrashDebugger.Size = new System.Drawing.Size( 907, 679 ); + this.iCtrl_CrashDebugger.TabIndex = 0; + // + // CATabNICDViewer + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add( this.iCtrl_CrashDebugger ); + this.Name = "CATabNICDViewer"; + this.Size = new System.Drawing.Size( 907, 679 ); + this.Load += new System.EventHandler( this.CATabNICDViewer_Load ); + this.ResumeLayout( false ); + + } + + #endregion + + private XPTable.Models.TextColumn iCol_FileName; + private XPTable.Models.TextColumn iCol_CrashCount; + private XPTable.Models.TextColumn iCol_SubRow_Line; + private CrashDebuggerUiLib.CrashDebuggerControl iCtrl_CrashDebugger; + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICDUi/Tabs/CATabNICDViewer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICDUi/Tabs/CATabNICDViewer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using CAPluginNICD.Plugin; +using CrashAnalyserEngine.Tabs; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Interfaces; + +namespace CAPluginNICDUi.Tabs +{ + internal partial class CATabNICDViewer : CATab + { + #region Constructors + public CATabNICDViewer( CAPluginNICD.Plugin.CAPluginNICD aPlugin ) + { + InitializeComponent(); + // + iPlugin = aPlugin; + base.Title = "NICD"; + } + #endregion + + #region Properties + #endregion + + #region Event handlers + private void CATabNICDViewer_Load( object sender, EventArgs e ) + { + iCtrl_CrashDebugger.Info = iPlugin.CrashDebuggerInfo; + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly CAPluginNICD.Plugin.CAPluginNICD iPlugin; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICDUi/Tabs/CATabNICDViewer.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICDUi/Tabs/CATabNICDViewer.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICDUi/Wizards/CAWizardNICD.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICDUi/Wizards/CAWizardNICD.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginNICDUi.Wizards +{ + partial class CAWizardNICD + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.iWizard = new SymbianWizardLib.GUI.SymWizard(); + this.iPG_SourceFile = new SymbianWizardLib.GUI.SymWizardPage(); + this.label2 = new System.Windows.Forms.Label(); + this.iFB_NICD_Trace = new SymbianUtilsUi.Controls.SymbianFileBrowserControl(); + this.iPG_SourceFiles_Header = new SymbianWizardLib.GUI.SymWizardHeaderSection(); + this.iPG_DebugEngine = new SymbianWizardLib.GUI.SymWizardPage(); + this.iPG_DebugEngine_Control = new SymbianDebugLibUi.Controls.DebugEngineControl(); + this.iPG_DebugEngine_Header = new SymbianWizardLib.GUI.SymWizardHeaderSection(); + this.iPG_SourceFile.SuspendLayout(); + this.iPG_DebugEngine.SuspendLayout(); + this.SuspendLayout(); + // + // iWizard + // + this.iWizard.Dock = System.Windows.Forms.DockStyle.Fill; + this.iWizard.Location = new System.Drawing.Point( 0, 0 ); + this.iWizard.Margin = new System.Windows.Forms.Padding( 0 ); + this.iWizard.Name = "iWizard"; + this.iWizard.Pages.AddRange( new SymbianWizardLib.GUI.SymWizardPage[] { + this.iPG_SourceFile, + this.iPG_DebugEngine} ); + this.iWizard.Size = new System.Drawing.Size( 892, 673 ); + this.iWizard.TabIndex = 0; + this.iWizard.WizardClosedFromFinish += new SymbianWizardLib.GUI.SymWizard.WizardClosedFromFinishHandler( this.iWizard_WizardClosedFromFinish ); + // + // iPG_SourceFile + // + this.iPG_SourceFile.Controls.Add( this.label2 ); + this.iPG_SourceFile.Controls.Add( this.iFB_NICD_Trace ); + this.iPG_SourceFile.Controls.Add( this.iPG_SourceFiles_Header ); + this.iPG_SourceFile.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_SourceFile.IsFinishingPage = false; + this.iPG_SourceFile.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_SourceFile.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_SourceFile.Name = "iPG_SourceFile"; + this.iPG_SourceFile.Size = new System.Drawing.Size( 892, 617 ); + this.iPG_SourceFile.TabIndex = 3; + this.iPG_SourceFile.Wizard = this.iWizard; + this.iPG_SourceFile.Load += new System.EventHandler( this.iPG_SourceFile_Load ); + this.iPG_SourceFile.PageClosedFromButtonNext += new SymbianWizardLib.GUI.SymWizardPage.PageClosedFromButtonNextHandler( this.iPG_SourceFile_PageClosedFromButtonNext ); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point( 12, 101 ); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size( 67, 13 ); + this.label2.TabIndex = 6; + this.label2.Text = "NICD Trace:"; + // + // iFB_NICD_Trace + // + this.iFB_NICD_Trace.DialogFilter = ""; + this.iFB_NICD_Trace.DialogTitle = ""; + this.iFB_NICD_Trace.EntityMustExist = true; + this.iFB_NICD_Trace.EntityName = ""; + this.iFB_NICD_Trace.Location = new System.Drawing.Point( 88, 97 ); + this.iFB_NICD_Trace.Margin = new System.Windows.Forms.Padding( 0 ); + this.iFB_NICD_Trace.MinimumSize = new System.Drawing.Size( 396, 21 ); + this.iFB_NICD_Trace.Name = "iFB_NICD_Trace"; + this.iFB_NICD_Trace.ShowDriveLetter = true; + this.iFB_NICD_Trace.Size = new System.Drawing.Size( 781, 21 ); + this.iFB_NICD_Trace.TabIndex = 5; + this.iFB_NICD_Trace.TextInputEnabled = true; + // + // iPG_SourceFiles_Header + // + this.iPG_SourceFiles_Header.BackColor = System.Drawing.SystemColors.Window; + this.iPG_SourceFiles_Header.Description = "Select an NICD trace file for analysis. You can also drag and drop a file onto th" + + "e edit box."; + this.iPG_SourceFiles_Header.Dock = System.Windows.Forms.DockStyle.Top; + this.iPG_SourceFiles_Header.Image = null; + this.iPG_SourceFiles_Header.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_SourceFiles_Header.Name = "iPG_SourceFiles_Header"; + this.iPG_SourceFiles_Header.Size = new System.Drawing.Size( 892, 74 ); + this.iPG_SourceFiles_Header.TabIndex = 4; + this.iPG_SourceFiles_Header.Title = "NICD Analysis"; + // + // iPG_DebugEngine + // + this.iPG_DebugEngine.Controls.Add( this.iPG_DebugEngine_Control ); + this.iPG_DebugEngine.Controls.Add( this.iPG_DebugEngine_Header ); + this.iPG_DebugEngine.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_DebugEngine.IsFinishingPage = true; + this.iPG_DebugEngine.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_DebugEngine.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_DebugEngine.Name = "iPG_DebugEngine"; + this.iPG_DebugEngine.Size = new System.Drawing.Size( 892, 617 ); + this.iPG_DebugEngine.TabIndex = 3; + this.iPG_DebugEngine.Wizard = this.iWizard; + this.iPG_DebugEngine.Load += new System.EventHandler( this.iPG_DebugEngine_Load ); + this.iPG_DebugEngine.PageClosedFromButtonNext += new SymbianWizardLib.GUI.SymWizardPage.PageClosedFromButtonNextHandler( this.iPG_DebugEngine_PageClosedFromButtonNext ); + // + // iPG_DebugEngine_Control + // + this.iPG_DebugEngine_Control.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_DebugEngine_Control.Location = new System.Drawing.Point( 0, 74 ); + this.iPG_DebugEngine_Control.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_DebugEngine_Control.Name = "iPG_DebugEngine_Control"; + this.iPG_DebugEngine_Control.Size = new System.Drawing.Size( 892, 543 ); + this.iPG_DebugEngine_Control.TabIndex = 42; + // + // iPG_DebugEngine_Header + // + this.iPG_DebugEngine_Header.BackColor = System.Drawing.SystemColors.Window; + this.iPG_DebugEngine_Header.Description = ""; + this.iPG_DebugEngine_Header.Dock = System.Windows.Forms.DockStyle.Top; + this.iPG_DebugEngine_Header.Image = null; + this.iPG_DebugEngine_Header.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_DebugEngine_Header.Name = "iPG_DebugEngine_Header"; + this.iPG_DebugEngine_Header.Size = new System.Drawing.Size( 892, 74 ); + this.iPG_DebugEngine_Header.TabIndex = 41; + this.iPG_DebugEngine_Header.Title = "Symbolic / Debug Meta-Data"; + // + // CAWizardNICD + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 892, 673 ); + this.Controls.Add( this.iWizard ); + this.Font = new System.Drawing.Font( "Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ( (byte) ( 0 ) ) ); + this.MinimumSize = new System.Drawing.Size( 900, 700 ); + this.Name = "CAWizardNICD"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Non Interactive Crash Debugger Analysis Wizard"; + this.iPG_SourceFile.ResumeLayout( false ); + this.iPG_SourceFile.PerformLayout(); + this.iPG_DebugEngine.ResumeLayout( false ); + this.ResumeLayout( false ); + + } + + #endregion + + private SymbianWizardLib.GUI.SymWizard iWizard; + private SymbianWizardLib.GUI.SymWizardPage iPG_SourceFile; + private SymbianWizardLib.GUI.SymWizardHeaderSection iPG_SourceFiles_Header; + private SymbianWizardLib.GUI.SymWizardPage iPG_DebugEngine; + private SymbianDebugLibUi.Controls.DebugEngineControl iPG_DebugEngine_Control; + private SymbianWizardLib.GUI.SymWizardHeaderSection iPG_DebugEngine_Header; + private SymbianUtilsUi.Controls.SymbianFileBrowserControl iFB_NICD_Trace; + private System.Windows.Forms.Label label2; + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICDUi/Wizards/CAWizardNICD.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICDUi/Wizards/CAWizardNICD.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Text; +using System.Windows.Forms; +using CAPluginNICD.Plugin; + +namespace CAPluginNICDUi.Wizards +{ + internal partial class CAWizardNICD : Form + { + #region Constructors + public CAWizardNICD( CAPluginNICD.Plugin.CAPluginNICD aPlugin ) + { + iPlugin = aPlugin; + // + InitializeComponent(); + } + #endregion + + #region Properties + #endregion + + #region Events + private void iWizard_WizardClosedFromFinish( SymbianWizardLib.Engine.SymWizardClosureEvent aEventArgs ) + { + string errorText = string.Empty; + bool isReady = iPG_DebugEngine_Control.IsReadyToPrime( out errorText ); + if ( isReady ) + { + // Prime debug engine + iPG_DebugEngine_Control.Prime(); + + // Store the settings at this point as we are largely past the + // initial configuration + iPlugin.Settings.Store(); + + // Also save debug engine configuration + iPG_DebugEngine_Control.XmlSettingsSave(); + + // Read NICD trace file + string fileName = iFB_NICD_Trace.EntityName; + CrashDebuggerUiLib.Dialogs.ParserProgressDialog.Read( iPlugin.CrashDebuggerInfo, fileName ); + + DialogResult = DialogResult.OK; + } + else + { + MessageBox.Show( errorText, "Error" ); + aEventArgs.CancelClosure = true; + } + } + #endregion + + #region Page - source files + private void iPG_SourceFile_Load( object sender, EventArgs e ) + { + iPlugin.Settings.Load( this.Name, iFB_NICD_Trace ); + } + + private void iPG_SourceFile_PageClosedFromButtonNext( SymbianWizardLib.Engine.SymWizardPageTransitionEvent aEventArgs ) + { + if ( iFB_NICD_Trace.IsValid ) + { + iPlugin.Settings.Save( this.Name, iFB_NICD_Trace ); + } + else + { + // Don't let a page transition occur if a valid file is not entered + aEventArgs.SuggestedNewPage = aEventArgs.CurrentPage; + } + } + #endregion + + #region Page - debug engine + private void iPG_DebugEngine_Load( object aSender, EventArgs aArgs ) + { + iPG_DebugEngine_Control.Engine = iPlugin.DebugEngine; + } + + private void iPG_DebugEngine_PageClosedFromButtonNext( SymbianWizardLib.Engine.SymWizardPageTransitionEvent aEventArgs ) + { + string errorText = string.Empty; + bool isReady = iPG_DebugEngine_Control.IsReadyToPrime( out errorText ); + if ( isReady == false ) + { + MessageBox.Show( errorText, "Error" ); + aEventArgs.SuggestedNewPage = aEventArgs.CurrentPage; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly CAPluginNICD.Plugin.CAPluginNICD iPlugin; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginNICDUi/Wizards/CAWizardNICD.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginNICDUi/Wizards/CAWizardNICD.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStack/CAPluginRawStack.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStack/CAPluginRawStack.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,79 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {B5D6067D-FAD0-490B-9563-408A28411C47} + Library + Properties + CAPluginRawStack + CAPluginRawStack.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3} + SymbianStackLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80} + CrashAnalyserEngine + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStack/Plugin/CAPluginRawStack.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStack/Plugin/CAPluginRawStack.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Threading; +using CrashAnalyserEngine.Plugins; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Interfaces; +using SymbianUtils; +using SymbianUtils.FileSystem.Utilities; +using SymbianStackLib.Engine; + +namespace CAPRawStack.Plugin +{ + public class CAPluginRawStack : CAPlugin + { + #region Constructors + public CAPluginRawStack( CAEngine aEngine ) + : base( aEngine, KPluginName ) + { + iStackEngine = new StackEngine( aEngine.DebugEngine ); + } + #endregion + + #region Constants + public const string KPluginName = "Call Stack Reconstructor"; + #endregion + + #region API + #endregion + + #region From CAPlugin + public override CAPlugin.TType Type + { + get { return CAPlugin.TType.ETypeEngine; } + } + #endregion + + #region Properties + public StackEngine StackEngine + { + get { return iStackEngine; } + } + #endregion + + #region Event handlers + #endregion + + #region Internal methods + #endregion + + #region Data members + private StackEngine iStackEngine; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStack/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStack/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "CAPluginRawStack" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia" )] +[assembly: AssemblyProduct( "CAPluginRawStack" )] +[assembly: AssemblyCopyright( "Copyright © Nokia 2009" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "c61030f1-a157-4b24-93d1-47061fa444b7" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStackUi/CAPluginRawStackUi.csproj --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStackUi/CAPluginRawStackUi.csproj Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,139 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {C1892E8C-3EC0-4ECE-B03D-8E10C0D45DDE} + Library + Properties + CAPluginRawStackUi + CAPluginRawStackUi.plugin + v2.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + False + ..\..\..\..\PerfToolsSharedLibraries\3rd Party\XPTable\bin\Debug\XPTable.dll + + + + + Form + + + RawStackImportDialog.cs + + + + + UserControl + + + CATabStackViewer.cs + + + Form + + + CAWizardRawStack.cs + + + + + + CATabStackViewer.cs + Designer + + + CAWizardRawStack.cs + Designer + + + + + {796DD82D-9E7D-476D-B700-086CD9A893DA} + SymbianDebugLib + + + {3E11A9E3-3D9B-46CC-BF1D-F4AB0D6A34C3} + SymbianStackLib + + + {D3BDEB23-43DA-4534-986B-F6B3DD05EBF6} + SymbianStructuresLib + + + {F6F4CE69-E73A-4917-97ED-B114DE90C92E} + SymbianUtils + + + {6C30B8C1-BF87-4626-8125-D5681B22347C} + SymbianDebugLibUi + + + {458E350D-35D8-46AB-978A-3BF12B8B87D7} + SymbianStackLibUi + + + {14175109-E40C-4BBA-9691-498EF118C8A0} + SymbianTabStripLib + + + {48F86FA3-3B42-4826-8D06-E8F2E0E7B822} + SymbianUtilsUi + + + {AC323F51-47D6-46BE-8E06-7A75F4C5348D} + SymbianWizardLib + + + {F9BFDB22-A976-43AD-BD9D-8495C6CCFD80} + CrashAnalyserEngine + + + {B5D6067D-FAD0-490B-9563-408A28411C47} + CAPluginRawStack + + + + + + set path_out="$(SolutionDir)$(OutDir)" +if not exist %25path_out%25 ( + mkdir %25path_out%25 +) +copy "$(TargetDir)\*.*" "$(SolutionDir)$(OutDir)" + + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Dialogs/RawStackImportDialog.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Dialogs/RawStackImportDialog.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginRawStackUi.Dialogs +{ + partial class RawStackImportDialog + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.iFBrowse_FileName = new SymbianUtilsUi.Controls.SymbianFileBrowserControl(); + this.label1 = new System.Windows.Forms.Label(); + this.iTB_FilterText = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.iBT_Cancel = new System.Windows.Forms.Button(); + this.iBT_OK = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // iFBrowse_FileName + // + this.iFBrowse_FileName.DialogFilter = ""; + this.iFBrowse_FileName.DialogTitle = ""; + this.iFBrowse_FileName.EntityName = ""; + this.iFBrowse_FileName.Location = new System.Drawing.Point( 78, 11 ); + this.iFBrowse_FileName.Margin = new System.Windows.Forms.Padding( 0 ); + this.iFBrowse_FileName.MinimumSize = new System.Drawing.Size( 396, 21 ); + this.iFBrowse_FileName.Name = "iFBrowse_FileName"; + this.iFBrowse_FileName.Size = new System.Drawing.Size( 396, 21 ); + this.iFBrowse_FileName.TabIndex = 0; + this.iFBrowse_FileName.FileSelectionChanged += new SymbianUtilsUi.Controls.SymbianFileControl.FileSelectionChangedHandler( this.iFBrowse_FileName_FileSelectionChanged ); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point( 12, 15 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 55, 13 ); + this.label1.TabIndex = 1; + this.label1.Text = "File name:"; + // + // iTB_FilterText + // + this.iTB_FilterText.Location = new System.Drawing.Point( 78, 41 ); + this.iTB_FilterText.Name = "iTB_FilterText"; + this.iTB_FilterText.Size = new System.Drawing.Size( 344, 20 ); + this.iTB_FilterText.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point( 12, 44 ); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size( 60, 13 ); + this.label2.TabIndex = 1; + this.label2.Text = "Filter prefix:"; + // + // iBT_Cancel + // + this.iBT_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.iBT_Cancel.Location = new System.Drawing.Point( 166, 77 ); + this.iBT_Cancel.Name = "iBT_Cancel"; + this.iBT_Cancel.Size = new System.Drawing.Size( 75, 23 ); + this.iBT_Cancel.TabIndex = 3; + this.iBT_Cancel.Text = "Cancel"; + this.iBT_Cancel.UseVisualStyleBackColor = true; + this.iBT_Cancel.Click += new System.EventHandler( this.iBT_Cancel_Click ); + // + // iBT_OK + // + this.iBT_OK.Location = new System.Drawing.Point( 247, 77 ); + this.iBT_OK.Name = "iBT_OK"; + this.iBT_OK.Size = new System.Drawing.Size( 75, 23 ); + this.iBT_OK.TabIndex = 3; + this.iBT_OK.Text = "OK"; + this.iBT_OK.UseVisualStyleBackColor = true; + this.iBT_OK.Click += new System.EventHandler( this.iBT_OK_Click ); + // + // RawStackImportDialog + // + this.AcceptButton = this.iBT_OK; + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.iBT_Cancel; + this.ClientSize = new System.Drawing.Size( 489, 113 ); + this.ControlBox = false; + this.Controls.Add( this.iBT_OK ); + this.Controls.Add( this.iBT_Cancel ); + this.Controls.Add( this.iTB_FilterText ); + this.Controls.Add( this.label2 ); + this.Controls.Add( this.label1 ); + this.Controls.Add( this.iFBrowse_FileName ); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "RawStackImportDialog"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Import Text File..."; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler( this.RawStackImportDialog_FormClosed ); + this.Load += new System.EventHandler( this.RawStackImportDialog_Load ); + this.ResumeLayout( false ); + this.PerformLayout(); + + } + + #endregion + + private SymbianUtilsUi.Controls.SymbianFileBrowserControl iFBrowse_FileName; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox iTB_FilterText; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button iBT_Cancel; + private System.Windows.Forms.Button iBT_OK; + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Dialogs/RawStackImportDialog.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Dialogs/RawStackImportDialog.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,105 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using SymbianUtils; +using SymbianUtils.Settings; + +namespace CAPluginRawStackUi.Dialogs +{ + public partial class RawStackImportDialog : Form + { + #region Constructors + public static DialogResult ShowDialog( XmlSettings aSettings, out string aFileName, out string aFilter ) + { + RawStackImportDialog self = new RawStackImportDialog( aSettings ); + DialogResult result = self.ShowDialog(); + // + if ( result == DialogResult.OK ) + { + aFileName = self.iFileName; + aFilter = self.iFilter; + } + else + { + aFileName = string.Empty; + aFilter = string.Empty; + } + // + return result; + } + #endregion + + #region Constructors + public RawStackImportDialog( XmlSettings aSettings ) + { + iSettings = aSettings; + // + InitializeComponent(); + } + #endregion + + #region Event handlers + private void iFBrowse_FileName_FileSelectionChanged( SymbianUtilsUi.Controls.SymbianFileControl aSelf, string aFileName ) + { + + } + + private void iBT_Cancel_Click( object sender, EventArgs e ) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + private void iBT_OK_Click( object sender, EventArgs e ) + { + iFileName = iFBrowse_FileName.EntityName; + iFilter = iTB_FilterText.Text; + // + DialogResult = DialogResult.OK; + Close(); + } + + private void RawStackImportDialog_Load( object sender, EventArgs e ) + { + iFBrowse_FileName.EntityName = iSettings[ "RawStackImportDialog", "iFBrowse_FileName" ]; + iSettings.Load( "RawStackImportDialog", iTB_FilterText ); + } + + private void RawStackImportDialog_FormClosed( object sender, FormClosedEventArgs e ) + { + if ( DialogResult == DialogResult.OK ) + { + iSettings[ "RawStackImportDialog", "iFBrowse_FileName" ] = iFBrowse_FileName.EntityName; + iSettings.Save( "RawStackImportDialog", iTB_FilterText ); + } + } + #endregion + + #region Data members + private readonly XmlSettings iSettings; + private string iFilter = string.Empty; + private string iFileName = string.Empty; + #endregion + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Plugin/CAPluginRawStackUi.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Plugin/CAPluginRawStackUi.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Text; +using System.IO; +using System.Collections.Generic; +using System.Threading; +using System.Windows.Forms; +using CrashAnalyserEngine.Plugins; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Interfaces; +using SymbianUtils; +using CAPRawStack.Plugin; +using CAPluginRawStackUi.Tabs; +using CAPluginRawStackUi.Wizards; + +namespace CAPluginRawStackUi.Plugin +{ + public class CAPluginRawStackUi : CAPluginRawStack + { + #region Constructors + public CAPluginRawStackUi( CAEngine aEngine ) + : base( aEngine ) + { + // Switch debug engine to UI mode + aEngine.DebugEngine.UiMode = SymbianDebugLib.TDbgUiMode.EUiEnabled; + RegisterMenuItems(); + } + #endregion + + #region API + #endregion + + #region From CAPlugin + public override CAPlugin.TType Type + { + get { return CAPlugin.TType.ETypeUi; } + } + #endregion + + #region Properties + #endregion + + #region Event handlers + private void Menu_File_New_RawStack_Click( object aTag, string aCaption ) + { + CAWizardRawStack wizard = new CAWizardRawStack( this ); + DialogResult result = wizard.ShowDialog(); + if ( result == DialogResult.OK ) + { + CATabStackViewer control = new CATabStackViewer( this ); + base.UIManager.UIManagerContentAdd( control ); + } + } + #endregion + + #region Internal constants + #endregion + + #region Internal methods + private void RegisterMenuItems() + { + // Register "new" menu item + base.UIManager.UIManagerMenuItemAdd( TEngineUIMenuPane.EFileNew, base.Name, new UIMenuItemClickHandler( Menu_File_New_RawStack_Click ), null ); + } + #endregion + + #region Data members + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Properties/AssemblyInfo.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Properties/AssemblyInfo.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "CAPluginRawStack" )] +[assembly: AssemblyDescription( "" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Nokia" )] +[assembly: AssemblyProduct( "CAPluginRawStack" )] +[assembly: AssemblyCopyright( "Copyright © Nokia 2009" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible( false )] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid( "b3e97a48-c1e0-487d-b5c2-6009e73fed5f" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Tabs/CATabStackViewer.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Tabs/CATabStackViewer.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,181 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginRawStackUi.Tabs +{ + partial class CATabStackViewer + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Component Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.iCol_FileName = new XPTable.Models.TextColumn(); + this.iCol_SubRow_Line = new XPTable.Models.TextColumn(); + this.iCol_CrashCount = new XPTable.Models.TextColumn(); + this.groupBox10 = new System.Windows.Forms.GroupBox(); + this.iCB_HideGhosts = new System.Windows.Forms.CheckBox(); + this.iCB_MatchExactSymbols = new System.Windows.Forms.CheckBox(); + this.iStackViewer = new SymbianStackLibUi.GUI.StackViewerControl(); + this.panel1 = new System.Windows.Forms.Panel(); + this.iLbl_ErrorMessage = new System.Windows.Forms.Label(); + this.eventLog1 = new System.Diagnostics.EventLog(); + this.groupBox10.SuspendLayout(); + this.panel1.SuspendLayout(); + ( (System.ComponentModel.ISupportInitialize) ( this.eventLog1 ) ).BeginInit(); + this.SuspendLayout(); + // + // iCol_FileName + // + this.iCol_FileName.ContentWidth = 0; + this.iCol_FileName.Width = 24; + // + // iCol_SubRow_Line + // + this.iCol_SubRow_Line.ContentWidth = 0; + this.iCol_SubRow_Line.Text = "Line"; + this.iCol_SubRow_Line.Width = 40; + // + // iCol_CrashCount + // + this.iCol_CrashCount.ContentWidth = 0; + this.iCol_CrashCount.Text = "Count"; + this.iCol_CrashCount.Width = 40; + // + // groupBox10 + // + this.groupBox10.Anchor = ( (System.Windows.Forms.AnchorStyles) ( ( System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left ) ) ); + this.groupBox10.Controls.Add( this.iCB_HideGhosts ); + this.groupBox10.Controls.Add( this.iCB_MatchExactSymbols ); + this.groupBox10.Location = new System.Drawing.Point( 3, 479 ); + this.groupBox10.Name = "groupBox10"; + this.groupBox10.Size = new System.Drawing.Size( 297, 72 ); + this.groupBox10.TabIndex = 10; + this.groupBox10.TabStop = false; + this.groupBox10.Text = "Options"; + // + // iCB_HideGhosts + // + this.iCB_HideGhosts.Location = new System.Drawing.Point( 143, 25 ); + this.iCB_HideGhosts.Name = "iCB_HideGhosts"; + this.iCB_HideGhosts.Size = new System.Drawing.Size( 136, 32 ); + this.iCB_HideGhosts.TabIndex = 0; + this.iCB_HideGhosts.Text = "Hide irrelevant function calls"; + this.iCB_HideGhosts.CheckedChanged += new System.EventHandler( this.iCB_HideGhosts_CheckedChanged ); + // + // iCB_MatchExactSymbols + // + this.iCB_MatchExactSymbols.Location = new System.Drawing.Point( 16, 25 ); + this.iCB_MatchExactSymbols.Name = "iCB_MatchExactSymbols"; + this.iCB_MatchExactSymbols.Size = new System.Drawing.Size( 136, 32 ); + this.iCB_MatchExactSymbols.TabIndex = 0; + this.iCB_MatchExactSymbols.Text = "Show only exact Symbolic matches"; + this.iCB_MatchExactSymbols.CheckedChanged += new System.EventHandler( this.iCB_MatchExactSymbols_CheckedChanged ); + // + // iStackViewer + // + this.iStackViewer.BorderColor = System.Drawing.SystemColors.ControlDark; + this.iStackViewer.BorderWidth = 1; + this.iStackViewer.Dock = System.Windows.Forms.DockStyle.Fill; + this.iStackViewer.Font = new System.Drawing.Font( "Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ( (byte) ( 0 ) ) ); + this.iStackViewer.HideGhosts = false; + this.iStackViewer.Location = new System.Drawing.Point( 0, 0 ); + this.iStackViewer.Name = "iStackViewer"; + this.iStackViewer.OnlyShowEntriesWithSymbols = false; + this.iStackViewer.Size = new System.Drawing.Size( 966, 477 ); + this.iStackViewer.TabIndex = 11; + // + // panel1 + // + this.panel1.Anchor = ( (System.Windows.Forms.AnchorStyles) ( ( ( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom ) + | System.Windows.Forms.AnchorStyles.Left ) + | System.Windows.Forms.AnchorStyles.Right ) ) ); + this.panel1.Controls.Add( this.iStackViewer ); + this.panel1.Location = new System.Drawing.Point( 3, 3 ); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size( 966, 477 ); + this.panel1.TabIndex = 12; + // + // iLbl_ErrorMessage + // + this.iLbl_ErrorMessage.Anchor = ( (System.Windows.Forms.AnchorStyles) ( ( ( System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left ) + | System.Windows.Forms.AnchorStyles.Right ) ) ); + this.iLbl_ErrorMessage.Font = new System.Drawing.Font( "Tahoma", 8.25F, System.Drawing.FontStyle.Bold ); + this.iLbl_ErrorMessage.ForeColor = System.Drawing.Color.Red; + this.iLbl_ErrorMessage.Location = new System.Drawing.Point( 304, 489 ); + this.iLbl_ErrorMessage.Name = "iLbl_ErrorMessage"; + this.iLbl_ErrorMessage.Size = new System.Drawing.Size( 663, 59 ); + this.iLbl_ErrorMessage.TabIndex = 13; + this.iLbl_ErrorMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.iLbl_ErrorMessage.Visible = false; + // + // eventLog1 + // + this.eventLog1.SynchronizingObject = this; + // + // CATabStackViewer + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add( this.iLbl_ErrorMessage ); + this.Controls.Add( this.panel1 ); + this.Controls.Add( this.groupBox10 ); + this.Font = new System.Drawing.Font( "Tahoma", 8.25F ); + this.Name = "CATabStackViewer"; + this.Size = new System.Drawing.Size( 972, 554 ); + this.Load += new System.EventHandler( this.CATabStackViewer_Load ); + this.groupBox10.ResumeLayout( false ); + this.panel1.ResumeLayout( false ); + ( (System.ComponentModel.ISupportInitialize) ( this.eventLog1 ) ).EndInit(); + this.ResumeLayout( false ); + + } + + #endregion + + private XPTable.Models.TextColumn iCol_FileName; + private XPTable.Models.TextColumn iCol_CrashCount; + private XPTable.Models.TextColumn iCol_SubRow_Line; + private System.Windows.Forms.GroupBox groupBox10; + private System.Windows.Forms.CheckBox iCB_HideGhosts; + private System.Windows.Forms.CheckBox iCB_MatchExactSymbols; + private SymbianStackLibUi.GUI.StackViewerControl iStackViewer; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label iLbl_ErrorMessage; + private System.Diagnostics.EventLog eventLog1; + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Tabs/CATabStackViewer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Tabs/CATabStackViewer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,109 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Text; +using System.Windows.Forms; +using CAPRawStack.Plugin; +using CrashAnalyserEngine.Tabs; +using CrashAnalyserEngine.Engine; +using CrashAnalyserEngine.Interfaces; +using SymbianStackLib.Engine; +using SymbianStackLib.Data.Source; +using SymbianStackLib.Data.Output; +using SymbianStackLib.Data.Output.Entry; +using SymbianStackLibUi.GUI; + +namespace CAPluginRawStackUi.Tabs +{ + internal partial class CATabStackViewer : CATab + { + #region Constructors + public CATabStackViewer( CAPluginRawStack aPlugin ) + { + InitializeComponent(); + // + iPlugin = aPlugin; + base.Title = "Call Stack"; + } + #endregion + + #region Properties + #endregion + + #region Event handlers + private void CATabStackViewer_Load( object sender, EventArgs e ) + { + StackEngine stackEngine = iPlugin.StackEngine; + + try + { + StackEngineProgressDialog.ReconstructStack( stackEngine ); + } + catch( Exception exception ) + { + iLbl_ErrorMessage.Text = exception.Message; + iLbl_ErrorMessage.Visible = true; + } + + iStackViewer.StackData = stackEngine.DataOutput; + + // Work out if we have any ghosts in the data - this dictates whether + // or not we show the "hide ghosts" checkbox. + bool seenGhost = false; + foreach ( StackOutputEntry entry in stackEngine.DataOutput ) + { + if ( entry.IsGhost ) + { + seenGhost = true; + break; + } + } + // + iCB_HideGhosts.Checked = seenGhost; + iCB_HideGhosts.Visible = seenGhost; + iStackViewer.OnlyShowEntriesWithSymbols = iCB_MatchExactSymbols.Checked; + iStackViewer.HideGhosts = iCB_HideGhosts.Checked; + } + + private void iCB_HideGhosts_CheckedChanged( object sender, EventArgs e ) + { + bool hideGhosts = iCB_HideGhosts.Checked; + iStackViewer.HideGhosts = hideGhosts; + iStackViewer.Refresh(); + } + + private void iCB_MatchExactSymbols_CheckedChanged( object sender, EventArgs e ) + { + bool matchExact = iCB_MatchExactSymbols.Checked; + iStackViewer.OnlyShowEntriesWithSymbols = matchExact; + iStackViewer.Refresh(); + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly CAPluginRawStack iPlugin; + #endregion + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Tabs/CATabStackViewer.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Tabs/CATabStackViewer.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Wizards/CAWizardRawStack.Designer.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Wizards/CAWizardRawStack.Designer.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,371 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +namespace CAPluginRawStackUi.Wizards +{ + partial class CAWizardRawStack + { + // + // Required designer variable. + // + private System.ComponentModel.IContainer components = null; + + // + // Clean up any resources being used. + // + // true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) + { + if ( disposing && ( components != null ) ) + { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + + // + // Required method for Designer support - do not modify + // the contents of this method with the code editor. + // + private void InitializeComponent() + { + this.iWizard = new SymbianWizardLib.GUI.SymWizard(); + this.iPG_SourceData = new SymbianWizardLib.GUI.SymWizardPage(); + this.iTabControl_Options = new System.Windows.Forms.TabControl(); + this.iTabCtrl_Page_Options = new System.Windows.Forms.TabPage(); + this.iTB_CurrentStackPointerAddress = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.iCB_MatchExactSymbols = new System.Windows.Forms.CheckBox(); + this.iTabCtrl_Page_Prefixes = new System.Windows.Forms.TabPage(); + this.iTB_PrefixCurrentStackPointer = new System.Windows.Forms.TextBox(); + this.label136 = new System.Windows.Forms.Label(); + this.iTB_PrefixCodeSegment = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.iTabCtrl_Page_Import = new System.Windows.Forms.TabPage(); + this.iBT_LoadTextDataFromFile = new System.Windows.Forms.Button(); + this.iStackDataWriteOutputToFileButton = new System.Windows.Forms.Button(); + this.iStackDataSaveOutputAsButton = new System.Windows.Forms.Button(); + this.iBT_LoadBinaryDataFromFile = new System.Windows.Forms.Button(); + this.iTB_RawStackData = new System.Windows.Forms.TextBox(); + this.iPG_SourceFiles_Header = new SymbianWizardLib.GUI.SymWizardHeaderSection(); + this.iPG_DebugEngine = new SymbianWizardLib.GUI.SymWizardPage(); + this.iPG_DebugEngine_Control = new SymbianDebugLibUi.Controls.DebugEngineControl(); + this.iPG_DebugEngine_Header = new SymbianWizardLib.GUI.SymWizardHeaderSection(); + this.iPG_SourceData.SuspendLayout(); + this.iTabControl_Options.SuspendLayout(); + this.iTabCtrl_Page_Options.SuspendLayout(); + this.iTabCtrl_Page_Prefixes.SuspendLayout(); + this.iTabCtrl_Page_Import.SuspendLayout(); + this.iPG_DebugEngine.SuspendLayout(); + this.SuspendLayout(); + // + // iWizard + // + this.iWizard.Dock = System.Windows.Forms.DockStyle.Fill; + this.iWizard.Location = new System.Drawing.Point( 0, 0 ); + this.iWizard.Margin = new System.Windows.Forms.Padding( 0 ); + this.iWizard.Name = "iWizard"; + this.iWizard.Pages.AddRange( new SymbianWizardLib.GUI.SymWizardPage[] { + this.iPG_SourceData, + this.iPG_DebugEngine} ); + this.iWizard.Size = new System.Drawing.Size( 892, 673 ); + this.iWizard.TabIndex = 0; + this.iWizard.WizardClosedFromFinish += new SymbianWizardLib.GUI.SymWizard.WizardClosedFromFinishHandler( this.iWizard_WizardClosedFromFinish ); + // + // iPG_SourceData + // + this.iPG_SourceData.Controls.Add( this.iTabControl_Options ); + this.iPG_SourceData.Controls.Add( this.iTB_RawStackData ); + this.iPG_SourceData.Controls.Add( this.iPG_SourceFiles_Header ); + this.iPG_SourceData.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_SourceData.IsFinishingPage = false; + this.iPG_SourceData.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_SourceData.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_SourceData.Name = "iPG_SourceData"; + this.iPG_SourceData.Size = new System.Drawing.Size( 892, 617 ); + this.iPG_SourceData.TabIndex = 3; + this.iPG_SourceData.Wizard = this.iWizard; + this.iPG_SourceData.Load += new System.EventHandler( this.iPG_SourceData_Load ); + this.iPG_SourceData.PageClosedFromButtonNext += new SymbianWizardLib.GUI.SymWizardPage.PageClosedFromButtonNextHandler( this.iPG_SourceData_PageClosedFromButtonNext ); + // + // iTabControl_Options + // + this.iTabControl_Options.Anchor = ( (System.Windows.Forms.AnchorStyles) ( ( ( System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left ) + | System.Windows.Forms.AnchorStyles.Right ) ) ); + this.iTabControl_Options.Controls.Add( this.iTabCtrl_Page_Options ); + this.iTabControl_Options.Controls.Add( this.iTabCtrl_Page_Prefixes ); + this.iTabControl_Options.Controls.Add( this.iTabCtrl_Page_Import ); + this.iTabControl_Options.Location = new System.Drawing.Point( 12, 502 ); + this.iTabControl_Options.Name = "iTabControl_Options"; + this.iTabControl_Options.SelectedIndex = 0; + this.iTabControl_Options.Size = new System.Drawing.Size( 864, 112 ); + this.iTabControl_Options.TabIndex = 39; + // + // iTabCtrl_Page_Options + // + this.iTabCtrl_Page_Options.Controls.Add( this.iTB_CurrentStackPointerAddress ); + this.iTabCtrl_Page_Options.Controls.Add( this.label1 ); + this.iTabCtrl_Page_Options.Controls.Add( this.label13 ); + this.iTabCtrl_Page_Options.Controls.Add( this.iCB_MatchExactSymbols ); + this.iTabCtrl_Page_Options.Location = new System.Drawing.Point( 4, 22 ); + this.iTabCtrl_Page_Options.Name = "iTabCtrl_Page_Options"; + this.iTabCtrl_Page_Options.Size = new System.Drawing.Size( 856, 86 ); + this.iTabCtrl_Page_Options.TabIndex = 2; + this.iTabCtrl_Page_Options.Text = "Options"; + // + // iTB_CurrentStackPointerAddress + // + this.iTB_CurrentStackPointerAddress.Location = new System.Drawing.Point( 144, 12 ); + this.iTB_CurrentStackPointerAddress.Name = "iTB_CurrentStackPointerAddress"; + this.iTB_CurrentStackPointerAddress.Size = new System.Drawing.Size( 200, 21 ); + this.iTB_CurrentStackPointerAddress.TabIndex = 23; + // + // label1 + // + this.label1.Location = new System.Drawing.Point( 8, 16 ); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size( 104, 32 ); + this.label1.TabIndex = 22; + this.label1.Text = "Current stack pointer address:"; + // + // label13 + // + this.label13.Location = new System.Drawing.Point( 8, 53 ); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size( 120, 13 ); + this.label13.TabIndex = 21; + this.label13.Text = "Match exact symbols:"; + // + // iCB_MatchExactSymbols + // + this.iCB_MatchExactSymbols.Location = new System.Drawing.Point( 144, 48 ); + this.iCB_MatchExactSymbols.Name = "iCB_MatchExactSymbols"; + this.iCB_MatchExactSymbols.Size = new System.Drawing.Size( 14, 22 ); + this.iCB_MatchExactSymbols.TabIndex = 20; + // + // iTabCtrl_Page_Prefixes + // + this.iTabCtrl_Page_Prefixes.Controls.Add( this.iTB_PrefixCurrentStackPointer ); + this.iTabCtrl_Page_Prefixes.Controls.Add( this.label136 ); + this.iTabCtrl_Page_Prefixes.Controls.Add( this.iTB_PrefixCodeSegment ); + this.iTabCtrl_Page_Prefixes.Controls.Add( this.label3 ); + this.iTabCtrl_Page_Prefixes.Location = new System.Drawing.Point( 4, 22 ); + this.iTabCtrl_Page_Prefixes.Name = "iTabCtrl_Page_Prefixes"; + this.iTabCtrl_Page_Prefixes.Size = new System.Drawing.Size( 856, 86 ); + this.iTabCtrl_Page_Prefixes.TabIndex = 3; + this.iTabCtrl_Page_Prefixes.Text = "Prefixes"; + this.iTabCtrl_Page_Prefixes.Visible = false; + // + // iTB_PrefixCurrentStackPointer + // + this.iTB_PrefixCurrentStackPointer.Location = new System.Drawing.Point( 144, 48 ); + this.iTB_PrefixCurrentStackPointer.Name = "iTB_PrefixCurrentStackPointer"; + this.iTB_PrefixCurrentStackPointer.Size = new System.Drawing.Size( 200, 21 ); + this.iTB_PrefixCurrentStackPointer.TabIndex = 42; + this.iTB_PrefixCurrentStackPointer.Text = "CurrentSP - "; + // + // label136 + // + this.label136.Location = new System.Drawing.Point( 8, 52 ); + this.label136.Name = "label136"; + this.label136.Size = new System.Drawing.Size( 120, 13 ); + this.label136.TabIndex = 41; + this.label136.Text = "Current stack pointer:"; + // + // iTB_PrefixCodeSegment + // + this.iTB_PrefixCodeSegment.Location = new System.Drawing.Point( 144, 12 ); + this.iTB_PrefixCodeSegment.Name = "iTB_PrefixCodeSegment"; + this.iTB_PrefixCodeSegment.Size = new System.Drawing.Size( 200, 21 ); + this.iTB_PrefixCodeSegment.TabIndex = 42; + this.iTB_PrefixCodeSegment.Text = "CodeSeg - "; + // + // label3 + // + this.label3.Location = new System.Drawing.Point( 8, 16 ); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size( 120, 13 ); + this.label3.TabIndex = 41; + this.label3.Text = "Code segment name:"; + // + // iTabCtrl_Page_Import + // + this.iTabCtrl_Page_Import.Controls.Add( this.iBT_LoadTextDataFromFile ); + this.iTabCtrl_Page_Import.Controls.Add( this.iStackDataWriteOutputToFileButton ); + this.iTabCtrl_Page_Import.Controls.Add( this.iStackDataSaveOutputAsButton ); + this.iTabCtrl_Page_Import.Controls.Add( this.iBT_LoadBinaryDataFromFile ); + this.iTabCtrl_Page_Import.Location = new System.Drawing.Point( 4, 22 ); + this.iTabCtrl_Page_Import.Name = "iTabCtrl_Page_Import"; + this.iTabCtrl_Page_Import.Size = new System.Drawing.Size( 856, 86 ); + this.iTabCtrl_Page_Import.TabIndex = 1; + this.iTabCtrl_Page_Import.Text = "Import..."; + this.iTabCtrl_Page_Import.Visible = false; + // + // iBT_LoadTextDataFromFile + // + this.iBT_LoadTextDataFromFile.Location = new System.Drawing.Point( 8, 13 ); + this.iBT_LoadTextDataFromFile.Name = "iBT_LoadTextDataFromFile"; + this.iBT_LoadTextDataFromFile.Size = new System.Drawing.Size( 232, 24 ); + this.iBT_LoadTextDataFromFile.TabIndex = 48; + this.iBT_LoadTextDataFromFile.Text = "Load text data from file..."; + this.iBT_LoadTextDataFromFile.Click += new System.EventHandler( this.iBT_LoadTextDataFromFile_Click ); + // + // iStackDataWriteOutputToFileButton + // + this.iStackDataWriteOutputToFileButton.Location = new System.Drawing.Point( 8, 88 ); + this.iStackDataWriteOutputToFileButton.Name = "iStackDataWriteOutputToFileButton"; + this.iStackDataWriteOutputToFileButton.Size = new System.Drawing.Size( 912, 32 ); + this.iStackDataWriteOutputToFileButton.TabIndex = 47; + this.iStackDataWriteOutputToFileButton.Text = "Write Call Stack to File..."; + // + // iStackDataSaveOutputAsButton + // + this.iStackDataSaveOutputAsButton.Location = new System.Drawing.Point( 895, 44 ); + this.iStackDataSaveOutputAsButton.Name = "iStackDataSaveOutputAsButton"; + this.iStackDataSaveOutputAsButton.Size = new System.Drawing.Size( 25, 20 ); + this.iStackDataSaveOutputAsButton.TabIndex = 44; + this.iStackDataSaveOutputAsButton.Text = "..."; + // + // iBT_LoadBinaryDataFromFile + // + this.iBT_LoadBinaryDataFromFile.Location = new System.Drawing.Point( 8, 47 ); + this.iBT_LoadBinaryDataFromFile.Name = "iBT_LoadBinaryDataFromFile"; + this.iBT_LoadBinaryDataFromFile.Size = new System.Drawing.Size( 232, 24 ); + this.iBT_LoadBinaryDataFromFile.TabIndex = 48; + this.iBT_LoadBinaryDataFromFile.Text = "Load binary data from file..."; + this.iBT_LoadBinaryDataFromFile.Click += new System.EventHandler( this.iBT_LoadBinaryDataFromFile_Click ); + // + // iTB_RawStackData + // + this.iTB_RawStackData.AcceptsReturn = true; + this.iTB_RawStackData.AcceptsTab = true; + this.iTB_RawStackData.Anchor = ( (System.Windows.Forms.AnchorStyles) ( ( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left ) + | System.Windows.Forms.AnchorStyles.Right ) ) ); + this.iTB_RawStackData.Font = new System.Drawing.Font( "Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ( (byte) ( 0 ) ) ); + this.iTB_RawStackData.Location = new System.Drawing.Point( 12, 80 ); + this.iTB_RawStackData.MaxLength = 0; + this.iTB_RawStackData.Multiline = true; + this.iTB_RawStackData.Name = "iTB_RawStackData"; + this.iTB_RawStackData.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.iTB_RawStackData.Size = new System.Drawing.Size( 864, 413 ); + this.iTB_RawStackData.TabIndex = 38; + this.iTB_RawStackData.WordWrap = false; + this.iTB_RawStackData.KeyDown += new System.Windows.Forms.KeyEventHandler( this.iTB_RawStackData_KeyDown ); + // + // iPG_SourceFiles_Header + // + this.iPG_SourceFiles_Header.BackColor = System.Drawing.SystemColors.Window; + this.iPG_SourceFiles_Header.Description = "Paste in the raw stack data to analyse or import from a file"; + this.iPG_SourceFiles_Header.Dock = System.Windows.Forms.DockStyle.Top; + this.iPG_SourceFiles_Header.Image = null; + this.iPG_SourceFiles_Header.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_SourceFiles_Header.Name = "iPG_SourceFiles_Header"; + this.iPG_SourceFiles_Header.Size = new System.Drawing.Size( 892, 74 ); + this.iPG_SourceFiles_Header.TabIndex = 4; + this.iPG_SourceFiles_Header.Title = "Call Stack Reconstructor Data"; + // + // iPG_DebugEngine + // + this.iPG_DebugEngine.Controls.Add( this.iPG_DebugEngine_Control ); + this.iPG_DebugEngine.Controls.Add( this.iPG_DebugEngine_Header ); + this.iPG_DebugEngine.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_DebugEngine.IsFinishingPage = true; + this.iPG_DebugEngine.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_DebugEngine.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_DebugEngine.Name = "iPG_DebugEngine"; + this.iPG_DebugEngine.Size = new System.Drawing.Size( 892, 617 ); + this.iPG_DebugEngine.TabIndex = 3; + this.iPG_DebugEngine.Wizard = this.iWizard; + this.iPG_DebugEngine.Load += new System.EventHandler( this.iPG_DebugEngine_Load ); + this.iPG_DebugEngine.PageClosedFromButtonNext += new SymbianWizardLib.GUI.SymWizardPage.PageClosedFromButtonNextHandler( this.iPG_DebugEngine_PageClosedFromButtonNext ); + // + // iPG_DebugEngine_Control + // + this.iPG_DebugEngine_Control.Dock = System.Windows.Forms.DockStyle.Fill; + this.iPG_DebugEngine_Control.Location = new System.Drawing.Point( 0, 74 ); + this.iPG_DebugEngine_Control.Margin = new System.Windows.Forms.Padding( 0 ); + this.iPG_DebugEngine_Control.Name = "iPG_DebugEngine_Control"; + this.iPG_DebugEngine_Control.Size = new System.Drawing.Size( 892, 543 ); + this.iPG_DebugEngine_Control.TabIndex = 42; + // + // iPG_DebugEngine_Header + // + this.iPG_DebugEngine_Header.BackColor = System.Drawing.SystemColors.Window; + this.iPG_DebugEngine_Header.Description = ""; + this.iPG_DebugEngine_Header.Dock = System.Windows.Forms.DockStyle.Top; + this.iPG_DebugEngine_Header.Image = null; + this.iPG_DebugEngine_Header.Location = new System.Drawing.Point( 0, 0 ); + this.iPG_DebugEngine_Header.Name = "iPG_DebugEngine_Header"; + this.iPG_DebugEngine_Header.Size = new System.Drawing.Size( 892, 74 ); + this.iPG_DebugEngine_Header.TabIndex = 41; + this.iPG_DebugEngine_Header.Title = "Symbolic / Debug Meta-Data"; + // + // CAWizardRawStack + // + this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size( 892, 673 ); + this.Controls.Add( this.iWizard ); + this.Font = new System.Drawing.Font( "Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ( (byte) ( 0 ) ) ); + this.MinimumSize = new System.Drawing.Size( 900, 700 ); + this.Name = "CAWizardRawStack"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Call Stack Reconstructor Wizard"; + this.Load += new System.EventHandler( this.CAWizardRawStack_Load ); + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler( this.CAWizardRawStack_FormClosing ); + this.iPG_SourceData.ResumeLayout( false ); + this.iPG_SourceData.PerformLayout(); + this.iTabControl_Options.ResumeLayout( false ); + this.iTabCtrl_Page_Options.ResumeLayout( false ); + this.iTabCtrl_Page_Options.PerformLayout(); + this.iTabCtrl_Page_Prefixes.ResumeLayout( false ); + this.iTabCtrl_Page_Prefixes.PerformLayout(); + this.iTabCtrl_Page_Import.ResumeLayout( false ); + this.iPG_DebugEngine.ResumeLayout( false ); + this.ResumeLayout( false ); + + } + + #endregion + + private SymbianWizardLib.GUI.SymWizard iWizard; + private SymbianWizardLib.GUI.SymWizardPage iPG_SourceData; + private SymbianWizardLib.GUI.SymWizardHeaderSection iPG_SourceFiles_Header; + private SymbianWizardLib.GUI.SymWizardPage iPG_DebugEngine; + private SymbianDebugLibUi.Controls.DebugEngineControl iPG_DebugEngine_Control; + private SymbianWizardLib.GUI.SymWizardHeaderSection iPG_DebugEngine_Header; + private System.Windows.Forms.TabControl iTabControl_Options; + private System.Windows.Forms.TabPage iTabCtrl_Page_Options; + private System.Windows.Forms.TextBox iTB_CurrentStackPointerAddress; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.CheckBox iCB_MatchExactSymbols; + private System.Windows.Forms.TabPage iTabCtrl_Page_Prefixes; + private System.Windows.Forms.TextBox iTB_PrefixCurrentStackPointer; + private System.Windows.Forms.Label label136; + private System.Windows.Forms.TextBox iTB_PrefixCodeSegment; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TabPage iTabCtrl_Page_Import; + private System.Windows.Forms.Button iBT_LoadTextDataFromFile; + private System.Windows.Forms.Button iStackDataWriteOutputToFileButton; + private System.Windows.Forms.Button iStackDataSaveOutputAsButton; + private System.Windows.Forms.Button iBT_LoadBinaryDataFromFile; + private System.Windows.Forms.TextBox iTB_RawStackData; + } +} \ No newline at end of file diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Wizards/CAWizardRawStack.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Wizards/CAWizardRawStack.cs Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,185 @@ +/* +* Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Text; +using System.Windows.Forms; +using CAPRawStack.Plugin; +using SymbianUtilsUi.Dialogs; +using CAPluginRawStackUi.Dialogs; +using SymbianStackLibUi.GUI; +using SymbianUtils; + +namespace CAPluginRawStackUi.Wizards +{ + internal partial class CAWizardRawStack : Form + { + #region Constructors + public CAWizardRawStack( CAPluginRawStack aEngine ) + { + iEngine = aEngine; + // + InitializeComponent(); + } + #endregion + + #region Events + private void CAWizardRawStack_Load( object sender, EventArgs e ) + { + } + + private void CAWizardRawStack_FormClosing( object sender, FormClosingEventArgs e ) + { + } + + private void iWizard_WizardClosedFromFinish( SymbianWizardLib.Engine.SymWizardClosureEvent aEventArgs ) + { + string errorText = string.Empty; + bool isReady = iPG_DebugEngine_Control.IsReadyToPrime( out errorText ); + if ( isReady ) + { + // Create new engine with (optionally) any new prefix values + iEngine.StackEngine.Prefixes.SetCustomPointer( iTB_PrefixCurrentStackPointer.Text ); + iEngine.StackEngine.Prefixes.SetCustomCodeSegment( iTB_PrefixCodeSegment.Text ); + iEngine.StackEngine.AddressInfo.Pointer = 0; + + // Check current stack pointer address is valid... + long currentStackAddress = 0; + string currentStackAddressText = iTB_CurrentStackPointerAddress.Text.Trim(); + NumberBaseUtils.TNumberBase numberBase; + if ( NumberBaseUtils.TextToDecimalNumber( ref currentStackAddressText, out currentStackAddress, out numberBase ) ) + { + iEngine.StackEngine.AddressInfo.Pointer = System.Convert.ToUInt32( currentStackAddress ); + } + + // Prime stack engine content + iEngine.StackEngine.Primer.Prime( iTB_RawStackData.Lines ); + + // If we still haven't obtained the stack pointer, then use the base address + if ( iEngine.StackEngine.AddressInfo.Pointer == 0 ) + { + iEngine.StackEngine.AddressInfo.Pointer = iEngine.StackEngine.AddressInfo.Top; + } + + // Prime debug engine + iPG_DebugEngine_Control.Prime(); + + // Store the settings at this point as we are largely past the + // initial configuration + iEngine.Settings.Store(); + + // Also save debug engine configuration + iPG_DebugEngine_Control.XmlSettingsSave(); + + DialogResult = DialogResult.OK; + } + else + { + MessageBox.Show( errorText, "Error" ); + aEventArgs.CancelClosure = true; + } + } + #endregion + + #region Page - source data + private void iPG_SourceData_Load( object aSender, EventArgs aArgs ) + { + iEngine.Settings.Load( this.Name, iTB_PrefixCodeSegment ); + iEngine.Settings.Load( this.Name, iTB_PrefixCurrentStackPointer ); + iEngine.Settings.Load( this.Name, iCB_MatchExactSymbols ); + } + + private void iPG_SourceData_PageClosedFromButtonNext( SymbianWizardLib.Engine.SymWizardPageTransitionEvent aEventArgs ) + { + iEngine.Settings.Save( this.Name, iTB_PrefixCodeSegment ); + iEngine.Settings.Save( this.Name, iTB_PrefixCurrentStackPointer ); + iEngine.Settings.Save( this.Name, iCB_MatchExactSymbols ); + } + + private void iBT_LoadTextDataFromFile_Click( object sender, EventArgs e ) + { + string fileName; + string filter; + // + DialogResult result = RawStackImportDialog.ShowDialog( iEngine.Settings, out fileName, out filter ); + // + if ( result == DialogResult.OK ) + { + FileToTextBoxProgressDialog.Read( fileName, filter, iTB_RawStackData ); + iTB_RawStackData.Select(); + iTB_RawStackData.Focus(); + } + } + + private void iBT_LoadBinaryDataFromFile_Click( object sender, EventArgs e ) + { + OpenFileDialog dialog = new OpenFileDialog(); + // + dialog.Filter = "All Files|*.*"; + dialog.Title = "Select a File"; + // + if ( dialog.ShowDialog() == DialogResult.OK ) + { + string fileName = dialog.FileName; + // + string data = StackFileToTextConverterDialog.Convert( fileName ); + iTB_RawStackData.Text = data; + iTB_RawStackData.Select(); + iTB_RawStackData.Focus(); + } + } + + private void iTB_RawStackData_KeyDown( object sender, KeyEventArgs e ) + { + if ( e.KeyCode == Keys.A && e.Control ) + { + iTB_RawStackData.SelectAll(); + e.Handled = true; + } + } + #endregion + + #region Page - debug engine + private void iPG_DebugEngine_Load( object aSender, EventArgs aArgs ) + { + iPG_DebugEngine_Control.Engine = iEngine.DebugEngine; + } + + private void iPG_DebugEngine_PageClosedFromButtonNext( SymbianWizardLib.Engine.SymWizardPageTransitionEvent aEventArgs ) + { + string errorText = string.Empty; + bool isReady = iPG_DebugEngine_Control.IsReadyToPrime( out errorText ); + if ( isReady == false ) + { + MessageBox.Show( errorText, "Error" ); + aEventArgs.SuggestedNewPage = aEventArgs.CurrentPage; + } + } + #endregion + + #region Internal methods + #endregion + + #region Data members + private readonly CAPluginRawStack iEngine; + #endregion + + } +} diff -r 000000000000 -r 818e61de6cd1 crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Wizards/CAWizardRawStack.resx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/crashanalysercmd/UI/Plugins/CAPluginRawStackUi/Wizards/CAWizardRawStack.resx Thu Feb 11 15:50:58 2010 +0200 @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file