[Lldb-commits] [lldb] [lldb-dap] Support throw and catch exception breakpoints for dynamica… (PR #97871)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 8 12:41:44 PDT 2024


================
@@ -26,3 +26,43 @@ SBLanguageRuntime::GetNameForLanguageType(lldb::LanguageType language) {
 
   return Language::GetNameForLanguageType(language);
 }
+
+bool SBLanguageRuntime::LanguageIsCPlusPlus(lldb::LanguageType language) {
+  return Language::LanguageIsCPlusPlus(language);
+}
+
+bool SBLanguageRuntime::LanguageIsObjC(lldb::LanguageType language) {
+  return Language::LanguageIsObjC(language);
+}
+
+bool SBLanguageRuntime::LanguageIsCFamily(lldb::LanguageType language) {
+  return Language::LanguageIsCFamily(language);
+}
+
+bool SBLanguageRuntime::SupportsExceptionBreakpointsOnThrow(
+    lldb::LanguageType language) {
+  if (Language *lang_plugin = Language::FindPlugin(language))
+    return lang_plugin->SupportsExceptionBreakpointsOnThrow();
+  return false;
+}
+
+bool SBLanguageRuntime::SupportsExceptionBreakpointsOnCatch(
+    lldb::LanguageType language) {
+  if (Language *lang_plugin = Language::FindPlugin(language))
+    return lang_plugin->SupportsExceptionBreakpointsOnCatch();
+  return false;
+}
+
+const char *
+SBLanguageRuntime::GetThrowKeywordForLanguage(lldb::LanguageType language) {
+  if (Language *lang_plugin = Language::FindPlugin(language))
+    return lang_plugin->GetThrowKeyword().data();
----------------
bulbazord wrote:

You should wrap these in `ConstString`. It is not safe in general for LLDB to pass out `const char *` values that are derived from `llvm::StringRef`. I know that `GetThrowKeyword` and `GetCatchKeyword` are passing out static c-strings wrapped in a `llvm::StringRef`, but those are virtual and plugins may not do the same.

https://github.com/llvm/llvm-project/pull/97871


More information about the lldb-commits mailing list