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); } }
public AsyncData(DbgViewSymbols aView, AutoResetEvent aWaiter, SymbolCollection aCollection, int aIterations) { iView = aView; iWaiter = aWaiter; iCollection = aCollection; iIterations = aIterations; }
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 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 TestMulitThreadedLookup() { 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 view = iDebugEngine.CreateView("TestView")) { DbgViewSymbols symView = view.Symbols; SymbolCollection col = null; // Should be possible to activate a file within a zip SymbolCollection colPageScaler = symView.ActivateAndGetCollection(new CodeSegDefinition(@"Z:\sys\bin\PageScaler.dll", 0x70000000, 0x7A000000)); System.Diagnostics.Debug.Assert(colPageScaler != null); // Verify that the symbols were really read. col = view.Symbols.CollectionByAddress(0x70000000); System.Diagnostics.Debug.Assert(col != null); System.Diagnostics.Debug.WriteLine(col.ToString("full", null)); // 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(); } } }
private void TestZipMapFiles() { // So we can spot it in the profiler... //Thread.Sleep( 2000 ); Clear(); iDebugEngine.Add(@"C:\Tool Demo Files\8. For SymbianSymbolLib Test Code\S60_3_2_200846_RnD_merlin_emulator_hw.rom.symbol"); iDebugEngine.Add(@"C:\Tool Demo Files\2. Crash Data\File44\Platform_wk49\Symbols\mapfiles.zip"); iDebugEngine.Prime(SymbianUtils.TSynchronicity.ESynchronous); 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 != null); 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<unsigned long>::RArray() 0x00009289 Thumb Code 10 accmonitor.in(t._ZN6RArrayImEC1Ev) // RArray<unsigned long>::RArray__sub_object() 0x00009289 Thumb Code 0 accmonitor.in(t._ZN6RArrayImEC1Ev) sym = FindByName("RArray<unsigned long>::RArray__sub_object()", col); System.Diagnostics.Debug.Assert(sym == null); sym = FindByName("RArray<unsigned long>::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 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<unsigned long>::RArray() 0x00009289 Thumb Code 10 accmonitor.in(t._ZN6RArrayImEC1Ev) // RArray<unsigned long>::RArray__sub_object() 0x00009289 Thumb Code 0 accmonitor.in(t._ZN6RArrayImEC1Ev) sym = FindByName("RArray<unsigned long>::RArray__sub_object()", col); System.Diagnostics.Debug.Assert(sym == null); sym = FindByName("RArray<unsigned long>::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); } }