Example #1
0
        public int GetSymbolInfo(enum_SYMBOL_SEARCH_INFO_FIELDS fields,
                                 MODULE_SYMBOL_SEARCH_INFO[] searchInfo)
        {
            var info = new MODULE_SYMBOL_SEARCH_INFO();

            if ((enum_SYMBOL_SEARCH_INFO_FIELDS.SSIF_VERBOSE_SEARCH_INFO & fields) != 0)
            {
                string log = _moduleSearchLogHolder.GetSearchLog(_lldbModule);
                if (string.IsNullOrEmpty(log))
                {
                    if (_moduleUtil.HasSymbolsLoaded(_lldbModule))
                    {
                        log = "Symbols for this module were automatically located by LLDB.";
                    }
                    else if (!_symbolSettingsProvider.IsSymbolServerEnabled)
                    {
                        log = "Symbols are not loaded automatically because symbol server " +
                              "support is disabled." + Environment.NewLine +
                              "Please enable symbol server support in Stadia SDK settings " +
                              "to load symbols automatically when the debug session is started." +
                              Environment.NewLine +
                              "Note that this may slow down your debug session startup.";
                    }
                }

                info.bstrVerboseSearchInfo = log;
                info.dwValidFields        |=
                    (uint)enum_SYMBOL_SEARCH_INFO_FIELDS.SSIF_VERBOSE_SEARCH_INFO;
            }

            searchInfo[0] = info;
            return(VSConstants.S_OK);
        }
        public void GetSymbolInfo()
        {
            string testSearchLog = @"C:\path\test.debug... File found.";

            _mockModuleSearchLogHolder.GetSearchLog(_mockModule).Returns(testSearchLog);
            var flags            = enum_SYMBOL_SEARCH_INFO_FIELDS.SSIF_VERBOSE_SEARCH_INFO;
            var symbolSearchInfo = new MODULE_SYMBOL_SEARCH_INFO[1];

            Assert.Multiple(() =>
            {
                Assert.That(_debugModule.GetSymbolInfo(flags, symbolSearchInfo),
                            Is.EqualTo(VSConstants.S_OK));
                Assert.That((enum_SYMBOL_SEARCH_INFO_FIELDS)symbolSearchInfo[0].dwValidFields,
                            Is.EqualTo(flags));
                Assert.That(symbolSearchInfo[0].bstrVerboseSearchInfo, Is.EqualTo(testSearchLog));
            });
        }