2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-06-16 11:08:54 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** Copyright (C) 2015 The Qt Company Ltd.
|
|
|
|
|
** Contact: http://www.qt.io/licensing
|
2010-06-16 11:08:54 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-06-16 11:08:54 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2015-01-14 18:07:15 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms and
|
|
|
|
|
** conditions see http://www.qt.io/terms-conditions. For further information
|
2014-10-01 13:21:18 +02:00
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2010-06-16 11:08:54 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
2015-01-14 18:07:15 +01:00
|
|
|
** In addition, as a special exception, The Qt Company gives you certain additional
|
|
|
|
|
** rights. These rights are described in The Qt Company LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-06-16 11:08:54 +02:00
|
|
|
|
|
|
|
|
#ifndef DEBUGGER_DEBUGGERENGINE_H
|
|
|
|
|
#define DEBUGGER_DEBUGGERENGINE_H
|
|
|
|
|
|
|
|
|
|
#include "debugger_global.h"
|
|
|
|
|
#include "debuggerconstants.h"
|
2015-05-27 13:59:56 +02:00
|
|
|
#include "debuggerstartparameters.h"
|
|
|
|
|
|
|
|
|
|
#include <projectexplorer/devicesupport/idevice.h>
|
2010-10-19 11:14:03 +02:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QObject>
|
2015-03-05 11:11:32 +01:00
|
|
|
#include <QProcess>
|
2010-06-16 11:08:54 +02:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QDebug;
|
|
|
|
|
class QPoint;
|
2011-01-10 10:14:23 +01:00
|
|
|
class QAbstractItemModel;
|
2010-06-16 11:08:54 +02:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
2012-03-30 17:36:44 +02:00
|
|
|
namespace Core { class IOptionsPage; }
|
2010-06-16 11:08:54 +02:00
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
|
2010-11-08 15:19:13 +01:00
|
|
|
class DebuggerRunControl;
|
2015-02-26 15:29:28 +01:00
|
|
|
class RemoteSetupResult;
|
2010-06-16 11:08:54 +02:00
|
|
|
|
|
|
|
|
DEBUGGER_EXPORT QDebug operator<<(QDebug str, DebuggerState state);
|
|
|
|
|
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2014-12-12 15:33:16 +01:00
|
|
|
class DebuggerEnginePrivate;
|
2010-11-10 11:39:01 +01:00
|
|
|
class DebuggerPluginPrivate;
|
2010-12-14 12:29:32 +01:00
|
|
|
class DisassemblerAgent;
|
2015-03-26 13:03:38 +01:00
|
|
|
class GdbMi;
|
2010-12-14 12:29:32 +01:00
|
|
|
class MemoryAgent;
|
2010-06-16 11:08:54 +02:00
|
|
|
class WatchData;
|
2015-03-19 12:42:53 +01:00
|
|
|
class WatchItem;
|
2010-06-16 11:08:54 +02:00
|
|
|
class BreakHandler;
|
|
|
|
|
class ModulesHandler;
|
|
|
|
|
class RegisterHandler;
|
|
|
|
|
class StackHandler;
|
|
|
|
|
class StackFrame;
|
|
|
|
|
class SourceFilesHandler;
|
|
|
|
|
class ThreadsHandler;
|
|
|
|
|
class WatchHandler;
|
2015-01-10 01:07:01 +01:00
|
|
|
class Breakpoint;
|
2012-04-18 14:20:54 +02:00
|
|
|
class QmlAdapter;
|
2010-12-03 12:07:32 +01:00
|
|
|
class QmlCppEngine;
|
2011-02-11 15:00:13 +01:00
|
|
|
class DebuggerToolTipContext;
|
2014-12-17 13:14:29 +01:00
|
|
|
class MemoryViewSetupData;
|
2015-01-14 16:58:10 +01:00
|
|
|
class Terminal;
|
2015-02-26 15:29:28 +01:00
|
|
|
class ThreadId;
|
2010-06-16 11:08:54 +02:00
|
|
|
|
2015-05-27 13:59:56 +02:00
|
|
|
class DebuggerRunParameters : public DebuggerStartParameters
|
|
|
|
|
{
|
|
|
|
|
public:
|
2015-06-24 08:26:35 +02:00
|
|
|
DebuggerRunParameters() {}
|
2015-05-27 13:59:56 +02:00
|
|
|
|
2015-06-26 13:06:08 +02:00
|
|
|
DebuggerEngineType masterEngineType = NoEngineType;
|
|
|
|
|
DebuggerEngineType cppEngineType = NoEngineType;
|
|
|
|
|
|
|
|
|
|
DebuggerLanguages languages = AnyLanguage;
|
|
|
|
|
bool breakOnMain = false;
|
|
|
|
|
bool multiProcess = false; // Whether to set detach-on-fork off.
|
|
|
|
|
|
|
|
|
|
QString debuggerCommand;
|
2015-05-27 13:59:56 +02:00
|
|
|
QString coreFile;
|
|
|
|
|
QString overrideStartScript; // Used in attach to core and remote debugging
|
|
|
|
|
QString startMessage; // First status message shown.
|
|
|
|
|
QMap<QString, QString> sourcePathMap;
|
|
|
|
|
QString debugInfoLocation; // Gdb "set-debug-file-directory".
|
|
|
|
|
QStringList debugSourceLocation; // Gdb "directory"
|
|
|
|
|
QString serverStartScript;
|
|
|
|
|
ProjectExplorer::IDevice::ConstPtr device;
|
2015-06-26 13:06:08 +02:00
|
|
|
QString sysRoot;
|
2015-06-24 08:26:35 +02:00
|
|
|
bool isSnapshot = false; // Set if created internally.
|
2015-06-26 13:06:08 +02:00
|
|
|
ProjectExplorer::Abi toolChainAbi;
|
|
|
|
|
|
|
|
|
|
QString projectSourceDirectory;
|
|
|
|
|
QStringList projectSourceFiles;
|
2015-05-27 13:59:56 +02:00
|
|
|
|
|
|
|
|
// Used by AttachCrashedExternal.
|
|
|
|
|
QString crashParameter;
|
|
|
|
|
|
|
|
|
|
// For Debugger testing.
|
2015-06-24 08:26:35 +02:00
|
|
|
int testCase = 0;
|
2015-05-27 13:59:56 +02:00
|
|
|
};
|
|
|
|
|
|
2015-06-08 18:07:11 +02:00
|
|
|
class UpdateParameters
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
UpdateParameters() {}
|
|
|
|
|
|
2015-07-06 09:46:08 +02:00
|
|
|
QList<QByteArray> partialVariables() const
|
|
|
|
|
{
|
|
|
|
|
QList<QByteArray> result;
|
|
|
|
|
if (!partialVariable.isEmpty())
|
|
|
|
|
result.append(partialVariable);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-08 18:07:11 +02:00
|
|
|
QByteArray partialVariable;
|
|
|
|
|
};
|
|
|
|
|
|
2010-12-16 19:06:33 +01:00
|
|
|
class Location
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Location() { init(); }
|
|
|
|
|
Location(quint64 address) { init(); m_address = address; }
|
|
|
|
|
Location(const QString &file) { init(); m_fileName = file; }
|
|
|
|
|
Location(const QString &file, int line, bool marker = true)
|
|
|
|
|
{ init(); m_lineNumber = line; m_fileName = file; m_needsMarker = marker; }
|
2011-01-10 10:14:23 +01:00
|
|
|
Location(const StackFrame &frame, bool marker = true);
|
2010-12-16 19:06:33 +01:00
|
|
|
QString fileName() const { return m_fileName; }
|
|
|
|
|
QString functionName() const { return m_functionName; }
|
2011-07-04 09:29:28 +02:00
|
|
|
QString from() const { return m_from; }
|
2010-12-16 19:06:33 +01:00
|
|
|
int lineNumber() const { return m_lineNumber; }
|
|
|
|
|
void setNeedsRaise(bool on) { m_needsRaise = on; }
|
|
|
|
|
void setNeedsMarker(bool on) { m_needsMarker = on; }
|
|
|
|
|
void setFileName(const QString &fileName) { m_fileName = fileName; }
|
2014-11-15 13:13:29 +01:00
|
|
|
void setUseAssembler(bool on) { m_hasDebugInfo = !on; }
|
2010-12-16 19:06:33 +01:00
|
|
|
bool needsRaise() const { return m_needsRaise; }
|
|
|
|
|
bool needsMarker() const { return m_needsMarker; }
|
|
|
|
|
bool hasDebugInfo() const { return m_hasDebugInfo; }
|
2015-02-27 11:56:03 +01:00
|
|
|
bool canBeDisassembled() const
|
|
|
|
|
{ return m_address != quint64(-1) || !m_functionName.isEmpty(); }
|
2010-12-16 19:06:33 +01:00
|
|
|
quint64 address() const { return m_address; }
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void init() { m_needsMarker = false; m_needsRaise = true; m_lineNumber = -1;
|
|
|
|
|
m_address = 0; m_hasDebugInfo = true; }
|
|
|
|
|
bool m_needsMarker;
|
|
|
|
|
bool m_needsRaise;
|
|
|
|
|
bool m_hasDebugInfo;
|
|
|
|
|
int m_lineNumber;
|
|
|
|
|
QString m_fileName;
|
|
|
|
|
QString m_functionName;
|
2011-07-04 09:29:28 +02:00
|
|
|
QString m_from;
|
2010-12-16 19:06:33 +01:00
|
|
|
quint64 m_address;
|
|
|
|
|
};
|
|
|
|
|
|
2011-02-23 10:16:11 +01:00
|
|
|
class ContextData
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
ContextData() : lineNumber(0), address(0) {}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
QString fileName;
|
|
|
|
|
int lineNumber;
|
|
|
|
|
quint64 address;
|
|
|
|
|
};
|
|
|
|
|
|
2014-12-12 15:33:16 +01:00
|
|
|
class DebuggerEngine : public QObject
|
2010-06-16 11:08:54 +02:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2015-05-27 13:59:56 +02:00
|
|
|
explicit DebuggerEngine(const DebuggerRunParameters &sp);
|
2010-06-16 11:08:54 +02:00
|
|
|
virtual ~DebuggerEngine();
|
|
|
|
|
|
2015-05-27 13:59:56 +02:00
|
|
|
const DebuggerRunParameters &runParameters() const;
|
|
|
|
|
DebuggerRunParameters &runParameters();
|
2011-01-12 13:43:23 +01:00
|
|
|
|
2015-06-08 18:07:11 +02:00
|
|
|
virtual bool canHandleToolTip(const DebuggerToolTipContext &) const;
|
|
|
|
|
virtual void updateWatchData(const QByteArray &iname);
|
|
|
|
|
virtual void selectWatchData(const QByteArray &iname);
|
2012-11-23 13:35:44 +01:00
|
|
|
|
2011-01-12 12:10:12 +01:00
|
|
|
virtual void startDebugger(DebuggerRunControl *runControl);
|
2010-09-13 13:30:35 +02:00
|
|
|
|
|
|
|
|
virtual void watchPoint(const QPoint &);
|
2011-04-19 12:17:48 +02:00
|
|
|
|
|
|
|
|
enum MemoryViewFlags
|
|
|
|
|
{
|
|
|
|
|
MemoryReadOnly = 0x1, //!< Read-only.
|
|
|
|
|
MemoryTrackRegister = 0x2, //!< Address parameter is register number to track
|
|
|
|
|
MemoryView = 0x4 //!< Open a separate view (using the pos-parameter).
|
|
|
|
|
};
|
|
|
|
|
|
2014-12-17 13:14:29 +01:00
|
|
|
virtual void openMemoryView(const MemoryViewSetupData &data);
|
2010-12-14 12:29:32 +01:00
|
|
|
virtual void fetchMemory(Internal::MemoryAgent *, QObject *,
|
2010-09-13 13:30:35 +02:00
|
|
|
quint64 addr, quint64 length);
|
2011-02-25 13:21:54 +01:00
|
|
|
virtual void changeMemory(Internal::MemoryAgent *, QObject *,
|
|
|
|
|
quint64 addr, const QByteArray &data);
|
2010-12-13 18:17:31 +01:00
|
|
|
virtual void updateMemoryViews();
|
2010-12-16 19:06:33 +01:00
|
|
|
virtual void openDisassemblerView(const Internal::Location &location);
|
2010-12-14 12:29:32 +01:00
|
|
|
virtual void fetchDisassembler(Internal::DisassemblerAgent *);
|
2010-09-13 13:30:35 +02:00
|
|
|
virtual void activateFrame(int index);
|
|
|
|
|
|
|
|
|
|
virtual void reloadModules();
|
|
|
|
|
virtual void examineModules();
|
|
|
|
|
virtual void loadSymbols(const QString &moduleName);
|
2010-12-21 13:34:59 +01:00
|
|
|
virtual void loadSymbolsForStack();
|
2010-09-13 13:30:35 +02:00
|
|
|
virtual void loadAllSymbols();
|
|
|
|
|
virtual void requestModuleSymbols(const QString &moduleName);
|
2012-11-07 18:31:17 +01:00
|
|
|
virtual void requestModuleSections(const QString &moduleName);
|
2010-09-13 13:30:35 +02:00
|
|
|
|
|
|
|
|
virtual void reloadRegisters();
|
|
|
|
|
virtual void reloadSourceFiles();
|
|
|
|
|
virtual void reloadFullStack();
|
2014-02-07 18:10:02 +01:00
|
|
|
virtual void loadAdditionalQmlStack();
|
2013-01-10 12:40:50 +01:00
|
|
|
virtual void reloadDebuggingHelpers();
|
2010-07-08 18:10:50 +02:00
|
|
|
|
2014-12-17 13:14:29 +01:00
|
|
|
virtual void setRegisterValue(const QByteArray &name, const QString &value);
|
2010-09-13 13:30:35 +02:00
|
|
|
virtual void addOptionPages(QList<Core::IOptionsPage*> *) const;
|
2012-01-12 20:28:17 +01:00
|
|
|
virtual bool hasCapability(unsigned cap) const = 0;
|
2014-01-04 01:34:51 +01:00
|
|
|
virtual void debugLastCommand() {}
|
2010-07-08 18:10:50 +02:00
|
|
|
|
2010-09-13 13:30:35 +02:00
|
|
|
virtual bool isSynchronous() const;
|
|
|
|
|
virtual QByteArray qtNamespace() const;
|
2015-03-26 13:03:38 +01:00
|
|
|
void setQtNamespace(const QByteArray &ns);
|
2010-07-08 18:10:50 +02:00
|
|
|
|
2010-09-13 13:30:35 +02:00
|
|
|
virtual void createSnapshot();
|
|
|
|
|
virtual void updateAll();
|
2015-06-08 18:07:11 +02:00
|
|
|
virtual void updateLocals();
|
2010-07-08 18:10:50 +02:00
|
|
|
|
2010-11-10 16:33:11 +01:00
|
|
|
virtual bool stateAcceptsBreakpointChanges() const { return true; }
|
|
|
|
|
virtual void attemptBreakpointSynchronization();
|
2015-01-10 01:07:01 +01:00
|
|
|
virtual bool acceptsBreakpoint(Breakpoint bp) const = 0;
|
|
|
|
|
virtual void insertBreakpoint(Breakpoint bp); // FIXME: make pure
|
|
|
|
|
virtual void removeBreakpoint(Breakpoint bp); // FIXME: make pure
|
|
|
|
|
virtual void changeBreakpoint(Breakpoint bp); // FIXME: make pure
|
2010-07-08 18:10:50 +02:00
|
|
|
|
2011-02-16 12:41:06 +01:00
|
|
|
virtual bool acceptsDebuggerCommands() const { return true; }
|
2014-01-04 01:34:51 +01:00
|
|
|
virtual void executeDebuggerCommand(const QString &command, DebuggerLanguages languages);
|
|
|
|
|
|
2015-03-19 12:42:53 +01:00
|
|
|
virtual void assignValueInDebugger(WatchItem *item,
|
2010-11-08 15:19:13 +01:00
|
|
|
const QString &expr, const QVariant &value);
|
2012-10-19 16:37:57 +02:00
|
|
|
virtual void selectThread(Internal::ThreadId threadId) = 0;
|
2010-07-21 14:24:29 +02:00
|
|
|
|
2011-01-12 12:10:12 +01:00
|
|
|
virtual Internal::ModulesHandler *modulesHandler() const;
|
|
|
|
|
virtual Internal::RegisterHandler *registerHandler() const;
|
|
|
|
|
virtual Internal::StackHandler *stackHandler() const;
|
|
|
|
|
virtual Internal::ThreadsHandler *threadsHandler() const;
|
|
|
|
|
virtual Internal::WatchHandler *watchHandler() const;
|
|
|
|
|
virtual Internal::SourceFilesHandler *sourceFilesHandler() const;
|
|
|
|
|
virtual Internal::BreakHandler *breakHandler() const;
|
2010-06-16 11:08:54 +02:00
|
|
|
|
2010-08-18 13:54:12 +02:00
|
|
|
virtual QAbstractItemModel *modulesModel() const;
|
|
|
|
|
virtual QAbstractItemModel *registerModel() const;
|
|
|
|
|
virtual QAbstractItemModel *stackModel() const;
|
|
|
|
|
virtual QAbstractItemModel *threadsModel() const;
|
2012-05-18 02:28:41 +02:00
|
|
|
virtual QAbstractItemModel *watchModel() const;
|
2010-08-18 13:54:12 +02:00
|
|
|
virtual QAbstractItemModel *sourceFilesModel() const;
|
2010-06-16 11:08:54 +02:00
|
|
|
|
2010-07-21 11:02:51 +02:00
|
|
|
void progressPing();
|
2010-06-22 15:14:44 +02:00
|
|
|
void handleFinished();
|
2010-07-20 18:31:35 +02:00
|
|
|
void handleStartFailed();
|
2010-06-16 11:08:54 +02:00
|
|
|
bool debuggerActionsEnabled() const;
|
|
|
|
|
static bool debuggerActionsEnabled(DebuggerState state);
|
|
|
|
|
|
|
|
|
|
DebuggerState state() const;
|
2010-07-09 17:07:59 +02:00
|
|
|
DebuggerState lastGoodState() const;
|
|
|
|
|
DebuggerState targetState() const;
|
2010-09-13 13:30:35 +02:00
|
|
|
bool isDying() const;
|
2010-06-16 11:08:54 +02:00
|
|
|
|
|
|
|
|
static const char *stateName(int s);
|
|
|
|
|
|
|
|
|
|
void notifyInferiorPid(qint64 pid);
|
|
|
|
|
qint64 inferiorPid() const;
|
|
|
|
|
bool isReverseDebugging() const;
|
2010-06-22 15:37:27 +02:00
|
|
|
void handleCommand(int role, const QVariant &value);
|
2010-06-16 11:08:54 +02:00
|
|
|
|
2010-07-09 08:48:33 +02:00
|
|
|
// Convenience
|
2011-02-21 17:01:40 +01:00
|
|
|
Q_SLOT virtual void showMessage(const QString &msg, int channel = LogDebug,
|
2010-12-14 12:21:29 +01:00
|
|
|
int timeout = -1) const;
|
2010-07-14 16:01:53 +02:00
|
|
|
Q_SLOT void showStatusMessage(const QString &msg, int timeout = -1) const;
|
2010-07-09 08:48:33 +02:00
|
|
|
|
2011-10-12 17:26:18 +02:00
|
|
|
virtual void resetLocation();
|
2010-12-16 19:06:33 +01:00
|
|
|
virtual void gotoLocation(const Internal::Location &location);
|
2014-05-27 17:27:31 +02:00
|
|
|
Q_SLOT virtual void quitDebugger(); // called by DebuggerRunControl
|
2011-10-31 17:36:08 +01:00
|
|
|
virtual void abortDebugger(); // called by DebuggerPlugin
|
2010-06-16 11:08:54 +02:00
|
|
|
|
2010-10-27 14:21:33 +02:00
|
|
|
virtual void updateViews();
|
2010-10-28 08:55:50 +02:00
|
|
|
bool isSlaveEngine() const;
|
2011-01-14 14:25:02 +01:00
|
|
|
bool isMasterEngine() const;
|
2011-01-12 13:43:23 +01:00
|
|
|
DebuggerEngine *masterEngine() const;
|
2015-03-04 17:43:59 +01:00
|
|
|
virtual DebuggerEngine *cppEngine() { return 0; }
|
2010-10-27 14:21:33 +02:00
|
|
|
|
2015-06-08 18:07:11 +02:00
|
|
|
virtual bool canDisplayTooltip() const;
|
2011-01-24 16:58:35 +01:00
|
|
|
|
2011-02-11 14:20:23 +01:00
|
|
|
virtual void notifyInferiorIll();
|
|
|
|
|
|
2012-02-22 11:50:05 +01:00
|
|
|
QString toFileInProject(const QUrl &fileUrl);
|
|
|
|
|
|
2010-08-18 13:54:12 +02:00
|
|
|
signals:
|
2012-03-29 16:00:34 +02:00
|
|
|
void stateChanged(Debugger::DebuggerState state);
|
2011-02-11 15:00:13 +01:00
|
|
|
// A new stack frame is on display including locals.
|
|
|
|
|
void stackFrameCompleted();
|
2010-12-10 12:41:44 +01:00
|
|
|
/*
|
2010-12-16 19:06:33 +01:00
|
|
|
* For "external" clients of a debugger run control that needs to do
|
2013-10-09 12:22:20 +02:00
|
|
|
* further setup before the debugger is started (e.g. RemoteLinux).
|
2014-09-18 19:21:27 +02:00
|
|
|
* Afterwards, notifyEngineRemoteSetupFinished
|
|
|
|
|
* must be called to continue or abort debugging.
|
2010-12-10 12:41:44 +01:00
|
|
|
* This signal is only emitted if the start parameters indicate that
|
|
|
|
|
* a server start script should be used, but none is given.
|
|
|
|
|
*/
|
|
|
|
|
void requestRemoteSetup();
|
2014-12-12 15:33:16 +01:00
|
|
|
void aboutToNotifyInferiorSetupOk();
|
2010-08-18 13:54:12 +02:00
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
protected:
|
2010-08-11 09:46:39 +02:00
|
|
|
// The base notify*() function implementation should be sufficient
|
|
|
|
|
// in most cases, but engines are free to override them to do some
|
|
|
|
|
// engine specific cleanup like stopping timers etc.
|
|
|
|
|
virtual void notifyEngineSetupOk();
|
|
|
|
|
virtual void notifyEngineSetupFailed();
|
|
|
|
|
virtual void notifyEngineRunFailed();
|
2010-06-16 11:08:54 +02:00
|
|
|
|
2012-01-31 13:23:05 +01:00
|
|
|
virtual void notifyEngineRequestRemoteSetup();
|
2012-06-13 11:29:26 +02:00
|
|
|
public:
|
2013-02-27 15:12:36 +01:00
|
|
|
virtual void notifyEngineRemoteServerRunning(const QByteArray &, int pid);
|
2014-09-18 19:21:27 +02:00
|
|
|
virtual void notifyEngineRemoteSetupFinished(const RemoteSetupResult &result);
|
2012-01-31 13:23:05 +01:00
|
|
|
|
2012-06-13 11:29:26 +02:00
|
|
|
protected:
|
2010-08-11 09:46:39 +02:00
|
|
|
virtual void notifyInferiorSetupOk();
|
|
|
|
|
virtual void notifyInferiorSetupFailed();
|
2010-07-08 18:10:50 +02:00
|
|
|
|
2010-08-11 09:46:39 +02:00
|
|
|
virtual void notifyEngineRunAndInferiorRunOk();
|
|
|
|
|
virtual void notifyEngineRunAndInferiorStopOk();
|
2015-02-26 15:21:43 +01:00
|
|
|
virtual void notifyEngineRunOkAndInferiorUnrunnable(); // Called by CoreAdapter.
|
2010-07-13 08:41:27 +02:00
|
|
|
|
|
|
|
|
// Use notifyInferiorRunRequested() plus notifyInferiorRunOk() instead.
|
2010-08-11 09:46:39 +02:00
|
|
|
//virtual void notifyInferiorSpontaneousRun();
|
2010-07-09 17:07:59 +02:00
|
|
|
|
2010-08-11 09:46:39 +02:00
|
|
|
virtual void notifyInferiorRunRequested();
|
|
|
|
|
virtual void notifyInferiorRunOk();
|
|
|
|
|
virtual void notifyInferiorRunFailed();
|
2010-07-09 17:07:59 +02:00
|
|
|
|
2010-08-11 09:46:39 +02:00
|
|
|
virtual void notifyInferiorStopOk();
|
|
|
|
|
virtual void notifyInferiorSpontaneousStop();
|
|
|
|
|
virtual void notifyInferiorStopFailed();
|
2014-12-12 15:33:16 +01:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
virtual void notifyInferiorExited();
|
2015-03-05 11:11:32 +01:00
|
|
|
void notifyDebuggerProcessFinished(int exitCode, QProcess::ExitStatus exitStatus,
|
|
|
|
|
const QString &backendName);
|
2010-07-09 17:07:59 +02:00
|
|
|
|
2014-10-24 10:07:31 +02:00
|
|
|
protected:
|
2010-08-11 09:46:39 +02:00
|
|
|
virtual void notifyInferiorShutdownOk();
|
|
|
|
|
virtual void notifyInferiorShutdownFailed();
|
2010-07-09 17:07:59 +02:00
|
|
|
|
2010-08-11 09:46:39 +02:00
|
|
|
virtual void notifyEngineSpontaneousShutdown();
|
|
|
|
|
virtual void notifyEngineShutdownOk();
|
|
|
|
|
virtual void notifyEngineShutdownFailed();
|
2010-07-09 08:48:33 +02:00
|
|
|
|
2010-08-11 09:46:39 +02:00
|
|
|
virtual void notifyEngineIll();
|
2010-07-09 08:48:33 +02:00
|
|
|
|
2010-07-09 17:07:59 +02:00
|
|
|
virtual void setupEngine() = 0;
|
|
|
|
|
virtual void setupInferior() = 0;
|
|
|
|
|
virtual void runEngine() = 0;
|
|
|
|
|
virtual void shutdownInferior() = 0;
|
|
|
|
|
virtual void shutdownEngine() = 0;
|
2014-06-05 17:22:51 +02:00
|
|
|
virtual void resetInferior() {}
|
2010-07-08 18:10:50 +02:00
|
|
|
|
2011-01-12 13:43:23 +01:00
|
|
|
virtual void detachDebugger();
|
|
|
|
|
virtual void exitDebugger();
|
|
|
|
|
virtual void executeStep();
|
2011-10-31 17:36:08 +01:00
|
|
|
virtual void executeStepOut();
|
2011-01-12 13:43:23 +01:00
|
|
|
virtual void executeNext();
|
|
|
|
|
virtual void executeStepI();
|
|
|
|
|
virtual void executeNextI();
|
|
|
|
|
virtual void executeReturn();
|
|
|
|
|
|
|
|
|
|
virtual void continueInferior();
|
|
|
|
|
virtual void interruptInferior();
|
|
|
|
|
virtual void requestInterruptInferior();
|
|
|
|
|
|
2011-02-23 10:16:11 +01:00
|
|
|
virtual void executeRunToLine(const Internal::ContextData &data);
|
2011-01-12 13:43:23 +01:00
|
|
|
virtual void executeRunToFunction(const QString &functionName);
|
2011-02-23 10:16:11 +01:00
|
|
|
virtual void executeJumpToLine(const Internal::ContextData &data);
|
2011-01-12 13:43:23 +01:00
|
|
|
|
|
|
|
|
virtual void frameUp();
|
|
|
|
|
virtual void frameDown();
|
|
|
|
|
|
2015-06-08 18:07:11 +02:00
|
|
|
virtual void doUpdateLocals(const UpdateParameters ¶ms);
|
|
|
|
|
|
2012-01-19 14:42:16 +01:00
|
|
|
void setTargetState(DebuggerState state);
|
2012-08-15 14:33:39 +02:00
|
|
|
void setMasterEngine(DebuggerEngine *masterEngine);
|
2012-01-19 14:42:16 +01:00
|
|
|
|
2011-01-14 14:25:02 +01:00
|
|
|
DebuggerRunControl *runControl() const;
|
2015-01-14 16:58:10 +01:00
|
|
|
Terminal *terminal() const;
|
2010-07-08 15:06:09 +02:00
|
|
|
|
2010-11-17 17:16:34 +01:00
|
|
|
static QString msgStopped(const QString &reason = QString());
|
|
|
|
|
static QString msgStoppedBySignal(const QString &meaning, const QString &name);
|
2010-11-26 09:58:34 +01:00
|
|
|
static QString msgStoppedByException(const QString &description,
|
|
|
|
|
const QString &threadId);
|
2010-11-17 17:16:34 +01:00
|
|
|
static QString msgInterrupted();
|
2010-11-26 09:58:34 +01:00
|
|
|
void showStoppedBySignalMessageBox(const QString meaning, QString name);
|
2010-11-17 17:16:34 +01:00
|
|
|
void showStoppedByExceptionMessageBox(const QString &description);
|
|
|
|
|
|
2011-01-14 14:25:02 +01:00
|
|
|
bool isStateDebugging() const;
|
|
|
|
|
void setStateDebugging(bool on);
|
|
|
|
|
|
2015-05-27 13:59:56 +02:00
|
|
|
static void validateExecutable(DebuggerRunParameters *sp);
|
2013-03-04 00:42:36 -08:00
|
|
|
|
2011-01-14 18:16:40 +01:00
|
|
|
virtual void setupSlaveInferior();
|
|
|
|
|
virtual void setupSlaveEngine();
|
|
|
|
|
virtual void runSlaveEngine();
|
|
|
|
|
virtual void shutdownSlaveEngine();
|
|
|
|
|
|
2011-01-17 10:07:13 +01:00
|
|
|
virtual void slaveEngineStateChanged(DebuggerEngine *engine,
|
|
|
|
|
DebuggerState state);
|
|
|
|
|
|
2015-03-26 13:03:38 +01:00
|
|
|
void updateLocalsView(const GdbMi &all);
|
|
|
|
|
|
2010-06-22 17:18:29 +02:00
|
|
|
private:
|
2010-11-18 17:37:56 +01:00
|
|
|
// Wrapper engine needs access to state of its subengines.
|
2014-12-12 15:33:16 +01:00
|
|
|
friend class QmlCppEngine;
|
|
|
|
|
friend class DebuggerPluginPrivate;
|
|
|
|
|
friend class QmlAdapter;
|
2011-01-12 13:43:23 +01:00
|
|
|
|
2011-01-14 14:25:02 +01:00
|
|
|
virtual void setState(DebuggerState state, bool forced = false);
|
2010-11-18 17:37:56 +01:00
|
|
|
|
2010-07-08 18:10:50 +02:00
|
|
|
friend class DebuggerEnginePrivate;
|
2010-06-16 11:08:54 +02:00
|
|
|
DebuggerEnginePrivate *d;
|
|
|
|
|
};
|
|
|
|
|
|
2015-06-24 08:26:35 +02:00
|
|
|
DebuggerEngine *createEngine(DebuggerEngineType et, const DebuggerRunParameters &rp, QStringList *errors);
|
2015-05-27 13:59:56 +02:00
|
|
|
|
2015-06-24 08:26:35 +02:00
|
|
|
DebuggerRunControl *createAndScheduleRun(const DebuggerRunParameters &rp, const ProjectExplorer::Kit *kit);
|
2015-05-27 13:59:56 +02:00
|
|
|
|
2014-12-12 15:33:16 +01:00
|
|
|
} // namespace Internal
|
2010-06-16 11:08:54 +02:00
|
|
|
} // namespace Debugger
|
|
|
|
|
|
2015-06-08 18:07:11 +02:00
|
|
|
Q_DECLARE_METATYPE(Debugger::Internal::UpdateParameters)
|
2011-02-23 10:16:11 +01:00
|
|
|
Q_DECLARE_METATYPE(Debugger::Internal::ContextData)
|
|
|
|
|
|
2010-06-16 11:08:54 +02:00
|
|
|
#endif // DEBUGGER_DEBUGGERENGINE_H
|