dolphin/Source/Core/DolphinQt/Debugger/MemoryViewWidget.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
2.0 KiB
C
Raw Normal View History

2018-03-16 11:39:53 +00:00
// Copyright 2018 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2018-03-16 11:39:53 +00:00
#pragma once
#include <QWidget>
2018-03-16 11:39:53 +00:00
#include "Common/CommonTypes.h"
class QPoint;
class QScrollBar;
namespace AddressSpace
{
enum class Type;
}
2018-03-16 11:39:53 +00:00
class MemoryViewTable;
class MemoryViewWidget final : public QWidget
2018-03-16 11:39:53 +00:00
{
Q_OBJECT
public:
enum class Type : int
2018-03-16 11:39:53 +00:00
{
Null = 0,
Hex8 = 1,
Hex16,
Hex32,
2022-04-17 07:47:05 +00:00
Hex64,
HexString,
Unsigned8,
Unsigned16,
Unsigned32,
Signed8,
Signed16,
Signed32,
2018-03-16 11:39:53 +00:00
ASCII,
Float32,
Double
2018-03-16 11:39:53 +00:00
};
enum class BPType
{
ReadWrite,
ReadOnly,
WriteOnly
};
explicit MemoryViewWidget(QWidget* parent = nullptr);
void CreateTable();
2018-03-16 11:39:53 +00:00
void Update();
void UpdateFont();
void ToggleBreakpoint(u32 addr, bool row);
2018-03-16 11:39:53 +00:00
std::vector<u8> ConvertTextToBytes(Type type, QString input_text);
void SetAddressSpace(AddressSpace::Type address_space);
AddressSpace::Type GetAddressSpace() const;
void SetDisplay(Type type, int bytes_per_row, int alignment, bool dual_view);
2018-03-16 11:39:53 +00:00
void SetBPType(BPType type);
void SetAddress(u32 address);
void SetFocus() const;
2018-03-16 11:39:53 +00:00
void SetBPLoggingEnabled(bool enabled);
signals:
void BreakpointsChanged();
void ShowCode(u32 address);
void RequestWatch(QString name, u32 address);
2018-03-16 11:39:53 +00:00
private:
void OnContextMenu(const QPoint& pos);
void OnCopyAddress(u32 addr);
void OnCopyHex(u32 addr);
void UpdateBreakpointTags();
void UpdateColumns();
void ScrollbarActionTriggered(int action);
void ScrollbarSliderReleased();
QString ValueToString(u32 address, Type type);
2018-03-16 11:39:53 +00:00
MemoryViewTable* m_table;
QScrollBar* m_scrollbar;
AddressSpace::Type m_address_space{};
2022-04-17 07:47:05 +00:00
Type m_type = Type::Hex32;
2018-03-16 11:39:53 +00:00
BPType m_bp_type = BPType::ReadWrite;
bool m_do_log = true;
u32 m_address = 0x80000000;
u32 m_address_highlight = 0;
int m_font_width = 0;
int m_font_vspace = 0;
int m_bytes_per_row = 16;
int m_alignment = 16;
int m_data_columns;
bool m_dual_view = false;
friend class MemoryViewTable;
2018-03-16 11:39:53 +00:00
};