diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-05-14 14:29:37 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-05-14 14:29:37 +0200 |
commit | 0e3aa47fcd4d857ec851b253a87ea5d7a26d49c2 (patch) | |
tree | cc748eb9acf86fb00accbdb8f7fd792cca464896 /src/plugins/debugger/gdbengine.cpp | |
parent | 11ccb57111c9974190469613eb21d2be449b53c9 (diff) | |
download | qt-creator-0e3aa47fcd4d857ec851b253a87ea5d7a26d49c2.tar.gz |
Added ToolTip support for CDB.
Make debugger tooltip API more general, have the engines check the
correct file type, figure out the expression and context from the text
editor.
Put common functionality in watchutils.cpp. In the CDB engine, check
whether a tooltip expression is a known variable within the stack frame
context. If so, retrieve via symbol group or dumpers. Cache by function
and expression.
Reviewed-by: hjk <qtc-committer@nokia.com>
Diffstat (limited to 'src/plugins/debugger/gdbengine.cpp')
-rw-r--r-- | src/plugins/debugger/gdbengine.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp index 6cd9d9bc20..c2849210e8 100644 --- a/src/plugins/debugger/gdbengine.cpp +++ b/src/plugins/debugger/gdbengine.cpp @@ -50,6 +50,7 @@ #include "debuggerdialogs.h" #include <utils/qtcassert.h> +#include <texteditor/itexteditor.h> #include <coreplugin/icore.h> #include <QtCore/QDebug> @@ -2605,11 +2606,10 @@ static QString m_toolTipExpression; static QPoint m_toolTipPos; static QMap<QString, WatchData> m_toolTipCache; -void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0) +void GdbEngine::setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos) { - //qDebug() << "SET TOOLTIP EXP" << pos << exp0; - if (q->status() != DebuggerInferiorStopped) { - //qDebug() << "SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED"; + if (q->status() != DebuggerInferiorStopped || !isCppEditor(editor)) { + //qDebug() << "SUPPRESSING DEBUGGER TOOLTIP, INFERIOR NOT STOPPED/Non Cpp editor"; return; } @@ -2618,9 +2618,10 @@ void GdbEngine::setToolTipExpression(const QPoint &pos, const QString &exp0) return; } - m_toolTipPos = pos; - m_toolTipExpression = exp0; - QString exp = exp0; + m_toolTipPos = mousePos; + int line, column; + m_toolTipExpression = cppExpressionAt(editor, cursorPos, &line, &column); + QString exp = m_toolTipExpression; /* if (m_toolTip.isTypePending()) { qDebug() << "suppressing duplicated tooltip creation"; |