debugger: more breakpoint refactoring

This commit is contained in:
hjk
2010-04-09 16:10:06 +02:00
parent b05773923f
commit a795c69325
5 changed files with 18 additions and 18 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -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);

View File

@@ -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()