forked from qt-creator/qt-creator
Debugger: Fix enabling breakpoints on click
Calling `BreakpointItem::setEnabled` from `BreakpointMarker::clicked` is
wrong and dangerous. It never actually enables a global breakpoint,
just updates the marker. While doing so, it calls
`BreakpointItem::adjustMarker`, which in turn calls
`BreakpointItem::destroyMarker`, which destroys the original marker,
hence the dangerous part.
What we actually want is simply enable the corresponding global
breakpoint instead.
Amends 8f3a0ebabb
.
Change-Id: I423752be4e4f51198e9e2968a978b57bce43a3ec
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -120,10 +120,14 @@ public:
|
||||
void clicked() final
|
||||
{
|
||||
QTC_ASSERT(m_bp, return);
|
||||
if (!m_bp->isEnabled())
|
||||
m_bp->setEnabled(true);
|
||||
else
|
||||
|
||||
if (m_bp->isEnabled()) {
|
||||
m_bp->deleteGlobalOrThisBreakpoint();
|
||||
return;
|
||||
}
|
||||
|
||||
if (const GlobalBreakpoint gbp = m_bp->globalBreakpoint())
|
||||
gbp->setEnabled(true);
|
||||
}
|
||||
|
||||
public:
|
||||
|
Reference in New Issue
Block a user