Make the Language print the description of the Exception Breakpoint resolver. Also

have the breakpoint description print the precondition description if one exists.
No behavior change.

<rdar://problem/22885189>

llvm-svn: 255972
This commit is contained in:
Jim Ingham
2015-12-18 02:14:04 +00:00
parent a6b96004b5
commit a202357197
7 changed files with 32 additions and 8 deletions

View File

@@ -163,7 +163,7 @@ public:
ConfigurePrecondition(Args &options);
virtual void
DescribePrecondition(Stream &stream, lldb::DescriptionLevel level);
GetDescription(Stream &stream, lldb::DescriptionLevel level);
};
typedef std::shared_ptr<BreakpointPrecondition> BreakpointPreconditionSP;

View File

@@ -146,6 +146,12 @@ public:
FunctionNameRepresentation representation,
Stream& s);
virtual void
GetExceptionResolverDescription(bool catch_on, bool throw_on, Stream &s);
static void
GetDefaultExceptionResolverDescription(bool catch_on, bool throw_on, Stream &s);
// These are accessors for general information about the Languages lldb knows about:
static lldb::LanguageType

View File

@@ -204,7 +204,7 @@ public:
~ObjCExceptionPrecondition() override = default;
bool EvaluatePrecondition(StoppointCallbackContext &context) override;
void DescribePrecondition(Stream &stream, lldb::DescriptionLevel level) override;
void GetDescription(Stream &stream, lldb::DescriptionLevel level) override;
Error ConfigurePrecondition(Args &args) override;
protected:

View File

@@ -844,6 +844,9 @@ Breakpoint::GetDescription (Stream *s, lldb::DescriptionLevel level, bool show_l
GetOptions()->GetDescription(s, level);
if (m_precondition_sp)
m_precondition_sp->GetDescription(*s, level);
if (level == lldb::eDescriptionLevelFull)
{
if (!m_name_list.empty())
@@ -959,7 +962,7 @@ Breakpoint::BreakpointPrecondition::EvaluatePrecondition(StoppointCallbackContex
}
void
Breakpoint::BreakpointPrecondition::DescribePrecondition(Stream &stream, lldb::DescriptionLevel level)
Breakpoint::BreakpointPrecondition::GetDescription(Stream &stream, lldb::DescriptionLevel level)
{
}

View File

@@ -430,6 +430,19 @@ Language::GetFunctionDisplayName (const SymbolContext *sc,
return false;
}
void
Language::GetExceptionResolverDescription(bool catch_on, bool throw_on, Stream &s)
{
GetDefaultExceptionResolverDescription(catch_on, throw_on, s);
}
void
Language::GetDefaultExceptionResolverDescription(bool catch_on, bool throw_on, Stream &s)
{
s.Printf ("Exception breakpoint (catch: %s throw: %s)",
catch_on ? "on" : "off",
throw_on ? "on" : "off");
}
//----------------------------------------------------------------------
// Constructor
//----------------------------------------------------------------------

View File

@@ -163,10 +163,12 @@ public:
void
GetDescription (Stream *s) override
{
s->Printf ("Exception breakpoint (catch: %s throw: %s)",
m_catch_bp ? "on" : "off",
m_throw_bp ? "on" : "off");
Language *language_plugin = Language::FindPlugin(m_language);
if (language_plugin)
language_plugin->GetExceptionResolverDescription(m_catch_bp, m_throw_bp, *s);
else
Language::GetDefaultExceptionResolverDescription(m_catch_bp, m_throw_bp, *s);
SetActualResolver();
if (m_actual_resolver_sp)
{

View File

@@ -426,7 +426,7 @@ ObjCLanguageRuntime::ObjCExceptionPrecondition::EvaluatePrecondition(StoppointCa
}
void
ObjCLanguageRuntime::ObjCExceptionPrecondition::DescribePrecondition(Stream &stream, lldb::DescriptionLevel level)
ObjCLanguageRuntime::ObjCExceptionPrecondition::GetDescription(Stream &stream, lldb::DescriptionLevel level)
{
}