RedPanda-CPP/RedPandaIDE/debugger/debugger.h

627 lines
21 KiB
C
Raw Normal View History

2021-12-26 23:18:28 +08:00
/*
* Copyright (C) 2020-2022 Roy Qu (royqh1979@gmail.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2021-07-03 21:57:50 +08:00
#ifndef DEBUGGER_H
#define DEBUGGER_H
2021-07-17 19:32:23 +08:00
#include <QAbstractTableModel>
2021-07-03 21:57:50 +08:00
#include <QList>
#include <QList>
2021-07-17 19:32:23 +08:00
#include <QMap>
2021-07-03 21:57:50 +08:00
#include <QMutex>
#include <QObject>
2021-07-19 23:02:32 +08:00
#include <QProcess>
2021-07-03 21:57:50 +08:00
#include <QQueue>
#include <QQueue>
2021-07-27 00:14:24 +08:00
#include <QSemaphore>
#include <QSet>
2021-07-19 23:02:32 +08:00
#include <QThread>
#include <QTimer>
2021-07-03 21:57:50 +08:00
#include <memory>
2021-11-20 07:53:39 +08:00
#include "gdbmiresultparser.h"
2021-07-03 21:57:50 +08:00
enum class DebugCommandSource {
Console,
HeartBeat,
2021-07-03 21:57:50 +08:00
Other
};
enum class DebuggerType {
GDB,
2024-03-09 11:34:52 +08:00
LLDB_MI,
DAP
};
2021-07-31 14:04:43 +08:00
struct WatchVar;
using PWatchVar = std::shared_ptr<WatchVar>;
2021-07-17 19:32:23 +08:00
struct WatchVar {
QString name;
2021-11-25 11:24:38 +08:00
QString expression;
bool hasMore;
2021-09-19 09:45:03 +08:00
QString value;
2021-11-25 11:24:38 +08:00
QString type;
int numChild;
2021-07-31 14:04:43 +08:00
QList<PWatchVar> children;
std::weak_ptr<WatchVar> parent; //use raw point to prevent circular-reference
qint64 timestamp;
2021-07-17 19:32:23 +08:00
};
enum class BreakpointType {
Breakpoint,
Watchpoint,
ReadWatchpoint,
WriteWatchpoint
};
2021-07-03 21:57:50 +08:00
struct Breakpoint {
2021-11-12 10:51:00 +08:00
int number; // breakpoint number
QString type; // type of the breakpoint
QString catch_type;
2021-07-03 21:57:50 +08:00
int line;
2021-07-24 11:18:25 +08:00
QString filename;
2021-07-03 21:57:50 +08:00
QString condition;
bool enabled;
2022-01-02 11:43:23 +08:00
BreakpointType breakpointType;
qint64 timestamp;
2021-07-03 21:57:50 +08:00
};
using PBreakpoint = std::shared_ptr<Breakpoint>;
struct DebugConfig {
QList<PBreakpoint> breakpoints;
QList<PWatchVar> watchVars;
qint64 timestamp;
};
using PDebugConfig=std::shared_ptr<DebugConfig>;
2021-07-03 21:57:50 +08:00
struct Trace {
QString funcname;
QString filename;
2021-11-23 21:08:33 +08:00
QString address;
2021-07-03 21:57:50 +08:00
int line;
2021-11-23 21:08:33 +08:00
int level;
2021-07-03 21:57:50 +08:00
};
using PTrace = std::shared_ptr<Trace>;
2021-08-01 23:24:37 +08:00
class RegisterModel: public QAbstractTableModel {
Q_OBJECT
public:
explicit RegisterModel(QObject* parent = nullptr);
int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
2021-11-25 09:05:45 +08:00
void updateNames(const QStringList& regNames);
void updateValues(const QHash<int,QString> registerValues);
2021-08-01 23:24:37 +08:00
void clear();
private:
QHash<QString,QString> mRegisterDescriptions;
2021-11-25 09:05:45 +08:00
QStringList mRegisterNames;
QHash<int,int> mRegisterNameIndex;
2021-11-25 09:05:45 +08:00
QHash<int,QString> mRegisterValues;
2021-08-01 23:24:37 +08:00
};
class Debugger;
2021-07-17 19:32:23 +08:00
class BreakpointModel: public QAbstractTableModel {
2021-07-24 11:18:25 +08:00
Q_OBJECT
2021-07-17 19:32:23 +08:00
// QAbstractItemModel interface
public:
2021-07-24 11:18:25 +08:00
explicit BreakpointModel(QObject *parent = nullptr);
2021-07-17 19:32:23 +08:00
int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
void addBreakpoint(PBreakpoint p, bool forProject);
void clear(bool forProject);
void removeBreakpoint(int index, bool forProject);
void removeBreakpointsInFile(const QString& fileName, bool forProject);
void renameBreakpointFilenames(const QString& oldFileName,const QString& newFileName, bool forProject);
PBreakpoint setBreakPointCondition(int index, const QString& condition, bool forProject);
const QList<PBreakpoint>& breakpoints(bool forProject) const {
return forProject?mProjectBreakpoints:mBreakpoints;
}
PBreakpoint breakpoint(int index, bool forProject) const;
public slots:
2021-11-21 08:38:03 +08:00
void updateBreakpointNumber(const QString& filename, int line, int number);
void invalidateAllBreakpointNumbers(); // call this when gdb is stopped
void onFileDeleteLines(const QString& filename, int startLine, int count, bool forProject);
void onFileInsertLines(const QString& filename, int startLine, int count, bool forProject);
private:
bool isForProject() const;
void setIsForProject(bool newIsForProject);
QList<PBreakpoint> loadJson(const QJsonArray& jsonArray, qint64 criteriaTime);
QJsonArray toJson(const QString& projectFolder);
void setBreakpoints(const QList<PBreakpoint>& list, bool forProject);
2021-07-17 19:32:23 +08:00
private:
QList<PBreakpoint> mBreakpoints;
QList<PBreakpoint> mProjectBreakpoints;
bool mIsForProject;
friend class Debugger;
2021-07-17 19:32:23 +08:00
};
class BacktraceModel : public QAbstractTableModel {
2021-07-31 14:04:43 +08:00
Q_OBJECT
2021-07-17 19:32:23 +08:00
// QAbstractItemModel interface
public:
2021-07-24 11:18:25 +08:00
explicit BacktraceModel(QObject *parent = nullptr);
2021-07-17 19:32:23 +08:00
int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
void addTrace(PTrace p);
void clear();
2021-07-24 11:18:25 +08:00
void removeTrace(int index);
const QList<PTrace>& backtraces() const;
PTrace backtrace(int index) const;
2021-07-17 19:32:23 +08:00
private:
QList<PTrace> mList;
};
2021-07-31 14:04:43 +08:00
class WatchModel: public QAbstractItemModel {
Q_OBJECT
public:
2021-07-31 20:19:45 +08:00
explicit WatchModel(QObject *parent = nullptr);
2021-07-31 14:04:43 +08:00
QVariant data(const QModelIndex &index, int role) const override;
QModelIndex index(int row, int column,
const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &index) const override;
2021-11-25 20:26:43 +08:00
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
void fetchMore(const QModelIndex &parent) override;
bool canFetchMore(const QModelIndex &parent) const override;
2021-07-31 14:04:43 +08:00
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
2021-11-25 20:26:43 +08:00
bool hasChildren(const QModelIndex &parent) const override;
QModelIndex index(PWatchVar var) const;
QModelIndex index(WatchVar* pVar) const;
2021-11-25 11:24:38 +08:00
void removeWatchVar(const QString& expression);
void removeWatchVar(const QModelIndex& index);
2021-07-31 14:04:43 +08:00
void clear();
2022-10-23 00:39:24 +08:00
void clear(bool forProject);
2021-11-25 20:26:43 +08:00
PWatchVar findWatchVar(const QModelIndex& index);
PWatchVar findWatchVar(const QString& expr);
void resetAllVarInfos();
void clearAllVarInfos();
void beginUpdate();
void endUpdate();
2021-07-31 20:19:45 +08:00
void notifyUpdated(PWatchVar var);
signals:
void setWatchVarValue(const QString& name, const QString& value);
2021-11-25 20:26:43 +08:00
public slots:
void updateVarInfo(const QString& expression,
const QString& name,
int numChild,
const QString& value,
const QString& type,
bool hasMore);
void prepareVarChildren(const QString& parentName, int numChild, bool hasMore);
void addVarChild(const QString& parentName, const QString& name,
const QString& exp, int numChild,
const QString& value, const QString& type,
bool hasMore);
void updateVarValue(const QString& name, const QString& val,
const QString& inScope, bool typeChanged,
const QString& newType, int newNumChildren,
bool hasMore);
void updateAllHasMoreVars();
2021-11-25 20:26:43 +08:00
signals:
void fetchChildren(const QString& name);
private:
bool isForProject() const;
void setIsForProject(bool newIsForProject);
const QList<PWatchVar> &watchVars(bool forProject) const;
QJsonArray toJson(bool forProject);
QList<PWatchVar> loadJson(const QJsonArray &jsonArray, qint64 criteriaTimestamp);
const QList<PWatchVar> &watchVars() const;
void addWatchVar(PWatchVar watchVar, bool forProject);
void setWatchVars(const QList<PWatchVar> list, bool forProject);
2021-07-31 14:04:43 +08:00
private:
QList<PWatchVar> mWatchVars;
QList<PWatchVar> mProjectWatchVars;
QHash<QString,PWatchVar> mVarIndex; //var index is only valid for the current debugging session
int mUpdateCount;
bool mIsForProject;
// QAbstractItemModel interface
public:
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
friend class Debugger;
2021-07-31 14:04:43 +08:00
};
struct MemoryLine {
uintptr_t startAddress;
QList<unsigned char> datas;
QSet<int> changedDatas;
};
using PMemoryLine = std::shared_ptr<MemoryLine>;
class MemoryModel: public QAbstractTableModel{
Q_OBJECT
public:
explicit MemoryModel(int dataPerLine,QObject* parent=nullptr);
void updateMemory(const QStringList& value);
qulonglong startAddress() const;
void reset();
// QAbstractItemModel interface
signals:
void setMemoryData(qlonglong address, unsigned char data);
public:
int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
private:
int mDataPerLine;
QList<PMemoryLine> mLines;
qulonglong mStartAddress;
};
2021-07-17 19:32:23 +08:00
class DebuggerClient;
class DebugTarget;
2021-07-24 11:18:25 +08:00
class Editor;
using PDebugReader = std::shared_ptr<DebuggerClient>;
2021-07-03 21:57:50 +08:00
class Debugger : public QObject
{
Q_OBJECT
public:
explicit Debugger(QObject *parent = nullptr);
~Debugger();
2021-07-24 11:18:25 +08:00
// Play/pause
bool startClient(
int compilerSetIndex,
const QString& inferior,
bool inferiorHasSymbols,
bool inferiorHasBreakpoints,
const QStringList& binDirs,
const QString& sourceFile=QString());
void runInferior();
2021-08-29 22:08:43 +08:00
bool commandRunning();
2021-11-24 21:22:01 +08:00
bool inferiorRunning();
void interrupt();
2024-03-10 11:15:10 +08:00
void stepOver();
void stepInto();
void stepOut();
void runTo(const QString& filename, int line);
void resume();
void stepOverInstruction();
void stepIntoInstruction();
2021-07-24 11:18:25 +08:00
void runClientCommand(const QString &command, const QString &params, DebugCommandSource source);
bool isForProject() const;
void setIsForProject(bool newIsForProject);
2022-10-23 00:39:24 +08:00
void clearForProject();
2021-07-26 18:22:09 +08:00
//breakpoints
2021-07-24 11:18:25 +08:00
void addBreakpoint(int line, const Editor* editor);
void addBreakpoint(int line, const QString& filename, bool forProject);
void deleteBreakpoints(const QString& filename, bool forProject);
2021-07-24 11:18:25 +08:00
void deleteBreakpoints(const Editor* editor);
void deleteBreakpoints(bool forProject);
void deleteInvalidProjectBreakpoints(const QSet<QString> unitFiles);
2021-07-24 11:18:25 +08:00
void removeBreakpoint(int line, const Editor* editor);
void removeBreakpoint(int line, const QString& filename, bool forProject);
void removeBreakpoint(int index, bool forProject);
PBreakpoint breakpointAt(int line, const QString &filename, int *index, bool forProject);
PBreakpoint breakpointAt(int line, const Editor *editor, int *index);
void setBreakPointCondition(int index, const QString& condition, bool forProject);
2021-07-25 13:03:46 +08:00
void sendAllBreakpointsToDebugger();
2021-07-31 20:19:45 +08:00
void saveForNonproject(const QString &filename);
void saveForProject(const QString &filename, const QString &projectFolder);
void loadForNonproject(const QString &filename);
void loadForProject(const QString& filename, const QString& projectFolder);
void addWatchpoint(const QString& expression);
2021-07-26 18:22:09 +08:00
//watch vars
2021-11-25 20:26:43 +08:00
void addWatchVar(const QString& expression);
void modifyWatchVarExpression(const QString& oldExpr, const QString& newExpr);
2021-07-26 18:22:09 +08:00
void removeWatchVars(bool deleteparent);
void removeWatchVar(const QModelIndex& index);
2021-11-25 20:26:43 +08:00
void sendAllWatchVarsToDebugger();
PWatchVar findWatchVar(const QString& expression);
2022-05-30 16:40:45 +08:00
PWatchVar watchVarAt(const QModelIndex& index);
2024-03-10 12:57:50 +08:00
void refreshWatchVars();
2024-03-10 09:56:20 +08:00
2024-03-10 11:15:10 +08:00
void readMemory(const QString& startAddress, int rows, int cols);
2024-03-10 09:56:20 +08:00
void evalExpression(const QString& expression);
2024-03-10 12:57:50 +08:00
void selectFrame(PTrace trace);
2024-03-10 11:15:10 +08:00
void refreshFrame();
2024-03-10 12:57:50 +08:00
void refreshStackVariables();
2024-03-10 11:15:10 +08:00
void refreshRegisters();
void disassembleCurrentFrame(bool blendMode);
void setDisassemblyLanguage(bool isIntel);
void includeOrSkipDirsInSymbolSearch(const QStringList &dirs, bool skip);
2021-09-19 02:00:25 +08:00
// void notifyWatchVarUpdated(PWatchVar var);
2021-07-26 18:22:09 +08:00
std::shared_ptr<BacktraceModel> backtraceModel();
std::shared_ptr<BreakpointModel> breakpointModel();
2021-07-26 11:47:54 +08:00
bool executing() const;
2021-07-26 18:22:09 +08:00
int leftPageIndexBackup() const;
void setLeftPageIndexBackup(int leftPageIndexBackup);
std::shared_ptr<WatchModel> watchModel() const;
2021-08-01 01:06:43 +08:00
std::shared_ptr<RegisterModel> registerModel() const;
2021-08-01 23:24:37 +08:00
std::shared_ptr<MemoryModel> memoryModel() const;
bool forceUTF8() const;
void setForceUTF8(bool newForceUTF8);
DebuggerType debuggerType() const;
void setDebuggerType(DebuggerType newDebuggerType);
bool debugInfosUsingUTF8() const;
void setDebugInfosUsingUTF8(bool newDebugInfosUsingUTF8);
bool useDebugServer() const;
void setUseDebugServer(bool newUseDebugServer);
bool supportDisassemlyBlendMode();
2021-08-29 22:08:43 +08:00
signals:
void evalValueReady(const QString& s);
void memoryExamineReady(const QStringList& s);
void localsReady(const QStringList& s);
2021-07-26 00:22:08 +08:00
public slots:
void stop();
void refreshAll();
2021-07-24 11:18:25 +08:00
private:
2021-07-31 20:19:45 +08:00
void sendWatchCommand(PWatchVar var);
void sendRemoveWatchCommand(PWatchVar var);
2021-07-25 13:03:46 +08:00
void sendBreakpointCommand(PBreakpoint breakpoint);
void sendClearBreakpointCommand(int index, bool forProject);
2021-07-25 13:03:46 +08:00
void sendClearBreakpointCommand(PBreakpoint breakpoint);
void save(const QString& filename, const QString& projectFolder);
PDebugConfig load(const QString& filename, bool forProject);
void addWatchVar(const PWatchVar &watchVar, bool forProject);
2021-08-01 01:06:43 +08:00
2021-07-26 11:47:54 +08:00
private slots:
void syncFinishedParsing();
void setMemoryData(qulonglong address, unsigned char data);
void setWatchVarValue(const QString& name, const QString& value);
2021-11-25 07:42:56 +08:00
void updateMemory(const QStringList& value);
void updateEval(const QString& value);
void updateDisassembly(const QString& file, const QString& func,const QStringList& value);
2021-07-30 23:28:58 +08:00
void onChangeDebugConsoleLastline(const QString& text);
void cleanUpReader();
2021-11-25 09:05:45 +08:00
void updateRegisterNames(const QStringList& registerNames);
void updateRegisterValues(const QHash<int,QString>& values);
2021-11-25 20:26:43 +08:00
void fetchVarChildren(const QString& varName);
2021-07-03 21:57:50 +08:00
private:
bool mExecuting;
bool mCommandChanged;
std::shared_ptr<BreakpointModel> mBreakpointModel;
std::shared_ptr<BacktraceModel> mBacktraceModel;
std::shared_ptr<WatchModel> mWatchModel;
std::shared_ptr<RegisterModel> mRegisterModel;
std::shared_ptr<MemoryModel> mMemoryModel;
DebuggerClient *mClient;
DebugTarget *mTarget;
bool mForceUTF8;
bool mDebugInfosUsingUTF8;
bool mUseDebugServer;
DebuggerType mDebuggerType;
2021-07-26 18:22:09 +08:00
int mLeftPageIndexBackup;
qint64 mLastLoadtime;
qint64 mProjectLastLoadtime;
QString mCurrentSourceFile;
bool mInferiorHasBreakpoints;
2021-07-03 21:57:50 +08:00
};
class DebugTarget: public QThread {
Q_OBJECT
public:
explicit DebugTarget(const QString& inferior,
const QString& GDBServer,
int port,
const QStringList& arguments,
QObject *parent = nullptr);
void setInputFile(const QString& inputFile);
void stopDebug();
void waitStart();
const QStringList &binDirs() const;
void addBinDirs(const QStringList &binDirs);
void addBinDir(const QString &binDir);
signals:
2024-03-09 11:34:52 +08:00
void processFailed(QProcess::ProcessError error);
private:
QString mInferior;
QStringList mArguments;
QString mGDBServer;
int mPort;
bool mStop;
std::shared_ptr<QProcess> mProcess;
QSemaphore mStartSemaphore;
2021-12-25 20:02:53 +08:00
bool mErrorOccured;
QString mInputFile;
QStringList mBinDirs;
// QThread interface
protected:
void run() override;
};
class DebuggerClient : public QThread
2021-07-03 21:57:50 +08:00
{
Q_OBJECT
public:
explicit DebuggerClient(Debugger* debugger, QObject *parent = nullptr);
virtual void stopDebug() = 0;
virtual bool commandRunning() = 0;
2021-07-25 00:26:13 +08:00
QString debuggerPath() const;
void setDebuggerPath(const QString &debuggerPath);
2021-11-24 17:53:25 +08:00
void waitStart();
2021-08-29 22:08:43 +08:00
2021-11-10 17:05:37 +08:00
bool processExited() const;
2021-11-23 21:08:33 +08:00
bool signalReceived() const;
const QStringList &consoleOutput() const;
bool updateCPUInfo() const;
2021-11-24 10:07:35 +08:00
bool receivedSFWarning() const;
2021-11-24 17:53:25 +08:00
const QStringList &fullOutput() const;
2021-11-24 21:22:01 +08:00
bool inferiorRunning() const;
2021-11-25 09:05:45 +08:00
const QString &signalName() const;
const QString &signalMeaning() const;
const QStringList &binDirs() const;
void addBinDirs(const QStringList &binDirs);
void addBinDir(const QString &binDir);
2024-03-09 11:34:52 +08:00
Debugger* debugger() { return mDebugger; }
2024-03-10 09:56:20 +08:00
virtual DebuggerType clientType() = 0;
//requests
virtual void initialize(const QString& inferior, bool hasSymbols) = 0;
virtual void runInferior(bool hasBreakpoints) = 0;
2024-03-10 11:15:10 +08:00
virtual void stepOver() = 0;
virtual void stepInto() = 0;
virtual void stepOut() = 0;
virtual void runTo(const QString& filename, int line) = 0;
virtual void resume() = 0;
virtual void stepOverInstruction() = 0;
virtual void stepIntoInstruction() = 0;
virtual void interrupt() = 0;
2024-03-10 11:15:10 +08:00
virtual void refreshStackVariables() = 0;
2024-03-10 09:56:20 +08:00
2024-03-10 11:15:10 +08:00
virtual void readMemory(const QString& startAddress, int rows, int cols) = 0;
2024-03-10 09:56:20 +08:00
virtual void writeMemory(qulonglong address, unsigned char data) = 0;
virtual void addBreakpoint(PBreakpoint breakpoint) = 0;
virtual void removeBreakpoint(PBreakpoint breakpoint) = 0;
virtual void addWatchpoint(const QString& watchExp) = 0;
2024-03-10 09:56:20 +08:00
virtual void setBreakpointCondition(PBreakpoint breakpoint) = 0;
virtual void addWatch(const QString& expression) = 0;
virtual void removeWatch(PWatchVar watchVar) = 0;
virtual void writeWatchVar(const QString& varName, const QString& value) = 0;
virtual void refreshWatch(PWatchVar var) = 0;
virtual void refreshWatch() = 0;
virtual void fetchWatchVarChildren(const QString& varName) = 0;
virtual void evalExpression(const QString& expression) = 0;
2024-03-10 12:57:50 +08:00
virtual void selectFrame(PTrace trace) = 0;
2024-03-10 09:56:20 +08:00
virtual void refreshFrame() = 0;
virtual void refreshRegisters() = 0;
virtual void disassembleCurrentFrame(bool blendMode) = 0;
2024-03-10 11:15:10 +08:00
virtual void setDisassemblyLanguage(bool isIntel) = 0;
virtual void skipDirectoriesInSymbolSearch(const QStringList& lst) = 0;
virtual void addSymbolSearchDirectories(const QStringList& lst) = 0;
2021-07-18 08:52:53 +08:00
signals:
void parseStarted();
void invalidateAllVars();
void parseFinished();
2021-07-19 23:02:32 +08:00
void writeToDebugFailed();
2024-03-09 11:34:52 +08:00
void processFailed(QProcess::ProcessError error);
2021-08-01 10:00:27 +08:00
void changeDebugConsoleLastLine(const QString& text);
void cmdStarted();
void cmdFinished();
2021-11-21 08:38:03 +08:00
void errorNoSymbolTable();
2021-11-21 08:38:03 +08:00
void breakpointInfoGetted(const QString& filename, int line, int number);
2021-11-24 10:07:35 +08:00
void inferiorContinued();
void watchpointHitted(const QString& var, const QString& oldVal, const QString& newVal);
2021-11-24 17:53:25 +08:00
void inferiorStopped(const QString& filename, int line, bool setFocus);
2021-11-24 10:07:35 +08:00
void localsUpdated(const QStringList& localsValue);
void evalUpdated(const QString& value);
void memoryUpdated(const QStringList& memoryValues);
2021-11-25 07:42:56 +08:00
void disassemblyUpdate(const QString& filename, const QString& funcName, const QStringList& result);
2021-11-25 09:05:45 +08:00
void registerNamesUpdated(const QStringList& registerNames);
void registerValuesUpdated(const QHash<int,QString>& values);
2021-11-25 20:26:43 +08:00
void varCreated(const QString& expression,
const QString& name,
int numChild,
const QString& value,
const QString& type,
bool hasMore);
void prepareVarChildren(const QString& parentName,int numChild, bool hasMore);
void addVarChild(const QString& parentName, const QString& name,
const QString& exp, int numChild,
const QString& value, const QString& type,
bool hasMore);
void varValueUpdated(const QString& name, const QString& val,
const QString& inScope, bool typeChanged,
const QString& newType, int newNumChildren,
bool hasMore);
void varsValueUpdated();
protected:
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
QRecursiveMutex mCmdQueueMutex;
#else
2022-01-04 16:50:54 +08:00
QMutex mCmdQueueMutex;
#endif
2021-07-03 21:57:50 +08:00
bool mCmdRunning;
2021-11-24 10:07:35 +08:00
bool mInferiorRunning;
2021-11-10 17:05:37 +08:00
bool mProcessExited;
2024-03-09 11:34:52 +08:00
QStringList mConsoleOutput;
QStringList mFullOutput;
QSemaphore mStartSemaphore;
2021-11-23 21:08:33 +08:00
bool mSignalReceived;
bool mUpdateCPUInfo;
2024-03-09 11:34:52 +08:00
QString mSignalName;
QString mSignalMeaning;
2021-11-24 10:07:35 +08:00
bool mReceivedSFWarning;
2024-03-09 11:34:52 +08:00
private:
Debugger *mDebugger;
QString mDebuggerPath;
QStringList mBinDirs;
2021-11-23 21:08:33 +08:00
2021-07-03 21:57:50 +08:00
};
#endif // DEBUGGER_H