Commit a795c693 authored by hjk's avatar hjk
Browse files

debugger: more breakpoint refactoring

parent b0577392
......@@ -746,17 +746,6 @@ void BreakHandler::loadSessionData()
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)
{
// One breakpoint per function is enough for now. This does not handle
......
......@@ -160,7 +160,6 @@ public slots:
void appendBreakpoint(BreakpointData *data);
void toggleBreakpointEnabled(BreakpointData *data);
void breakByFunction(const QString &functionName);
void activateBreakpoint(int index);
void removeBreakpoint(int index);
private:
......
......@@ -419,7 +419,7 @@ void DebuggerManager::init()
qobject_cast<QAbstractItemView *>(d->m_breakWindow);
breakView->setModel(d->m_breakHandler->model());
connect(breakView, SIGNAL(breakpointActivated(int)),
d->m_breakHandler, SLOT(activateBreakpoint(int)));
this, SLOT(activateBreakpoint(int)));
connect(breakView, SIGNAL(breakpointDeleted(int)),
d->m_breakHandler, SLOT(removeBreakpoint(int)));
connect(breakView, SIGNAL(breakpointSynchronizationRequested()),
......@@ -1336,6 +1336,17 @@ void DebuggerManager::addToWatchWindow()
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()
{
#ifdef Q_OS_WIN
......
......@@ -259,6 +259,7 @@ public slots: // FIXME
{ showDebuggerOutput(LogDebug, msg); }
void ensureLogVisible();
void updateWatchersWindow();
void activateBreakpoint(int index);
//private slots: // FIXME
void showDebuggerOutput(int channel, const QString &msg);
......
......@@ -1174,11 +1174,11 @@ void DebuggerPlugin::requestContextMenu(TextEditor::ITextEditor *editor,
void DebuggerPlugin::breakpointSetRemoveMarginActionTriggered()
{
if (QAction *act = qobject_cast<QAction *>(sender())) {
QString str = act->data().toString();
int pos = str.lastIndexOf(':');
m_manager->toggleBreakpoint(str.left(pos), str.mid(pos + 1).toInt());
}
QAction *act = qobject_cast<QAction *>(sender());
QTC_ASSERT(act, return);
QString str = act->data().toString();
int pos = str.lastIndexOf(':');
m_manager->toggleBreakpoint(str.left(pos), str.mid(pos + 1).toInt());
}
void DebuggerPlugin::breakpointEnableDisableMarginActionTriggered()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment