forked from qt-creator/qt-creator
Debugger: Remove 'friend gdbengine' from stackhandler.
Preparing the introduction of tooltips for the new CDB engine. Fix some breakpoint states in CDB.
This commit is contained in:
@@ -1096,9 +1096,10 @@ void CdbEngine::assignValueInDebugger(const WatchData *w, const QString &expr, c
|
|||||||
v.toString();
|
v.toString();
|
||||||
}
|
}
|
||||||
// Update view
|
// Update view
|
||||||
if (WatchData *fwd = watchHandler()->findItem(w->iname)) {
|
if (const WatchData *fwd = watchHandler()->findItem(w->iname)) {
|
||||||
fwd->setValue(newValueObtained);
|
WatchData modified = *fwd;
|
||||||
watchHandler()->insertData(*fwd);
|
modified.setValue(newValueObtained);
|
||||||
|
watchHandler()->insertData(modified);
|
||||||
watchHandler()->updateWatchers();
|
watchHandler()->updateWatchers();
|
||||||
}
|
}
|
||||||
success = true;
|
success = true;
|
||||||
@@ -1319,6 +1320,7 @@ bool CdbEngine::attemptBreakpointSynchronizationI(QString *errorMessage)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BreakpointRemoveRequested:
|
case BreakpointRemoveRequested:
|
||||||
|
handler->notifyBreakpointRemoveProceeding(id);
|
||||||
handler->notifyBreakpointRemoveOk(id);
|
handler->notifyBreakpointRemoveOk(id);
|
||||||
break;
|
break;
|
||||||
case BreakpointInserted:
|
case BreakpointInserted:
|
||||||
|
|||||||
@@ -41,12 +41,14 @@
|
|||||||
#include "debuggercore.h"
|
#include "debuggercore.h"
|
||||||
#include "registerhandler.h"
|
#include "registerhandler.h"
|
||||||
#include "debuggeragents.h"
|
#include "debuggeragents.h"
|
||||||
|
#include "debuggertooltip.h"
|
||||||
#include "cdbparsehelpers.h"
|
#include "cdbparsehelpers.h"
|
||||||
#include "watchutils.h"
|
#include "watchutils.h"
|
||||||
#include "gdb/gdbmi.h"
|
#include "gdb/gdbmi.h"
|
||||||
#include "shared/cdbsymbolpathlisteditor.h"
|
#include "shared/cdbsymbolpathlisteditor.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
#include <texteditor/itexteditor.h>
|
||||||
|
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
#include <utils/winutils.h>
|
#include <utils/winutils.h>
|
||||||
@@ -328,9 +330,26 @@ void CdbEngine::syncOperateByInstruction(bool operateByInstruction)
|
|||||||
|
|
||||||
void CdbEngine::setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos)
|
void CdbEngine::setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos)
|
||||||
{
|
{
|
||||||
|
if (debug)
|
||||||
|
qDebug() << Q_FUNC_INFO;
|
||||||
|
// Need a stopped debuggee and a cpp file in a valid frame
|
||||||
|
if (state() != InferiorStopOk || !isCppEditor(editor) || stackHandler()->currentIndex() < 0)
|
||||||
|
return;
|
||||||
|
// Determine expression and function
|
||||||
|
int line;
|
||||||
|
int column;
|
||||||
|
QString function;
|
||||||
|
const QString exp = cppExpressionAt(editor, cursorPos, &line, &column, &function);
|
||||||
|
// Are we in the current stack frame
|
||||||
|
if (function.isEmpty() || exp.isEmpty() || function != stackHandler()->currentFrame().function)
|
||||||
|
return;
|
||||||
|
// No numerical or any other expressions [yet]
|
||||||
|
if (!(exp.at(0).isLetter() || exp.at(0) == QLatin1Char('_')))
|
||||||
|
return;
|
||||||
|
const QByteArray iname = QByteArray("local.") + exp.toAscii();
|
||||||
|
const QModelIndex index = watchHandler()->itemIndex(iname);
|
||||||
|
Q_UNUSED(index)
|
||||||
Q_UNUSED(mousePos)
|
Q_UNUSED(mousePos)
|
||||||
Q_UNUSED(editor)
|
|
||||||
Q_UNUSED(cursorPos)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CdbEngine::setupEngine()
|
void CdbEngine::setupEngine()
|
||||||
@@ -1678,6 +1697,7 @@ void CdbEngine::attemptBreakpointSynchronization()
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case BreakpointRemoveRequested:
|
case BreakpointRemoveRequested:
|
||||||
|
handler->notifyBreakpointRemoveProceeding(id);
|
||||||
handler->notifyBreakpointRemoveOk(id);
|
handler->notifyBreakpointRemoveOk(id);
|
||||||
break;
|
break;
|
||||||
case BreakpointInserted:
|
case BreakpointInserted:
|
||||||
|
|||||||
@@ -3268,22 +3268,20 @@ bool GdbEngine::supportsThreads() const
|
|||||||
|
|
||||||
bool GdbEngine::showToolTip()
|
bool GdbEngine::showToolTip()
|
||||||
{
|
{
|
||||||
QByteArray iname = tooltipIName(m_toolTipExpression);
|
const QByteArray iname = tooltipIName(m_toolTipExpression);
|
||||||
|
|
||||||
if (!debuggerCore()->boolSetting(UseToolTipsInMainEditor)) {
|
if (!debuggerCore()->boolSetting(UseToolTipsInMainEditor)) {
|
||||||
watchHandler()->removeData(iname);
|
watchHandler()->removeData(iname);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
WatchModel *model = watchHandler()->model(TooltipsWatch);
|
const QModelIndex index = watchHandler()->itemIndex(iname);
|
||||||
WatchItem *item = model->findItem(iname, model->rootItem());
|
if (!index.isValid()) {
|
||||||
if (!item) {
|
|
||||||
watchHandler()->removeData(iname);
|
watchHandler()->removeData(iname);
|
||||||
hideDebuggerToolTip();
|
hideDebuggerToolTip();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
QModelIndex index = model->watchIndex(item);
|
showDebuggerToolTip(m_toolTipPos, watchHandler()->model(TooltipsWatch), index, m_toolTipExpression);
|
||||||
showDebuggerToolTip(m_toolTipPos, model, index, m_toolTipExpression);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1590,13 +1590,29 @@ WatchModel *WatchHandler::modelForIName(const QByteArray &iname) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
WatchData *WatchHandler::findItem(const QByteArray &iname) const
|
const WatchData *WatchHandler::watchData(WatchType type, const QModelIndex &index) const
|
||||||
|
{
|
||||||
|
if (index.isValid())
|
||||||
|
if (const WatchModel *m = model(type))
|
||||||
|
return m->watchItem(index);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const WatchData *WatchHandler::findItem(const QByteArray &iname) const
|
||||||
{
|
{
|
||||||
const WatchModel *model = modelForIName(iname);
|
const WatchModel *model = modelForIName(iname);
|
||||||
QTC_ASSERT(model, return 0);
|
QTC_ASSERT(model, return 0);
|
||||||
return model->findItem(iname, model->m_root);
|
return model->findItem(iname, model->m_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QModelIndex WatchHandler::itemIndex(const QByteArray &iname) const
|
||||||
|
{
|
||||||
|
if (const WatchModel *model = modelForIName(iname))
|
||||||
|
if (WatchItem *item = model->findItem(iname, model->m_root))
|
||||||
|
return model->watchIndex(item);
|
||||||
|
return QModelIndex();
|
||||||
|
}
|
||||||
|
|
||||||
void WatchHandler::setFormat(const QByteArray &type, int format)
|
void WatchHandler::setFormat(const QByteArray &type, int format)
|
||||||
{
|
{
|
||||||
if (format == -1)
|
if (format == -1)
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ private:
|
|||||||
void fetchMore(const QModelIndex &parent);
|
void fetchMore(const QModelIndex &parent);
|
||||||
|
|
||||||
friend class WatchHandler;
|
friend class WatchHandler;
|
||||||
friend class GdbEngine;
|
|
||||||
|
|
||||||
WatchItem *watchItem(const QModelIndex &) const;
|
WatchItem *watchItem(const QModelIndex &) const;
|
||||||
QModelIndex watchIndex(const WatchItem *needle) const;
|
QModelIndex watchIndex(const WatchItem *needle) const;
|
||||||
@@ -151,7 +150,10 @@ public:
|
|||||||
void insertData(const WatchData &data);
|
void insertData(const WatchData &data);
|
||||||
void insertBulkData(const QList<WatchData> &data);
|
void insertBulkData(const QList<WatchData> &data);
|
||||||
void removeData(const QByteArray &iname);
|
void removeData(const QByteArray &iname);
|
||||||
WatchData *findItem(const QByteArray &iname) const;
|
|
||||||
|
const WatchData *watchData(WatchType type, const QModelIndex &) const;
|
||||||
|
const WatchData *findItem(const QByteArray &iname) const;
|
||||||
|
QModelIndex itemIndex(const QByteArray &iname) const;
|
||||||
|
|
||||||
static void loadSessionData();
|
static void loadSessionData();
|
||||||
static void saveSessionData();
|
static void saveSessionData();
|
||||||
|
|||||||
Reference in New Issue
Block a user