Skip to content

Commit

Permalink
[lldb-dap][NFC] Minor rename
Browse files Browse the repository at this point in the history
As a minor follow up for #97675, I'm renaming `SupportsExceptionBreakpoints` to `SupportsExceptionBreakpointsOnThrow` and adding a `SupportsExceptionBreakpointsOnCatch` to have a bit of more granularity.
  • Loading branch information
walter-erquinigo committed Jul 5, 2024
1 parent 6c1c97c commit 3bfc516
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
10 changes: 7 additions & 3 deletions lldb/include/lldb/Target/Language.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,13 @@ class Language : public PluginInterface {
return false;
}

/// Returns true if this Language supports exception breakpoints via a
/// corresponding LanguageRuntime plugin.
virtual bool SupportsExceptionBreakpoints() const { return false; }
/// Returns true if this Language supports exception breakpoints on throw via
/// a corresponding LanguageRuntime plugin.
virtual bool SupportsExceptionBreakpointsOnThrow() const { return false; }

/// Returns true if this Language supports exception breakpoints on catch via
/// a corresponding LanguageRuntime plugin.
virtual bool SupportsExceptionBreakpointsOnCatch() const { return false; }

protected:
// Classes that inherit from Language can see and modify these
Expand Down
3 changes: 2 additions & 1 deletion lldb/source/Commands/CommandObjectBreakpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
break;
default:
if (Language *languagePlugin = Language::FindPlugin(language)) {
if (languagePlugin->SupportsExceptionBreakpoints()) {
if (languagePlugin->SupportsExceptionBreakpointsOnThrow() ||
languagePlugin->SupportsExceptionBreakpointsOnCatch()) {
m_exception_language = language;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/Language/ObjC/ObjCLanguage.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class ObjCLanguage : public Language {

llvm::StringRef GetInstanceVariableName() override { return "self"; }

bool SupportsExceptionBreakpoints() const override { return true; }
bool SupportsExceptionBreakpointsOnThrow() const override { return true; }

// PluginInterface protocol
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
Expand Down

0 comments on commit 3bfc516

Please sign in to comment.