2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2009-08-12 10:51:25 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2009-08-12 10:51:25 +02:00
|
|
|
|
2011-04-19 12:17:48 +02:00
|
|
|
#include "debuggerconstants.h"
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QObject>
|
2014-12-17 13:14:29 +01:00
|
|
|
#include <QPoint>
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QPointer>
|
|
|
|
|
#include <QColor>
|
2010-11-24 16:57:40 +01:00
|
|
|
|
2016-07-14 10:00:15 +02:00
|
|
|
namespace BinEditor { class EditorService; }
|
2011-04-08 16:18:47 +02:00
|
|
|
|
2022-07-05 15:37:08 +02:00
|
|
|
namespace Debugger::Internal {
|
2010-06-16 11:08:54 +02:00
|
|
|
|
|
|
|
|
class DebuggerEngine;
|
2014-12-12 15:33:16 +01:00
|
|
|
|
2011-04-19 12:17:48 +02:00
|
|
|
class MemoryMarkup
|
|
|
|
|
{
|
|
|
|
|
public:
|
2018-07-23 22:28:49 +02:00
|
|
|
MemoryMarkup() = default;
|
2016-07-14 10:00:15 +02:00
|
|
|
MemoryMarkup(quint64 address, quint64 length, QColor c, const QString &tt)
|
|
|
|
|
: address(address), length(length), color(c), toolTip(tt)
|
|
|
|
|
{}
|
2011-04-19 12:17:48 +02:00
|
|
|
|
2016-07-14 10:00:15 +02:00
|
|
|
quint64 address = 0;
|
|
|
|
|
quint64 length = 0;
|
2011-04-19 12:17:48 +02:00
|
|
|
QColor color;
|
|
|
|
|
QString toolTip;
|
|
|
|
|
};
|
2010-09-13 13:30:35 +02:00
|
|
|
|
2014-12-17 13:14:29 +01:00
|
|
|
class MemoryViewSetupData
|
|
|
|
|
{
|
|
|
|
|
public:
|
2018-07-23 22:28:49 +02:00
|
|
|
MemoryViewSetupData() = default;
|
2014-12-17 13:14:29 +01:00
|
|
|
|
2016-07-14 10:00:15 +02:00
|
|
|
quint64 startAddress = 0;
|
2016-06-07 17:04:53 +02:00
|
|
|
QString registerName;
|
2016-07-14 10:00:15 +02:00
|
|
|
QList<MemoryMarkup> markup;
|
2014-12-17 13:14:29 +01:00
|
|
|
QPoint pos;
|
|
|
|
|
QString title;
|
2016-08-03 22:19:34 +02:00
|
|
|
bool readOnly = false; // Read-only.
|
|
|
|
|
bool separateView = false; // Open a separate view (using the pos-parameter).
|
|
|
|
|
bool trackRegisters = false; // Address parameter is register number to track
|
2014-12-17 13:14:29 +01:00
|
|
|
};
|
|
|
|
|
|
2010-12-14 12:29:32 +01:00
|
|
|
class MemoryAgent : public QObject
|
2009-08-12 10:51:25 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2016-07-14 10:00:15 +02:00
|
|
|
MemoryAgent(const MemoryViewSetupData &data, DebuggerEngine *engine);
|
2018-05-07 15:06:53 +02:00
|
|
|
~MemoryAgent() override;
|
2009-08-12 10:51:25 +02:00
|
|
|
|
2011-04-19 12:17:48 +02:00
|
|
|
void updateContents();
|
2016-07-14 10:00:15 +02:00
|
|
|
void addData(quint64 address, const QByteArray &data);
|
|
|
|
|
void setFinished();
|
|
|
|
|
bool isUsable();
|
|
|
|
|
|
|
|
|
|
static bool hasBinEditor();
|
2009-08-14 13:04:05 +02:00
|
|
|
|
2011-02-28 15:01:19 +01:00
|
|
|
private:
|
2016-07-14 10:00:15 +02:00
|
|
|
// The backend, provided by the BinEditor plugin, if loaded.
|
|
|
|
|
BinEditor::EditorService *m_service = nullptr;
|
2011-04-19 12:17:48 +02:00
|
|
|
|
2016-07-14 10:00:15 +02:00
|
|
|
DebuggerEngine *m_engine = nullptr;
|
2016-08-03 22:19:34 +02:00
|
|
|
bool m_trackRegisters = false;
|
2009-08-14 13:04:05 +02:00
|
|
|
};
|
|
|
|
|
|
2016-07-14 10:00:15 +02:00
|
|
|
QList<MemoryMarkup> registerViewMarkup(quint64 address, const QString ®Name);
|
|
|
|
|
QString registerViewTitle(const QString ®isterName, quint64 address = 0);
|
|
|
|
|
|
2022-07-05 15:37:08 +02:00
|
|
|
} // Debugger::Intenal
|