private void CreateClient(IDebugClient client) { DebuggerInterface = client; _spaces = (IDebugDataSpaces)DebuggerInterface; _spacesPtr = (IDebugDataSpacesPtr)DebuggerInterface; _symbols = (IDebugSymbols)DebuggerInterface; _control = (IDebugControl2)DebuggerInterface; // These interfaces may not be present in older DbgEng dlls. _spaces2 = DebuggerInterface as IDebugDataSpaces2; _symbols3 = DebuggerInterface as IDebugSymbols3; _advanced = DebuggerInterface as IDebugAdvanced; _systemObjects = DebuggerInterface as IDebugSystemObjects; _systemObjects3 = DebuggerInterface as IDebugSystemObjects3; Interlocked.Increment(ref s_totalInstanceCount); if (_systemObjects3 == null && s_totalInstanceCount > 1) { throw new ClrDiagnosticsException("This version of DbgEng is too old to create multiple instances of DataTarget.", ClrDiagnosticsExceptionKind.DebuggerError); } if (_systemObjects3 != null) { _systemObjects3.GetCurrentSystemId(out _instance); } }
internal static IDebugSymbols GetDebugSymbols(this IntPtr debugClient) { if (_debugSymbols == null) { _debugSymbols = (IDebugSymbols)debugClient.GetIUnknown(); } return(_debugSymbols); }
public static string GetSymbolType(this IDebugSymbols symbols, ulong moduleBase, uint typeId) { StringBuilder buffer = new StringBuilder(Defaults.BufferSize); uint size; var hr = symbols.GetTypeName(moduleBase, typeId, buffer, buffer.Capacity, out size); if (hr != HResult.Ok) { return(string.Empty); } return(buffer.ToString()); }
public static string GetSymbolName(this IDebugSymbols symbols, ulong offset) { StringBuilder buffer = new StringBuilder(Defaults.BufferSize); uint size; ulong displacement; var hr = symbols.GetNameByOffset(offset, buffer, buffer.Capacity, out size, out displacement); if (hr != HResult.Ok) { return(string.Empty); } return(buffer.ToString()); }
private void CreateClient(IDebugClient client) { _client = client; _spaces = (IDebugDataSpaces)_client; _spacesPtr = (IDebugDataSpacesPtr)_client; _symbols = (IDebugSymbols)_client; _control = (IDebugControl2)_client; // These interfaces may not be present in older DbgEng dlls. _spaces2 = _client as IDebugDataSpaces2; _symbols3 = _client as IDebugSymbols3; _advanced = _client as IDebugAdvanced; _systemObjects = _client as IDebugSystemObjects; _systemObjects3 = _client as IDebugSystemObjects3; Interlocked.Increment(ref s_totalInstanceCount); if (_systemObjects3 == null && s_totalInstanceCount > 1) throw new ClrDiagnosticsException("This version of DbgEng is too old to create multiple instances of DataTarget.", ClrDiagnosticsException.HR.DebuggerError); if (_systemObjects3 != null) _systemObjects3.GetCurrentSystemId(out _instance); }