mirror of
https://github.com/intel/llvm.git
synced 2026-01-22 23:49:22 +08:00
[lldb] Support specifying a language for breakpoint conditions (#147603)
LLDB breakpoint conditions take an expression that's evaluated using the language of the code where the breakpoint is located. Users have asked to have an option to tell it to evaluate the expression in a specific language. This is feature is especially helpful for Swift, for example for a condition based on the value in memory at an offset from a register. Such a condition is pretty difficult to write in Swift, but easy in C. This PR adds a new argument (-Y) to specify the language of the condition expression. We can't reuse the current -L option, since you might want to break on only Swift symbols, but run a C expression there as per the example above. rdar://146119507
This commit is contained in:
committed by
GitHub
parent
4859b92b7f
commit
f28a497a06
@@ -440,13 +440,13 @@ const char *Breakpoint::GetQueueName() const {
|
||||
return m_options.GetThreadSpecNoCreate()->GetQueueName();
|
||||
}
|
||||
|
||||
void Breakpoint::SetCondition(const char *condition) {
|
||||
m_options.SetCondition(condition);
|
||||
void Breakpoint::SetCondition(StopCondition condition) {
|
||||
m_options.SetCondition(std::move(condition));
|
||||
SendBreakpointChangedEvent(eBreakpointEventTypeConditionChanged);
|
||||
}
|
||||
|
||||
const char *Breakpoint::GetConditionText() const {
|
||||
return m_options.GetConditionText();
|
||||
const StopCondition &Breakpoint::GetCondition() const {
|
||||
return m_options.GetCondition();
|
||||
}
|
||||
|
||||
// This function is used when "baton" doesn't need to be freed
|
||||
|
||||
Reference in New Issue
Block a user