forked from qt-creator/qt-creator
debugger: re-enable functions and cleanup after breakhandler move
This commit is contained in:
@@ -353,29 +353,28 @@ void DebuggerEnginePrivate::handleContextMenuRequest(const QVariant ¶meters)
|
|||||||
{
|
{
|
||||||
const QList<QVariant> list = parameters.toList();
|
const QList<QVariant> list = parameters.toList();
|
||||||
QTC_ASSERT(list.size() == 3, qDebug() << list; return);
|
QTC_ASSERT(list.size() == 3, qDebug() << list; return);
|
||||||
// TextEditor::ITextEditor *editor =
|
TextEditor::ITextEditor *editor =
|
||||||
// (TextEditor::ITextEditor *)(list.at(0).value<quint64>());
|
(TextEditor::ITextEditor *)(list.at(0).value<quint64>());
|
||||||
int lineNumber = list.at(1).toInt();
|
int lineNumber = list.at(1).toInt();
|
||||||
QMenu *menu = (QMenu *)(list.at(2).value<quint64>());
|
QMenu *menu = (QMenu *)(list.at(2).value<quint64>());
|
||||||
|
|
||||||
BreakpointData *data = 0;
|
BreakpointData *data = 0;
|
||||||
QString fileName;
|
QString fileName;
|
||||||
quint64 address = 0;
|
quint64 address = 0;
|
||||||
/*
|
|
||||||
FIXME:
|
|
||||||
if (editor->property("DisassemblerView").toBool()) {
|
if (editor->property("DisassemblerView").toBool()) {
|
||||||
fileName = editor->file()->fileName();
|
fileName = editor->file()->fileName();
|
||||||
QString line = editor->contents()
|
QString line = editor->contents()
|
||||||
.section('\n', lineNumber - 1, lineNumber - 1);
|
.section('\n', lineNumber - 1, lineNumber - 1);
|
||||||
BreakpointData needle;
|
BreakpointData needle;
|
||||||
address = needle.address = DisassemblerViewAgent::addressFromDisassemblyLine(line);
|
address = DisassemblerViewAgent::addressFromDisassemblyLine(line);
|
||||||
|
needle.address = address;
|
||||||
needle.bpLineNumber = -1;
|
needle.bpLineNumber = -1;
|
||||||
data = m_breakHandler.findSimilarBreakpoint(&needle);
|
data = m_engine->breakHandler()->findSimilarBreakpoint(&needle);
|
||||||
} else {
|
} else {
|
||||||
fileName = editor->file()->fileName();
|
fileName = editor->file()->fileName();
|
||||||
data = m_breakHandler.findBreakpoint(fileName, lineNumber);
|
data = m_engine->breakHandler()->findBreakpoint(fileName, lineNumber);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
QList<QVariant> args;
|
QList<QVariant> args;
|
||||||
args.append(fileName);
|
args.append(fileName);
|
||||||
@@ -392,7 +391,7 @@ FIXME:
|
|||||||
act = new QAction(tr("Remove Breakpoint %1").arg(number), menu);
|
act = new QAction(tr("Remove Breakpoint %1").arg(number), menu);
|
||||||
act->setData(args);
|
act->setData(args);
|
||||||
connect(act, SIGNAL(triggered()),
|
connect(act, SIGNAL(triggered()),
|
||||||
this, SLOT(breakpointSetRemoveMarginActionTriggered()));
|
SLOT(breakpointSetRemoveMarginActionTriggered()));
|
||||||
menu->addAction(act);
|
menu->addAction(act);
|
||||||
|
|
||||||
QAction *act2;
|
QAction *act2;
|
||||||
@@ -415,7 +414,7 @@ FIXME:
|
|||||||
editAction = new QAction(tr("Edit Breakpoint..."), menu);
|
editAction = new QAction(tr("Edit Breakpoint..."), menu);
|
||||||
else
|
else
|
||||||
editAction = new QAction(tr("Edit Breakpoint %1...").arg(number), menu);
|
editAction = new QAction(tr("Edit Breakpoint %1...").arg(number), menu);
|
||||||
connect(editAction, SIGNAL(triggered()), this, SLOT(slotEditBreakpoint()));
|
connect(editAction, SIGNAL(triggered()), SLOT(slotEditBreakpoint()));
|
||||||
editAction->setData(qVariantFromValue(data));
|
editAction->setData(qVariantFromValue(data));
|
||||||
menu->addAction(editAction);
|
menu->addAction(editAction);
|
||||||
} else {
|
} else {
|
||||||
@@ -426,7 +425,7 @@ FIXME:
|
|||||||
QAction *act = new QAction(text, menu);
|
QAction *act = new QAction(text, menu);
|
||||||
act->setData(args);
|
act->setData(args);
|
||||||
connect(act, SIGNAL(triggered()),
|
connect(act, SIGNAL(triggered()),
|
||||||
this, SLOT(breakpointSetRemoveMarginActionTriggered()));
|
SLOT(breakpointSetRemoveMarginActionTriggered()));
|
||||||
menu->addAction(act);
|
menu->addAction(act);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -825,8 +825,6 @@ bool WatchModel::setData(const QModelIndex &index, const QVariant &value, int ro
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
FIXME BP:
|
|
||||||
case RequestToggleWatchRole: {
|
case RequestToggleWatchRole: {
|
||||||
BreakHandler *handler = engine()->breakHandler();
|
BreakHandler *handler = engine()->breakHandler();
|
||||||
const quint64 address = value.toULongLong();
|
const quint64 address = value.toULongLong();
|
||||||
@@ -842,7 +840,6 @@ bool WatchModel::setData(const QModelIndex &index, const QVariant &value, int ro
|
|||||||
engine()->attemptBreakpointSynchronization();
|
engine()->attemptBreakpointSynchronization();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
case RequestShowMemoryRole: {
|
case RequestShowMemoryRole: {
|
||||||
(void) new MemoryViewAgent(engine(), value.toULongLong());
|
(void) new MemoryViewAgent(engine(), value.toULongLong());
|
||||||
|
|||||||
@@ -69,7 +69,8 @@ public:
|
|||||||
{
|
{
|
||||||
// Value column: Custom editor. Apply integer-specific settings.
|
// Value column: Custom editor. Apply integer-specific settings.
|
||||||
if (index.column() == 1) {
|
if (index.column() == 1) {
|
||||||
const QVariant::Type type = static_cast<QVariant::Type>(index.data(LocalsEditTypeRole).toInt());
|
const QVariant::Type type =
|
||||||
|
static_cast<QVariant::Type>(index.data(LocalsEditTypeRole).toInt());
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case QVariant::Bool:
|
case QVariant::Bool:
|
||||||
return new BooleanComboBox(parent);
|
return new BooleanComboBox(parent);
|
||||||
@@ -296,7 +297,8 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
const unsigned engineCapabilities = modelData(EngineCapabilitiesRole).toUInt();
|
const unsigned engineCapabilities = modelData(EngineCapabilitiesRole).toUInt();
|
||||||
const bool canHandleWatches =
|
const bool canHandleWatches =
|
||||||
actionsEnabled && (engineCapabilities & AddWatcherCapability);
|
actionsEnabled && (engineCapabilities & AddWatcherCapability);
|
||||||
const DebuggerState state = static_cast<DebuggerState>(modelData(EngineStateRole).toInt());
|
const DebuggerState state =
|
||||||
|
static_cast<DebuggerState>(modelData(EngineStateRole).toInt());
|
||||||
|
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
QAction *actInsertNewWatchItem = menu.addAction(tr("Insert New Watch Item"));
|
QAction *actInsertNewWatchItem = menu.addAction(tr("Insert New Watch Item"));
|
||||||
@@ -329,14 +331,13 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
const bool canSetWatchpoint = engineCapabilities & WatchpointCapability;
|
const bool canSetWatchpoint = engineCapabilities & WatchpointCapability;
|
||||||
if (canSetWatchpoint && address) {
|
if (canSetWatchpoint && address) {
|
||||||
actSetWatchPointAtVariableAddress =
|
actSetWatchPointAtVariableAddress =
|
||||||
new QAction(tr("Break on Changes at Object's Address (0x%1)")
|
new QAction(tr("Add Watchpoint at Object's Address (0x%1)")
|
||||||
.arg(address, 0, 16), &menu);
|
.arg(address, 0, 16), &menu);
|
||||||
actSetWatchPointAtVariableAddress->setCheckable(true);
|
|
||||||
actSetWatchPointAtVariableAddress->
|
actSetWatchPointAtVariableAddress->
|
||||||
setChecked(mi0.data(LocalsIsWatchpointAtAddressRole).toBool());
|
setChecked(mi0.data(LocalsIsWatchpointAtAddressRole).toBool());
|
||||||
if (createPointerActions) {
|
if (createPointerActions) {
|
||||||
actSetWatchPointAtPointerValue =
|
actSetWatchPointAtPointerValue =
|
||||||
new QAction(tr("Break on Changes at Referenced Address (0x%1)")
|
new QAction(tr("Add Watchpoint at Referenced Address (0x%1)")
|
||||||
.arg(pointerValue, 0, 16), &menu);
|
.arg(pointerValue, 0, 16), &menu);
|
||||||
actSetWatchPointAtPointerValue->setCheckable(true);
|
actSetWatchPointAtPointerValue->setCheckable(true);
|
||||||
actSetWatchPointAtPointerValue->
|
actSetWatchPointAtPointerValue->
|
||||||
@@ -344,9 +345,12 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
actSetWatchPointAtVariableAddress =
|
actSetWatchPointAtVariableAddress =
|
||||||
new QAction(tr("Break on Changing Contents"), &menu);
|
new QAction(tr("At Watchpoint"), &menu);
|
||||||
actSetWatchPointAtVariableAddress->setEnabled(false);
|
actSetWatchPointAtVariableAddress->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
actSetWatchPointAtVariableAddress->setToolTip(
|
||||||
|
tr("Setting a watchpoint on an address will cause the program "
|
||||||
|
"to stop when the data at the address it modified"));
|
||||||
|
|
||||||
QString actionName = exp.isEmpty() ? tr("Watch Expression")
|
QString actionName = exp.isEmpty() ? tr("Watch Expression")
|
||||||
: tr("Watch Expression \"%1\"").arg(exp);
|
: tr("Watch Expression \"%1\"").arg(exp);
|
||||||
@@ -357,8 +361,8 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
actionName = exp.isEmpty() ? tr("Remove Watch Expression")
|
actionName = exp.isEmpty() ? tr("Remove Watch Expression")
|
||||||
: tr("Remove Watch Expression \"%1\"").arg(exp);
|
: tr("Remove Watch Expression \"%1\"").arg(exp);
|
||||||
QAction *actRemoveWatchExpression = new QAction(actionName, &menu);
|
QAction *actRemoveWatchExpression = new QAction(actionName, &menu);
|
||||||
actRemoveWatchExpression->setEnabled((canHandleWatches || state == DebuggerNotReady)
|
actRemoveWatchExpression->setEnabled(
|
||||||
&& !exp.isEmpty());
|
(canHandleWatches || state == DebuggerNotReady) && !exp.isEmpty());
|
||||||
|
|
||||||
if (m_type == LocalsType)
|
if (m_type == LocalsType)
|
||||||
menu.addAction(actWatchExpression);
|
menu.addAction(actWatchExpression);
|
||||||
|
|||||||
Reference in New Issue
Block a user