forked from qt-creator/qt-creator
debugger: more breakpoint refactoring
This commit is contained in:
@@ -746,17 +746,6 @@ void BreakHandler::loadSessionData()
|
|||||||
updateMarkers();
|
updateMarkers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BreakHandler::activateBreakpoint(int index)
|
|
||||||
{
|
|
||||||
const BreakpointData *data = at(index);
|
|
||||||
if (!data->markerFileName().isEmpty()) {
|
|
||||||
StackFrame frame;
|
|
||||||
frame.file = data->markerFileName();
|
|
||||||
frame.line = data->markerLineNumber();
|
|
||||||
m_manager->gotoLocation(frame, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void BreakHandler::breakByFunction(const QString &functionName)
|
void BreakHandler::breakByFunction(const QString &functionName)
|
||||||
{
|
{
|
||||||
// One breakpoint per function is enough for now. This does not handle
|
// One breakpoint per function is enough for now. This does not handle
|
||||||
|
|||||||
@@ -160,7 +160,6 @@ public slots:
|
|||||||
void appendBreakpoint(BreakpointData *data);
|
void appendBreakpoint(BreakpointData *data);
|
||||||
void toggleBreakpointEnabled(BreakpointData *data);
|
void toggleBreakpointEnabled(BreakpointData *data);
|
||||||
void breakByFunction(const QString &functionName);
|
void breakByFunction(const QString &functionName);
|
||||||
void activateBreakpoint(int index);
|
|
||||||
void removeBreakpoint(int index);
|
void removeBreakpoint(int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ void DebuggerManager::init()
|
|||||||
qobject_cast<QAbstractItemView *>(d->m_breakWindow);
|
qobject_cast<QAbstractItemView *>(d->m_breakWindow);
|
||||||
breakView->setModel(d->m_breakHandler->model());
|
breakView->setModel(d->m_breakHandler->model());
|
||||||
connect(breakView, SIGNAL(breakpointActivated(int)),
|
connect(breakView, SIGNAL(breakpointActivated(int)),
|
||||||
d->m_breakHandler, SLOT(activateBreakpoint(int)));
|
this, SLOT(activateBreakpoint(int)));
|
||||||
connect(breakView, SIGNAL(breakpointDeleted(int)),
|
connect(breakView, SIGNAL(breakpointDeleted(int)),
|
||||||
d->m_breakHandler, SLOT(removeBreakpoint(int)));
|
d->m_breakHandler, SLOT(removeBreakpoint(int)));
|
||||||
connect(breakView, SIGNAL(breakpointSynchronizationRequested()),
|
connect(breakView, SIGNAL(breakpointSynchronizationRequested()),
|
||||||
@@ -1336,6 +1336,17 @@ void DebuggerManager::addToWatchWindow()
|
|||||||
d->m_watchHandler->watchExpression(exp);
|
d->m_watchHandler->watchExpression(exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DebuggerManager::activateBreakpoint(int index)
|
||||||
|
{
|
||||||
|
const BreakpointData *data = breakHandler()->at(index);
|
||||||
|
if (!data->markerFileName().isEmpty()) {
|
||||||
|
StackFrame frame;
|
||||||
|
frame.file = data->markerFileName();
|
||||||
|
frame.line = data->markerLineNumber();
|
||||||
|
gotoLocation(frame, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DebuggerManager::breakByFunctionMain()
|
void DebuggerManager::breakByFunctionMain()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
|||||||
@@ -259,6 +259,7 @@ public slots: // FIXME
|
|||||||
{ showDebuggerOutput(LogDebug, msg); }
|
{ showDebuggerOutput(LogDebug, msg); }
|
||||||
void ensureLogVisible();
|
void ensureLogVisible();
|
||||||
void updateWatchersWindow();
|
void updateWatchersWindow();
|
||||||
|
void activateBreakpoint(int index);
|
||||||
|
|
||||||
//private slots: // FIXME
|
//private slots: // FIXME
|
||||||
void showDebuggerOutput(int channel, const QString &msg);
|
void showDebuggerOutput(int channel, const QString &msg);
|
||||||
|
|||||||
@@ -1174,11 +1174,11 @@ void DebuggerPlugin::requestContextMenu(TextEditor::ITextEditor *editor,
|
|||||||
|
|
||||||
void DebuggerPlugin::breakpointSetRemoveMarginActionTriggered()
|
void DebuggerPlugin::breakpointSetRemoveMarginActionTriggered()
|
||||||
{
|
{
|
||||||
if (QAction *act = qobject_cast<QAction *>(sender())) {
|
QAction *act = qobject_cast<QAction *>(sender());
|
||||||
|
QTC_ASSERT(act, return);
|
||||||
QString str = act->data().toString();
|
QString str = act->data().toString();
|
||||||
int pos = str.lastIndexOf(':');
|
int pos = str.lastIndexOf(':');
|
||||||
m_manager->toggleBreakpoint(str.left(pos), str.mid(pos + 1).toInt());
|
m_manager->toggleBreakpoint(str.left(pos), str.mid(pos + 1).toInt());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerPlugin::breakpointEnableDisableMarginActionTriggered()
|
void DebuggerPlugin::breakpointEnableDisableMarginActionTriggered()
|
||||||
|
|||||||
Reference in New Issue
Block a user