Example #1
0
 public static SymbolHandler CreateFromHandle(IntPtr handle, SymbolOptions options = SymbolOptions.None, string searchPath = null)
 {
     if (searchPath == null)
     {
         searchPath = GetDefaultSearchPath();
     }
     Win32.SymSetOptions(options);
     Win32.SymInitialize(handle, searchPath, true).ThrowIfWin32Failed();
     return(new SymbolHandler(handle, false));
 }
Example #2
0
        public static SymbolHandler TryCreateFromProcess(int pid, SymbolOptions options = SymbolOptions.None, string searchPath = null)
        {
            if (searchPath == null)
            {
                searchPath = GetDefaultSearchPath();
            }
            var handle = new IntPtr(pid);

            if (Win32.SymInitialize(handle, searchPath, true))
            {
                return(new SymbolHandler(handle, false));
            }
            return(null);
        }
Example #3
0
        public static SymbolHandler CreateFromProcess(int pid, SymbolOptions options = SymbolOptions.None, string searchPath = null)
        {
            if (searchPath == null)
            {
                searchPath = GetDefaultSearchPath();
            }
            var handle = new IntPtr(pid);

            if (Win32.SymInitialize(handle, searchPath, true))
            {
                return(new SymbolHandler(handle, false));
            }
            throw new Win32Exception(Marshal.GetLastWin32Error());
        }
Example #4
0
        public static SymbolHandler Create(SymbolOptions options = SymbolOptions.CaseInsensitive | SymbolOptions.UndecorateNames, string searchPath = null)
        {
            if (Debugger.IsAttached)
            {
                options |= SymbolOptions.Debug;
            }

            if (searchPath == null)
            {
                searchPath = GetDefaultSearchPath();
            }
            Win32.SymSetOptions(options);
            var handle = new IntPtr(++_instances);

            Win32.SymInitialize(handle, searchPath, false).ThrowIfWin32Failed();
            return(new SymbolHandler(handle, false));
        }