Beispiel #1
0
        public void WriteAssembly(BreakpointVM vm)
        {
            var ilbp = vm.Breakpoint as ILCodeBreakpoint;

            if (ilbp != null)
            {
                var asm = GetAssembly(ilbp);
                if (asm != null)
                {
                    output.Write(asm);
                }
                else
                {
                    output.WriteFilename(ilbp.Assembly);
                }
                return;
            }

            var debp = vm.Breakpoint as DebugEventBreakpoint;

            if (debp != null)
            {
                // nothing
                return;
            }
        }
Beispiel #2
0
 void WriteFilename(ModuleVM vm, string filename)
 {
     if (vm.Module.IsDynamic || vm.Module.IsInMemory)
     {
         filename = DebugOutputUtils.FilterName(filename, 300);
     }
     output.WriteFilename(filename);
 }
Beispiel #3
0
        public void WriteFile(BreakpointVM vm)
        {
            var ilbp = vm.Breakpoint as ILCodeBreakpoint;

            if (ilbp != null)
            {
                output.WriteFilename(ilbp.SerializedDnSpyToken.Module.ModuleName);
                return;
            }

            var debp = vm.Breakpoint as DebugEventBreakpoint;

            if (debp != null)
            {
                // nothing
                return;
            }
        }
Beispiel #4
0
 void WriteFilename(ProcessVM vm, string filename)
 {
     output.WriteFilename(filename);
 }
Beispiel #5
0
        void CreateUI(ITextOutput output, object o, bool includeNamespace)
        {
            var ns = o as NamespaceSearchResult;

            if (ns != null)
            {
                output.WriteNamespace(ns.Namespace);
                return;
            }

            var td = o as TypeDef;

            if (td != null)
            {
                Debug.Assert(Language != null);
                Language.TypeToString(output, td, includeNamespace);
                return;
            }

            var md = o as MethodDef;

            if (md != null)
            {
                output.Write(IdentifierEscaper.Escape(md.Name), TextTokenHelper.GetTextTokenType(md));
                return;
            }

            var fd = o as FieldDef;

            if (fd != null)
            {
                output.Write(IdentifierEscaper.Escape(fd.Name), TextTokenHelper.GetTextTokenType(fd));
                return;
            }

            var pd = o as PropertyDef;

            if (pd != null)
            {
                output.Write(IdentifierEscaper.Escape(pd.Name), TextTokenHelper.GetTextTokenType(pd));
                return;
            }

            var ed = o as EventDef;

            if (ed != null)
            {
                output.Write(IdentifierEscaper.Escape(ed.Name), TextTokenHelper.GetTextTokenType(ed));
                return;
            }

            var asm = o as AssemblyDef;

            if (asm != null)
            {
                output.Write(asm);
                return;
            }

            var mod = o as ModuleDef;

            if (mod != null)
            {
                output.WriteModule(mod.FullName);
                return;
            }

            var asmRef = o as AssemblyRef;

            if (asmRef != null)
            {
                output.Write(asmRef);
                return;
            }

            var modRef = o as ModuleRef;

            if (modRef != null)
            {
                output.WriteModule(modRef.FullName);
                return;
            }

            // non-.NET file
            var file = o as DnSpyFile;

            if (file != null)
            {
                output.Write(file.ShortName, TextTokenType.Text);
                return;
            }

            var resNode = o as ResourceTreeNode;

            if (resNode != null)
            {
                output.WriteFilename(resNode.Name);
                return;
            }

            var resElNode = o as ResourceElementTreeNode;

            if (resElNode != null)
            {
                output.WriteFilename(resElNode.Name);
                return;
            }

            var s = o as string;

            if (s != null)
            {
                output.Write(s, TextTokenType.Text);
                return;
            }

            Debug.Assert(s == null);
        }
Beispiel #6
0
 protected sealed override void Write(ITextOutput output, Language language)
 {
     output.WriteFilename(r.Name);
 }
Beispiel #7
0
        void CreateUI(ITextOutput output, object o, bool includeNamespace)
        {
            var ns = o as NamespaceSearchResult;
            if (ns != null) {
                output.WriteNamespace(ns.Namespace);
                return;
            }

            var td = o as TypeDef;
            if (td != null) {
                Debug.Assert(Language != null);
                Language.TypeToString(output, td, includeNamespace);
                return;
            }

            var md = o as MethodDef;
            if (md != null) {
                output.Write(IdentifierEscaper.Escape(md.Name), TextTokenHelper.GetTextTokenType(md));
                return;
            }

            var fd = o as FieldDef;
            if (fd != null) {
                output.Write(IdentifierEscaper.Escape(fd.Name), TextTokenHelper.GetTextTokenType(fd));
                return;
            }

            var pd = o as PropertyDef;
            if (pd != null) {
                output.Write(IdentifierEscaper.Escape(pd.Name), TextTokenHelper.GetTextTokenType(pd));
                return;
            }

            var ed = o as EventDef;
            if (ed != null) {
                output.Write(IdentifierEscaper.Escape(ed.Name), TextTokenHelper.GetTextTokenType(ed));
                return;
            }

            var asm = o as AssemblyDef;
            if (asm != null) {
                output.Write(asm);
                return;
            }

            var mod = o as ModuleDef;
            if (mod != null) {
                output.WriteModule(mod.FullName);
                return;
            }

            var asmRef = o as AssemblyRef;
            if (asmRef != null) {
                output.Write(asmRef);
                return;
            }

            var modRef = o as ModuleRef;
            if (modRef != null) {
                output.WriteModule(modRef.FullName);
                return;
            }

            // non-.NET file
            var loadedAsm = o as LoadedAssembly;
            if (loadedAsm != null) {
                output.Write(loadedAsm.ShortName, TextTokenType.Text);
                return;
            }

            var resNode = o as ResourceTreeNode;
            if (resNode != null) {
                output.WriteFilename(resNode.Name);
                return;
            }

            var resElNode = o as ResourceElementTreeNode;
            if (resElNode != null) {
                output.WriteFilename(resElNode.Name);
                return;
            }

            var s = o as string;
            if (s != null) {
                output.Write(s, TextTokenType.Text);
                return;
            }

            Debug.Assert(s == null);
        }
Beispiel #8
0
		protected sealed override void Write(ITextOutput output, Language language) {
			output.WriteFilename(r.Name);
		}
Beispiel #9
0
 void WriteManifestResourceInfo(ITextOutput output)
 {
     output.WriteFilename(ReadStringsHeap(2));
 }
Beispiel #10
0
 void WriteFileInfo(ITextOutput output)
 {
     output.WriteFilename(ReadStringsHeap(1));
 }
		void WriteManifestResourceInfo(ITextOutput output) {
			output.WriteFilename(ReadStringsHeap(2));
		}
		void WriteFileInfo(ITextOutput output) {
			output.WriteFilename(ReadStringsHeap(1));
		}