2009-02-25 09:15:00 +01:00
|
|
|
/**************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-06-17 00:01:27 +10:00
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** Commercial Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15: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.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15: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.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15: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.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
**************************************************************************/
|
2008-12-02 15:08:31 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#ifndef DEBUGGER_GDBENGINE_H
|
|
|
|
#define DEBUGGER_GDBENGINE_H
|
|
|
|
|
2008-12-09 12:27:55 +01:00
|
|
|
#include "idebuggerengine.h"
|
2009-09-10 13:09:42 +02:00
|
|
|
#include "debuggermanager.h" // only for StartParameters
|
2008-12-09 12:27:55 +01:00
|
|
|
#include "gdbmi.h"
|
2009-09-11 15:53:08 +02:00
|
|
|
#include "abstractgdbadapter.h"
|
2009-01-15 14:47:14 +01:00
|
|
|
#include "outputcollector.h"
|
2009-04-29 14:15:09 +02:00
|
|
|
#include "watchutils.h"
|
2008-12-09 12:27:55 +01:00
|
|
|
|
2009-02-20 12:33:16 +01:00
|
|
|
#include <consoleprocess.h>
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <QtCore/QByteArray>
|
|
|
|
#include <QtCore/QHash>
|
|
|
|
#include <QtCore/QMap>
|
|
|
|
#include <QtCore/QObject>
|
|
|
|
#include <QtCore/QProcess>
|
|
|
|
#include <QtCore/QPoint>
|
2009-01-15 14:47:14 +01:00
|
|
|
#include <QtCore/QTextCodec>
|
2009-07-06 11:37:21 +02:00
|
|
|
#include <QtCore/QTime>
|
2008-12-02 12:01:29 +01:00
|
|
|
#include <QtCore/QVariant>
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QAction;
|
|
|
|
class QAbstractItemModel;
|
|
|
|
class QWidget;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
namespace Internal {
|
|
|
|
|
2009-09-09 12:39:15 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
class DebuggerManager;
|
|
|
|
class IDebuggerManagerAccessForEngines;
|
|
|
|
class GdbResultRecord;
|
|
|
|
class GdbMi;
|
|
|
|
|
|
|
|
class WatchData;
|
|
|
|
class BreakpointData;
|
|
|
|
|
2009-04-07 16:39:17 +02:00
|
|
|
enum DebuggingHelperState
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-04-07 16:39:17 +02:00
|
|
|
DebuggingHelperUninitialized,
|
|
|
|
DebuggingHelperLoadTried,
|
|
|
|
DebuggingHelperAvailable,
|
|
|
|
DebuggingHelperUnavailable,
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
2009-09-11 15:53:08 +02:00
|
|
|
class PlainGdbAdapter : public AbstractGdbAdapter
|
2009-09-09 12:39:15 +02:00
|
|
|
{
|
|
|
|
public:
|
2009-09-11 15:53:08 +02:00
|
|
|
PlainGdbAdapter(QObject *parent = 0)
|
|
|
|
: AbstractGdbAdapter(parent)
|
2009-09-09 12:39:15 +02:00
|
|
|
{
|
|
|
|
connect(&m_proc, SIGNAL(error(QProcess::ProcessError)),
|
|
|
|
this, SIGNAL(error(QProcess::ProcessError)));
|
|
|
|
connect(&m_proc, SIGNAL(readyReadStandardOutput()),
|
|
|
|
this, SIGNAL(readyReadStandardOutput()));
|
|
|
|
connect(&m_proc, SIGNAL(readyReadStandardError()),
|
|
|
|
this, SIGNAL(readyReadStandardError()));
|
2009-09-10 13:09:42 +02:00
|
|
|
connect(&m_proc, SIGNAL(started()),
|
|
|
|
this, SIGNAL(started()));
|
2009-09-09 12:39:15 +02:00
|
|
|
connect(&m_proc, SIGNAL(finished(int, QProcess::ExitStatus)),
|
|
|
|
this, SIGNAL(finished(int, QProcess::ExitStatus)));
|
|
|
|
}
|
|
|
|
|
|
|
|
void start(const QString &program, const QStringList &args,
|
|
|
|
QIODevice::OpenMode mode) { m_proc.start(program, args, mode); }
|
|
|
|
void kill() { m_proc.kill(); }
|
|
|
|
void terminate() { m_proc.terminate(); }
|
|
|
|
bool waitForStarted(int msecs) { return m_proc.waitForStarted(msecs); }
|
|
|
|
bool waitForFinished(int msecs) { return m_proc.waitForFinished(msecs); }
|
|
|
|
QProcess::ProcessState state() const { return m_proc.state(); }
|
|
|
|
QString errorString() const { return m_proc.errorString(); }
|
|
|
|
QByteArray readAllStandardError() { return m_proc.readAllStandardError(); }
|
|
|
|
QByteArray readAllStandardOutput() { return m_proc.readAllStandardOutput(); }
|
|
|
|
qint64 write(const char *data) { return m_proc.write(data); }
|
|
|
|
void setWorkingDirectory(const QString &dir) { m_proc.setWorkingDirectory(dir); }
|
|
|
|
void setEnvironment(const QStringList &env) { m_proc.setEnvironment(env); }
|
2009-09-10 16:30:04 +02:00
|
|
|
bool isAdapter() const { return false; }
|
2009-09-14 11:02:36 +02:00
|
|
|
void attach();
|
|
|
|
void interruptInferior();
|
2009-09-09 12:39:15 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
QProcess m_proc;
|
|
|
|
};
|
2008-12-11 14:01:53 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
class GdbEngine : public IDebuggerEngine
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2009-09-11 15:53:08 +02:00
|
|
|
GdbEngine(DebuggerManager *parent, AbstractGdbAdapter *gdbAdapter);
|
2008-12-02 12:01:29 +01:00
|
|
|
~GdbEngine();
|
|
|
|
|
|
|
|
signals:
|
2009-06-19 12:04:21 +02:00
|
|
|
void gdbInputAvailable(int channel, const QString &msg);
|
|
|
|
void gdbOutputAvailable(int channel, const QString &msg);
|
2009-01-15 14:30:49 +01:00
|
|
|
void applicationOutputAvailable(const QString &output);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
private:
|
2009-09-11 15:53:08 +02:00
|
|
|
friend class PlainGdbAdapter;
|
|
|
|
friend class TrkGdbAdapter;
|
2009-09-11 12:30:53 +02:00
|
|
|
|
|
|
|
const DebuggerStartParameters &startParameters() const
|
2009-09-17 14:17:43 +02:00
|
|
|
{ return *m_startParameters; }
|
2008-12-02 12:01:29 +01:00
|
|
|
//
|
|
|
|
// IDebuggerEngine implementation
|
|
|
|
//
|
|
|
|
void stepExec();
|
|
|
|
void stepOutExec();
|
|
|
|
void nextExec();
|
|
|
|
void stepIExec();
|
|
|
|
void nextIExec();
|
|
|
|
|
|
|
|
void shutdown();
|
2009-05-14 14:29:37 +02:00
|
|
|
void setToolTipExpression(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos);
|
2009-09-10 13:09:42 +02:00
|
|
|
void startDebugger(const QSharedPointer<DebuggerStartParameters> &sp);
|
|
|
|
Q_SLOT void startDebugger2();
|
2008-12-02 12:01:29 +01:00
|
|
|
void exitDebugger();
|
2009-09-16 13:43:03 +02:00
|
|
|
void exitDebugger2();
|
2009-05-07 15:20:44 +02:00
|
|
|
void detachDebugger();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
void continueInferior();
|
|
|
|
void interruptInferior();
|
|
|
|
|
|
|
|
void runToLineExec(const QString &fileName, int lineNumber);
|
|
|
|
void runToFunctionExec(const QString &functionName);
|
|
|
|
void jumpToLineExec(const QString &fileName, int lineNumber);
|
|
|
|
|
|
|
|
void activateFrame(int index);
|
|
|
|
void selectThread(int index);
|
|
|
|
|
|
|
|
Q_SLOT void attemptBreakpointSynchronization();
|
|
|
|
|
|
|
|
void assignValueInDebugger(const QString &expr, const QString &value);
|
|
|
|
void executeDebuggerCommand(const QString & command);
|
2009-07-01 12:49:41 +02:00
|
|
|
void watchPoint(const QPoint &);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
void loadSymbols(const QString &moduleName);
|
|
|
|
void loadAllSymbols();
|
2009-04-15 12:01:58 +02:00
|
|
|
virtual QList<Symbol> moduleSymbols(const QString &moduleName);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-08-12 10:51:25 +02:00
|
|
|
void fetchMemory(MemoryViewAgent *agent, quint64 addr, quint64 length);
|
|
|
|
void handleFetchMemory(const GdbResultRecord &record, const QVariant &cookie);
|
|
|
|
|
2009-08-14 13:04:05 +02:00
|
|
|
void fetchDisassembler(DisassemblerViewAgent *agent,
|
|
|
|
const StackFrame &frame);
|
|
|
|
void fetchDisassemblerByAddress(DisassemblerViewAgent *agent,
|
|
|
|
bool useMixedMode);
|
|
|
|
void handleFetchDisassemblerByLine(const GdbResultRecord &record,
|
|
|
|
const QVariant &cookie);
|
|
|
|
void handleFetchDisassemblerByAddress1(const GdbResultRecord &record,
|
|
|
|
const QVariant &cookie);
|
|
|
|
void handleFetchDisassemblerByAddress0(const GdbResultRecord &record,
|
|
|
|
const QVariant &cookie);
|
|
|
|
|
2009-04-07 16:39:17 +02:00
|
|
|
Q_SLOT void setDebugDebuggingHelpers(const QVariant &on);
|
|
|
|
Q_SLOT void setUseDebuggingHelpers(const QVariant &on);
|
2009-01-27 15:53:50 +01:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
//
|
|
|
|
// Own stuff
|
|
|
|
//
|
2009-04-20 16:40:50 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
int currentFrame() const;
|
|
|
|
|
|
|
|
bool supportsThreads() const;
|
|
|
|
|
2009-02-13 13:50:50 +01:00
|
|
|
void initializeConnections();
|
|
|
|
void initializeVariables();
|
2008-12-02 12:01:29 +01:00
|
|
|
QString fullName(const QString &fileName);
|
|
|
|
// get one usable name out of these, try full names first
|
|
|
|
QString fullName(const QStringList &candidates);
|
|
|
|
|
|
|
|
void handleResult(const GdbResultRecord &, int type, const QVariant &);
|
|
|
|
|
2009-05-04 18:30:22 +02:00
|
|
|
public: // otherwise the Qt flag macros are unhappy
|
|
|
|
enum GdbCommandFlag {
|
|
|
|
NoFlags = 0,
|
|
|
|
NeedsStop = 1,
|
|
|
|
Discardable = 2,
|
|
|
|
RebuildModel = 4,
|
2009-08-18 11:23:01 +02:00
|
|
|
WatchUpdate = Discardable | RebuildModel,
|
2009-05-06 14:07:55 +02:00
|
|
|
EmbedToken = 8
|
2009-05-04 18:30:22 +02:00
|
|
|
};
|
|
|
|
Q_DECLARE_FLAGS(GdbCommandFlags, GdbCommandFlag)
|
|
|
|
|
2009-09-11 12:30:53 +02:00
|
|
|
|
2009-08-18 11:23:01 +02:00
|
|
|
private:
|
2009-05-04 18:30:22 +02:00
|
|
|
typedef void (GdbEngine::*GdbCommandCallback)(const GdbResultRecord &record, const QVariant &cookie);
|
|
|
|
|
|
|
|
struct GdbCommand
|
|
|
|
{
|
|
|
|
GdbCommand() : flags(0), callback(0), callbackName(0) {}
|
|
|
|
|
|
|
|
int flags;
|
|
|
|
GdbCommandCallback callback;
|
|
|
|
const char *callbackName;
|
|
|
|
QString command;
|
|
|
|
QVariant cookie;
|
2009-07-06 11:37:21 +02:00
|
|
|
QTime postTime;
|
2009-05-04 18:30:22 +02:00
|
|
|
};
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
// type and cookie are sender-internal data, opaque for the "event
|
|
|
|
// queue". resultNeeded == true increments m_pendingResults on
|
|
|
|
// send and decrements on receipt, effectively preventing
|
|
|
|
// watch model updates before everything is finished.
|
2009-05-04 18:30:22 +02:00
|
|
|
void flushCommand(GdbCommand &cmd);
|
2009-05-07 09:51:21 +02:00
|
|
|
void postCommand(const QString &command,
|
2009-05-05 11:16:54 +02:00
|
|
|
GdbCommandFlags flags,
|
|
|
|
GdbCommandCallback callback = 0,
|
|
|
|
const char *callbackName = 0,
|
|
|
|
const QVariant &cookie = QVariant());
|
2009-05-07 09:51:21 +02:00
|
|
|
void postCommand(const QString &command,
|
2009-05-05 11:16:54 +02:00
|
|
|
GdbCommandCallback callback = 0,
|
|
|
|
const char *callbackName = 0,
|
|
|
|
const QVariant &cookie = QVariant());
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
void setTokenBarrier();
|
|
|
|
|
|
|
|
void updateLocals();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void gdbProcError(QProcess::ProcessError error);
|
|
|
|
void readGdbStandardOutput();
|
|
|
|
void readGdbStandardError();
|
2009-05-07 14:53:53 +02:00
|
|
|
void readUploadStandardOutput();
|
|
|
|
void readUploadStandardError();
|
2009-01-15 14:47:14 +01:00
|
|
|
void readDebugeeOutput(const QByteArray &data);
|
2009-02-20 12:33:16 +01:00
|
|
|
void stubStarted();
|
|
|
|
void stubError(const QString &msg);
|
2009-05-06 16:11:42 +02:00
|
|
|
void uploadProcError(QProcess::ProcessError error);
|
2009-09-11 09:51:05 +02:00
|
|
|
void emitStartFailed();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
int terminationIndex(const QByteArray &buffer, int &length);
|
2009-02-24 20:34:30 +01:00
|
|
|
void handleResponse(const QByteArray &buff);
|
2009-05-04 18:30:22 +02:00
|
|
|
void handleStart(const GdbResultRecord &response, const QVariant &);
|
|
|
|
void handleAttach(const GdbResultRecord &, const QVariant &);
|
|
|
|
void handleStubAttached(const GdbResultRecord &, const QVariant &);
|
2009-02-18 15:27:56 +01:00
|
|
|
void handleAqcuiredInferior();
|
2009-05-04 18:30:22 +02:00
|
|
|
void handleAsyncOutput2(const GdbResultRecord &, const QVariant &cookie);
|
2008-12-02 12:01:29 +01:00
|
|
|
void handleAsyncOutput2(const GdbMi &data);
|
|
|
|
void handleAsyncOutput(const GdbMi &data);
|
|
|
|
void handleResultRecord(const GdbResultRecord &response);
|
2009-05-04 18:30:22 +02:00
|
|
|
void handleFileExecAndSymbols(const GdbResultRecord &response, const QVariant &);
|
2009-07-21 14:37:51 +02:00
|
|
|
void handleExecContinue(const GdbResultRecord &response, const QVariant &);
|
2009-05-04 18:30:22 +02:00
|
|
|
void handleExecRun(const GdbResultRecord &response, const QVariant &);
|
|
|
|
void handleExecJumpToLine(const GdbResultRecord &response, const QVariant &);
|
|
|
|
void handleExecRunToFunction(const GdbResultRecord &response, const QVariant &);
|
|
|
|
void handleInfoShared(const GdbResultRecord &response, const QVariant &);
|
|
|
|
void handleInfoProc(const GdbResultRecord &response, const QVariant &);
|
|
|
|
void handleInfoThreads(const GdbResultRecord &response, const QVariant &);
|
|
|
|
void handleShowVersion(const GdbResultRecord &response, const QVariant &);
|
|
|
|
void handleQueryPwd(const GdbResultRecord &response, const QVariant &);
|
|
|
|
void handleQuerySources(const GdbResultRecord &response, const QVariant &);
|
|
|
|
void handleTargetCore(const GdbResultRecord &, const QVariant &);
|
|
|
|
void handleExit(const GdbResultRecord &, const QVariant &);
|
2009-09-16 13:43:03 +02:00
|
|
|
void handleExitHelper(const GdbResultRecord &, const QVariant &);
|
2009-05-07 09:35:11 +02:00
|
|
|
void handleSetTargetAsync(const GdbResultRecord &, const QVariant &);
|
|
|
|
void handleTargetRemote(const GdbResultRecord &, const QVariant &);
|
2009-07-01 12:49:41 +02:00
|
|
|
void handleWatchPoint(const GdbResultRecord &, const QVariant &);
|
2009-02-16 13:29:57 +01:00
|
|
|
void debugMessage(const QString &msg);
|
2009-06-24 12:31:09 +02:00
|
|
|
bool showToolTip();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-09-14 11:02:36 +02:00
|
|
|
// Convenience
|
|
|
|
DebuggerManager *manager() { return m_manager; }
|
|
|
|
void showStatusMessage(const QString &msg, int timeout = -1)
|
|
|
|
{ m_manager->showStatusMessage(msg, timeout); }
|
|
|
|
int status() const { return m_manager->status(); }
|
|
|
|
QMainWindow *mainWindow() const { return m_manager->mainWindow(); }
|
2009-09-17 14:17:43 +02:00
|
|
|
DebuggerStartMode startMode() const { return m_startParameters->startMode; }
|
2009-09-14 11:02:36 +02:00
|
|
|
qint64 inferiorPid() const { return m_manager->inferiorPid(); }
|
|
|
|
|
2009-08-28 15:36:52 +02:00
|
|
|
void handleChildren(const WatchData &parent, const GdbMi &child,
|
|
|
|
QList<WatchData> *insertions);
|
2009-05-14 15:03:30 +02:00
|
|
|
const bool m_dumperInjectionLoad;
|
|
|
|
|
2009-01-15 14:47:14 +01:00
|
|
|
OutputCollector m_outputCollector;
|
|
|
|
QTextCodec *m_outputCodec;
|
|
|
|
QTextCodec::ConverterState m_outputCodecState;
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
QByteArray m_inbuffer;
|
|
|
|
|
2009-09-11 15:53:08 +02:00
|
|
|
AbstractGdbAdapter *m_gdbAdapter;
|
2009-05-06 16:11:42 +02:00
|
|
|
QProcess m_uploadProc;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-02-20 12:33:16 +01:00
|
|
|
Core::Utils::ConsoleProcess m_stubProc;
|
|
|
|
|
2009-05-04 18:30:22 +02:00
|
|
|
QHash<int, GdbCommand> m_cookieForToken;
|
2008-12-02 12:01:29 +01:00
|
|
|
QHash<int, QByteArray> m_customOutputForToken;
|
|
|
|
|
|
|
|
QByteArray m_pendingConsoleStreamOutput;
|
|
|
|
QByteArray m_pendingTargetStreamOutput;
|
|
|
|
QByteArray m_pendingLogStreamOutput;
|
|
|
|
|
|
|
|
// contains the first token number for the current round
|
|
|
|
// of evaluation. Responses with older tokens are considers
|
|
|
|
// out of date and discarded.
|
|
|
|
int m_oldestAcceptableToken;
|
|
|
|
|
|
|
|
int m_gdbVersion; // 6.8.0 is 680
|
2009-02-23 16:06:23 +01:00
|
|
|
int m_gdbBuildVersion; // MAC only?
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
// awful hack to keep track of used files
|
2009-02-17 14:08:49 +01:00
|
|
|
QMap<QString, QString> m_shortToFullName;
|
|
|
|
QMap<QString, QString> m_fullToShortName;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
//
|
|
|
|
// Breakpoint specific stuff
|
|
|
|
//
|
2009-05-04 18:30:22 +02:00
|
|
|
void handleBreakList(const GdbResultRecord &record, const QVariant &);
|
2008-12-02 12:01:29 +01:00
|
|
|
void handleBreakList(const GdbMi &table);
|
2009-05-04 18:30:22 +02:00
|
|
|
void handleBreakIgnore(const GdbResultRecord &record, const QVariant &cookie);
|
|
|
|
void handleBreakInsert(const GdbResultRecord &record, const QVariant &cookie);
|
|
|
|
void handleBreakInsert1(const GdbResultRecord &record, const QVariant &cookie);
|
|
|
|
void handleBreakCondition(const GdbResultRecord &record, const QVariant &cookie);
|
|
|
|
void handleBreakInfo(const GdbResultRecord &record, const QVariant &cookie);
|
2008-12-02 12:01:29 +01:00
|
|
|
void extractDataFromInfoBreak(const QString &output, BreakpointData *data);
|
|
|
|
void breakpointDataFromOutput(BreakpointData *data, const GdbMi &bkpt);
|
|
|
|
void sendInsertBreakpoint(int index);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Modules specific stuff
|
|
|
|
//
|
|
|
|
void reloadModules();
|
2009-05-04 18:30:22 +02:00
|
|
|
void handleModulesList(const GdbResultRecord &record, const QVariant &);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Register specific stuff
|
|
|
|
//
|
2009-03-24 16:39:01 +01:00
|
|
|
Q_SLOT void reloadRegisters();
|
2009-08-18 08:34:48 +02:00
|
|
|
void setRegisterValue(int nr, const QString &value);
|
2009-05-04 18:30:22 +02:00
|
|
|
void handleRegisterListNames(const GdbResultRecord &record, const QVariant &);
|
|
|
|
void handleRegisterListValues(const GdbResultRecord &record, const QVariant &);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-02-17 14:08:49 +01:00
|
|
|
//
|
|
|
|
// Source file specific stuff
|
|
|
|
//
|
|
|
|
void reloadSourceFiles();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
//
|
|
|
|
// Stack specific stuff
|
|
|
|
//
|
2009-05-04 18:30:22 +02:00
|
|
|
void handleStackListFrames(const GdbResultRecord &record, const QVariant &cookie);
|
|
|
|
void handleStackSelectThread(const GdbResultRecord &, const QVariant &);
|
|
|
|
void handleStackListThreads(const GdbResultRecord &record, const QVariant &cookie);
|
2009-04-06 17:27:15 +02:00
|
|
|
Q_SLOT void reloadStack();
|
|
|
|
Q_SLOT void reloadFullStack();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Tooltip specific stuff
|
|
|
|
//
|
|
|
|
void sendToolTipCommand(const QString &command, const QString &cookie);
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// Watch specific stuff
|
|
|
|
//
|
|
|
|
// FIXME: BaseClass. called to improve situation for a watch item
|
|
|
|
void updateSubItem(const WatchData &data);
|
|
|
|
|
2009-07-13 09:11:07 +02:00
|
|
|
void updateWatchData(const WatchData &data);
|
2009-08-31 09:14:04 +02:00
|
|
|
Q_SLOT void updateWatchDataHelper(const WatchData &data);
|
2009-06-17 16:00:03 +02:00
|
|
|
void rebuildModel();
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
void insertData(const WatchData &data);
|
|
|
|
void sendWatchParameters(const QByteArray ¶ms0);
|
|
|
|
void createGdbVariable(const WatchData &data);
|
|
|
|
|
|
|
|
void maybeHandleInferiorPidChanged(const QString &pid);
|
|
|
|
|
2009-04-07 16:39:17 +02:00
|
|
|
void tryLoadDebuggingHelpers();
|
2009-05-14 15:03:30 +02:00
|
|
|
void tryQueryDebuggingHelpers();
|
2009-04-07 16:39:17 +02:00
|
|
|
Q_SLOT void recheckDebuggingHelperAvailability();
|
|
|
|
void runDebuggingHelper(const WatchData &data, bool dumpChildren);
|
|
|
|
void runDirectDebuggingHelper(const WatchData &data, bool dumpChildren);
|
|
|
|
bool hasDebuggingHelperForType(const QString &type) const;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
void handleVarListChildren(const GdbResultRecord &record,
|
2009-05-04 18:30:22 +02:00
|
|
|
const QVariant &cookie);
|
2008-12-02 12:01:29 +01:00
|
|
|
void handleVarCreate(const GdbResultRecord &record,
|
2009-05-04 18:30:22 +02:00
|
|
|
const QVariant &cookie);
|
|
|
|
void handleVarAssign(const GdbResultRecord &, const QVariant &);
|
2008-12-02 12:01:29 +01:00
|
|
|
void handleEvaluateExpression(const GdbResultRecord &record,
|
2009-05-04 18:30:22 +02:00
|
|
|
const QVariant &cookie);
|
2009-06-24 12:31:09 +02:00
|
|
|
//void handleToolTip(const GdbResultRecord &record,
|
|
|
|
// const QVariant &cookie);
|
2009-05-04 18:30:22 +02:00
|
|
|
void handleQueryDebuggingHelper(const GdbResultRecord &record, const QVariant &);
|
2009-04-07 16:39:17 +02:00
|
|
|
void handleDebuggingHelperValue1(const GdbResultRecord &record,
|
2009-05-04 18:30:22 +02:00
|
|
|
const QVariant &cookie);
|
2009-04-07 16:39:17 +02:00
|
|
|
void handleDebuggingHelperValue2(const GdbResultRecord &record,
|
2009-05-04 18:30:22 +02:00
|
|
|
const QVariant &cookie);
|
2009-04-07 16:39:17 +02:00
|
|
|
void handleDebuggingHelperValue3(const GdbResultRecord &record,
|
2009-05-04 18:30:22 +02:00
|
|
|
const QVariant &cookie);
|
2009-04-07 16:39:17 +02:00
|
|
|
void handleDebuggingHelperEditValue(const GdbResultRecord &record);
|
2009-05-04 18:30:22 +02:00
|
|
|
void handleDebuggingHelperSetup(const GdbResultRecord &record, const QVariant &);
|
|
|
|
void handleStackListLocals(const GdbResultRecord &record, const QVariant &);
|
|
|
|
void handleStackListArguments(const GdbResultRecord &record, const QVariant &);
|
2008-12-02 12:01:29 +01:00
|
|
|
void handleVarListChildrenHelper(const GdbMi &child,
|
|
|
|
const WatchData &parent);
|
|
|
|
void setWatchDataType(WatchData &data, const GdbMi &mi);
|
2009-08-25 17:32:14 +02:00
|
|
|
void setWatchDataDisplayedType(WatchData &data, const GdbMi &mi);
|
2008-12-03 16:51:56 +01:00
|
|
|
void setLocals(const QList<GdbMi> &locals);
|
2009-05-06 16:11:42 +02:00
|
|
|
|
|
|
|
bool startModeAllowsDumpers() const;
|
2009-08-18 11:23:01 +02:00
|
|
|
QString parseDisassembler(const GdbMi &lines);
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
int m_pendingRequests;
|
2009-08-20 13:51:05 +02:00
|
|
|
QSet<QString> m_processedNames;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-04-29 14:15:09 +02:00
|
|
|
QtDumperHelper m_dumperHelper;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-04-07 16:39:17 +02:00
|
|
|
DebuggingHelperState m_debuggingHelperState;
|
2008-12-02 12:01:29 +01:00
|
|
|
QList<GdbMi> m_currentFunctionArgs;
|
|
|
|
QString m_currentFrame;
|
|
|
|
QMap<QString, QString> m_varToType;
|
|
|
|
|
2009-05-07 12:18:45 +02:00
|
|
|
bool m_autoContinue;
|
2009-02-13 16:55:24 +01:00
|
|
|
bool m_waitingForFirstBreakpointToBeHit;
|
2009-02-13 13:50:50 +01:00
|
|
|
bool m_modulesListOutdated;
|
2009-02-13 12:34:10 +01:00
|
|
|
|
2009-05-04 18:30:22 +02:00
|
|
|
QList<GdbCommand> m_commandsToRunOnTemporaryBreak;
|
2009-02-16 18:28:15 +01:00
|
|
|
|
2009-09-14 11:02:36 +02:00
|
|
|
DebuggerManager * const m_manager;
|
2009-06-29 13:53:41 +02:00
|
|
|
IDebuggerManagerAccessForEngines * const qq;
|
2009-09-17 14:17:43 +02:00
|
|
|
DebuggerStartParametersPtr m_startParameters;
|
2009-06-29 13:53:41 +02:00
|
|
|
// make sure to re-initialize new members in initializeVariables();
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
} // namespace Debugger
|
|
|
|
|
2009-05-04 18:30:22 +02:00
|
|
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Debugger::Internal::GdbEngine::GdbCommandFlags)
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
#endif // DEBUGGER_GDBENGINE_H
|