public WabbitcodeDebugger(string outputFile) { _disposed = false; _debuggerService = DependencyFactory.Resolve <IDebuggerService>(); _fileService = DependencyFactory.Resolve <IFileService>(); _symbolService = DependencyFactory.Resolve <ISymbolService>(); WabbitcodeBreakpointManager.OnBreakpointAdded += WabbitcodeBreakpointManager_OnBreakpointAdded; WabbitcodeBreakpointManager.OnBreakpointRemoved += WabbitcodeBreakpointManager_OnBreakpointRemoved; Debug.WriteLine("Creating wabbitemu debugger"); _debugger = new WabbitemuDebugger(); Debug.WriteLine("Loading file " + outputFile); _debugger.LoadFile(outputFile); _debugger.Visible = true; _debugger.OnBreakpoint += BreakpointHit; _debugger.OnClose += DebuggerOnClose; CurrentDebuggingFile = outputFile; IsAnApp = outputFile.EndsWith(".8xk"); _memoryAllocations = new List <KeyValuePair <ushort, ushort> >(); CallStack = new Stack <CallStackEntry>(); MachineStack = new Stack <StackEntry>(); _oldSp = IsAnApp ? TopStackApp : (ushort)0xFFFF; SetupInternalBreakpoints(); }
public MainViewModel(INavigationService navigationService , IDialogService dialogService , ISymbolService symbolService , IHistoricalPriceViewModel historicalPriceViewModel , ISettingsViewModel settings) : base(navigationService, dialogService) { PriceViewModel = historicalPriceViewModel; Settings = settings; SearchSymbols = ReactiveCommand.CreateFromTask <object, ObservableCollection <BloombergSymbol> >(async _ => { IsLoading = true; var result = await symbolService.SearchSymbol(Keyword); IsLoading = false; return(new ObservableCollection <BloombergSymbol>(result)); }, this.WhenAny(x => x.Keyword, x => !string.IsNullOrEmpty(x.Value))); SearchSymbols.ThrownExceptions.Subscribe(ex => { Debug.WriteLine(ex.Message); IsLoading = false; }); OpenPrices = ReactiveCommand.Create <Unit, Unit>(_ => { SelectedSymbols = Symbols.Where(s => s.Selected); return(Unit.Default); }); _symbols = this.WhenAnyObservable(x => x.SearchSymbols) .ToProperty(this, x => x.Symbols); }
public DataTargetWrapper(IServiceProvider services, IRuntime runtime) { Debug.Assert(services != null); Debug.Assert(runtime != null); _services = services; _runtimeBaseAddress = runtime.RuntimeModule.ImageBase; _symbolService = services.GetService <ISymbolService>(); _memoryService = services.GetService <IMemoryService>(); _threadService = services.GetService <IThreadService>(); _threadUnwindService = services.GetService <IThreadUnwindService>(); _moduleService = services.GetService <IModuleService>(); _remoteMemoryService = services.GetService <IRemoteMemoryService>(); _ignoreAddressBitsMask = _memoryService.SignExtensionMask(); VTableBuilder builder = AddInterface(IID_ICLRDataTarget, false); AddDataTarget(builder); IDataTarget = builder.Complete(); builder = AddInterface(IID_ICLRDataTarget2, false); AddDataTarget2(builder); builder.Complete(); builder = AddInterface(IID_ICLRDataTarget4, validate: false); builder.AddMethod(new VirtualUnwindDelegate(VirtualUnwind)); builder.Complete(); builder = AddInterface(IID_ICLRMetadataLocator, false); builder.AddMethod(new GetMetadataDelegate(GetMetadata)); builder.Complete(); builder = AddInterface(IID_ICLRRuntimeLocator, false); builder.AddMethod(new GetRuntimeBaseDelegate(GetRuntimeBase)); builder.Complete(); }
public SymbolServiceWrapper(IHost host) { Debug.Assert(host != null); _host = host; _symbolService = host.Services.GetService <ISymbolService>(); VTableBuilder builder = AddInterface(IID_ISymbolService, validate: false); builder.AddMethod(new IsSymbolStoreEnabledDelegate((IntPtr self) => _symbolService.IsSymbolStoreEnabled)); builder.AddMethod(new InitializeSymbolStoreDelegate(InitializeSymbolStore)); builder.AddMethod(new ParseSymbolPathDelegate(ParseSymbolPath)); builder.AddMethod(new DisplaySymbolStoreDelegate(DisplaySymbolStore)); builder.AddMethod(new DisableSymbolStoreDelegate((IntPtr self) => _symbolService.DisableSymbolStore())); builder.AddMethod(new LoadNativeSymbolsDelegate(LoadNativeSymbols)); builder.AddMethod(new LoadNativeSymbolsFromIndexDelegate(LoadNativeSymbolsFromIndex)); builder.AddMethod(new LoadSymbolsForModuleDelegate(LoadSymbolsForModule)); builder.AddMethod(new DisposeDelegate(Dispose)); builder.AddMethod(new ResolveSequencePointDelegate(ResolveSequencePoint)); builder.AddMethod(new GetLocalVariableNameDelegate(GetLocalVariableName)); builder.AddMethod(new GetLineByILOffsetDelegate(GetLineByILOffset)); builder.AddMethod(new GetExpressionValueDelegate(GetExpressionValue)); builder.AddMethod(new GetMetadataLocatorDelegate(GetMetadataLocator)); builder.AddMethod(new GetICorDebugMetadataLocatorDelegate(GetICorDebugMetadataLocator)); builder.Complete(); }
public AssemblerService(IFileService fileService, ISymbolService symbolService, IAssemblerFactory assemblerFactory) { _fileService = fileService; _symbolService = symbolService; _assemblerFactory = assemblerFactory; }
internal CorDebugDataTargetWrapper(IServiceProvider services) { Debug.Assert(services != null); _target = services.GetService <ITarget>(); _symbolService = services.GetService <ISymbolService>(); _memoryService = services.GetService <IMemoryService>(); _threadService = services.GetService <IThreadService>(); _threadUnwindService = services.GetService <IThreadUnwindService>(); _ignoreAddressBitsMask = _memoryService.SignExtensionMask(); VTableBuilder builder = AddInterface(IID_ICorDebugDataTarget, validate: false); builder.AddMethod(new GetPlatformDelegate(GetPlatform)); builder.AddMethod(new ReadVirtualDelegate(ReadVirtual)); builder.AddMethod(new GetThreadContextDelegate(GetThreadContext)); ICorDebugDataTarget = builder.Complete(); builder = AddInterface(IID_ICorDebugDataTarget4, validate: false); builder.AddMethod(new VirtualUnwindDelegate(VirtualUnwind)); builder.Complete(); builder = AddInterface(IID_ICorDebugMutableDataTarget, validate: false); builder.AddMethod(new WriteVirtualDelegate(WriteVirtual)); builder.AddMethod(new SetThreadContextDelegate((self, threadId, contextSize, context) => HResult.E_NOTIMPL)); builder.AddMethod(new ContinueStatusChangeDelegate((self, continueStatus) => HResult.E_NOTIMPL)); builder.Complete(); builder = AddInterface(IID_ICorDebugMetaDataLocator, validate: false); builder.AddMethod(new GetMetaDataDelegate(GetMetaData)); builder.Complete(); AddRef(); }
public EnumVariableDisplayController(ExpressionEvaluator evaluator, DebuggingEnum debugEnum) : base(evaluator) { _enum = debugEnum; _symbolService = DependencyFactory.Resolve <ISymbolService>(); var debuggerService = DependencyFactory.Resolve <IDebuggerService>(); debuggerService.OnDebuggingStarted += _debuggerService_OnDebuggingStarted; }
private MapFileEditor() { InitializeComponent(); _debuggerService = DependencyFactory.Resolve <IDebuggerService>(); _symbolService = DependencyFactory.Resolve <ISymbolService>(); _debuggerService.OnDebuggingStarted += DebuggerService_OnDebuggingStarted; _debuggerService.OnDebuggingEnded += DebuggerService_OnDebuggingEnded; }
/// <summary> /// Metadata locator helper for the DAC. /// </summary> /// <param name="imagePath">file name and path to module</param> /// <param name="imageTimestamp">module timestamp</param> /// <param name="imageSize">module image</param> /// <param name="pathBufferSize">output buffer size</param> /// <param name="pPathBufferSize">native pointer to put actual path size</param> /// <param name="pwszPathBuffer">native pointer to WCHAR path buffer</param> /// <returns>HRESULT</returns> public static int GetICorDebugMetadataLocator( this ISymbolService symbolService, string imagePath, uint imageTimestamp, uint imageSize, uint pathBufferSize, IntPtr pPathBufferSize, IntPtr pwszPathBuffer) { int hr = HResult.S_OK; int actualSize = 0; Debug.Assert(pwszPathBuffer != IntPtr.Zero); try { if (symbolService.IsSymbolStoreEnabled) { SymbolStoreKey key = PEFileKeyGenerator.GetKey(imagePath, imageTimestamp, imageSize); string localFilePath = symbolService.DownloadFile(key); localFilePath += "\0"; // null terminate the string actualSize = localFilePath.Length; if (pathBufferSize > actualSize) { Trace.TraceInformation($"GetICorDebugMetadataLocator: SUCCEEDED {localFilePath}"); Marshal.Copy(localFilePath.ToCharArray(), 0, pwszPathBuffer, actualSize); } else { Trace.TraceError("GetICorDebugMetadataLocator: E_INSUFFICIENT_BUFFER"); hr = E_INSUFFICIENT_BUFFER; } } else { Trace.TraceError($"GetICorDebugMetadataLocator: {imagePath} {imageTimestamp:X8} {imageSize:X8} symbol store not enabled"); hr = HResult.E_FAIL; } } catch (Exception ex) when (ex is UnauthorizedAccessException || ex is BadImageFormatException || ex is InvalidVirtualAddressException || ex is IOException) { Trace.TraceError($"GetICorDebugMetadataLocator: {imagePath} {imageTimestamp:X8} {imageSize:X8} ERROR {ex.Message}"); hr = HResult.E_FAIL; } if (pPathBufferSize != IntPtr.Zero) { Marshal.WriteInt32(pPathBufferSize, actualSize); } return(hr); }
private void init() { _symbolService = Bootstrapper.container.GetInstance <ISymbolService>(); _symbolGroupService = Bootstrapper.container.GetInstance <ISymbolGroupService>(); _customGroupService = Bootstrapper.container.GetInstance <ICustomGroupService>(); initComboBoxCustomGroup(); initComboBoxCustomGroupMember(); initComboBoxSymbolGroup(); initComboBoxSymbolGroupMember(); initChartDrawer(); }
/// <summary> /// Set the windows symbol path converting the default "srv*" to the cached public symbol server URL. /// </summary> /// <param name="symbolPath">The windows symbol path to translate and set</param> /// <returns>if false, error parsing symbol path</returns> public static bool ParseSymbolPathFixDefault( this ISymbolService symbolService, string symbolPath) { // Translate dbgeng's default .sympath to what the public version actually does. Normally "srv*" // means no caching and the server path depends on whether dbgeng is internal or public. if (symbolPath.ToLowerInvariant() == "srv*") { symbolPath = "cache*;SRV*https://msdl.microsoft.com/download/symbols"; } return(symbolService.ParseSymbolPath(symbolPath)); }
public Grid(int rowCount, int columnCount, ISymbolService symbolService) { Rows = Enumerable.Range(0, rowCount) .Select(r => new Row { Symbols = Enumerable.Range(0, columnCount) .Select(c => symbolService.GetRandomSymbol()) .ToList() }) .ToList(); }
public SymbolsController( IHub hub, IConfiguration config, ISymbolService symbolService, ILogger <SymbolsController> logger) { _hub = hub; _symbolService = symbolService; _logger = logger; _fileSizeLimit = config.GetValue <long>("FileSizeLimitBytes"); // Don't allow file names with paths encoded. _invalidChars = Path.GetInvalidFileNameChars().Concat(new[] { '/', '\\' }).ToArray(); }
public VolumeSpikesDetector(IMessageHub messageHub, IOptions <AppSettings> appSettings, ISymbolService symbolService, ILastTradesService lastTradesService, IVolumeRecordService volumeRecordService, ILogger <VolumeSpikesDetector> logger) { _logger = logger; _appSettings = appSettings; _symbolService = symbolService; _lastTradesService = lastTradesService; _volumeRecordService = volumeRecordService; LoadSymbols(); messageHub.Subscribe <IList <StreamingMessage> >(HandleMessages); }
/// <summary> /// Metadata locator helper for the DAC. /// </summary> /// <param name="imagePath">file name and path to module</param> /// <param name="imageTimestamp">module timestamp</param> /// <param name="imageSize">module image</param> /// <param name="mvid">not used</param> /// <param name="mdRva">not used</param> /// <param name="flags">not used</param> /// <param name="bufferSize">size of incoming buffer (pMetadata)</param> /// <param name="pMetadata">pointer to buffer</param> /// <param name="pMetadataSize">size of outgoing metadata</param> /// <returns>HRESULT</returns> public static int GetMetadataLocator( this ISymbolService symbolService, string imagePath, uint imageTimestamp, uint imageSize, byte[] mvid, uint mdRva, uint flags, uint bufferSize, IntPtr pMetadata, IntPtr pMetadataSize) { Debug.Assert(imageTimestamp != 0); Debug.Assert(imageSize != 0); if (pMetadata == IntPtr.Zero) { return(HResult.E_INVALIDARG); } int hr = HResult.S_OK; int dataSize = 0; ImmutableArray <byte> metadata = symbolService.GetMetadata(imagePath, imageTimestamp, imageSize); if (!metadata.IsEmpty) { dataSize = metadata.Length; int size = Math.Min((int)bufferSize, dataSize); Marshal.Copy(metadata.ToArray(), 0, pMetadata, size); } else { hr = HResult.E_FAIL; } if (pMetadataSize != IntPtr.Zero) { Marshal.WriteInt32(pMetadataSize, dataSize); } return(hr); }
public SymbolServiceWrapper(ISymbolService symbolService, IMemoryService memoryService) { Debug.Assert(symbolService != null); Debug.Assert(memoryService != null); _symbolService = symbolService; _memoryService = memoryService; _ignoreAddressBitsMask = memoryService.SignExtensionMask(); Debug.Assert(_symbolService != null); VTableBuilder builder = AddInterface(IID_ISymbolService, validate: false); builder.AddMethod(new ParseSymbolPathDelegate(ParseSymbolPath)); builder.AddMethod(new LoadSymbolsForModuleDelegate(LoadSymbolsForModule)); builder.AddMethod(new DisposeDelegate(Dispose)); builder.AddMethod(new ResolveSequencePointDelegate(ResolveSequencePoint)); builder.AddMethod(new GetLocalVariableNameDelegate(GetLocalVariableName)); builder.AddMethod(new GetLineByILOffsetDelegate(GetLineByILOffset)); builder.AddMethod(new GetExpressionValueDelegate(GetExpressionValue)); builder.AddMethod(new GetMetadataLocatorDelegate(GetMetadataLocator)); builder.AddMethod(new GetICorDebugMetadataLocatorDelegate(GetICorDebugMetadataLocator)); builder.Complete(); AddRef(); }
public static string FormatSymbolStores( this ISymbolService symbolService) { return(symbolService.ToString().Replace(Environment.NewLine, " ").TrimEnd()); }
internal DbgEngController(string dbgengPath, string dumpPath, string sosPath) { Trace.TraceInformation($"DbgEngController: {dbgengPath} {dumpPath} {sosPath}"); _converter = new CharToLineConverter((text) => { Trace.TraceInformation(text); }); IntPtr dbgengLibrary = DataTarget.PlatformFunctions.LoadLibrary(dbgengPath); var debugCreate = SOSHost.GetDelegateFunction <DebugCreateDelegate>(dbgengLibrary, "DebugCreate"); if (debugCreate == null) { throw new DiagnosticsException($"DebugCreate export not found"); } Guid iid = _iidClient; HResult hr = debugCreate(ref iid, out object client); if (hr != HResult.S_OK) { throw new DiagnosticsException($"DebugCreate FAILED {hr:X8}"); } Client = (IDebugClient)client; Control = (IDebugControl)client; Symbols = (IDebugSymbols2)client; hr = Client.SetOutputCallbacks(this); if (hr != HResult.S_OK) { throw new DiagnosticsException($"SetOutputCallbacks FAILED {hr:X8}"); } // Automatically enable/adjust symbol server support. Override the default cache path so // the cache isn't created in the debugger binaries .nuget package cache directory. string cachePath = Path.Combine(Environment.GetEnvironmentVariable("PROGRAMDATA"), "dbg", "sym"); string sympath = $"{Path.GetDirectoryName(dumpPath)};cache*{cachePath};SRV*https://msdl.microsoft.com/download/symbols"; hr = Symbols.SetSymbolPath(sympath); if (hr != HResult.S_OK) { Trace.TraceError($"SetSymbolPath({sympath}) FAILED {hr:X8}"); } // Load dump file hr = Client.OpenDumpFile(dumpPath); if (hr != HResult.S_OK) { throw new DiagnosticsException($"OpenDumpFile({dumpPath} FAILED {hr:X8}"); } ProcessEvents(); // Load the sos extensions hr = Control.Execute(DEBUG_OUTCTL.ALL_CLIENTS, $".load {sosPath}", DEBUG_EXECUTE.DEFAULT); if (hr != HResult.S_OK) { throw new DiagnosticsException($"Loading {sosPath} FAILED {hr:X8}"); } // Set the HTTP symbol store timeout and retry count before the symbol path is added to the symbol service HostServices.DefaultTimeout = 6; HostServices.DefaultRetryCount = 5; // Initialize the extension host hr = HostServices.Initialize(sosPath); if (hr != HResult.S_OK) { throw new DiagnosticsException($"HostServices.Initialize({sosPath}) FAILED {hr:X8}"); } ISymbolService symbolService = Host.Services.GetService <ISymbolService>(); Trace.TraceInformation($"SymbolService: {symbolService}"); }
/// <summary> /// Memory service constructor /// </summary> /// <param name="runtime">runtime instance</param> /// <param name="memoryService">memory service to wrap</param> /// <param name="symbolService">symbol service</param> internal MetadataMappingMemoryService(IRuntime runtime, IMemoryService memoryService, ISymbolService symbolService) { _runtime = runtime; _memoryService = memoryService; _symbolService = symbolService; }
public TSDemoController(ISymbolService symbolService, ISymbolGroupService symbolGroupService) { _symbolService = symbolService; _symbolGroupService = symbolGroupService; }
public HomeController(ISymbolService symbolService) { _symbolService = symbolService; }
public LabelVariableDisplayController(ExpressionEvaluator evaluator) : base(evaluator) { _symbolService = DependencyFactory.Resolve <ISymbolService>(); }
public ExpressionEvaluator() { _symbolService = DependencyFactory.Resolve <ISymbolService>(); _debuggerService = DependencyFactory.Resolve <IDebuggerService>(); }
public ChartDrawer(System.Windows.Forms.DataVisualization.Charting.Chart chart, ISymbolService symbolService) { this.chart = chart; this._symbolService = symbolService; this.chart.ChartAreas[0].AxisX.MajorGrid.Interval = 30; }
public ChartController(ISymbolService symbolService) { _symbolService = symbolService; }
public CartController(Cart cartService) { _symbolService = Bootstrapper.container.GetInstance <ISymbolService>(); Cart = cartService; }
public NavigationMenuViewComponent() { _symbolService = Bootstrapper.container.GetInstance <ISymbolService>(); }
public SymbolFilesController(ISymbolService symbolService, IAuthorizationService authorizationService) { _symbolService = symbolService; _authorizationService = authorizationService; }
public BinaryLocator(ITarget target) { _symbolService = target.Services.GetService <ISymbolService>(); }
public ApiSymbolController(ISymbolService symbolService) { _symbolService = symbolService; }