Пример #1
0
        internal DebugRegisters(DebugClient client, SOSHost soshost)
        {
            VTableBuilder builder = client.AddInterface(typeof(IDebugRegisters).GUID, validate: true);

            AddDebugRegisters(builder, soshost);
            builder.Complete();
        }
 private static void AddDebugSystemObjects(VTableBuilder builder, SOSHost soshost)
 {
     builder.AddMethod(new GetEventThreadDelegate((self, id) => DebugClient.NotImplemented));
     builder.AddMethod(new GetEventProcessDelegate((self, id) => DebugClient.NotImplemented));
     builder.AddMethod(new GetCurrentThreadIdDelegate(soshost.GetCurrentThreadId));
     builder.AddMethod(new SetCurrentThreadIdDelegate(soshost.SetCurrentThreadId));
     builder.AddMethod(new GetCurrentProcessIdDelegate((self, id) => DebugClient.NotImplemented));
     builder.AddMethod(new SetCurrentProcessIdDelegate((self, id) => DebugClient.NotImplemented));
     builder.AddMethod(new GetNumberThreadsDelegate(soshost.GetNumberThreads));
     builder.AddMethod(new GetTotalNumberThreadsDelegate(soshost.GetTotalNumberThreads));
     builder.AddMethod(new GetThreadIdsByIndexDelegate(soshost.GetThreadIdsByIndex));
     builder.AddMethod(new GetThreadIdByProcessorDelegate((self, processor, id) => DebugClient.NotImplemented));
     builder.AddMethod(new GetCurrentThreadDataOffsetDelegate((self, offset) => DebugClient.NotImplemented));
     builder.AddMethod(new GetThreadIdByDataOffsetDelegate((self, offset, id) => DebugClient.NotImplemented));
     builder.AddMethod(new GetCurrentThreadTebDelegate(soshost.GetCurrentThreadTeb));
     builder.AddMethod(new GetThreadIdByTebDelegate((self, offset, id) => DebugClient.NotImplemented));
     builder.AddMethod(new GetCurrentThreadSystemIdDelegate(soshost.GetCurrentThreadSystemId));
     builder.AddMethod(new GetThreadIdBySystemIdDelegate(soshost.GetThreadIdBySystemId));
     builder.AddMethod(new GetCurrentThreadHandleDelegate((self, handle) => DebugClient.NotImplemented));
     builder.AddMethod(new GetThreadIdByHandleDelegate((self, handle, id) => DebugClient.NotImplemented));
     builder.AddMethod(new GetNumberProcessesDelegate((self, number) => DebugClient.NotImplemented));
     builder.AddMethod(new GetProcessIdsByIndexDelegate((self, start, count, ids, sysIds) => DebugClient.NotImplemented));
     builder.AddMethod(new GetCurrentProcessDataOffsetDelegate((self, offset) => DebugClient.NotImplemented));
     builder.AddMethod(new GetProcessIdByDataOffsetDelegate((self, offset, id) => DebugClient.NotImplemented));
     builder.AddMethod(new GetCurrentProcessPebDelegate((self, offset) => DebugClient.NotImplemented));
     builder.AddMethod(new GetProcessIdByPebDelegate((self, offset, id) => DebugClient.NotImplemented));
     builder.AddMethod(new GetCurrentProcessSystemIdDelegate(soshost.GetCurrentProcessSystemId));
     builder.AddMethod(new GetProcessIdBySystemIdDelegate((self, sysId, id) => DebugClient.NotImplemented));
     builder.AddMethod(new GetCurrentProcessHandleDelegate((self, handle) => DebugClient.NotImplemented));
     builder.AddMethod(new GetProcessIdByHandleDelegate((self, handle, id) => DebugClient.NotImplemented));
     builder.AddMethod(new GetCurrentProcessExecutableNameDelegate((self, buffer, bufferSize, exeSize) => DebugClient.NotImplemented));
 }
Пример #3
0
        /// <summary>
        /// Create an instance of the service wrapper SOS uses.
        /// </summary>
        /// <param name="soshost">SOS host instance</param>
        internal LLDBServices(SOSHost soshost)
        {
            _soshost = soshost;

            VTableBuilder builder = AddInterface(IID_ILLDBServices, validate: false);

            builder.AddMethod(new GetCoreClrDirectoryDelegate(GetCoreClrDirectory));
            builder.AddMethod(new GetExpressionDelegate((self, expression) => SOSHost.GetExpression(expression)));
            builder.AddMethod(new VirtualUnwindDelegate(VirtualUnwind));
            builder.AddMethod(new SetExceptionCallbackDelegate(SetExceptionCallback));
            builder.AddMethod(new ClearExceptionCallbackDelegate(ClearExceptionCallback));

            builder.AddMethod(new GetInterruptDelegate(soshost.GetInterrupt));
            builder.AddMethod(new OutputVaListDelegate(soshost.OutputVaList));
            builder.AddMethod(new GetDebuggeeTypeDelegate(soshost.GetDebuggeeType));
            builder.AddMethod(new GetPageSizeDelegate(soshost.GetPageSize));
            builder.AddMethod(new GetExecutingProcessorTypeDelegate(soshost.GetExecutingProcessorType));
            builder.AddMethod(new ExecuteDelegate(soshost.Execute));
            builder.AddMethod(new GetLastEventInformationDelegate(soshost.GetLastEventInformation));
            builder.AddMethod(new DisassembleDelegate(soshost.Disassemble));

            builder.AddMethod(new GetContextStackTraceDelegate(GetContextStackTrace));
            builder.AddMethod(new ReadVirtualDelegate(soshost.ReadVirtual));
            builder.AddMethod(new WriteVirtualDelegate(soshost.WriteVirtual));

            builder.AddMethod(new GetSymbolOptionsDelegate(soshost.GetSymbolOptions));
            builder.AddMethod(new GetNameByOffsetDelegate(soshost.GetNameByOffset));
            builder.AddMethod(new GetNumberModulesDelegate(soshost.GetNumberModules));
            builder.AddMethod(new GetModuleByIndexDelegate(soshost.GetModuleByIndex));
            builder.AddMethod(new GetModuleByModuleNameDelegate(soshost.GetModuleByModuleName));
            builder.AddMethod(new GetModuleByOffsetDelegate(soshost.GetModuleByOffset));
            builder.AddMethod(new GetModuleNamesDelegate(soshost.GetModuleNames));
            builder.AddMethod(new GetLineByOffsetDelegate(soshost.GetLineByOffset));
            builder.AddMethod(new GetSourceFileLineOffsetsDelegate(soshost.GetSourceFileLineOffsets));
            builder.AddMethod(new FindSourceFileDelegate(soshost.FindSourceFile));

            builder.AddMethod(new GetCurrentProcessSystemIdDelegate(soshost.GetCurrentProcessSystemId));
            builder.AddMethod(new GetCurrentThreadIdDelegate(soshost.GetCurrentThreadId));
            builder.AddMethod(new SetCurrentThreadIdDelegate(soshost.SetCurrentThreadId));
            builder.AddMethod(new GetCurrentThreadSystemIdDelegate(soshost.GetCurrentThreadSystemId));
            builder.AddMethod(new GetThreadIdBySystemIdDelegate(soshost.GetThreadIdBySystemId));
            builder.AddMethod(new GetThreadContextBySystemIdDelegate(soshost.GetThreadContextBySystemId));

            builder.AddMethod(new GetValueByNameDelegate(GetValueByName));
            builder.AddMethod(new GetInstructionOffsetDelegate(soshost.GetInstructionOffset));
            builder.AddMethod(new GetStackOffsetDelegate(soshost.GetStackOffset));
            builder.AddMethod(new GetFrameOffsetDelegate(soshost.GetFrameOffset));

            ILLDBServices = builder.Complete();

            builder = AddInterface(IID_ILLDBServices2, validate: false);
            builder.AddMethod(new LoadNativeSymbolsDelegate2(LoadNativeSymbols2));
            builder.AddMethod(new AddModuleSymbolDelegate(AddModuleSymbol));
            builder.AddMethod(new GetModuleInfoDelegate(GetModuleInfo));
            builder.AddMethod(new GetModuleVersionInformationDelegate(soshost.GetModuleVersionInformation));
            builder.Complete();

            AddRef();
        }
        internal DebugAdvanced(DebugClient client, SOSHost soshost)
        {
            VTableBuilder builder = client.AddInterface(typeof(IDebugAdvanced).GUID, validate: true);

            builder.AddMethod(new GetThreadContextDelegate(soshost.GetThreadContext));
            builder.AddMethod(new SetThreadContextDelegate(soshost.SetThreadContext));
            builder.Complete();
        }
Пример #5
0
 private static void AddDebugDataSpaces2(VTableBuilder builder, SOSHost soshost)
 {
     AddDebugDataSpaces(builder, soshost);
     builder.AddMethod(new VirtualToPhysicalDelegate((self, virtualAddress, physicalAddress) => DebugClient.NotImplemented));
     builder.AddMethod(new GetVirtualTranslationPhysicalOffsetsDelegate((self, virtualAddress, offsets, offsetsSize, levels) => DebugClient.NotImplemented));
     builder.AddMethod(new ReadHandleDataDelegate((self, handle, dataType, buffer, bufferSize, dataSize) => DebugClient.NotImplemented));
     builder.AddMethod(new FillVirtualDelegate((self, start, size, buffer, patternSize, filled) => DebugClient.NotImplemented));
     builder.AddMethod(new FillPhysicalDelegate((self, start, size, buffer, patternSize, filled) => DebugClient.NotImplemented));
     builder.AddMethod(new QueryVirtualDelegate((self, offset, info) => DebugClient.NotImplemented));
 }
Пример #6
0
 /// <summary>
 /// Loads and initializes the SOS module.
 /// </summary>
 private void Initialize()
 {
     if (_sosLibrary == IntPtr.Zero)
     {
         string sos;
         if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
         {
             sos = "sos.dll";
         }
         else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
         {
             sos = "libsos.so";
         }
         else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
         {
             sos = "libsos.dylib";
         }
         else
         {
             throw new PlatformNotSupportedException($"Unsupported operating system: {RuntimeInformation.OSDescription}");
         }
         string sosPath = Path.Combine(SOSPath, sos);
         try
         {
             _sosLibrary = Microsoft.Diagnostics.Runtime.DataTarget.PlatformFunctions.LoadLibrary(sosPath);
         }
         catch (DllNotFoundException ex)
         {
             // This is a workaround for the Microsoft SDK docker images. Can fail when LoadLibrary uses libdl.so to load the SOS module.
             if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
             {
                 throw new DllNotFoundException("Problem loading SOS module. Try installing libc6-dev (apt-get install libc6-dev) to work around this problem.", ex);
             }
             else
             {
                 throw;
             }
         }
         if (_sosLibrary == IntPtr.Zero)
         {
             throw new FileNotFoundException($"SOS module {sosPath} not found");
         }
         var initializeFunc = SOSHost.GetDelegateFunction <SOSInitializeDelegate>(_sosLibrary, SOSInitialize);
         if (initializeFunc == null)
         {
             throw new EntryPointNotFoundException($"Can not find SOS module initialization function: {SOSInitialize}");
         }
         int result = initializeFunc(_hostWrapper.IHost);
         if (result != 0)
         {
             throw new InvalidOperationException($"SOS initialization FAILED 0x{result:X8}");
         }
         Trace.TraceInformation("SOS initialized: sosPath '{0}'", sosPath);
     }
 }
 private static void AddDebugControl2(VTableBuilder builder, SOSHost soshost)
 {
     AddDebugControl(builder, soshost);
     builder.AddMethod(new GetCurrentTimeDateDelegate((self, timeDate) => DebugClient.NotImplemented));
     builder.AddMethod(new GetCurrentSystemUpTimeDelegate((self, uptime) => DebugClient.NotImplemented));
     builder.AddMethod(new GetDumpFormatFlagsDelegate(soshost.GetDumpFormatFlags));
     builder.AddMethod(new GetNumberTextReplacementsDelegate((self, numRepl) => DebugClient.NotImplemented));
     builder.AddMethod(new GetTextReplacementDelegate((self, srcText, index, srcBuffer, srcBufferSize, srcSize, dstBuffer, dstBufferSize, dstSize) => DebugClient.NotImplemented));
     builder.AddMethod(new SetTextReplacementDelegate((self, srcText, dstText) => DebugClient.NotImplemented));
     builder.AddMethod(new RemoveTextReplacementsDelegate((self) => DebugClient.NotImplemented));
     builder.AddMethod(new OutputTextReplacementsDelegate((self, outputControl, flags) => DebugClient.NotImplemented));
 }
Пример #8
0
        /// <summary>
        /// Shutdown/clean up the native SOS module.
        /// </summary>
        private void Uninitialize()
        {
            Trace.TraceInformation("SOSHost: Uninitialize");
            if (_sosLibrary != IntPtr.Zero)
            {
                var uninitializeFunc = SOSHost.GetDelegateFunction <SOSUninitializeDelegate>(_sosLibrary, SOSUninitialize);
                uninitializeFunc?.Invoke();

                Microsoft.Diagnostics.Runtime.DataTarget.PlatformFunctions.FreeLibrary(_sosLibrary);
                _sosLibrary = IntPtr.Zero;
            }
            _hostWrapper.Release();
        }
Пример #9
0
 private static void AddDebugRegisters(VTableBuilder builder, SOSHost soshost)
 {
     builder.AddMethod(new GetNumberRegistersDelegate((self, number) => DebugClient.NotImplemented));
     builder.AddMethod(new GetDescriptionDelegate((self, register, nameBuffer, nameBufferSize, nameSize, desc) => DebugClient.NotImplemented));
     builder.AddMethod(new GetIndexByNameDelegate(soshost.GetIndexByName));
     builder.AddMethod(new GetValueDelegate(soshost.GetValue));
     builder.AddMethod(new SetValueDelegate((self, register, value) => DebugClient.NotImplemented));
     builder.AddMethod(new GetValuesDelegate((self, count, indices, start, values) => DebugClient.NotImplemented));
     builder.AddMethod(new SetValuesDelegate((self, count, indices, start, values) => DebugClient.NotImplemented));
     builder.AddMethod(new OutputRegistersDelegate((self, outputControl, flags) => DebugClient.NotImplemented));
     builder.AddMethod(new GetInstructionOffsetDelegate(soshost.GetInstructionOffset));
     builder.AddMethod(new GetStackOffsetDelegate(soshost.GetStackOffset));
     builder.AddMethod(new GetFrameOffsetDelegate(soshost.GetFrameOffset));
 }
Пример #10
0
 int GetContextStackTrace(
     IntPtr self,
     IntPtr startContext,
     uint startContextSize,
     DEBUG_STACK_FRAME[] frames,
     uint framesSize,
     IntPtr frameContexts,
     uint frameContextsSize,
     uint frameContextsEntrySize,
     uint *framesFilled)
 {
     // Don't fail, but always return 0 native frames so "clrstack -f" still prints the managed frames
     SOSHost.Write(framesFilled);
     return(HResult.S_OK);
 }
Пример #11
0
 private static void AddDebugClient(VTableBuilder builder, SOSHost soshost)
 {
     builder.AddMethod(new AttachKernelDelegate((self, flags, connectOptions) => NotImplemented));
     builder.AddMethod(new GetKernelConnectionOptionsDelegate((self, buffer, bufferSize, optionsSize) => NotImplemented));
     builder.AddMethod(new SetKernelConnectionOptionsDelegate((self, options) => NotImplemented));
     builder.AddMethod(new StartProcessServerDelegate((self, flags, options, reserved) => NotImplemented));
     builder.AddMethod(new ConnectProcessServerDelegate((self, remoteOptions, server) => NotImplemented));
     builder.AddMethod(new DisconnectProcessServerDelegate((self, server) => NotImplemented));
     builder.AddMethod(new GetRunningProcessSystemIdsDelegate((self, server, ids, count, actualCount) => NotImplemented));
     builder.AddMethod(new GetRunningProcessSystemIdByExecutableNameDelegate((self, server, exeName, flags, id) => NotImplemented));
     builder.AddMethod(new GetRunningProcessDescriptionDelegate((self, server, systemId, flags, exeName, exeNameSize, actualExeNameSize, description, descriptionSize, actualDescriptionSize) => NotImplemented));
     builder.AddMethod(new AttachProcessDelegate((self, server, processId, attachFlags) => NotImplemented));
     builder.AddMethod(new CreateProcessDelegate((self, server, commandLine, flags) => NotImplemented));
     builder.AddMethod(new CreateProcessAndAttachDelegate((self, server, commandLine, flags, processId, attachFlags) => NotImplemented));
     builder.AddMethod(new GetProcessOptionsDelegate((self, options) => NotImplemented));
     builder.AddMethod(new AddProcessOptionsDelegate((self, options) => NotImplemented));
     builder.AddMethod(new RemoveProcessOptionsDelegate((self, options) => NotImplemented));
     builder.AddMethod(new SetProcessOptionsDelegate((self, options) => NotImplemented));
     builder.AddMethod(new OpenDumpFileDelegate((self, dumpFile) => NotImplemented));
     builder.AddMethod(new WriteDumpFileDelegate((self, dumpFile, qualifier) => NotImplemented));
     builder.AddMethod(new ConnectSessionDelegate((self, flags, historyLimit) => NotImplemented));
     builder.AddMethod(new StartServerDelegate((self, options) => NotImplemented));
     builder.AddMethod(new OutputServerDelegate((self, outputControl, machine, flags) => NotImplemented));
     builder.AddMethod(new TerminateProcessesDelegate((self) => NotImplemented));
     builder.AddMethod(new DetachProcessesDelegate((self) => NotImplemented));
     builder.AddMethod(new EndSessionDelegate((self, flags) => NotImplemented));
     builder.AddMethod(new GetExitCodeDelegate((self, code) => NotImplemented));
     builder.AddMethod(new DispatchCallbacksDelegate((self, timeout) => NotImplemented));
     builder.AddMethod(new ExitDispatchDelegate((self, client) => NotImplemented));
     builder.AddMethod(new CreateClientDelegate((self, client) => NotImplemented));
     builder.AddMethod(new GetInputCallbacksDelegate((self, callbacks) => NotImplemented));
     builder.AddMethod(new SetInputCallbacksDelegate((self, callbacks) => NotImplemented));
     builder.AddMethod(new GetOutputCallbacksDelegate((self, callbacks) => NotImplemented));
     builder.AddMethod(new SetOutputCallbacksDelegate((self, callbacks) => NotImplemented));
     builder.AddMethod(new GetOutputMaskDelegate((self, mask) => NotImplemented));
     builder.AddMethod(new SetOutputMaskDelegate((self, mask) => NotImplemented));
     builder.AddMethod(new GetOtherOutputMaskDelegate((self, client, mask) => NotImplemented));
     builder.AddMethod(new SetOtherOutputMaskDelegate((self, client, mask) => NotImplemented));
     builder.AddMethod(new GetOutputWidthDelegate((self, columns) => NotImplemented));
     builder.AddMethod(new SetOutputWidthDelegate((self, columns) => NotImplemented));
     builder.AddMethod(new GetOutputLinePrefixDelegate((self, buffer, bufferSize, prefixSize) => NotImplemented));
     builder.AddMethod(new SetOutputLinePrefixDelegate((self, prefix) => NotImplemented));
     builder.AddMethod(new GetIdentityDelegate((self, buffer, bufferSize, identitySize) => NotImplemented));
     builder.AddMethod(new OutputIdentityDelegate((self, outputControl, flags, format) => NotImplemented));
     builder.AddMethod(new GetEventCallbacksDelegate((self, callbacks) => NotImplemented));
     builder.AddMethod(new SetEventCallbacksDelegate((self, callbacks) => NotImplemented));
     builder.AddMethod(new FlushCallbacksDelegate((self) => NotImplemented));
 }
Пример #12
0
 private unsafe int ReadVirtual(
     IntPtr self,
     ulong address,
     IntPtr buffer,
     uint bytesRequested,
     uint *pbytesRead)
 {
     address &= _ignoreAddressBitsMask;
     if (!_memoryService.ReadMemory(address, buffer, unchecked ((int)bytesRequested), out int bytesRead))
     {
         Trace.TraceError("CorDebugDataTargetWrappter.ReadVirtual FAILED address {0:X16} size {1:X8}", address, bytesRequested);
         return(HResult.E_FAIL);
     }
     SOSHost.Write(pbytesRead, (uint)bytesRead);
     return(HResult.S_OK);
 }
Пример #13
0
        /// <summary>
        /// Create an instance of the service wrapper SOS uses.
        /// </summary>
        /// <param name="soshost">SOS host instance</param>
        public DebugClient(SOSHost soshost)
        {
            VTableBuilder builder = AddInterface(typeof(IDebugClient).GUID, validate: true);

            AddDebugClient(builder, soshost);
            IDebugClient = builder.Complete();

            _debugAdvanced      = new DebugAdvanced(this, soshost);
            _debugControl       = new DebugControl(this, soshost);
            _debugDataSpaces    = new DebugDataSpaces(this, soshost);
            _debugRegisters     = new DebugRegisters(this, soshost);
            _debugSymbols       = new DebugSymbols(this, soshost);
            _debugSystemObjects = new DebugSystemObjects(this, soshost);

            AddRef();
        }
Пример #14
0
 private HResult WriteVirtual(
     IntPtr self,
     ulong address,
     IntPtr buffer,
     uint bytesRequested,
     uint *bytesWritten)
 {
     address &= _ignoreAddressBitsMask;
     if (!_memoryService.WriteMemory(address, new Span <byte>(buffer.ToPointer(), unchecked ((int)bytesRequested)), out int written))
     {
         SOSHost.Write(bytesWritten);
         return(HResult.E_FAIL);
     }
     SOSHost.Write(bytesWritten, (uint)written);
     return(HResult.S_OK);
 }
Пример #15
0
        /// <summary>
        /// Execute a SOS command.
        /// </summary>
        /// <param name="client">client interface</param>
        /// <param name="command">just the command name</param>
        /// <param name="arguments">the command arguments and options</param>
        public void ExecuteCommand(IntPtr client, string command, string arguments)
        {
            Debug.Assert(_sosLibrary != IntPtr.Zero);

            var commandFunc = SOSHost.GetDelegateFunction <SOSCommandDelegate>(_sosLibrary, command);

            if (commandFunc == null)
            {
                throw new EntryPointNotFoundException($"Can not find SOS command: {command}");
            }
            int result = commandFunc(client, arguments ?? "");

            if (result != HResult.S_OK)
            {
                Trace.TraceError($"SOS command FAILED 0x{result:X8}");
            }
        }
Пример #16
0
 unsafe int GetModuleInfo(
     IntPtr self,
     uint index,
     ulong *moduleBase,
     ulong *moduleSize)
 {
     try
     {
         IModule module = _soshost.ModuleService.GetModuleFromIndex((int)index);
         SOSHost.Write(moduleBase, module.ImageBase);
         SOSHost.Write(moduleSize, module.ImageSize);
     }
     catch (DiagnosticsException)
     {
         return(HResult.E_FAIL);
     }
     return(HResult.S_OK);
 }
Пример #17
0
 private HResult ReadVirtual(
     IntPtr self,
     ulong address,
     IntPtr buffer,
     uint bytesRequested,
     uint *bytesRead)
 {
     Debug.Assert(address != MagicCallbackConstant);
     address &= _ignoreAddressBitsMask;
     if (!_memoryService.ReadMemory(address, buffer, unchecked ((int)bytesRequested), out int read))
     {
         Trace.TraceError("DataTargetWrapper.ReadVirtual FAILED address {0:X16} size {1:X8}", address, bytesRequested);
         SOSHost.Write(bytesRead);
         return(HResult.E_FAIL);
     }
     SOSHost.Write(bytesRead, (uint)read);
     return(HResult.S_OK);
 }
Пример #18
0
 private HResult AllocVirtual(
     IntPtr self,
     ulong address,
     uint size,
     uint typeFlags,
     uint protectFlags,
     ulong *buffer)
 {
     if (_remoteMemoryService == null)
     {
         return(HResult.E_NOTIMPL);
     }
     if (!_remoteMemoryService.AllocateMemory(address, size, typeFlags, protectFlags, out ulong remoteAddress))
     {
         return(HResult.E_FAIL);
     }
     SOSHost.Write(buffer, remoteAddress);
     return(HResult.S_OK);
 }
Пример #19
0
 unsafe int GetModuleInfo(
     IntPtr self,
     uint index,
     ulong *moduleBase,
     ulong *moduleSize,
     uint *timestamp,
     uint *checksum)
 {
     try
     {
         IModule module = _soshost.ModuleService.GetModuleFromIndex((int)index);
         SOSHost.Write(moduleBase, module.ImageBase);
         SOSHost.Write(moduleSize, module.ImageSize);
         SOSHost.Write(timestamp, module.IndexTimeStamp.GetValueOrDefault(SOSHost.InvalidTimeStamp));
         SOSHost.Write(checksum, SOSHost.InvalidChecksum);
     }
     catch (DiagnosticsException)
     {
         return(HResult.E_FAIL);
     }
     return(HResult.S_OK);
 }
Пример #20
0
 private static void AddDebugDataSpaces(VTableBuilder builder, SOSHost soshost)
 {
     builder.AddMethod(new ReadVirtualDelegate(soshost.ReadVirtual));
     builder.AddMethod(new WriteVirtualDelegate(soshost.WriteVirtual));
     builder.AddMethod(new SearchVirtualDelegate((self, offset, length, pattern, patternSize, patternGranularity, matchOffset) => DebugClient.NotImplemented));
     builder.AddMethod(new ReadVirtualUncachedDelegate((self, offset, buffer, bufferSize, bytesRead) => DebugClient.NotImplemented));
     builder.AddMethod(new WriteVirtualUncachedDelegate((self, offset, buffer, bufferSize, bytesWritten) => DebugClient.NotImplemented));
     builder.AddMethod(new ReadPointersVirtualDelegate((self, count, offset, ptrs) => DebugClient.NotImplemented));
     builder.AddMethod(new WritePointersVirtualDelegate((self, count, offset, ptrs) => DebugClient.NotImplemented));
     builder.AddMethod(new ReadPhysicalDelegate((self, offset, buffer, bufferSize, bytesRead) => DebugClient.NotImplemented));
     builder.AddMethod(new WritePhysicalDelegate((self, offset, buffer, bufferSize, bytesWritten) => DebugClient.NotImplemented));
     builder.AddMethod(new ReadControlDelegate((self, processor, offset, buffer, bufferSize, bytesRead) => DebugClient.NotImplemented));
     builder.AddMethod(new WriteControlDelegate((self, processor, offset, buffer, bufferSize, bytesWritten) => DebugClient.NotImplemented));
     builder.AddMethod(new ReadIoDelegate((self, interfaceType, busNumber, addressSpace, offset, buffer, bufferSize, bytesRead) => DebugClient.NotImplemented));
     builder.AddMethod(new WriteIoDelegate((self, interfaceType, busNumber, addressSpace, offset, buffer, bufferSize, bytesWritten) => DebugClient.NotImplemented));
     builder.AddMethod(new ReadMsrDelegate((self, msr, msrValue) => DebugClient.NotImplemented));
     builder.AddMethod(new WriteMsrDelegate((self, msr, msrValue) => DebugClient.NotImplemented));
     builder.AddMethod(new ReadBusDataDelegate((self, busDataType, busNumber, slotNumber, offset, buffer, bufferSize, bytesRead) => DebugClient.NotImplemented));
     builder.AddMethod(new WriteBusDataDelegate((self, busDataType, busNumber, slotNumber, offset, buffer, bufferSize, bytesWritten) => DebugClient.NotImplemented));
     builder.AddMethod(new CheckLowMemoryDelegate((self) => DebugClient.NotImplemented));
     builder.AddMethod(new ReadDebuggerDataDelegate((self, index, buffer, bufferSize, dataSize) => HResult.E_NOTIMPL));
     builder.AddMethod(new ReadProcessorSystemDataDelegate((self, processor, index, buffer, bufferSize, dataSize) => DebugClient.NotImplemented));
 }
Пример #21
0
 private static void AddDebugControl(VTableBuilder builder, SOSHost soshost)
 {
     builder.AddMethod(new GetInterruptDelegate(soshost.GetInterrupt));
     builder.AddMethod(new SetInterruptDelegate((self, flags) => HResult.S_OK));
     builder.AddMethod(new GetInterruptTimeoutDelegate((self, seconds) => DebugClient.NotImplemented));
     builder.AddMethod(new SetInterruptTimeoutDelegate((self, seconds) => DebugClient.NotImplemented));
     builder.AddMethod(new GetLogFileDelegate((self, buffer, bufferSize, fileSize, append) => DebugClient.NotImplemented));
     builder.AddMethod(new OpenLogFileDelegate((self, file, append) => DebugClient.NotImplemented));
     builder.AddMethod(new CloseLogFileDelegate((self) => DebugClient.NotImplemented));
     builder.AddMethod(new GetLogMaskDelegate((self, mask) => DebugClient.NotImplemented));
     builder.AddMethod(new SetLogMaskDelegate((self, mask) => DebugClient.NotImplemented));
     builder.AddMethod(new InputDelegate((self, buffer, bufferSize, inputSize) => DebugClient.NotImplemented));
     builder.AddMethod(new ReturnInputDelegate((self, buffer) => DebugClient.NotImplemented));
     builder.AddMethod(new OutputDelegate((self, mask, format) => DebugClient.NotImplemented));
     builder.AddMethod(new OutputVaListDelegate(soshost.OutputVaList));
     builder.AddMethod(new ControlledOutputDelegate((self, outputControl, mask, format) => DebugClient.NotImplemented));
     builder.AddMethod(new ControlledOutputVaListDelegate((self, outputControl, mask, format, valist) => DebugClient.NotImplemented));
     builder.AddMethod(new OutputPromptDelegate((self, outputControl, format) => DebugClient.NotImplemented));
     builder.AddMethod(new OutputPromptVaListDelegate((self, outputControl, format, valist) => DebugClient.NotImplemented));
     builder.AddMethod(new GetPromptTextDelegate((self, buffer, bufferSize, textSize) => DebugClient.NotImplemented));
     builder.AddMethod(new OutputCurrentStateDelegate((self, outputControl, flags) => DebugClient.NotImplemented));
     builder.AddMethod(new OutputVersionInformationDelegate((self, outputControl) => DebugClient.NotImplemented));
     builder.AddMethod(new GetNotifyEventHandleDelegate((self, handle) => DebugClient.NotImplemented));
     builder.AddMethod(new SetNotifyEventHandleDelegate((self, handle) => DebugClient.NotImplemented));
     builder.AddMethod(new AssembleDelegate((self, offset, instr, endoffset) => DebugClient.NotImplemented));
     builder.AddMethod(new DisassembleDelegate(soshost.Disassemble));
     builder.AddMethod(new GetDisassembleEffectiveOffsetDelegate((self, offset) => DebugClient.NotImplemented));
     builder.AddMethod(new OutputDisassemblyDelegate((self, outputControl, offset, flags, endOffset) => DebugClient.NotImplemented));
     builder.AddMethod(new OutputDisassemblyLinesDelegate((self, outputControl, previousLines, totalLines, offset, flags, offsetLine, startOffset, EndOffset, lineOffsets) => DebugClient.NotImplemented));
     builder.AddMethod(new GetNearInstructionDelegate((self, offset, delta, nearOffset) => DebugClient.NotImplemented));
     builder.AddMethod(new GetStackTraceDelegate((self, frameOffset, stackOffset, instructionOffset, frames, frameSize, framesFilled) => DebugClient.NotImplemented));
     builder.AddMethod(new GetReturnOffsetDelegate((self, offset) => DebugClient.NotImplemented));
     builder.AddMethod(new OutputStackTraceDelegate((self, outputControl, frames, frameSize, flags) => DebugClient.NotImplemented));
     builder.AddMethod(new GetDebuggeeTypeDelegate(soshost.GetDebuggeeType));
     builder.AddMethod(new GetActualProcessorTypeDelegate((self, type) => DebugClient.NotImplemented));
     builder.AddMethod(new GetExecutingProcessorTypeDelegate(soshost.GetExecutingProcessorType));
     builder.AddMethod(new GetNumberPossibleExecutingProcessorTypesDelegate((self, number) => DebugClient.NotImplemented));
     builder.AddMethod(new GetPossibleExecutingProcessorTypesDelegate((self, start, count, types) => DebugClient.NotImplemented));
     builder.AddMethod(new GetNumberProcessorsDelegate((self, number) => DebugClient.NotImplemented));
     builder.AddMethod(new GetSystemVersionDelegate((self, platformId, major, minor, servicePack, servicePackSize, servicePackUsed, servicePackNumber, buildString, buildStringSize, buildStringUse) => DebugClient.NotImplemented));
     builder.AddMethod(new GetPageSizeDelegate(soshost.GetPageSize));
     builder.AddMethod(new IsPointer64BitDelegate((self) => DebugClient.NotImplemented));
     builder.AddMethod(new ReadBugCheckDataDelegate((self, code, arg1, arg2, arg3, arg4) => DebugClient.NotImplemented));
     builder.AddMethod(new GetNumberSupportedProcessorTypesDelegate((self, number) => DebugClient.NotImplemented));
     builder.AddMethod(new GetSupportedProcessorTypesDelegate((self, start, count, types) => DebugClient.NotImplemented));
     builder.AddMethod(new GetProcessorTypeNamesDelegate((self, type, fullNameBuffer, fullNameBufferSize, fullNameSize, abbrevNameBuffer, abbrevNameBufferSize, abbrevNameSize) => DebugClient.NotImplemented));
     builder.AddMethod(new GetEffectiveProcessorTypeDelegate((self, type) => DebugClient.NotImplemented));
     builder.AddMethod(new SetEffectiveProcessorTypeDelegate((self, type) => DebugClient.NotImplemented));
     builder.AddMethod(new GetExecutionStatusDelegate((self, status) => DebugClient.NotImplemented));
     builder.AddMethod(new SetExecutionStatusDelegate((self, status) => DebugClient.NotImplemented));
     builder.AddMethod(new GetCodeLevelDelegate((self, level) => DebugClient.NotImplemented));
     builder.AddMethod(new SetCodeLevelDelegate((self, level) => DebugClient.NotImplemented));
     builder.AddMethod(new GetEngineOptionsDelegate((self, options) => HResult.E_NOTIMPL));
     builder.AddMethod(new AddEngineOptionsDelegate((self, options) => HResult.E_NOTIMPL));
     builder.AddMethod(new RemoveEngineOptionsDelegate((self, options) => DebugClient.NotImplemented));
     builder.AddMethod(new SetEngineOptionsDelegate((self, options) => DebugClient.NotImplemented));
     builder.AddMethod(new GetSystemErrorControlDelegate((self, outputLevel, breakLevel) => DebugClient.NotImplemented));
     builder.AddMethod(new SetSystemErrorControlDelegate((self, outputLevel, breakLevel) => DebugClient.NotImplemented));
     builder.AddMethod(new GetTextMacroDelegate((self, slot, buffer, bufferSize, macroSize) => DebugClient.NotImplemented));
     builder.AddMethod(new SetTextMacroDelegate((self, slot, macro) => DebugClient.NotImplemented));
     builder.AddMethod(new GetRadixDelegate((self, radix) => DebugClient.NotImplemented));
     builder.AddMethod(new SetRadixDelegate((self, radix) => DebugClient.NotImplemented));
     builder.AddMethod(new EvaluateDelegate((self, expression, desiredType, value, remainderIndex) => DebugClient.NotImplemented));
     builder.AddMethod(new CoerceValueDelegate((self, inValue, outType, outValue) => DebugClient.NotImplemented));
     builder.AddMethod(new CoerceValuesDelegate((self, count, inValues, outTypes, outValues) => DebugClient.NotImplemented));
     builder.AddMethod(new ExecuteDelegate(soshost.Execute));
     builder.AddMethod(new ExecuteCommandFileDelegate((self, outputControl, commandFile, flags) => DebugClient.NotImplemented));
     builder.AddMethod(new GetNumberBreakpointsDelegate((self, number) => DebugClient.NotImplemented));
     builder.AddMethod(new GetBreakpointByIndexDelegate((self, index, bp) => DebugClient.NotImplemented));
     builder.AddMethod(new GetBreakpointByIdDelegate((self, id, bp) => DebugClient.NotImplemented));
     builder.AddMethod(new GetBreakpointParametersDelegate((self, count, ids, start, bpParams) => DebugClient.NotImplemented));
     builder.AddMethod(new AddBreakpointDelegate((self, type, desiredid, bp) => DebugClient.NotImplemented));
     builder.AddMethod(new RemoveBreakpointDelegate((self, bp) => DebugClient.NotImplemented));
     builder.AddMethod(new AddExtensionDelegate((self, path, flags, handle) => DebugClient.NotImplemented));
     builder.AddMethod(new RemoveExtensionDelegate((self, handle) => DebugClient.NotImplemented));
     builder.AddMethod(new GetExtensionByPathDelegate((self, path, handle) => DebugClient.NotImplemented));
     builder.AddMethod(new CallExtensionDelegate((self, handle, function, arguments) => DebugClient.NotImplemented));
     builder.AddMethod(new GetExtensionFunctionDelegate((self, handle, functionName, function) => DebugClient.NotImplemented));
     builder.AddMethod(new GetWindbgExtensionApis32Delegate((self, api) => DebugClient.NotImplemented));
     builder.AddMethod(new GetWindbgExtensionApis64Delegate((self, api) => DebugClient.NotImplemented));
     builder.AddMethod(new GetNumberEventFiltersDelegate((self, specificEvents, specificExceptions, arbitraryExceptions) => DebugClient.NotImplemented));
     builder.AddMethod(new GetEventFilterTextDelegate((self, index, buffer, bufferSize, textSize) => DebugClient.NotImplemented));
     builder.AddMethod(new GetEventFilterCommandDelegate((self, index, buffer, bufferSize, commandSize) => DebugClient.NotImplemented));
     builder.AddMethod(new SetEventFilterCommandDelegate((self, index, command) => DebugClient.NotImplemented));
     builder.AddMethod(new GetSpecificFilterParametersDelegate((self, start, count, filterParams) => DebugClient.NotImplemented));
     builder.AddMethod(new SetSpecificFilterParametersDelegate((self, start, count, filterParams) => DebugClient.NotImplemented));
     builder.AddMethod(new GetSpecificEventFilterArgumentDelegate((self, index, buffer, bufferSize, argumentSize) => DebugClient.NotImplemented));
     builder.AddMethod(new SetSpecificEventFilterArgumentDelegate((self, index, argument) => DebugClient.NotImplemented));
     builder.AddMethod(new GetExceptionFilterParametersDelegate((self, count, codes, start, filterParams) => DebugClient.NotImplemented));
     builder.AddMethod(new SetExceptionFilterParametersDelegate((self, count, filterParams) => DebugClient.NotImplemented));
     builder.AddMethod(new GetExceptionFilterSecondCommandDelegate((self, index, buffer, bufferSize, commandSize) => DebugClient.NotImplemented));
     builder.AddMethod(new SetExceptionFilterSecondCommandDelegate((self, index, command) => DebugClient.NotImplemented));
     builder.AddMethod(new WaitForEventDelegate((self, flags, timeout) => DebugClient.NotImplemented));
     builder.AddMethod(new GetLastEventInformationDelegate(soshost.GetLastEventInformation));
 }