void OnUpdateModuleSymbols (object sender, CorUpdateModuleSymbolsEventArgs e)
		{
			SymbolBinder binder = new SymbolBinder ();
			CorMetadataImport mi = new CorMetadataImport (e.Module);
			ISymbolReader reader = binder.GetReaderFromStream (mi.RawCOMObject, e.Stream);
			foreach (ISymbolDocument doc in reader.GetDocuments ()) {
				Console.WriteLine (doc.URL);
			}
			e.Continue = true;
		}
Beispiel #2
0
        private void UpdateModuleSymbolsEventHandler(Object sender, CorUpdateModuleSymbolsEventArgs e)
        {
            Trace.WriteLine("ManagedCallback::UpdateModuleSymbols");
            BeginManagedDebugEvent();
            try
            {
                // If the CLR supports ICorDebugModule3::CreateReaderForInMemorySymbols and this is a dynamic
                // module, then this callback is useless - we already retrieved the symbols.  In most cases
                // (eg. when not specifically being compatible with the Mix07 VS tools) the CLR won't even
                // dispatch this callback to us when it supports this new API.
                if (e.Module.SupportsCreateReaderForInMemorySymbols && e.Module.IsDynamic)
                {
                    Trace.WriteLine("ManagedCallback::UpdateModuleSymbols - Ignored");
                    return;
                }

                MDbgModule m = Modules.Lookup(e.Module);

                Debug.Assert(m != null);                        // all modules should always be registered
                bool ok = m.UpdateSymbols(e.Stream);
                Debug.Assert(ok, "UpdateSymbolStore failed");

                // Anytime we udpate symbols, we need to check for if we can bind any source-level breakpoints.
                //m_breakpointMgr.BindBreakpoints(m);
                foreach (MDbgBreakpoint b in m_breakpointMgr)
                {
                    b.BindToModule(m);
                }

                // if IsInMemory holds this is probably a module in an assembly
                // loaded by byte-array, and a user entry breakpoint might not have
                // been found at Load time; so check again for one.
                if (e.Module.IsInMemory && !m_processAttaching &&
                    m_userEntryBreakpointEnabled && m_userEntryBreakpoint == null)
                    SetUserEntryBreakpointInModule(m);

                if (InternalHandleRawMode(ManagedCallbackType.OnUpdateModuleSymbols, e))
                    return;

                if (HandleCustomPostCallback(ManagedCallbackType.OnUpdateModuleSymbols, e))
                    return;
            }
            finally
            {
                EndManagedDebugEvent(e);
            }
        }