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); }
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; } } }
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"); }