2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2009-08-12 10:51:25 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2009-08-12 10:51:25 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2009-08-12 10:51:25 +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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2009-08-12 10:51:25 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
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
|