forked from qt-creator/qt-creator
253 lines
5.3 KiB
C++
253 lines
5.3 KiB
C++
|
|
/**************************************************************************
|
||
|
|
**
|
||
|
|
** This file is part of Qt Creator
|
||
|
|
**
|
||
|
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||
|
|
**
|
||
|
|
** Contact: Qt Software Information (qt-info@nokia.com)
|
||
|
|
**
|
||
|
|
** Commercial Usage
|
||
|
|
**
|
||
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
||
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
||
|
|
** Software or, alternatively, in accordance with the terms contained in
|
||
|
|
** a written agreement between you and Nokia.
|
||
|
|
**
|
||
|
|
** GNU Lesser General Public License Usage
|
||
|
|
**
|
||
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||
|
|
** General Public License version 2.1 as published by the Free Software
|
||
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||
|
|
** packaging of this file. Please review the following information to
|
||
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||
|
|
**
|
||
|
|
** If you are unsure which license is appropriate for your use, please
|
||
|
|
** contact the sales department at qt-sales@nokia.com.
|
||
|
|
**
|
||
|
|
**************************************************************************/
|
||
|
|
|
||
|
|
#include "tcfengine.h"
|
||
|
|
|
||
|
|
#include "debuggerdialogs.h"
|
||
|
|
#include "breakhandler.h"
|
||
|
|
#include "debuggerconstants.h"
|
||
|
|
#include "debuggermanager.h"
|
||
|
|
#include "disassemblerhandler.h"
|
||
|
|
#include "moduleshandler.h"
|
||
|
|
#include "registerhandler.h"
|
||
|
|
#include "stackhandler.h"
|
||
|
|
#include "watchhandler.h"
|
||
|
|
#include "watchutils.h"
|
||
|
|
#include "moduleshandler.h"
|
||
|
|
|
||
|
|
#include <utils/qtcassert.h>
|
||
|
|
|
||
|
|
#include <QtCore/QDateTime>
|
||
|
|
#include <QtCore/QDebug>
|
||
|
|
#include <QtCore/QDir>
|
||
|
|
#include <QtCore/QFileInfo>
|
||
|
|
#include <QtCore/QTimer>
|
||
|
|
|
||
|
|
#include <QtGui/QAction>
|
||
|
|
#include <QtGui/QApplication>
|
||
|
|
#include <QtGui/QToolTip>
|
||
|
|
|
||
|
|
|
||
|
|
using namespace Debugger;
|
||
|
|
using namespace Debugger::Internal;
|
||
|
|
using namespace Debugger::Constants;
|
||
|
|
|
||
|
|
//#define DEBUG_TCF 1
|
||
|
|
#if DEBUG_TCF
|
||
|
|
# define SDEBUG(s) qDebug() << s
|
||
|
|
#else
|
||
|
|
# define SDEBUG(s)
|
||
|
|
#endif
|
||
|
|
# define XSDEBUG(s) qDebug() << s
|
||
|
|
|
||
|
|
///////////////////////////////////////////////////////////////////////
|
||
|
|
//
|
||
|
|
// TcfEngine
|
||
|
|
//
|
||
|
|
///////////////////////////////////////////////////////////////////////
|
||
|
|
|
||
|
|
TcfEngine::TcfEngine(DebuggerManager *parent)
|
||
|
|
{
|
||
|
|
q = parent;
|
||
|
|
qq = parent->engineInterface();
|
||
|
|
}
|
||
|
|
|
||
|
|
TcfEngine::~TcfEngine()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::executeDebuggerCommand(const QString &command)
|
||
|
|
{
|
||
|
|
Q_UNUSED(command);
|
||
|
|
XSDEBUG("FIXME: TcfEngine::executeDebuggerCommand()");
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::shutdown()
|
||
|
|
{
|
||
|
|
exitDebugger();
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::exitDebugger()
|
||
|
|
{
|
||
|
|
SDEBUG("TcfEngine::exitDebugger()");
|
||
|
|
qq->notifyInferiorExited();
|
||
|
|
}
|
||
|
|
|
||
|
|
bool TcfEngine::startDebugger()
|
||
|
|
{
|
||
|
|
qq->notifyInferiorRunningRequested();
|
||
|
|
QTimer::singleShot(0, this, SLOT(runInferior()));
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::continueInferior()
|
||
|
|
{
|
||
|
|
SDEBUG("TcfEngine::continueInferior()");
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::runInferior()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::interruptInferior()
|
||
|
|
{
|
||
|
|
XSDEBUG("TcfEngine::interruptInferior()");
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::stepExec()
|
||
|
|
{
|
||
|
|
//SDEBUG("TcfEngine::stepExec()");
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::stepIExec()
|
||
|
|
{
|
||
|
|
//SDEBUG("TcfEngine::stepIExec()");
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::stepOutExec()
|
||
|
|
{
|
||
|
|
//SDEBUG("TcfEngine::stepOutExec()");
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::nextExec()
|
||
|
|
{
|
||
|
|
//SDEBUG("TcfEngine::nextExec()");
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::nextIExec()
|
||
|
|
{
|
||
|
|
//SDEBUG("TcfEngine::nextIExec()");
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::runToLineExec(const QString &fileName, int lineNumber)
|
||
|
|
{
|
||
|
|
Q_UNUSED(fileName);
|
||
|
|
Q_UNUSED(lineNumber);
|
||
|
|
SDEBUG("FIXME: TcfEngine::runToLineExec()");
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::runToFunctionExec(const QString &functionName)
|
||
|
|
{
|
||
|
|
Q_UNUSED(functionName);
|
||
|
|
XSDEBUG("FIXME: TcfEngine::runToFunctionExec()");
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::jumpToLineExec(const QString &fileName, int lineNumber)
|
||
|
|
{
|
||
|
|
Q_UNUSED(fileName);
|
||
|
|
Q_UNUSED(lineNumber);
|
||
|
|
XSDEBUG("FIXME: TcfEngine::jumpToLineExec()");
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::activateFrame(int index)
|
||
|
|
{
|
||
|
|
Q_UNUSED(index);
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::selectThread(int index)
|
||
|
|
{
|
||
|
|
Q_UNUSED(index);
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::attemptBreakpointSynchronization()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::reloadDisassembler()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::loadSymbols(const QString &moduleName)
|
||
|
|
{
|
||
|
|
Q_UNUSED(moduleName);
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::loadAllSymbols()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::reloadModules()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
QList<Symbol> TcfEngine::moduleSymbols(const QString & /*moduleName*/)
|
||
|
|
{
|
||
|
|
return QList<Symbol>();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//////////////////////////////////////////////////////////////////////
|
||
|
|
//
|
||
|
|
// Tooltip specific stuff
|
||
|
|
//
|
||
|
|
//////////////////////////////////////////////////////////////////////
|
||
|
|
|
||
|
|
static WatchData m_toolTip;
|
||
|
|
static QPoint m_toolTipPos;
|
||
|
|
static QHash<QString, WatchData> m_toolTipCache;
|
||
|
|
|
||
|
|
void TcfEngine::setToolTipExpression(const QPoint &pos, const QString &exp0)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//////////////////////////////////////////////////////////////////////
|
||
|
|
//
|
||
|
|
// Watch specific stuff
|
||
|
|
//
|
||
|
|
//////////////////////////////////////////////////////////////////////
|
||
|
|
|
||
|
|
void TcfEngine::assignValueInDebugger(const QString &expression,
|
||
|
|
const QString &value)
|
||
|
|
{
|
||
|
|
XSDEBUG("ASSIGNING: " << expression + '=' + value);
|
||
|
|
updateLocals();
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::updateLocals()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::updateWatchModel()
|
||
|
|
{
|
||
|
|
qq->watchHandler()->rebuildModel();
|
||
|
|
q->showStatusMessage(tr("Stopped."), 5000);
|
||
|
|
}
|
||
|
|
|
||
|
|
void TcfEngine::updateSubItem(const WatchData &data0)
|
||
|
|
{
|
||
|
|
QTC_ASSERT(false, return);
|
||
|
|
}
|
||
|
|
|
||
|
|
IDebuggerEngine *createTcfEngine(DebuggerManager *parent, QList<Core::IOptionsPage*> *)
|
||
|
|
{
|
||
|
|
return new TcfEngine(parent);
|
||
|
|
}
|
||
|
|
|