Files
qt-creator/src/plugins/debugger/cdb/cdbdebugengine.h

140 lines
4.8 KiB
C
Raw Normal View History

/**************************************************************************
2009-02-20 17:07:00 +01:00
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
2009-02-20 17:07:00 +01:00
**
** Contact: Nokia Corporation (qt-info@nokia.com)
2009-02-20 17:07:00 +01:00
**
** Commercial Usage
2009-02-20 17:07:00 +01:00
**
** 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.
2009-02-20 17:07:00 +01:00
**
** GNU Lesser General Public License Usage
2009-02-20 17:07:00 +01:00
**
** 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.
2009-02-20 17:07:00 +01:00
**
** If you are unsure which license is appropriate for your use, please
2009-08-14 09:30:56 +02:00
** contact the sales department at http://qt.nokia.com/contact.
2009-02-20 17:07:00 +01:00
**
**************************************************************************/
2009-02-20 17:07:00 +01:00
2009-02-09 13:07:38 +01:00
#ifndef DEBUGGER_CDBENGINE_H
#define DEBUGGER_CDBENGINE_H
2009-02-09 11:35:43 +01:00
#include "idebuggerengine.h"
#include "debuggermanager.h"
2009-02-09 13:07:38 +01:00
#include <QtCore/QSharedPointer>
2009-02-09 11:35:43 +01:00
namespace Debugger {
class DebuggerManager;
2009-02-09 11:35:43 +01:00
namespace Internal {
class DisassemblerViewAgent;
2009-02-20 17:07:00 +01:00
class CdbDebugEventCallback;
class CdbDebugOutput;
struct CdbDebugEnginePrivate;
struct CdbOptions;
2009-02-09 11:35:43 +01:00
2009-02-09 13:07:38 +01:00
class CdbDebugEngine : public IDebuggerEngine
2009-02-09 11:35:43 +01:00
{
2009-02-23 16:13:35 +01:00
Q_DISABLE_COPY(CdbDebugEngine)
2009-02-09 11:35:43 +01:00
Q_OBJECT
explicit CdbDebugEngine(DebuggerManager *parent,
const QSharedPointer<CdbOptions> &options);
2009-02-23 16:13:35 +01:00
2009-02-09 11:35:43 +01:00
public:
2009-02-09 13:07:38 +01:00
~CdbDebugEngine();
2009-02-09 11:35:43 +01:00
2009-02-23 16:13:35 +01:00
// Factory function that returns 0 if the debug engine library cannot be found.
static IDebuggerEngine *create(DebuggerManager *parent,
const QSharedPointer<CdbOptions> &options,
QString *errorMessage);
2009-02-23 16:13:35 +01:00
2009-02-09 11:35:43 +01:00
virtual void shutdown();
virtual void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
2009-09-10 13:09:42 +02:00
virtual void startDebugger(const QSharedPointer<DebuggerStartParameters> &startParameters);
2009-02-09 11:35:43 +01:00
virtual void exitDebugger();
2009-05-11 16:54:35 +02:00
virtual void detachDebugger();
virtual void updateWatchData(const WatchData &data);
2009-02-09 11:35:43 +01:00
virtual void stepExec();
virtual void stepOutExec();
virtual void nextExec();
virtual void stepIExec();
virtual void nextIExec();
virtual void continueInferior();
2009-02-09 11:35:43 +01:00
virtual void interruptInferior();
virtual void runToLineExec(const QString &fileName, int lineNumber);
virtual void runToFunctionExec(const QString &functionName);
virtual void jumpToLineExec(const QString &fileName, int lineNumber);
virtual void assignValueInDebugger(const QString &expr, const QString &value);
virtual void executeDebuggerCommand(const QString &command);
virtual void activateFrame(int index);
virtual void selectThread(int index);
virtual void attemptBreakpointSynchronization();
virtual void fetchDisassembler(DisassemblerViewAgent *agent,
const StackFrame &frame);
virtual void fetchMemory(MemoryViewAgent *, quint64 addr, quint64 length);
2009-02-09 11:35:43 +01:00
virtual void reloadModules();
virtual void loadSymbols(const QString &moduleName);
virtual void loadAllSymbols();
2009-04-15 12:04:27 +02:00
virtual QList<Symbol> moduleSymbols(const QString &moduleName);
2009-02-09 11:35:43 +01:00
virtual void reloadRegisters();
2009-02-20 14:56:36 +01:00
virtual void reloadSourceFiles();
virtual void reloadFullStack() {}
2009-02-20 14:56:36 +01:00
public slots:
void syncDebuggerPaths();
2009-02-09 11:35:43 +01:00
protected:
void timerEvent(QTimerEvent*);
private slots:
void slotConsoleStubStarted();
void slotConsoleStubError(const QString &msg);
void slotConsoleStubTerminated();
void warning(const QString &w);
2009-02-09 11:35:43 +01:00
private:
void setState(DebuggerState state, const char *func, int line);
bool startAttachDebugger(qint64 pid, DebuggerStartMode sm, QString *errorMessage);
bool startDebuggerWithExecutable(DebuggerStartMode sm, QString *errorMessage);
2009-02-09 11:35:43 +01:00
void startWatchTimer();
void killWatchTimer();
void processTerminated(unsigned long exitCode);
bool executeDebuggerCommand(const QString &command, QString *errorMessage);
bool evaluateExpression(const QString &expression, QString *value, QString *type, QString *errorMessage);
void evaluateWatcher(WatchData *wd);
QString editorToolTip(const QString &exp, const QString &function);
bool step(unsigned long executionStatus);
2009-02-09 11:35:43 +01:00
2009-02-20 17:07:00 +01:00
CdbDebugEnginePrivate *m_d;
2009-02-09 11:35:43 +01:00
2009-02-20 17:07:00 +01:00
friend struct CdbDebugEnginePrivate;
2009-02-09 13:07:38 +01:00
friend class CdbDebugEventCallback;
friend class CdbDebugOutput;
2009-02-09 11:35:43 +01:00
};
} // namespace Internal
} // namespace Debugger
2009-02-09 13:07:38 +01:00
#endif // DEBUGGER_CDBENGINE_H