Example #1
0
        public void LoadExe(string imageFile)
        {
            int    hr;
            var    searchPath = Environment.ExpandEnvironmentVariables(@"%localappdata%\Temp\SymbolCache");
            string globalName;

            hr = dataSource.loadDataForExe(imageFile, searchPath, null);

            if (hr != VSConstants.S_OK)
            {
                Marshal.ThrowExceptionForHR(hr);
            }

            hr = dataSource.openSession(out session);

            if (hr != VSConstants.S_OK)
            {
                Marshal.ThrowExceptionForHR(hr);
            }

            hr = session.get_globalScope(out globalScope);

            if (hr != VSConstants.S_OK)
            {
                Marshal.ThrowExceptionForHR(hr);
            }

            hr = globalScope.get_name(out globalName);

            if (hr != VSConstants.S_OK)
            {
                Marshal.ThrowExceptionForHR(hr);
            }

            this.GlobalName  = globalName;
            this.GlobalScope = new DiaSymbol(globalScope);
        }
Example #2
0
        public void LoadPdb(string pdbFile)
        {
            int    hr;
            string globalName;

            hr = dataSource.loadDataFromPdb(pdbFile);

            if (hr != VSConstants.S_OK)
            {
                Marshal.ThrowExceptionForHR(hr);
            }

            hr = dataSource.openSession(out session);

            if (hr != VSConstants.S_OK)
            {
                Marshal.ThrowExceptionForHR(hr);
            }

            hr = session.get_globalScope(out globalScope);

            if (hr != VSConstants.S_OK)
            {
                Marshal.ThrowExceptionForHR(hr);
            }

            hr = globalScope.get_name(out globalName);

            if (hr != VSConstants.S_OK)
            {
                Marshal.ThrowExceptionForHR(hr);
            }

            this.GlobalName  = globalName;
            this.GlobalScope = new DiaSymbol(globalScope);
        }