#include "debuggeractions.h"
#include "debuggermanager.h"
+#include "stackhandler.h"
#include "ui_breakcondition.h"
#include "ui_breakbyfunction.h"
new QAction(tr("Edit Breakpoint..."), &menu);
editBreakpointAction->setEnabled(si.size() > 0);
+ int threadId = m_manager->threadsHandler()->currentThreadId();
+ QString associateTitle = threadId == -1
+ ? tr("Associate Breakpoint With All Threads")
+ : tr("Associate Breakpoint With Thread %1").arg(threadId);
+ QAction *associateBreakpointAction = new QAction(associateTitle, &menu);
+ associateBreakpointAction->setEnabled(si.size() > 0);
+
QAction *synchronizeAction =
new QAction(tr("Synchronize Breakpoints"), &menu);
synchronizeAction->setEnabled(
menu.addAction(deleteAction);
menu.addAction(editBreakpointAction);
+ menu.addAction(associateBreakpointAction);
menu.addAction(toggleEnabledAction);
menu.addAction(pathAction);
menu.addSeparator();
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
else if (act == editBreakpointAction)
editBreakpoint(si);
+ else if (act == associateBreakpointAction)
+ associateBreakpoint(si, threadId);
else if (act == synchronizeAction)
emit breakpointSynchronizationRequested();
else if (act == toggleEnabledAction)
emit breakpointSynchronizationRequested();
}
+void BreakWindow::associateBreakpoint(const QModelIndexList &list, int threadId)
+{
+ QString str;
+ if (threadId != -1)
+ str = QString::number(threadId);
+ foreach (const QModelIndex &idx, list)
+ model()->setData(idx.sibling(idx.row(), 6), str);
+ emit breakpointSynchronizationRequested();
+}
+
void BreakWindow::resizeColumnsToContents()
{
for (int i = model()->columnCount(); --i >= 0; )
void deleteBreakpoints(const QModelIndexList &list);
void deleteBreakpoints(QList<int> rows);
void editBreakpoint(const QModelIndexList &list);
+ void associateBreakpoint(const QModelIndexList &list, int thread);
void setBreakpointsEnabled(const QModelIndexList &list, bool enabled);
void setBreakpointsFullPath(const QModelIndexList &list, bool fullpath);
void operateByInstructionTriggered();
void startFailed();
-private:
+public:
Internal::ModulesHandler *modulesHandler() const;
Internal::BreakHandler *breakHandler() const;
Internal::RegisterHandler *registerHandler() const;
Internal::ThreadsHandler *threadsHandler() const;
Internal::WatchHandler *watchHandler() const;
Internal::SnapshotHandler *snapshotHandler() const;
+
+private:
Internal::SourceFilesWindow *sourceFileWindow() const;
QWidget *threadsWindow() const;
data->bpEnabled = false;
continue;
}
- if (data->threadSpec != data->bpThreadSpec && !data->bpThreadSpec.isEmpty()) {
+ if (data->threadSpec != data->bpThreadSpec && !data->bpNumber.isEmpty()) {
// The only way to change this seems to be to re-set the bp completely.
//qDebug() << "FIXME: THREAD: " << data->threadSpec << data->bpThreadSpec;
- //data->bpThreadSpec = data->threadSpec;
- if (!data->bpNumber.isEmpty()) {
- postCommand("-break-delete " + data->bpNumber,
- NeedsStop | RebuildBreakpointModel);
- sendInsertBreakpoint(index);
- }
+ data->bpThreadSpec.clear();
+ postCommand("-break-delete " + data->bpNumber,
+ NeedsStop | RebuildBreakpointModel);
+ sendInsertBreakpoint(index);
continue;
}
if (data->bpAddress.startsWith("0x")