Reapply PR/87550 (#94625)

Re-apply https://github.com/llvm/llvm-project/pull/87550 with fixes.

Details:
Some tests in fuchsia failed because of the newly added assertion.
This was because `GetExceptionBreakpoint()` could be called before
`g_dap.debugger` was initted.

The fix here is to just lazily populate the list in
GetExceptionBreakpoint() rather than assuming it's already been initted.
(There is some nuisance here because we can't simply just populate it in
DAP::DAP(), which is a global ctor and is called before
`SBDebugger::Initialize()` is called. )
This commit is contained in:
Vy Nguyen
2024-06-07 11:27:52 -04:00
committed by GitHub
parent e9adcc488f
commit 35fa2ded2a
7 changed files with 77 additions and 13 deletions

View File

@@ -1742,3 +1742,7 @@ bool SBDebugger::InterruptRequested() {
return m_opaque_sp->InterruptRequested();
return false;
}
bool SBDebugger::SupportsLanguage(lldb::LanguageType language) {
return TypeSystem::SupportsLanguageStatic(language);
}

View File

@@ -335,3 +335,14 @@ TypeSystemMap::GetTypeSystemForLanguage(lldb::LanguageType language,
}
return GetTypeSystemForLanguage(language);
}
bool TypeSystem::SupportsLanguageStatic(lldb::LanguageType language) {
if (language == eLanguageTypeUnknown)
return false;
LanguageSet languages =
PluginManager::GetAllTypeSystemSupportedLanguagesForTypes();
if (languages.Empty())
return false;
return languages[language];
}