예제 #1
0
 public int GetSymbolSearchInfo(out IDebugModule3 pModule, ref string pbstrDebugMessage, enum_MODULE_INFO_FLAGS[] pdwModuleInfoFlags)
 {
     pModule               = module;
     pbstrDebugMessage     = message;
     pdwModuleInfoFlags[0] = flags;
     return(VSConstants.S_OK);
 }
예제 #2
0
        int IDebugSymbolSearchEvent2.GetSymbolSearchInfo(out IDebugModule3 pModule, ref string pbstrDebugMessage, enum_MODULE_INFO_FLAGS[] pdwModuleInfoFlags)
        {
            pModule               = _module;
            pbstrDebugMessage     = _searchInfo;
            pdwModuleInfoFlags[0] = _symbolFlags;

            return(Constants.S_OK);
        }
예제 #3
0
        /// <summary>
        /// Called by an event handler to retrieve results about a symbol load process.
        /// </summary>
        /// <param name="pModule">An IDebugModule3 object representing the module for which the symbols were loaded.</param>
        /// <param name="pbstrDebugMessage">Returns a string containing any error messages from the module. If there is no error, then this string will just contain the module's name but it is never empty.</param>
        /// <param name="pdwModuleInfoFlags">A combination of flags from the MODULE_INFO_FLAGS enumeration indicating whether any symbols were loaded.</param>
        /// <returns>If successful, returns S_OK; otherwise returns an error code.</returns>
        /// <remarks>When a handler receives the IDebugSymbolSearchEvent2 event after an attempt is made to load debugging symbols for a module, the handler can call this method to determine the results of that load.</remarks>
        public virtual int GetSymbolSearchInfo( out IDebugModule3 pModule,
            ref string pbstrDebugMessage,
            enum_MODULE_INFO_FLAGS[] pdwModuleInfoFlags)
        {
            pModule = Module;
            pbstrDebugMessage = DebugMessage;
            pdwModuleInfoFlags[0] = ModuleInfoFlags;

            return VSConstants.S_OK;
        }
예제 #4
0
 public DebugSymbolSearchEvent(IDebugModule3 module, string moduleName, string errorMessage,
                               bool loaded)
     : base((uint)enum_EVENTATTRIBUTES.EVENT_ASYNCHRONOUS,
            new Guid("2A064CA8-D657-4CC8-B11B-F545BFC3FDD3"))
 {
     _module       = module;
     _moduleName   = moduleName;
     _errorMessage = errorMessage;
     _loaded       = loaded;
 }
예제 #5
0
        public DebugSymbolSearchEvent(enum_EVENTATTRIBUTES attributes, IDebugModule3 module, string debugMessage, enum_MODULE_INFO_FLAGS moduleInfoFlags)
            : base(attributes)
        {
            Contract.Requires<ArgumentNullException>(module != null, "module");
            Contract.Requires<ArgumentNullException>(debugMessage != null, "debugMessage");
            Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(debugMessage));

            _module = module;
            _debugMessage = debugMessage;
            _moduleInfoFlags = moduleInfoFlags;
        }
        public DebugSymbolSearchEvent(enum_EVENTATTRIBUTES attributes, IDebugModule3 module, string debugMessage, enum_MODULE_INFO_FLAGS moduleInfoFlags)
            : base(attributes)
        {
            Contract.Requires <ArgumentNullException>(module != null, "module");
            Contract.Requires <ArgumentNullException>(debugMessage != null, "debugMessage");
            Contract.Requires <ArgumentException>(!string.IsNullOrEmpty(debugMessage));

            _module          = module;
            _debugMessage    = debugMessage;
            _moduleInfoFlags = moduleInfoFlags;
        }
예제 #7
0
        public int GetSymbolSearchInfo(out IDebugModule3 pModule, ref string pbstrDebugMessage, enum_MODULE_INFO_FLAGS[] pdwModuleInfoFlags)
        {
            if (pdwModuleInfoFlags == null)
                throw new ArgumentNullException("pdwModuleInfoFlags");
            if (pdwModuleInfoFlags.Length < 1)
                throw new ArgumentException();

            pModule = _module;
            pbstrDebugMessage = _debugMessage;
            pdwModuleInfoFlags[0] = _moduleInfoFlags;
            return VSConstants.S_OK;
        }
        public int GetSymbolSearchInfo(out IDebugModule3 pModule, ref string pbstrDebugMessage, enum_MODULE_INFO_FLAGS[] pdwModuleInfoFlags)
        {
            if (pdwModuleInfoFlags == null)
            {
                throw new ArgumentNullException("pdwModuleInfoFlags");
            }
            if (pdwModuleInfoFlags.Length < 1)
            {
                throw new ArgumentException();
            }

            pModule               = _module;
            pbstrDebugMessage     = _debugMessage;
            pdwModuleInfoFlags[0] = _moduleInfoFlags;
            return(VSConstants.S_OK);
        }
예제 #9
0
        // Haven't seen this method being actually invoked, VS asks IDebugModule3 directly.
        public int GetSymbolSearchInfo(out IDebugModule3 pModule, ref string pbstrDebugMessage,
                                       enum_MODULE_INFO_FLAGS[] pdwModuleInfoFlags)
        {
            pModule = _module;

            // From documentation: Returns a string containing any error messages from the
            // module. If there is no error, then this string will just contain the module's
            // name but it is never empty.
            // https://docs.microsoft.com/en-us/visualstudio/extensibility/debugger/reference/idebugsymbolsearchevent2-getsymbolsearchinfo?view=vs-2019
            pbstrDebugMessage = _errorMessage ?? _moduleName;

            if (pdwModuleInfoFlags.Length > 0)
            {
                pdwModuleInfoFlags[0] = _loaded ? enum_MODULE_INFO_FLAGS.MIF_SYMBOLS_LOADED : 0;
            }

            return(VSConstants.S_OK);
        }
예제 #10
0
        public void SetUp()
        {
            _mockCancelableTaskFactory = Substitute.For <CancelableTask.Factory>();
            _mockModuleUtil            = Substitute.For <ILldbModuleUtil>();
            _mockModuleUtil.HasSymbolsLoaded(Arg.Any <SbModule>()).Returns(false);
            _mockModuleFileLoader      = Substitute.For <IModuleFileLoader>();
            _mockModuleSearchLogHolder = Substitute.For <IModuleSearchLogHolder>();
            _mockModule         = Substitute.For <SbModule>();
            _mockActionRecorder = Substitute.For <ActionRecorder>(null, null);
            var mockModuleFileLoadRecorderFactory =
                Substitute.For <ModuleFileLoadMetricsRecorder.Factory>();

            _mockEngineHandler          = Substitute.For <IDebugEngineHandler>();
            _mockDebugProgram           = Substitute.For <IGgpDebugProgram>();
            _mockSymbolSettingsProvider = Substitute.For <ISymbolSettingsProvider>();
            _debugModule =
                new DebugModule
                .Factory(_mockCancelableTaskFactory, _mockActionRecorder,
                         mockModuleFileLoadRecorderFactory, _mockModuleUtil,
                         _mockSymbolSettingsProvider)
                .Create(_mockModuleFileLoader, _mockModuleSearchLogHolder, _mockModule,
                        _testLoadOrder, _mockEngineHandler, _mockDebugProgram);
        }
예제 #11
0
        int IDebugSymbolSearchEvent2.GetSymbolSearchInfo(out IDebugModule3 pModule, ref string pbstrDebugMessage, enum_MODULE_INFO_FLAGS[] pdwModuleInfoFlags)
        {
            pModule = _module;
            pbstrDebugMessage = _searchInfo;
            pdwModuleInfoFlags[0] = _symbolFlags;

            return Constants.S_OK;
        }
예제 #12
0
      int IDebugSymbolSearchEvent2.GetSymbolSearchInfo (out IDebugModule3 pModule, ref string pbstrDebugMessage, enum_MODULE_INFO_FLAGS [] pdwModuleInfoFlags)
      {
        LoggingUtils.PrintFunction ();

        pModule = m_debugModule;

        pbstrDebugMessage = m_searchInfo;

        pdwModuleInfoFlags [0] = enum_MODULE_INFO_FLAGS.MIF_SYMBOLS_LOADED;

        return Constants.S_OK;
      }
예제 #13
0
      public SymbolSearch (IDebugModule3 debugModule, string searchInfo)
      {
        m_debugModule = debugModule;

        m_searchInfo = searchInfo;
      }
예제 #14
0
      public SymbolSearch (IDebugModule3 debugModule, string searchInfo)
      {
        m_debugModule = debugModule;

        m_searchInfo = searchInfo;

        m_symbolFlags = enum_MODULE_INFO_FLAGS.MIF_SYMBOLS_LOADED;
      }
예제 #15
0
 /// <summary>
 /// Send a symbols loaded event.
 /// </summary>
 public static void OnSymbolsLoaded(this IDebugEngineHandler handler, IDebugModule3 module,
                                    string moduleName, string errorMessage, bool loaded,
                                    IGgpDebugProgram program) =>
 handler.SendEvent(new DebugSymbolSearchEvent(module, moduleName, errorMessage, loaded),
                   program);