Beispiel #1
0
 public CallStackFrameVM(ICallStackFrameContext context, int index, CorFrame frame, DnProcess process)
 {
     this.context = context;
     this.index   = index;
     this.frame   = frame;
     this.process = process;
 }
Beispiel #2
0
 MemoryModuleDefFile(DnProcess process, ulong address, byte[] data, bool isInMemory, ModuleDef module, bool loadSyms, bool autoUpdateMemory)
     : base(module, loadSyms)
 {
     this.Process          = process;
     this.Address          = address;
     this.data             = data;
     this.isInMemory       = isInMemory;
     this.AutoUpdateMemory = autoUpdateMemory;
 }
Beispiel #3
0
 MemoryModuleDefFile(SimpleProcessReader simpleProcessReader, DnProcess process, ulong address, byte[] data, bool isInMemory, ModuleDef module, bool loadSyms, bool autoUpdateMemory)
     : base(module, loadSyms)
 {
     this.simpleProcessReader = simpleProcessReader;
     Process          = process;
     Address          = address;
     this.data        = data;
     this.isInMemory  = isInMemory;
     AutoUpdateMemory = autoUpdateMemory;
 }
Beispiel #4
0
 MemoryModuleDefFile(Dictionary <ModuleDef, MemoryModuleDefFile> dict, DnProcess process, ulong address, byte[] data, bool isInMemory, ModuleDef module, bool loadSyms, bool autoUpdateMemory)
     : base(module, loadSyms)
 {
     this.dict             = dict;
     this.process          = process;
     this.address          = address;
     this.data             = data;
     this.isInMemory       = isInMemory;
     this.autoUpdateMemory = autoUpdateMemory;
 }
Beispiel #5
0
            public DebugState(DnDebugger dbg)
            {
                this.dbg = dbg;

                Debug.Assert(dbg.Processes.Length == 1);
                this.debuggedProcess = dbg.Processes[0];

                const uint PROCESS_QUERY_LIMITED_INFORMATION = 0x1000;

                this.hProcess_debuggee = NativeMethods.OpenProcess2(PROCESS_QUERY_LIMITED_INFORMATION, false, (uint)this.debuggedProcess.ProcessId);
                Debug.Assert(this.hProcess_debuggee != IntPtr.Zero, string.Format("OpenProcess() failed: 0x{0:X8}", Marshal.GetLastWin32Error()));
            }
Beispiel #6
0
        public ValueContext(ILocalsOwner localsOwner, CorFrame frame, DnThread thread, List <CorType> genericTypeArguments)
        {
            this.LocalsOwner = localsOwner;
            this.Thread      = thread;
            this.Process     = thread.Process;

            // Read everything immediately since the frame will be neutered when Continue() is called
            this.FrameCouldBeNeutered   = frame;
            this.genericTypeArguments   = genericTypeArguments;
            this.genericMethodArguments = new List <CorType>();
            this.Function = frame?.Function;
        }
Beispiel #7
0
        string GetProcessFullPath(DnProcess process)
        {
            if (process == null)
            {
                return("???");
            }
            var name = process.Filename;

            if (string.IsNullOrEmpty(name))
            {
                return(string.Format("0x{0:X}", process.ProcessId));
            }
            return(name);
        }
Beispiel #8
0
 public static T Write <T>(this T output, DnProcess p, bool useHex) where T : ITextOutput
 {
     output.Write('[', TextTokenType.Operator);
     if (useHex)
     {
         output.Write(string.Format("0x{0:X}", p.ProcessId), TextTokenType.Number);
     }
     else
     {
         output.Write(string.Format("{0}", p.ProcessId), TextTokenType.Number);
     }
     output.Write(']', TextTokenType.Operator);
     output.WriteSpace();
     output.WriteFilename(GetFilename(p.Filename));
     return(output);
 }
Beispiel #9
0
 public static T Write <T>(this T output, DnProcess p, bool useHex) where T : ITextColorWriter
 {
     output.Write(BoxedTextColor.Punctuation, "[");
     if (useHex)
     {
         output.Write(BoxedTextColor.Number, string.Format("0x{0:X}", p.ProcessId));
     }
     else
     {
         output.Write(BoxedTextColor.Number, string.Format("{0}", p.ProcessId));
     }
     output.Write(BoxedTextColor.Punctuation, "]");
     output.WriteSpace();
     output.WriteFilename(GetFilename(p.Filename));
     return(output);
 }
Beispiel #10
0
 public static T Write <T>(this T output, DnProcess p, bool useHex) where T : ISyntaxHighlightOutput
 {
     output.Write("[", TextTokenKind.Operator);
     if (useHex)
     {
         output.Write(string.Format("0x{0:X}", p.ProcessId), TextTokenKind.Number);
     }
     else
     {
         output.Write(string.Format("{0}", p.ProcessId), TextTokenKind.Number);
     }
     output.Write("]", TextTokenKind.Operator);
     output.WriteSpace();
     output.WriteFilename(GetFilename(p.Filename));
     return(output);
 }
Beispiel #11
0
        public ValueContext(ILocalsOwner localsOwner, CorFrame frame, DnThread thread, DnProcess process)
        {
            this.LocalsOwner = localsOwner;
            this.Thread      = thread;
            this.Process     = process;
            Debug.Assert(thread == null || thread.Process == process);

            // Read everything immediately since the frame will be neutered when Continue() is called
            this.FrameCouldBeNeutered = frame;
            if (frame == null)
            {
                genericTypeArguments = genericMethodArguments = new List <CorType>();
                this.Function        = null;
            }
            else
            {
                frame.GetTypeAndMethodGenericParameters(out genericTypeArguments, out genericMethodArguments);
                this.Function = frame.Function;
            }
        }
Beispiel #12
0
        public void SetFrame(CorFrame frame, DnProcess process)
        {
            this.frame   = frame;
            this.process = process;

            if (cachedOutput == null || !HasPropertyChangedHandlers)
            {
                cachedOutput = null;
                OnPropertyChanged("NameObject");
            }
            else
            {
                var newCachedOutput = CachedOutput.Create(frame, Context.TypePrinterFlags);
                if (newCachedOutput.Equals(cachedOutput.Value))
                {
                    return;
                }

                cachedOutput = newCachedOutput;
                OnPropertyChanged("NameObject");
            }
        }
Beispiel #13
0
 public static IDnSpyFilenameKey CreateKey(DnProcess process, ulong address) => new MyKey(process, address);
Beispiel #14
0
 public MyKey(DnProcess process, ulong address)
 {
     this.process = process;
     this.address = address;
 }
Beispiel #15
0
 string GetProcessNameWithPID(DnProcess process) => string.Format("[0x{0:X}] {1}", process?.ProcessId, GetProcessName(process));
 public static IDnSpyFilenameKey CreateKey(DnProcess process, ulong address)
 {
     return(new MyKey(process, address));
 }
 public override CorDebugJITCompilerFlags GetDesiredNGENCompilerFlags(DnProcess process) =>
 suppressJITOptimization_SystemModules ? CorDebugJITCompilerFlags.CORDEBUG_JIT_DISABLE_OPTIMIZATION : CorDebugJITCompilerFlags.CORDEBUG_JIT_DEFAULT;
Beispiel #18
0
 public static void ReadMemory(DnProcess process, ulong address, byte[] data, long index, int count)
 {
     ReadMemory(process.CorProcess.Handle, address, data, index, count);
 }
Beispiel #19
0
 public FrameInfo(ILocalsOwner localsOwner, DnThread thread, DnProcess process, CorFrame frame, int frameNo)
 {
     this.ValueContext = new ValueContext(localsOwner, frame, thread, process);
 }
Beispiel #20
0
 public static IDsDocumentNameKey CreateKey(DnProcess process, ulong address) => new MyKey(process, address);