Compare commits

...

6 Commits

Author SHA1 Message Date
JordanTheToaster
ccc8b38b77 GameDB: Switch Rule of Rose to SoftwareFMV 2025-04-16 01:41:23 +02:00
PCSX2 Bot
c6d1c8063b [ci skip] Qt: Update Base Translation. 2025-04-15 02:05:23 +02:00
chaoticgd
0ffb6d6362 Debugger: Rename DebuggerView subclasses 2025-04-14 18:48:36 -04:00
chaoticgd
252aaa500e Debugger: Rename DebuggerWidget to DebuggerView 2025-04-14 18:48:36 -04:00
chaoticgd
d456908e37 Debugger: Don't save UI layouts unnecessarily after loading them 2025-04-14 18:48:36 -04:00
chaoticgd
cd13bfb429 Debugger: Revise file format for UI layouts 2025-04-14 18:48:36 -04:00
44 changed files with 1203 additions and 1202 deletions

View File

@@ -2264,9 +2264,9 @@ SCAJ-20167:
preloadFrameData: 1 # Fixes some missing effects.
SCAJ-20168:
name: "Rule of Rose"
region: "NTSC-Unk"
gsHWFixes:
preloadFrameData: 1 # Fixes Black FMV's.
region: "NTSC-C"
gameFixes:
- SoftwareRendererFMVHack # Fixes black FMVs in hardware and hash cache disabling itself.
SCAJ-20169:
name: "Dirge of Cerberus - Final Fantasy VII"
region: "NTSC-Unk"
@@ -8896,8 +8896,8 @@ SCPS-15093:
name-en: "Rule of Rose"
region: "NTSC-J"
compat: 5
gsHWFixes:
preloadFrameData: 1 # Fixes Black FMV's.
gameFixes:
- SoftwareRendererFMVHack # Fixes black FMVs in hardware and hash cache disabling itself.
SCPS-15094:
name: "アイトーイ プレイ2 [ソフト単体]"
name-sort: "あいとーい ぷれい2 [そふとたんたい]"
@@ -24960,8 +24960,8 @@ SLES-54217:
SLES-54218:
name: "Rule of Rose"
region: "PAL-M5"
gsHWFixes:
preloadFrameData: 1 # Fixes Black FMV's.
gameFixes:
- SoftwareRendererFMVHack # Fixes black FMVs in hardware and hash cache disabling itself.
SLES-54221:
name: "LEGO Star Wars II - The Original Trilogy"
region: "PAL-M6"
@@ -69595,8 +69595,8 @@ SLUS-21448:
name: "Rule of Rose"
region: "NTSC-U"
compat: 5
gsHWFixes:
preloadFrameData: 1 # Fixes Black FMV's.
gameFixes:
- SoftwareRendererFMVHack # Fixes black FMVs in hardware and hash cache disabling itself.
SLUS-21449:
name: "The Fast and the Furious"
name-sort: "Fast and the Furious, The"
@@ -72367,8 +72367,8 @@ SLUS-28062:
SLUS-28063:
name: "Rule of Rose [Trade Demo]"
region: "NTSC-U"
gsHWFixes:
preloadFrameData: 1 # Fixes Black FMV's.
gameFixes:
- SoftwareRendererFMVHack # Fixes black FMVs in hardware and hash cache disabling itself.
SLUS-28064:
name: "Shin Megami Tensei - Devil Summoner [Trade Demo]"
region: "NTSC-U"

View File

@@ -164,34 +164,34 @@ target_sources(pcsx2-qt PRIVATE
Debugger/DebuggerSettingsManager.cpp
Debugger/DebuggerSettingsManager.h
Debugger/DebuggerEvents.h
Debugger/DebuggerWidget.cpp
Debugger/DebuggerWidget.h
Debugger/DebuggerView.cpp
Debugger/DebuggerView.h
Debugger/DebuggerWindow.cpp
Debugger/DebuggerWindow.h
Debugger/DebuggerWindow.ui
Debugger/DisassemblyWidget.cpp
Debugger/DisassemblyWidget.h
Debugger/DisassemblyWidget.ui
Debugger/DisassemblyView.cpp
Debugger/DisassemblyView.h
Debugger/DisassemblyView.ui
Debugger/JsonValueWrapper.h
Debugger/RegisterWidget.cpp
Debugger/RegisterWidget.h
Debugger/RegisterWidget.ui
Debugger/RegisterView.cpp
Debugger/RegisterView.h
Debugger/RegisterView.ui
Debugger/StackModel.cpp
Debugger/StackModel.h
Debugger/StackWidget.cpp
Debugger/StackWidget.h
Debugger/StackView.cpp
Debugger/StackView.h
Debugger/ThreadModel.cpp
Debugger/ThreadModel.h
Debugger/ThreadWidget.cpp
Debugger/ThreadWidget.h
Debugger/ThreadView.cpp
Debugger/ThreadView.h
Debugger/Breakpoints/BreakpointDialog.cpp
Debugger/Breakpoints/BreakpointDialog.h
Debugger/Breakpoints/BreakpointDialog.ui
Debugger/Breakpoints/BreakpointModel.cpp
Debugger/Breakpoints/BreakpointModel.h
Debugger/Breakpoints/BreakpointWidget.cpp
Debugger/Breakpoints/BreakpointWidget.h
Debugger/Breakpoints/BreakpointWidget.ui
Debugger/Breakpoints/BreakpointView.cpp
Debugger/Breakpoints/BreakpointView.h
Debugger/Breakpoints/BreakpointView.ui
Debugger/Docking/DockLayout.cpp
Debugger/Docking/DockLayout.h
Debugger/Docking/DockManager.cpp
@@ -212,17 +212,17 @@ target_sources(pcsx2-qt PRIVATE
Debugger/Docking/NoLayoutsWidget.cpp
Debugger/Docking/NoLayoutsWidget.h
Debugger/Docking/NoLayoutsWidget.ui
Debugger/Memory/MemorySearchWidget.cpp
Debugger/Memory/MemorySearchWidget.h
Debugger/Memory/MemorySearchWidget.ui
Debugger/Memory/MemoryViewWidget.cpp
Debugger/Memory/MemoryViewWidget.h
Debugger/Memory/MemoryViewWidget.ui
Debugger/Memory/MemorySearchView.cpp
Debugger/Memory/MemorySearchView.h
Debugger/Memory/MemorySearchView.ui
Debugger/Memory/MemoryView.cpp
Debugger/Memory/MemoryView.h
Debugger/Memory/MemoryView.ui
Debugger/Memory/SavedAddressesModel.cpp
Debugger/Memory/SavedAddressesModel.h
Debugger/Memory/SavedAddressesWidget.cpp
Debugger/Memory/SavedAddressesWidget.h
Debugger/Memory/SavedAddressesWidget.ui
Debugger/Memory/SavedAddressesView.cpp
Debugger/Memory/SavedAddressesView.h
Debugger/Memory/SavedAddressesView.ui
Debugger/SymbolTree/NewSymbolDialogs.cpp
Debugger/SymbolTree/NewSymbolDialogs.h
Debugger/SymbolTree/NewSymbolDialog.ui
@@ -234,9 +234,9 @@ target_sources(pcsx2-qt PRIVATE
Debugger/SymbolTree/SymbolTreeNode.h
Debugger/SymbolTree/SymbolTreeDelegates.cpp
Debugger/SymbolTree/SymbolTreeDelegates.h
Debugger/SymbolTree/SymbolTreeWidgets.cpp
Debugger/SymbolTree/SymbolTreeWidgets.h
Debugger/SymbolTree/SymbolTreeWidget.ui
Debugger/SymbolTree/SymbolTreeViews.cpp
Debugger/SymbolTree/SymbolTreeViews.h
Debugger/SymbolTree/SymbolTreeView.ui
Debugger/SymbolTree/TypeString.cpp
Debugger/SymbolTree/TypeString.h
Tools/InputRecording/NewInputRecordingDlg.cpp

View File

@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "BreakpointWidget.h"
#include "BreakpointView.h"
#include "QtUtils.h"
#include "Debugger/DebuggerSettingsManager.h"
@@ -10,15 +10,15 @@
#include <QtGui/QClipboard>
BreakpointWidget::BreakpointWidget(const DebuggerWidgetParameters& parameters)
: DebuggerWidget(parameters, DISALLOW_MULTIPLE_INSTANCES)
BreakpointView::BreakpointView(const DebuggerViewParameters& parameters)
: DebuggerView(parameters, DISALLOW_MULTIPLE_INSTANCES)
, m_model(BreakpointModel::getInstance(cpu()))
{
m_ui.setupUi(this);
m_ui.breakpointList->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_ui.breakpointList, &QTableView::customContextMenuRequested, this, &BreakpointWidget::openContextMenu);
connect(m_ui.breakpointList, &QTableView::doubleClicked, this, &BreakpointWidget::onDoubleClicked);
connect(m_ui.breakpointList, &QTableView::customContextMenuRequested, this, &BreakpointView::openContextMenu);
connect(m_ui.breakpointList, &QTableView::doubleClicked, this, &BreakpointView::onDoubleClicked);
m_ui.breakpointList->setModel(m_model);
for (std::size_t i = 0; auto mode : BreakpointModel::HeaderResizeModes)
@@ -28,13 +28,13 @@ BreakpointWidget::BreakpointWidget(const DebuggerWidgetParameters& parameters)
}
}
void BreakpointWidget::onDoubleClicked(const QModelIndex& index)
void BreakpointView::onDoubleClicked(const QModelIndex& index)
{
if (index.isValid() && index.column() == BreakpointModel::OFFSET)
goToInDisassembler(m_model->data(index, BreakpointModel::DataRole).toUInt(), true);
}
void BreakpointWidget::openContextMenu(QPoint pos)
void BreakpointView::openContextMenu(QPoint pos)
{
QMenu* menu = new QMenu(m_ui.breakpointList);
menu->setAttribute(Qt::WA_DeleteOnClose);
@@ -42,23 +42,23 @@ void BreakpointWidget::openContextMenu(QPoint pos)
if (cpu().isAlive())
{
QAction* newAction = menu->addAction(tr("New"));
connect(newAction, &QAction::triggered, this, &BreakpointWidget::contextNew);
connect(newAction, &QAction::triggered, this, &BreakpointView::contextNew);
const QItemSelectionModel* selModel = m_ui.breakpointList->selectionModel();
if (selModel->hasSelection())
{
QAction* editAction = menu->addAction(tr("Edit"));
connect(editAction, &QAction::triggered, this, &BreakpointWidget::contextEdit);
connect(editAction, &QAction::triggered, this, &BreakpointView::contextEdit);
if (selModel->selectedIndexes().count() == 1)
{
QAction* copyAction = menu->addAction(tr("Copy"));
connect(copyAction, &QAction::triggered, this, &BreakpointWidget::contextCopy);
connect(copyAction, &QAction::triggered, this, &BreakpointView::contextCopy);
}
QAction* deleteAction = menu->addAction(tr("Delete"));
connect(deleteAction, &QAction::triggered, this, &BreakpointWidget::contextDelete);
connect(deleteAction, &QAction::triggered, this, &BreakpointView::contextDelete);
}
}
@@ -76,7 +76,7 @@ void BreakpointWidget::openContextMenu(QPoint pos)
if (cpu().isAlive())
{
QAction* actionImport = menu->addAction(tr("Paste from CSV"));
connect(actionImport, &QAction::triggered, this, &BreakpointWidget::contextPasteCSV);
connect(actionImport, &QAction::triggered, this, &BreakpointView::contextPasteCSV);
if (cpu().getCpuType() == BREAKPOINT_EE)
{
@@ -87,14 +87,14 @@ void BreakpointWidget::openContextMenu(QPoint pos)
});
QAction* actionSave = menu->addAction(tr("Save to Settings"));
connect(actionSave, &QAction::triggered, this, &BreakpointWidget::saveBreakpointsToDebuggerSettings);
connect(actionSave, &QAction::triggered, this, &BreakpointView::saveBreakpointsToDebuggerSettings);
}
}
menu->popup(m_ui.breakpointList->viewport()->mapToGlobal(pos));
}
void BreakpointWidget::contextCopy()
void BreakpointView::contextCopy()
{
const QItemSelectionModel* selModel = m_ui.breakpointList->selectionModel();
@@ -104,7 +104,7 @@ void BreakpointWidget::contextCopy()
QGuiApplication::clipboard()->setText(m_model->data(selModel->currentIndex()).toString());
}
void BreakpointWidget::contextDelete()
void BreakpointView::contextDelete()
{
const QItemSelectionModel* selModel = m_ui.breakpointList->selectionModel();
@@ -121,14 +121,14 @@ void BreakpointWidget::contextDelete()
m_model->removeRows(*row, 1);
}
void BreakpointWidget::contextNew()
void BreakpointView::contextNew()
{
BreakpointDialog* bpDialog = new BreakpointDialog(this, &cpu(), *m_model);
bpDialog->setAttribute(Qt::WA_DeleteOnClose);
bpDialog->show();
}
void BreakpointWidget::contextEdit()
void BreakpointView::contextEdit()
{
const QItemSelectionModel* selModel = m_ui.breakpointList->selectionModel();
@@ -144,7 +144,7 @@ void BreakpointWidget::contextEdit()
bpDialog->show();
}
void BreakpointWidget::contextPasteCSV()
void BreakpointView::contextPasteCSV()
{
QString csv = QGuiApplication::clipboard()->text();
// Skip header
@@ -168,7 +168,7 @@ void BreakpointWidget::contextPasteCSV()
}
}
void BreakpointWidget::saveBreakpointsToDebuggerSettings()
void BreakpointView::saveBreakpointsToDebuggerSettings()
{
DebuggerSettingsManager::saveGameSettings(m_model);
}

View File

@@ -3,11 +3,11 @@
#pragma once
#include "ui_BreakpointWidget.h"
#include "ui_BreakpointView.h"
#include "BreakpointModel.h"
#include "Debugger/DebuggerWidget.h"
#include "Debugger/DebuggerView.h"
#include "DebugTools/DebugInterface.h"
#include "DebugTools/DisassemblyManager.h"
@@ -16,12 +16,12 @@
#include <QtWidgets/QTabBar>
#include <QtGui/QPainter>
class BreakpointWidget : public DebuggerWidget
class BreakpointView : public DebuggerView
{
Q_OBJECT
public:
BreakpointWidget(const DebuggerWidgetParameters& parameters);
BreakpointView(const DebuggerViewParameters& parameters);
void onDoubleClicked(const QModelIndex& index);
void openContextMenu(QPoint pos);
@@ -35,7 +35,7 @@ public:
void saveBreakpointsToDebuggerSettings();
private:
Ui::BreakpointWidget m_ui;
Ui::BreakpointView m_ui;
BreakpointModel* m_model;
};

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>BreakpointWidget</class>
<widget class="QWidget" name="BreakpointWidget">
<class>BreakpointView</class>
<widget class="QWidget" name="BreakpointView">
<property name="geometry">
<rect>
<x>0</x>

View File

@@ -14,8 +14,8 @@ namespace DebuggerEvents
virtual ~Event() = default;
};
// Sent when a debugger widget is first created, and subsequently broadcast
// to all debugger widgets at regular intervals.
// Sent when a debugger view is first created, and subsequently broadcast to
// all debugger views at regular intervals.
struct Refresh : Event
{
};
@@ -41,7 +41,7 @@ namespace DebuggerEvents
static constexpr const char* ACTION_PREFIX = QT_TRANSLATE_NOOP("DebuggerEvents", "Go to in");
};
// The state of the VM has changed and widgets should be updated to reflect
// The state of the VM has changed and views should be updated to reflect
// the new state (e.g. the VM has been paused).
struct VMUpdate : Event
{

View File

@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "DebuggerWidget.h"
#include "DebuggerView.h"
#include "Debugger/DebuggerWindow.h"
#include "Debugger/JsonValueWrapper.h"
@@ -12,8 +12,9 @@
#include "common/Assertions.h"
DebuggerWidget::DebuggerWidget(const DebuggerWidgetParameters& parameters, u32 flags)
DebuggerView::DebuggerView(const DebuggerViewParameters& parameters, u32 flags)
: QWidget(parameters.parent)
, m_id(parameters.id)
, m_unique_name(parameters.unique_name)
, m_cpu(parameters.cpu)
, m_cpu_override(parameters.cpu_override)
@@ -22,25 +23,30 @@ DebuggerWidget::DebuggerWidget(const DebuggerWidgetParameters& parameters, u32 f
updateStyleSheet();
}
DebugInterface& DebuggerWidget::cpu() const
DebugInterface& DebuggerView::cpu() const
{
if (m_cpu_override.has_value())
return DebugInterface::get(*m_cpu_override);
pxAssertRel(m_cpu, "DebuggerWidget::cpu called on object with null cpu.");
pxAssertRel(m_cpu, "DebuggerView::cpu called on object with null cpu.");
return *m_cpu;
}
QString DebuggerWidget::uniqueName() const
QString DebuggerView::uniqueName() const
{
return m_unique_name;
}
QString DebuggerWidget::displayName() const
u64 DebuggerView::id() const
{
return m_id;
}
QString DebuggerView::displayName() const
{
QString name = displayNameWithoutSuffix();
// If there are multiple debugger widgets of the same name, append a number
// If there are multiple debugger views with the same name, append a number
// to the display name.
if (m_display_name_suffix_number.has_value())
name = tr("%1 #%2").arg(name).arg(*m_display_name_suffix_number);
@@ -51,17 +57,17 @@ QString DebuggerWidget::displayName() const
return name;
}
QString DebuggerWidget::displayNameWithoutSuffix() const
QString DebuggerView::displayNameWithoutSuffix() const
{
return m_translated_display_name;
}
QString DebuggerWidget::customDisplayName() const
QString DebuggerView::customDisplayName() const
{
return m_custom_display_name;
}
bool DebuggerWidget::setCustomDisplayName(QString display_name)
bool DebuggerView::setCustomDisplayName(QString display_name)
{
if (display_name.size() > DockUtils::MAX_DOCK_WIDGET_NAME_SIZE)
return false;
@@ -70,17 +76,17 @@ bool DebuggerWidget::setCustomDisplayName(QString display_name)
return true;
}
bool DebuggerWidget::isPrimary() const
bool DebuggerView::isPrimary() const
{
return m_is_primary;
}
void DebuggerWidget::setPrimary(bool is_primary)
void DebuggerView::setPrimary(bool is_primary)
{
m_is_primary = is_primary;
}
bool DebuggerWidget::setCpu(DebugInterface& new_cpu)
bool DebuggerView::setCpu(DebugInterface& new_cpu)
{
BreakPointCpu before = cpu().getCpuType();
m_cpu = &new_cpu;
@@ -88,12 +94,12 @@ bool DebuggerWidget::setCpu(DebugInterface& new_cpu)
return before == after;
}
std::optional<BreakPointCpu> DebuggerWidget::cpuOverride() const
std::optional<BreakPointCpu> DebuggerView::cpuOverride() const
{
return m_cpu_override;
}
bool DebuggerWidget::setCpuOverride(std::optional<BreakPointCpu> new_cpu)
bool DebuggerView::setCpuOverride(std::optional<BreakPointCpu> new_cpu)
{
BreakPointCpu before = cpu().getCpuType();
m_cpu_override = new_cpu;
@@ -101,7 +107,7 @@ bool DebuggerWidget::setCpuOverride(std::optional<BreakPointCpu> new_cpu)
return before == after;
}
bool DebuggerWidget::handleEvent(const DebuggerEvents::Event& event)
bool DebuggerView::handleEvent(const DebuggerEvents::Event& event)
{
auto [begin, end] = m_event_handlers.equal_range(typeid(event).name());
for (auto handler = begin; handler != end; handler++)
@@ -111,14 +117,14 @@ bool DebuggerWidget::handleEvent(const DebuggerEvents::Event& event)
return false;
}
bool DebuggerWidget::acceptsEventType(const char* event_type)
bool DebuggerView::acceptsEventType(const char* event_type)
{
auto [begin, end] = m_event_handlers.equal_range(event_type);
return begin != end;
}
void DebuggerWidget::toJson(JsonValueWrapper& json)
void DebuggerView::toJson(JsonValueWrapper& json)
{
std::string custom_display_name_str = m_custom_display_name.toStdString();
rapidjson::Value custom_display_name;
@@ -128,7 +134,7 @@ void DebuggerWidget::toJson(JsonValueWrapper& json)
json.value().AddMember("isPrimary", m_is_primary, json.allocator());
}
bool DebuggerWidget::fromJson(const JsonValueWrapper& json)
bool DebuggerView::fromJson(const JsonValueWrapper& json)
{
auto custom_display_name = json.value().FindMember("customDisplayName");
if (custom_display_name != json.value().MemberEnd() && custom_display_name->value.IsString())
@@ -144,17 +150,17 @@ bool DebuggerWidget::fromJson(const JsonValueWrapper& json)
return true;
}
void DebuggerWidget::switchToThisTab()
void DebuggerView::switchToThisTab()
{
g_debugger_window->dockManager().switchToDebuggerWidget(this);
g_debugger_window->dockManager().switchToDebuggerView(this);
}
bool DebuggerWidget::supportsMultipleInstances()
bool DebuggerView::supportsMultipleInstances()
{
return !(m_flags & DISALLOW_MULTIPLE_INSTANCES);
}
void DebuggerWidget::retranslateDisplayName()
void DebuggerView::retranslateDisplayName()
{
if (!m_custom_display_name.isEmpty())
{
@@ -162,25 +168,25 @@ void DebuggerWidget::retranslateDisplayName()
}
else
{
auto description = DockTables::DEBUGGER_WIDGETS.find(metaObject()->className());
if (description != DockTables::DEBUGGER_WIDGETS.end())
m_translated_display_name = QCoreApplication::translate("DebuggerWidget", description->second.display_name);
auto description = DockTables::DEBUGGER_VIEWS.find(metaObject()->className());
if (description != DockTables::DEBUGGER_VIEWS.end())
m_translated_display_name = QCoreApplication::translate("DebuggerView", description->second.display_name);
else
m_translated_display_name = QString();
}
}
std::optional<int> DebuggerWidget::displayNameSuffixNumber() const
std::optional<int> DebuggerView::displayNameSuffixNumber() const
{
return m_display_name_suffix_number;
}
void DebuggerWidget::setDisplayNameSuffixNumber(std::optional<int> suffix_number)
void DebuggerView::setDisplayNameSuffixNumber(std::optional<int> suffix_number)
{
m_display_name_suffix_number = suffix_number;
}
void DebuggerWidget::updateStyleSheet()
void DebuggerView::updateStyleSheet()
{
QString stylesheet;
@@ -205,48 +211,48 @@ void DebuggerWidget::updateStyleSheet()
setStyleSheet(stylesheet);
}
void DebuggerWidget::goToInDisassembler(u32 address, bool switch_to_tab)
void DebuggerView::goToInDisassembler(u32 address, bool switch_to_tab)
{
DebuggerEvents::GoToAddress event;
event.address = address;
event.filter = DebuggerEvents::GoToAddress::DISASSEMBLER;
event.switch_to_tab = switch_to_tab;
DebuggerWidget::sendEvent(std::move(event));
DebuggerView::sendEvent(std::move(event));
}
void DebuggerWidget::goToInMemoryView(u32 address, bool switch_to_tab)
void DebuggerView::goToInMemoryView(u32 address, bool switch_to_tab)
{
DebuggerEvents::GoToAddress event;
event.address = address;
event.filter = DebuggerEvents::GoToAddress::MEMORY_VIEW;
event.switch_to_tab = switch_to_tab;
DebuggerWidget::sendEvent(std::move(event));
DebuggerView::sendEvent(std::move(event));
}
void DebuggerWidget::sendEventImplementation(const DebuggerEvents::Event& event)
void DebuggerView::sendEventImplementation(const DebuggerEvents::Event& event)
{
if (!g_debugger_window)
return;
for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerWidgets())
for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerViews())
if (widget->isPrimary() && widget->handleEvent(event))
return;
for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerWidgets())
for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerViews())
if (!widget->isPrimary() && widget->handleEvent(event))
return;
}
void DebuggerWidget::broadcastEventImplementation(const DebuggerEvents::Event& event)
void DebuggerView::broadcastEventImplementation(const DebuggerEvents::Event& event)
{
if (!g_debugger_window)
return;
for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerWidgets())
for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerViews())
widget->handleEvent(event);
}
std::vector<QAction*> DebuggerWidget::createEventActionsImplementation(
std::vector<QAction*> DebuggerView::createEventActionsImplementation(
QMenu* menu,
u32 max_top_level_actions,
bool skip_self,
@@ -257,12 +263,12 @@ std::vector<QAction*> DebuggerWidget::createEventActionsImplementation(
if (!g_debugger_window)
return {};
std::vector<DebuggerWidget*> receivers;
for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerWidgets())
std::vector<DebuggerView*> receivers;
for (const auto& [unique_name, widget] : g_debugger_window->dockManager().debuggerViews())
if ((!skip_self || widget != this) && widget->acceptsEventType(event_type))
receivers.emplace_back(widget);
std::sort(receivers.begin(), receivers.end(), [&](const DebuggerWidget* lhs, const DebuggerWidget* rhs) {
std::sort(receivers.begin(), receivers.end(), [&](const DebuggerView* lhs, const DebuggerView* rhs) {
if (lhs->displayNameWithoutSuffix() == rhs->displayNameWithoutSuffix())
return lhs->displayNameSuffixNumber() < rhs->displayNameSuffixNumber();
@@ -279,7 +285,7 @@ std::vector<QAction*> DebuggerWidget::createEventActionsImplementation(
std::vector<QAction*> actions;
for (size_t i = 0; i < receivers.size(); i++)
{
DebuggerWidget* receiver = receivers[i];
DebuggerView* receiver = receivers[i];
QAction* action;
if (!submenu || i + 1 < max_top_level_actions)

View File

@@ -12,24 +12,26 @@
class JsonValueWrapper;
// Container for variables to be passed to the constructor of DebuggerWidget.
struct DebuggerWidgetParameters
// Container for variables to be passed to the constructor of DebuggerView.
struct DebuggerViewParameters
{
QString unique_name;
u64 id = 0;
DebugInterface* cpu = nullptr;
std::optional<BreakPointCpu> cpu_override;
QWidget* parent = nullptr;
};
// The base class for the contents of the dock widgets in the debugger.
class DebuggerWidget : public QWidget
class DebuggerView : public QWidget
{
Q_OBJECT
public:
QString uniqueName() const;
u64 id() const;
// Get the translated name that should be displayed for this widget.
// Get the translated name that should be displayed for this view.
QString displayName() const;
QString displayNameWithoutSuffix() const;
@@ -39,30 +41,30 @@ public:
bool isPrimary() const;
void setPrimary(bool is_primary);
// Get the effective debug interface associated with this particular widget
// Get the effective debug interface associated with this particular view
// if it's set, otherwise return the one associated with the layout that
// contains this widget.
// contains this view.
DebugInterface& cpu() const;
// Set the debug interface associated with the layout. If false is returned,
// we have to recreate the object.
bool setCpu(DebugInterface& new_cpu);
// Get the CPU associated with this particular widget.
// Get the CPU associated with this particular view.
std::optional<BreakPointCpu> cpuOverride() const;
// Set the CPU associated with the individual dock widget. If false is
// returned, we have to recreate the object.
bool setCpuOverride(std::optional<BreakPointCpu> new_cpu);
// Send each open debugger widget an event in turn, until one handles it.
// Send each open debugger view an event in turn, until one handles it.
template <typename Event>
static void sendEvent(Event event)
{
if (!QtHost::IsOnUIThread())
{
QtHost::RunOnUIThread([event = std::move(event)]() {
DebuggerWidget::sendEventImplementation(event);
DebuggerView::sendEventImplementation(event);
});
return;
}
@@ -70,14 +72,14 @@ public:
sendEventImplementation(event);
}
// Send all open debugger widgets an event.
// Send all open debugger views an event.
template <typename Event>
static void broadcastEvent(Event event)
{
if (!QtHost::IsOnUIThread())
{
QtHost::RunOnUIThread([event = std::move(event)]() {
DebuggerWidget::broadcastEventImplementation(event);
DebuggerView::broadcastEventImplementation(event);
});
return;
}
@@ -110,10 +112,10 @@ public:
// Call the handler callback for the specified event.
bool handleEvent(const DebuggerEvents::Event& event);
// Check if this debugger widget can receive the specified type of event.
// Check if this debugger view can receive the specified type of event.
bool acceptsEventType(const char* event_type);
// Generates context menu actions to send an event to each debugger widget
// Generates context menu actions to send an event to each debugger view
// that can receive it. A submenu is generated if the number of possible
// receivers exceeds max_top_level_actions. If skip_self is true, actions
// are only generated if the sender and receiver aren't the same object.
@@ -163,7 +165,7 @@ protected:
MONOSPACE_FONT = 1 << 1
};
DebuggerWidget(const DebuggerWidgetParameters& parameters, u32 flags);
DebuggerView(const DebuggerViewParameters& parameters, u32 flags);
private:
static void sendEventImplementation(const DebuggerEvents::Event& event);
@@ -177,6 +179,12 @@ private:
const char* action_prefix,
std::function<const DebuggerEvents::Event*()> event_func);
// Used for sorting debugger views that have the same display name. Unique
// within a single layout.
u64 m_id;
// Identifier for the dock widget used by KDDockWidgets. Unique within a
// single layout.
QString m_unique_name;
// A user-defined name, or an empty string if no name was specified so that
@@ -186,7 +194,7 @@ private:
QString m_translated_display_name;
std::optional<int> m_display_name_suffix_number;
// Primary debugger widgets will be chosen to handle events first. For
// Primary debugger views will be chosen to handle events first. For
// example, clicking on an address to go to it in the primary memory view.
bool m_is_primary = false;

View File

@@ -3,7 +3,7 @@
#include "DebuggerWindow.h"
#include "Debugger/DebuggerWidget.h"
#include "Debugger/DebuggerView.h"
#include "Debugger/Docking/DockManager.h"
#include "DebugTools/DebugInterface.h"
@@ -86,7 +86,7 @@ DebuggerWindow::DebuggerWindow(QWidget* parent)
});
connect(g_emu_thread, &EmuThread::onVMPaused, this, []() {
DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate());
DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
});
connect(g_emu_thread, &EmuThread::onVMStarting, this, &DebuggerWindow::onVMStarting);
@@ -290,7 +290,7 @@ void DebuggerWindow::updateFromSettings()
{
m_refresh_timer = new QTimer(this);
connect(m_refresh_timer, &QTimer::timeout, this, []() {
DebuggerWidget::broadcastEvent(DebuggerEvents::Refresh());
DebuggerView::broadcastEvent(DebuggerEvents::Refresh());
});
m_refresh_timer->start(effective_refresh_interval);
}
@@ -346,7 +346,7 @@ void DebuggerWindow::onVMPaused()
});
}
// Stops us from telling the disassembly widget to jump somwhere because
// Stops us from telling the disassembly view to jump somwhere because
// breakpoint code paused the core.
if (!CBreakPoints::GetCorePaused())
emit onVMActuallyPaused();

View File

@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "DisassemblyWidget.h"
#include "DisassemblyView.h"
#include "Debugger/DebuggerWindow.h"
#include "Debugger/JsonValueWrapper.h"
@@ -24,8 +24,8 @@
using namespace QtUtils;
DisassemblyWidget::DisassemblyWidget(const DebuggerWidgetParameters& parameters)
: DebuggerWidget(parameters, MONOSPACE_FONT)
DisassemblyView::DisassemblyView(const DebuggerViewParameters& parameters)
: DebuggerView(parameters, MONOSPACE_FONT)
{
m_ui.setupUi(this);
@@ -34,10 +34,10 @@ DisassemblyWidget::DisassemblyWidget(const DebuggerWidgetParameters& parameters)
setFocusPolicy(Qt::FocusPolicy::ClickFocus);
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, &DisassemblyWidget::customContextMenuRequested, this, &DisassemblyWidget::openContextMenu);
connect(this, &DisassemblyView::customContextMenuRequested, this, &DisassemblyView::openContextMenu);
connect(g_debugger_window, &DebuggerWindow::onVMActuallyPaused,
this, &DisassemblyWidget::gotoProgramCounterOnPause);
this, &DisassemblyView::gotoProgramCounterOnPause);
receiveEvent<DebuggerEvents::Refresh>([this](const DebuggerEvents::Refresh& event) -> bool {
update();
@@ -58,20 +58,20 @@ DisassemblyWidget::DisassemblyWidget(const DebuggerWidgetParameters& parameters)
});
}
DisassemblyWidget::~DisassemblyWidget() = default;
DisassemblyView::~DisassemblyView() = default;
void DisassemblyWidget::toJson(JsonValueWrapper& json)
void DisassemblyView::toJson(JsonValueWrapper& json)
{
DebuggerWidget::toJson(json);
DebuggerView::toJson(json);
json.value().AddMember("startAddress", m_visibleStart, json.allocator());
json.value().AddMember("goToPCOnPause", m_goToProgramCounterOnPause, json.allocator());
json.value().AddMember("showInstructionBytes", m_showInstructionBytes, json.allocator());
}
bool DisassemblyWidget::fromJson(const JsonValueWrapper& json)
bool DisassemblyView::fromJson(const JsonValueWrapper& json)
{
if (!DebuggerWidget::fromJson(json))
if (!DebuggerView::fromJson(json))
return false;
auto start_address = json.value().FindMember("startAddress");
@@ -91,22 +91,22 @@ bool DisassemblyWidget::fromJson(const JsonValueWrapper& json)
return true;
}
void DisassemblyWidget::contextCopyAddress()
void DisassemblyView::contextCopyAddress()
{
QGuiApplication::clipboard()->setText(FetchSelectionInfo(SelectionInfo::ADDRESS));
}
void DisassemblyWidget::contextCopyInstructionHex()
void DisassemblyView::contextCopyInstructionHex()
{
QGuiApplication::clipboard()->setText(FetchSelectionInfo(SelectionInfo::INSTRUCTIONHEX));
}
void DisassemblyWidget::contextCopyInstructionText()
void DisassemblyView::contextCopyInstructionText()
{
QGuiApplication::clipboard()->setText(FetchSelectionInfo(SelectionInfo::INSTRUCTIONTEXT));
}
void DisassemblyWidget::contextAssembleInstruction()
void DisassemblyView::contextAssembleInstruction()
{
if (!cpu().isCpuPaused())
{
@@ -140,12 +140,12 @@ void DisassemblyWidget::contextAssembleInstruction()
this->m_nopedInstructions.insert({i, cpu->read32(i)});
cpu->write32(i, val);
}
DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate());
DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
});
}
}
void DisassemblyWidget::contextNoopInstruction()
void DisassemblyView::contextNoopInstruction()
{
Host::RunOnCPUThread([this, start = m_selectedAddressStart, end = m_selectedAddressEnd, cpu = &cpu()] {
for (u32 i = start; i <= end; i += 4)
@@ -153,11 +153,11 @@ void DisassemblyWidget::contextNoopInstruction()
this->m_nopedInstructions.insert({i, cpu->read32(i)});
cpu->write32(i, 0x00);
}
DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate());
DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
});
}
void DisassemblyWidget::contextRestoreInstruction()
void DisassemblyView::contextRestoreInstruction()
{
Host::RunOnCPUThread([this, start = m_selectedAddressStart, end = m_selectedAddressEnd, cpu = &cpu()] {
for (u32 i = start; i <= end; i += 4)
@@ -168,11 +168,11 @@ void DisassemblyWidget::contextRestoreInstruction()
this->m_nopedInstructions.erase(i);
}
}
DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate());
DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
});
}
void DisassemblyWidget::contextRunToCursor()
void DisassemblyView::contextRunToCursor()
{
const u32 selectedAddressStart = m_selectedAddressStart;
Host::RunOnCPUThread([cpu = &cpu(), selectedAddressStart] {
@@ -181,18 +181,18 @@ void DisassemblyWidget::contextRunToCursor()
});
}
void DisassemblyWidget::contextJumpToCursor()
void DisassemblyView::contextJumpToCursor()
{
cpu().setPc(m_selectedAddressStart);
this->repaint();
}
void DisassemblyWidget::contextToggleBreakpoint()
void DisassemblyView::contextToggleBreakpoint()
{
toggleBreakpoint(m_selectedAddressStart);
}
void DisassemblyWidget::contextFollowBranch()
void DisassemblyView::contextFollowBranch()
{
DisassemblyLineInfo line;
@@ -207,7 +207,7 @@ void DisassemblyWidget::contextFollowBranch()
}
}
void DisassemblyWidget::contextGoToAddress()
void DisassemblyView::contextGoToAddress()
{
bool ok;
const QString targetString = QInputDialog::getText(this, tr("Go To In Disassembly"), "",
@@ -227,7 +227,7 @@ void DisassemblyWidget::contextGoToAddress()
gotoAddressAndSetFocus(static_cast<u32>(address) & ~3);
}
void DisassemblyWidget::contextAddFunction()
void DisassemblyView::contextAddFunction()
{
NewFunctionDialog* dialog = new NewFunctionDialog(cpu(), this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -239,13 +239,13 @@ void DisassemblyWidget::contextAddFunction()
update();
}
void DisassemblyWidget::contextCopyFunctionName()
void DisassemblyView::contextCopyFunctionName()
{
std::string name = cpu().GetSymbolGuardian().FunctionStartingAtAddress(m_selectedAddressStart).name;
QGuiApplication::clipboard()->setText(QString::fromStdString(name));
}
void DisassemblyWidget::contextRemoveFunction()
void DisassemblyView::contextRemoveFunction()
{
cpu().GetSymbolGuardian().ReadWrite([&](ccc::SymbolDatabase& database) {
ccc::Function* curFunc = database.functions.symbol_overlapping_address(m_selectedAddressStart);
@@ -261,7 +261,7 @@ void DisassemblyWidget::contextRemoveFunction()
});
}
void DisassemblyWidget::contextRenameFunction()
void DisassemblyView::contextRenameFunction()
{
const FunctionInfo curFunc = cpu().GetSymbolGuardian().FunctionOverlappingAddress(m_selectedAddressStart);
@@ -289,7 +289,7 @@ void DisassemblyWidget::contextRenameFunction()
});
}
void DisassemblyWidget::contextStubFunction()
void DisassemblyView::contextStubFunction()
{
FunctionInfo function = cpu().GetSymbolGuardian().FunctionOverlappingAddress(m_selectedAddressStart);
u32 address = function.address.valid() ? function.address.value : m_selectedAddressStart;
@@ -298,11 +298,11 @@ void DisassemblyWidget::contextStubFunction()
this->m_stubbedFunctions.insert({address, {cpu->read32(address), cpu->read32(address + 4)}});
cpu->write32(address, 0x03E00008); // jr ra
cpu->write32(address + 4, 0x00000000); // nop
DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate());
DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
});
}
void DisassemblyWidget::contextRestoreFunction()
void DisassemblyView::contextRestoreFunction()
{
u32 address = m_selectedAddressStart;
cpu().GetSymbolGuardian().Read([&](const ccc::SymbolDatabase& database) {
@@ -319,7 +319,7 @@ void DisassemblyWidget::contextRestoreFunction()
cpu->write32(address, first_instruction);
cpu->write32(address + 4, second_instruction);
this->m_stubbedFunctions.erase(address);
DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate());
DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
});
}
else
@@ -328,13 +328,13 @@ void DisassemblyWidget::contextRestoreFunction()
}
}
void DisassemblyWidget::contextShowInstructionBytes()
void DisassemblyView::contextShowInstructionBytes()
{
m_showInstructionBytes = !m_showInstructionBytes;
this->repaint();
}
QString DisassemblyWidget::GetLineDisasm(u32 address)
QString DisassemblyView::GetLineDisasm(u32 address)
{
DisassemblyLineInfo lineInfo;
m_disassemblyManager.getLine(address, true, lineInfo);
@@ -342,7 +342,7 @@ QString DisassemblyWidget::GetLineDisasm(u32 address)
};
// Here we go!
void DisassemblyWidget::paintEvent(QPaintEvent* event)
void DisassemblyView::paintEvent(QPaintEvent* event)
{
QPainter painter(this);
@@ -526,7 +526,7 @@ void DisassemblyWidget::paintEvent(QPaintEvent* event)
painter.drawRect(0, 0, w, h);
}
void DisassemblyWidget::mousePressEvent(QMouseEvent* event)
void DisassemblyView::mousePressEvent(QMouseEvent* event)
{
// Calculate index of row that was clicked
const u32 selectedRowIndex = static_cast<int>(event->position().y()) / m_rowHeight;
@@ -567,7 +567,7 @@ void DisassemblyWidget::mousePressEvent(QMouseEvent* event)
}
}
void DisassemblyWidget::mouseDoubleClickEvent(QMouseEvent* event)
void DisassemblyView::mouseDoubleClickEvent(QMouseEvent* event)
{
// Calculate index of row that was double clicked
const u32 selectedRowIndex = static_cast<int>(event->position().y()) / m_rowHeight;
@@ -580,7 +580,7 @@ void DisassemblyWidget::mouseDoubleClickEvent(QMouseEvent* event)
}
}
void DisassemblyWidget::wheelEvent(QWheelEvent* event)
void DisassemblyView::wheelEvent(QWheelEvent* event)
{
if (event->angleDelta().y() < 0) // todo: max address bounds check?
{
@@ -593,7 +593,7 @@ void DisassemblyWidget::wheelEvent(QWheelEvent* event)
this->repaint();
}
void DisassemblyWidget::keyPressEvent(QKeyEvent* event)
void DisassemblyView::keyPressEvent(QKeyEvent* event)
{
switch (event->key())
{
@@ -665,7 +665,7 @@ void DisassemblyWidget::keyPressEvent(QKeyEvent* event)
this->repaint();
}
void DisassemblyWidget::openContextMenu(QPoint pos)
void DisassemblyView::openContextMenu(QPoint pos)
{
if (!cpu().isAlive())
return;
@@ -678,19 +678,19 @@ void DisassemblyWidget::openContextMenu(QPoint pos)
menu->setAttribute(Qt::WA_DeleteOnClose);
QAction* copy_address_action = menu->addAction(tr("Copy Address"));
connect(copy_address_action, &QAction::triggered, this, &DisassemblyWidget::contextCopyAddress);
connect(copy_address_action, &QAction::triggered, this, &DisassemblyView::contextCopyAddress);
QAction* copy_instruction_hex_action = menu->addAction(tr("Copy Instruction Hex"));
connect(copy_instruction_hex_action, &QAction::triggered, this, &DisassemblyWidget::contextCopyInstructionHex);
connect(copy_instruction_hex_action, &QAction::triggered, this, &DisassemblyView::contextCopyInstructionHex);
QAction* copy_instruction_text_action = menu->addAction(tr("&Copy Instruction Text"));
copy_instruction_text_action->setShortcut(QKeySequence(Qt::Key_C));
connect(copy_instruction_text_action, &QAction::triggered, this, &DisassemblyWidget::contextCopyInstructionText);
connect(copy_instruction_text_action, &QAction::triggered, this, &DisassemblyView::contextCopyInstructionText);
if (cpu().GetSymbolGuardian().FunctionExistsWithStartingAddress(m_selectedAddressStart))
{
QAction* copy_function_name_action = menu->addAction(tr("Copy Function Name"));
connect(copy_function_name_action, &QAction::triggered, this, &DisassemblyWidget::contextCopyFunctionName);
connect(copy_function_name_action, &QAction::triggered, this, &DisassemblyView::contextCopyFunctionName);
}
menu->addSeparator();
@@ -698,37 +698,37 @@ void DisassemblyWidget::openContextMenu(QPoint pos)
if (AddressCanRestore(m_selectedAddressStart, m_selectedAddressEnd))
{
QAction* restore_instruction_action = menu->addAction(tr("Restore Instruction(s)"));
connect(restore_instruction_action, &QAction::triggered, this, &DisassemblyWidget::contextRestoreInstruction);
connect(restore_instruction_action, &QAction::triggered, this, &DisassemblyView::contextRestoreInstruction);
}
QAction* assemble_new_instruction = menu->addAction(tr("Asse&mble new Instruction(s)"));
assemble_new_instruction->setShortcut(QKeySequence(Qt::Key_M));
connect(assemble_new_instruction, &QAction::triggered, this, &DisassemblyWidget::contextAssembleInstruction);
connect(assemble_new_instruction, &QAction::triggered, this, &DisassemblyView::contextAssembleInstruction);
QAction* nop_instruction_action = menu->addAction(tr("NOP Instruction(s)"));
connect(nop_instruction_action, &QAction::triggered, this, &DisassemblyWidget::contextNoopInstruction);
connect(nop_instruction_action, &QAction::triggered, this, &DisassemblyView::contextNoopInstruction);
menu->addSeparator();
QAction* run_to_cursor_action = menu->addAction(tr("Run to Cursor"));
connect(run_to_cursor_action, &QAction::triggered, this, &DisassemblyWidget::contextRunToCursor);
connect(run_to_cursor_action, &QAction::triggered, this, &DisassemblyView::contextRunToCursor);
QAction* jump_to_cursor_action = menu->addAction(tr("&Jump to Cursor"));
jump_to_cursor_action->setShortcut(QKeySequence(Qt::Key_J));
connect(jump_to_cursor_action, &QAction::triggered, this, &DisassemblyWidget::contextJumpToCursor);
connect(jump_to_cursor_action, &QAction::triggered, this, &DisassemblyView::contextJumpToCursor);
QAction* toggle_breakpoint_action = menu->addAction(tr("Toggle &Breakpoint"));
toggle_breakpoint_action->setShortcut(QKeySequence(Qt::Key_B));
connect(toggle_breakpoint_action, &QAction::triggered, this, &DisassemblyWidget::contextToggleBreakpoint);
connect(toggle_breakpoint_action, &QAction::triggered, this, &DisassemblyView::contextToggleBreakpoint);
QAction* follow_branch_action = menu->addAction(tr("Follow Branch"));
connect(follow_branch_action, &QAction::triggered, this, &DisassemblyWidget::contextFollowBranch);
connect(follow_branch_action, &QAction::triggered, this, &DisassemblyView::contextFollowBranch);
menu->addSeparator();
QAction* go_to_address_action = menu->addAction(tr("&Go to Address"));
go_to_address_action->setShortcut(QKeySequence(Qt::Key_G));
connect(go_to_address_action, &QAction::triggered, this, &DisassemblyWidget::contextGoToAddress);
connect(go_to_address_action, &QAction::triggered, this, &DisassemblyView::contextGoToAddress);
createEventActions<DebuggerEvents::GoToAddress>(menu, [this]() {
DebuggerEvents::GoToAddress event;
@@ -745,24 +745,24 @@ void DisassemblyWidget::openContextMenu(QPoint pos)
menu->addSeparator();
QAction* add_function_action = menu->addAction(tr("Add Function"));
connect(add_function_action, &QAction::triggered, this, &DisassemblyWidget::contextAddFunction);
connect(add_function_action, &QAction::triggered, this, &DisassemblyView::contextAddFunction);
QAction* rename_function_action = menu->addAction(tr("Rename Function"));
connect(rename_function_action, &QAction::triggered, this, &DisassemblyWidget::contextRenameFunction);
connect(rename_function_action, &QAction::triggered, this, &DisassemblyView::contextRenameFunction);
QAction* remove_function_action = menu->addAction(tr("Remove Function"));
menu->addAction(remove_function_action);
connect(remove_function_action, &QAction::triggered, this, &DisassemblyWidget::contextRemoveFunction);
connect(remove_function_action, &QAction::triggered, this, &DisassemblyView::contextRemoveFunction);
if (FunctionCanRestore(m_selectedAddressStart))
{
QAction* restore_action = menu->addAction(tr("Restore Function"));
connect(restore_action, &QAction::triggered, this, &DisassemblyWidget::contextRestoreFunction);
connect(restore_action, &QAction::triggered, this, &DisassemblyView::contextRestoreFunction);
}
else
{
QAction* stub_action = menu->addAction(tr("Stub (NOP) Function"));
connect(stub_action, &QAction::triggered, this, &DisassemblyWidget::contextStubFunction);
connect(stub_action, &QAction::triggered, this, &DisassemblyView::contextStubFunction);
}
menu->addSeparator();
@@ -771,12 +771,12 @@ void DisassemblyWidget::openContextMenu(QPoint pos)
show_instruction_bytes_action->setShortcut(QKeySequence(Qt::Key_I));
show_instruction_bytes_action->setCheckable(true);
show_instruction_bytes_action->setChecked(m_showInstructionBytes);
connect(show_instruction_bytes_action, &QAction::triggered, this, &DisassemblyWidget::contextShowInstructionBytes);
connect(show_instruction_bytes_action, &QAction::triggered, this, &DisassemblyView::contextShowInstructionBytes);
menu->popup(this->mapToGlobal(pos));
}
QString DisassemblyWidget::GetDisassemblyTitleLine()
QString DisassemblyView::GetDisassemblyTitleLine()
{
// Disassembly column title line based on format created by DisassemblyStringFromAddress()
QString title_line_string;
@@ -785,11 +785,11 @@ QString DisassemblyWidget::GetDisassemblyTitleLine()
const bool show_instruction_bytes = m_showInstructionBytes && cpu().isAlive();
if (show_instruction_bytes)
{
title_line_string = QCoreApplication::translate("DisassemblyWidgetColumnTitle", " %1 %2 %3 %4");
title_line_string = QCoreApplication::translate("DisassemblyViewColumnTitle", " %1 %2 %3 %4");
}
else
{
title_line_string = QCoreApplication::translate("DisassemblyWidgetColumnTitle", " %1 %2 %3");
title_line_string = QCoreApplication::translate("DisassemblyViewColumnTitle", " %1 %2 %3");
}
// First 2 chars in disassembly row is always for non-returning functions (NR)
@@ -797,21 +797,21 @@ QString DisassemblyWidget::GetDisassemblyTitleLine()
title_line_string = title_line_string.arg(" ");
// Second column title is always address of instruction
title_line_string = title_line_string.arg(QCoreApplication::translate("DisassemblyWidgetColumnTitle", "Location"));
title_line_string = title_line_string.arg(QCoreApplication::translate("DisassemblyViewColumnTitle", "Location"));
// If user specified to "Show Instruction Bytes", third column is opcode + args
if (show_instruction_bytes)
{
title_line_string = title_line_string.arg(QCoreApplication::translate("DisassemblyWidgetColumnTitle", "Bytes "));
title_line_string = title_line_string.arg(QCoreApplication::translate("DisassemblyViewColumnTitle", "Bytes "));
}
// Last column title is always disassembled instruction
title_line_string = title_line_string.arg(QCoreApplication::translate("DisassemblyWidgetColumnTitle", "Instruction"));
title_line_string = title_line_string.arg(QCoreApplication::translate("DisassemblyViewColumnTitle", "Instruction"));
return title_line_string;
}
QColor DisassemblyWidget::GetDisassemblyTitleLineColor()
QColor DisassemblyView::GetDisassemblyTitleLineColor()
{
// Determine color of column title line. Based on QFusionStyle.
QColor title_line_color = this->palette().button().color();
@@ -821,7 +821,7 @@ QColor DisassemblyWidget::GetDisassemblyTitleLineColor()
return title_line_color.lighter(104);
}
inline QString DisassemblyWidget::DisassemblyStringFromAddress(u32 address, QFont font, u32 pc, bool selected)
inline QString DisassemblyView::DisassemblyStringFromAddress(u32 address, QFont font, u32 pc, bool selected)
{
DisassemblyLineInfo line;
@@ -882,7 +882,7 @@ inline QString DisassemblyWidget::DisassemblyStringFromAddress(u32 address, QFon
return lineString;
}
QColor DisassemblyWidget::GetAddressFunctionColor(u32 address)
QColor DisassemblyView::GetAddressFunctionColor(u32 address)
{
std::array<QColor, 6> colors;
if (QtUtils::IsLightTheme(palette()))
@@ -920,7 +920,7 @@ QColor DisassemblyWidget::GetAddressFunctionColor(u32 address)
return colors[(function_address.value >> 4) % colors.size()];
}
QString DisassemblyWidget::FetchSelectionInfo(SelectionInfo selInfo)
QString DisassemblyView::FetchSelectionInfo(SelectionInfo selInfo)
{
QString infoBlock;
for (u32 i = m_selectedAddressStart; i <= m_selectedAddressEnd; i += 4)
@@ -945,18 +945,18 @@ QString DisassemblyWidget::FetchSelectionInfo(SelectionInfo selInfo)
return infoBlock;
}
void DisassemblyWidget::gotoAddressAndSetFocus(u32 address)
void DisassemblyView::gotoAddressAndSetFocus(u32 address)
{
gotoAddress(address, true);
}
void DisassemblyWidget::gotoProgramCounterOnPause()
void DisassemblyView::gotoProgramCounterOnPause()
{
if (m_goToProgramCounterOnPause)
gotoAddress(cpu().getPC(), false);
}
void DisassemblyWidget::gotoAddress(u32 address, bool should_set_focus)
void DisassemblyView::gotoAddress(u32 address, bool should_set_focus)
{
const u32 destAddress = address & ~3;
// Center the address
@@ -969,12 +969,12 @@ void DisassemblyWidget::gotoAddress(u32 address, bool should_set_focus)
this->setFocus();
}
void DisassemblyWidget::toggleBreakpoint(u32 address)
void DisassemblyView::toggleBreakpoint(u32 address)
{
if (!cpu().isAlive())
return;
QPointer<DisassemblyWidget> disassembly_widget(this);
QPointer<DisassemblyView> disassembly_widget(this);
Host::RunOnCPUThread([cpu = &cpu(), address, disassembly_widget] {
if (!CBreakPoints::IsAddressBreakPoint(cpu->getCpuType(), address))
@@ -990,7 +990,7 @@ void DisassemblyWidget::toggleBreakpoint(u32 address)
});
}
bool DisassemblyWidget::AddressCanRestore(u32 start, u32 end)
bool DisassemblyView::AddressCanRestore(u32 start, u32 end)
{
for (u32 i = start; i <= end; i += 4)
{
@@ -1002,7 +1002,7 @@ bool DisassemblyWidget::AddressCanRestore(u32 start, u32 end)
return false;
}
bool DisassemblyWidget::FunctionCanRestore(u32 address)
bool DisassemblyView::FunctionCanRestore(u32 address)
{
FunctionInfo function = cpu().GetSymbolGuardian().FunctionOverlappingAddress(address);
if (function.address.valid())

View File

@@ -3,22 +3,22 @@
#pragma once
#include "ui_DisassemblyWidget.h"
#include "ui_DisassemblyView.h"
#include "DebuggerWidget.h"
#include "DebuggerView.h"
#include "pcsx2/DebugTools/DisassemblyManager.h"
#include <QtWidgets/QMenu>
#include <QtGui/QPainter>
class DisassemblyWidget final : public DebuggerWidget
class DisassemblyView final : public DebuggerView
{
Q_OBJECT
public:
DisassemblyWidget(const DebuggerWidgetParameters& parameters);
~DisassemblyWidget();
DisassemblyView(const DebuggerViewParameters& parameters);
~DisassemblyView();
void toJson(JsonValueWrapper& json) override;
bool fromJson(const JsonValueWrapper& json) override;
@@ -65,7 +65,7 @@ public slots:
void toggleBreakpoint(u32 address);
private:
Ui::DisassemblyWidget m_ui;
Ui::DisassemblyView m_ui;
u32 m_visibleStart = 0x100000; // The address of the first instruction shown.
u32 m_visibleRows;

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DisassemblyWidget</class>
<widget class="QWidget" name="DisassemblyWidget">
<class>DisassemblyView</class>
<widget class="QWidget" name="DisassemblyView">
<property name="geometry">
<rect>
<x>0</x>

View File

@@ -3,7 +3,7 @@
#include "DockLayout.h"
#include "Debugger/DebuggerWidget.h"
#include "Debugger/DebuggerView.h"
#include "Debugger/DebuggerWindow.h"
#include "Debugger/JsonValueWrapper.h"
@@ -29,7 +29,7 @@
const char* DEBUGGER_LAYOUT_FILE_FORMAT = "PCSX2 Debugger User Interface Layout";
// Increment this whenever there is a breaking change to the JSON format.
const u32 DEBUGGER_LAYOUT_FILE_VERSION_MAJOR = 1;
const u32 DEBUGGER_LAYOUT_FILE_VERSION_MAJOR = 2;
// Increment this whenever there is a non-breaking change to the JSON format.
const u32 DEBUGGER_LAYOUT_FILE_VERSION_MINOR = 0;
@@ -70,23 +70,24 @@ DockLayout::DockLayout(
: m_name(name)
, m_cpu(cpu)
, m_is_default(is_default)
, m_next_unique_name(layout_to_clone.m_next_unique_name)
, m_next_id(layout_to_clone.m_next_id)
, m_base_layout(layout_to_clone.m_base_layout)
, m_toolbars(layout_to_clone.m_toolbars)
, m_geometry(layout_to_clone.m_geometry)
{
for (const auto& [unique_name, widget_to_clone] : layout_to_clone.m_widgets)
{
auto widget_description = DockTables::DEBUGGER_WIDGETS.find(widget_to_clone->metaObject()->className());
if (widget_description == DockTables::DEBUGGER_WIDGETS.end())
auto widget_description = DockTables::DEBUGGER_VIEWS.find(widget_to_clone->metaObject()->className());
if (widget_description == DockTables::DEBUGGER_VIEWS.end())
continue;
DebuggerWidgetParameters parameters;
DebuggerViewParameters parameters;
parameters.unique_name = unique_name;
parameters.id = widget_to_clone->id();
parameters.cpu = &DebugInterface::get(cpu);
parameters.cpu_override = widget_to_clone->cpuOverride();
DebuggerWidget* new_widget = widget_description->second.create_widget(parameters);
DebuggerView* new_widget = widget_description->second.create_widget(parameters);
new_widget->setCustomDisplayName(widget_to_clone->customDisplayName());
new_widget->setPrimary(widget_to_clone->isPrimary());
m_widgets.emplace(unique_name, new_widget);
@@ -143,7 +144,7 @@ void DockLayout::setCpu(BreakPointCpu cpu)
pxAssert(widget.get());
if (!widget->setCpu(DebugInterface::get(cpu)))
recreateDebuggerWidget(unique_name);
recreateDebuggerView(unique_name);
}
}
@@ -221,24 +222,24 @@ void DockLayout::thaw()
}
// Check that all the dock widgets have been restored correctly.
std::vector<QString> orphaned_debugger_widgets;
std::vector<QString> orphaned_debugger_views;
for (auto& [unique_name, widget] : m_widgets)
{
auto [controller, view] = DockUtils::dockWidgetFromName(unique_name);
if (!controller || !view)
{
Console.Error("Debugger: Failed to restore dock widget '%s'.", unique_name.toStdString().c_str());
orphaned_debugger_widgets.emplace_back(unique_name);
orphaned_debugger_views.emplace_back(unique_name);
}
}
// Delete any debugger widgets that haven't been restored correctly.
for (const QString& unique_name : orphaned_debugger_widgets)
// Delete any debugger views that haven't been restored correctly.
for (const QString& unique_name : orphaned_debugger_views)
{
auto widget_iterator = m_widgets.find(unique_name);
pxAssert(widget_iterator != m_widgets.end());
setPrimaryDebuggerWidget(widget_iterator->second.get(), false);
setPrimaryDebuggerView(widget_iterator->second.get(), false);
delete widget_iterator->second.get();
m_widgets.erase(widget_iterator);
}
@@ -262,7 +263,7 @@ void DockLayout::reset()
delete widget;
}
m_next_unique_name = 0;
m_next_id = 0;
m_toolbars.clear();
m_widgets.clear();
m_geometry.clear();
@@ -273,18 +274,19 @@ void DockLayout::reset()
for (size_t i = 0; i < base_layout->widgets.size(); i++)
{
auto iterator = DockTables::DEBUGGER_WIDGETS.find(base_layout->widgets[i].type);
pxAssertRel(iterator != DockTables::DEBUGGER_WIDGETS.end(), "Invalid default layout.");
const DockTables::DebuggerWidgetDescription& dock_description = iterator->second;
auto iterator = DockTables::DEBUGGER_VIEWS.find(base_layout->widgets[i].type);
pxAssertRel(iterator != DockTables::DEBUGGER_VIEWS.end(), "Invalid default layout.");
const DockTables::DebuggerViewDescription& dock_description = iterator->second;
DebuggerWidgetParameters parameters;
parameters.unique_name = generateNewUniqueName(base_layout->widgets[i].type.c_str());
DebuggerViewParameters parameters;
std::tie(parameters.unique_name, parameters.id) =
generateNewUniqueName(base_layout->widgets[i].type.c_str());
parameters.cpu = &DebugInterface::get(m_cpu);
if (parameters.unique_name.isEmpty())
continue;
DebuggerWidget* widget = dock_description.create_widget(parameters);
DebuggerView* widget = dock_description.create_widget(parameters);
widget->setPrimary(true);
m_widgets.emplace(parameters.unique_name, widget);
}
@@ -299,7 +301,7 @@ KDDockWidgets::Core::DockWidget* DockLayout::createDockWidget(const QString& nam
if (widget_iterator == m_widgets.end())
return nullptr;
DebuggerWidget* widget = widget_iterator->second;
DebuggerView* widget = widget_iterator->second;
if (!widget)
return nullptr;
@@ -317,20 +319,20 @@ void DockLayout::updateDockWidgetTitles()
if (!m_is_active)
return;
// Translate default debugger widget names.
// Translate default debugger view names.
for (auto& [unique_name, widget] : m_widgets)
widget->retranslateDisplayName();
// Determine if any widgets have duplicate display names.
std::map<QString, std::vector<DebuggerWidget*>> display_name_to_widgets;
std::map<QString, std::vector<DebuggerView*>> display_name_to_widgets;
for (auto& [unique_name, widget] : m_widgets)
display_name_to_widgets[widget->displayNameWithoutSuffix()].emplace_back(widget.get());
for (auto& [display_name, widgets] : display_name_to_widgets)
{
std::sort(widgets.begin(), widgets.end(),
[&](const DebuggerWidget* lhs, const DebuggerWidget* rhs) {
return lhs->uniqueName() < rhs->uniqueName();
[&](const DebuggerView* lhs, const DebuggerView* rhs) {
return lhs->id() < rhs->id();
});
for (size_t i = 0; i < widgets.size(); i++)
@@ -343,7 +345,7 @@ void DockLayout::updateDockWidgetTitles()
}
}
// Propagate the new names from the debugger widgets to the dock widgets.
// Propagate the new names from the debugger views to the dock widgets.
for (auto& [unique_name, widget] : m_widgets)
{
auto [controller, view] = DockUtils::dockWidgetFromName(widget->uniqueName());
@@ -354,17 +356,17 @@ void DockLayout::updateDockWidgetTitles()
}
}
const std::map<QString, QPointer<DebuggerWidget>>& DockLayout::debuggerWidgets()
const std::map<QString, QPointer<DebuggerView>>& DockLayout::debuggerViews()
{
return m_widgets;
}
bool DockLayout::hasDebuggerWidget(const QString& unique_name)
bool DockLayout::hasDebuggerView(const QString& unique_name)
{
return m_widgets.find(unique_name) != m_widgets.end();
}
size_t DockLayout::countDebuggerWidgetsOfType(const char* type)
size_t DockLayout::countDebuggerViewsOfType(const char* type)
{
size_t count = 0;
for (const auto& [unique_name, widget] : m_widgets)
@@ -376,29 +378,29 @@ size_t DockLayout::countDebuggerWidgetsOfType(const char* type)
return count;
}
void DockLayout::createDebuggerWidget(const std::string& type)
void DockLayout::createDebuggerView(const std::string& type)
{
pxAssert(m_is_active);
if (!g_debugger_window)
return;
auto description_iterator = DockTables::DEBUGGER_WIDGETS.find(type);
pxAssert(description_iterator != DockTables::DEBUGGER_WIDGETS.end());
auto description_iterator = DockTables::DEBUGGER_VIEWS.find(type);
pxAssert(description_iterator != DockTables::DEBUGGER_VIEWS.end());
const DockTables::DebuggerWidgetDescription& description = description_iterator->second;
const DockTables::DebuggerViewDescription& description = description_iterator->second;
DebuggerWidgetParameters parameters;
parameters.unique_name = generateNewUniqueName(type.c_str());
DebuggerViewParameters parameters;
std::tie(parameters.unique_name, parameters.id) = generateNewUniqueName(type.c_str());
parameters.cpu = &DebugInterface::get(m_cpu);
if (parameters.unique_name.isEmpty())
return;
DebuggerWidget* widget = description.create_widget(parameters);
DebuggerView* widget = description.create_widget(parameters);
m_widgets.emplace(parameters.unique_name, widget);
setPrimaryDebuggerWidget(widget, countDebuggerWidgetsOfType(type.c_str()) == 0);
setPrimaryDebuggerView(widget, countDebuggerViewsOfType(type.c_str()) == 0);
auto view = static_cast<KDDockWidgets::QtWidgets::DockWidget*>(
KDDockWidgets::Config::self().viewFactory()->createDockWidget(widget->uniqueName()));
@@ -411,55 +413,56 @@ void DockLayout::createDebuggerWidget(const std::string& type)
updateDockWidgetTitles();
}
void DockLayout::recreateDebuggerWidget(const QString& unique_name)
void DockLayout::recreateDebuggerView(const QString& unique_name)
{
if (!g_debugger_window)
return;
auto debugger_widget_iterator = m_widgets.find(unique_name);
pxAssert(debugger_widget_iterator != m_widgets.end());
auto debugger_view_iterator = m_widgets.find(unique_name);
pxAssert(debugger_view_iterator != m_widgets.end());
DebuggerWidget* old_debugger_widget = debugger_widget_iterator->second;
DebuggerView* old_debugger_view = debugger_view_iterator->second;
auto description_iterator = DockTables::DEBUGGER_WIDGETS.find(old_debugger_widget->metaObject()->className());
pxAssert(description_iterator != DockTables::DEBUGGER_WIDGETS.end());
auto description_iterator = DockTables::DEBUGGER_VIEWS.find(old_debugger_view->metaObject()->className());
pxAssert(description_iterator != DockTables::DEBUGGER_VIEWS.end());
const DockTables::DebuggerWidgetDescription& description = description_iterator->second;
const DockTables::DebuggerViewDescription& description = description_iterator->second;
DebuggerWidgetParameters parameters;
parameters.unique_name = old_debugger_widget->uniqueName();
DebuggerViewParameters parameters;
parameters.unique_name = old_debugger_view->uniqueName();
parameters.id = old_debugger_view->id();
parameters.cpu = &DebugInterface::get(m_cpu);
parameters.cpu_override = old_debugger_widget->cpuOverride();
parameters.cpu_override = old_debugger_view->cpuOverride();
DebuggerWidget* new_debugger_widget = description.create_widget(parameters);
new_debugger_widget->setCustomDisplayName(old_debugger_widget->customDisplayName());
new_debugger_widget->setPrimary(old_debugger_widget->isPrimary());
debugger_widget_iterator->second = new_debugger_widget;
DebuggerView* new_debugger_view = description.create_widget(parameters);
new_debugger_view->setCustomDisplayName(old_debugger_view->customDisplayName());
new_debugger_view->setPrimary(old_debugger_view->isPrimary());
debugger_view_iterator->second = new_debugger_view;
if (m_is_active)
{
auto [controller, view] = DockUtils::dockWidgetFromName(unique_name);
if (view)
view->setWidget(new_debugger_widget);
view->setWidget(new_debugger_view);
}
delete old_debugger_widget;
delete old_debugger_view;
}
void DockLayout::destroyDebuggerWidget(const QString& unique_name)
void DockLayout::destroyDebuggerView(const QString& unique_name)
{
pxAssert(m_is_active);
if (!g_debugger_window)
return;
auto debugger_widget_iterator = m_widgets.find(unique_name);
if (debugger_widget_iterator == m_widgets.end())
auto debugger_view_iterator = m_widgets.find(unique_name);
if (debugger_view_iterator == m_widgets.end())
return;
setPrimaryDebuggerWidget(debugger_widget_iterator->second.get(), false);
delete debugger_widget_iterator->second.get();
m_widgets.erase(debugger_widget_iterator);
setPrimaryDebuggerView(debugger_view_iterator->second.get(), false);
delete debugger_view_iterator->second.get();
m_widgets.erase(debugger_view_iterator);
auto [controller, view] = DockUtils::dockWidgetFromName(unique_name);
if (!controller)
@@ -470,7 +473,7 @@ void DockLayout::destroyDebuggerWidget(const QString& unique_name)
updateDockWidgetTitles();
}
void DockLayout::setPrimaryDebuggerWidget(DebuggerWidget* widget, bool is_primary)
void DockLayout::setPrimaryDebuggerView(DebuggerView* widget, bool is_primary)
{
bool present = false;
for (auto& [unique_name, test_widget] : m_widgets)
@@ -545,24 +548,22 @@ bool DockLayout::save(DockLayout::Index layout_index)
rapidjson::Document geometry;
const char* cpu_name = DebugInterface::cpuName(m_cpu);
const std::string& default_layouts_hash = DockTables::hashDefaultLayouts();
u32 default_layout_hash = DockTables::hashDefaultLayouts();
rapidjson::Value format;
format.SetString(DEBUGGER_LAYOUT_FILE_FORMAT, strlen(DEBUGGER_LAYOUT_FILE_FORMAT));
json.AddMember("format", format, json.GetAllocator());
json.AddMember("version_major", DEBUGGER_LAYOUT_FILE_VERSION_MAJOR, json.GetAllocator());
json.AddMember("version_minor", DEBUGGER_LAYOUT_FILE_VERSION_MINOR, json.GetAllocator());
rapidjson::Value version_hash;
version_hash.SetString(default_layouts_hash.c_str(), default_layouts_hash.size());
json.AddMember("version_hash", version_hash, json.GetAllocator());
json.AddMember("versionMajor", DEBUGGER_LAYOUT_FILE_VERSION_MAJOR, json.GetAllocator());
json.AddMember("versionMinor", DEBUGGER_LAYOUT_FILE_VERSION_MINOR, json.GetAllocator());
json.AddMember("defaultLayoutHash", default_layout_hash, json.GetAllocator());
std::string name_str = m_name.toStdString();
json.AddMember("name", rapidjson::Value().SetString(name_str.c_str(), name_str.size()), json.GetAllocator());
json.AddMember("target", rapidjson::Value().SetString(cpu_name, strlen(cpu_name)), json.GetAllocator());
json.AddMember("index", static_cast<int>(layout_index), json.GetAllocator());
json.AddMember("isDefault", m_is_default, json.GetAllocator());
json.AddMember("nextUniqueName", m_next_unique_name, json.GetAllocator());
json.AddMember("nextId", m_next_id, json.GetAllocator());
if (!m_base_layout.empty())
{
@@ -579,7 +580,7 @@ bool DockLayout::save(DockLayout::Index layout_index)
json.AddMember("toolbars", toolbars, json.GetAllocator());
}
rapidjson::Value widgets(rapidjson::kArrayType);
rapidjson::Value dock_widgets(rapidjson::kArrayType);
for (auto& [unique_name, widget] : m_widgets)
{
pxAssert(widget.get());
@@ -590,6 +591,7 @@ bool DockLayout::save(DockLayout::Index layout_index)
rapidjson::Value name;
name.SetString(name_str.c_str(), name_str.size(), json.GetAllocator());
object.AddMember("uniqueName", name, json.GetAllocator());
object.AddMember("id", widget->id(), json.GetAllocator());
const char* type_str = widget->metaObject()->className();
rapidjson::Value type;
@@ -608,9 +610,9 @@ bool DockLayout::save(DockLayout::Index layout_index)
JsonValueWrapper wrapper(object, json.GetAllocator());
widget->toJson(wrapper);
widgets.PushBack(object, json.GetAllocator());
dock_widgets.PushBack(object, json.GetAllocator());
}
json.AddMember("widgets", widgets, json.GetAllocator());
json.AddMember("dockWidgets", dock_widgets, json.GetAllocator());
if (!m_geometry.isEmpty() && !geometry.Parse(m_geometry).HasParseError())
json.AddMember("geometry", geometry, json.GetAllocator());
@@ -687,11 +689,11 @@ void DockLayout::load(
return;
}
auto version_major = json.FindMember("version_major");
auto version_major = json.FindMember("versionMajor");
if (version_major == json.MemberEnd() || !version_major->value.IsInt())
{
Console.Error("Debugger: Layout file '%s' has missing or invalid 'version_major' property.", path.c_str());
result = INVALID_FORMAT;
Console.Error("Debugger: Layout file '%s' has missing or invalid 'versionMajor' property.", path.c_str());
result = MAJOR_VERSION_MISMATCH;
return;
}
@@ -701,23 +703,23 @@ void DockLayout::load(
return;
}
auto version_minor = json.FindMember("version_minor");
auto version_minor = json.FindMember("versionMinor");
if (version_minor == json.MemberEnd() || !version_minor->value.IsInt())
{
Console.Error("Debugger: Layout file '%s' has missing or invalid 'version_minor' property.", path.c_str());
result = INVALID_FORMAT;
Console.Error("Debugger: Layout file '%s' has missing or invalid 'versionMinor' property.", path.c_str());
result = MAJOR_VERSION_MISMATCH;
return;
}
auto version_hash = json.FindMember("version_hash");
if (version_hash == json.MemberEnd() || !version_hash->value.IsString())
auto default_layout_hash = json.FindMember("defaultLayoutHash");
if (default_layout_hash == json.MemberEnd() || !default_layout_hash->value.IsUint())
{
Console.Error("Debugger: Layout file '%s' has missing or invalid 'version_hash' property.", path.c_str());
result = INVALID_FORMAT;
Console.Error("Debugger: Layout file '%s' has missing or invalid 'defaultLayoutHash' property.", path.c_str());
result = MAJOR_VERSION_MISMATCH;
return;
}
if (strcmp(version_hash->value.GetString(), DockTables::hashDefaultLayouts().c_str()) != 0)
if (default_layout_hash->value.GetUint() != DockTables::hashDefaultLayouts())
result = DEFAULT_LAYOUT_HASH_MISMATCH;
auto name = json.FindMember("name");
@@ -745,9 +747,9 @@ void DockLayout::load(
if (is_default != json.MemberEnd() && is_default->value.IsBool())
m_is_default = is_default->value.GetBool();
auto next_unique_name = json.FindMember("nextUniqueName");
if (next_unique_name != json.MemberBegin() && next_unique_name->value.IsInt())
m_next_unique_name = next_unique_name->value.GetInt();
auto next_id = json.FindMember("nextId");
if (next_id != json.MemberBegin() && next_id->value.IsUint64())
m_next_id = next_id->value.GetUint64();
auto base_layout = json.FindMember("baseLayout");
if (base_layout != json.MemberEnd() && base_layout->value.IsString())
@@ -757,15 +759,19 @@ void DockLayout::load(
if (toolbars != json.MemberEnd() && toolbars->value.IsString())
m_toolbars = QByteArray::fromBase64(toolbars->value.GetString());
auto widgets = json.FindMember("widgets");
if (widgets != json.MemberEnd() && widgets->value.IsArray())
auto dock_widgets = json.FindMember("dockWidgets");
if (dock_widgets != json.MemberEnd() && dock_widgets->value.IsArray())
{
for (rapidjson::Value& object : widgets->value.GetArray())
for (rapidjson::Value& object : dock_widgets->value.GetArray())
{
auto unique_name = object.FindMember("uniqueName");
if (unique_name == object.MemberEnd() || !unique_name->value.IsString())
continue;
auto id = object.FindMember("id");
if (id == object.MemberEnd() || !id->value.IsUint64())
continue;
auto widgets_iterator = m_widgets.find(unique_name->value.GetString());
if (widgets_iterator != m_widgets.end())
continue;
@@ -774,8 +780,8 @@ void DockLayout::load(
if (type == object.MemberEnd() || !type->value.IsString())
continue;
auto description = DockTables::DEBUGGER_WIDGETS.find(type->value.GetString());
if (description == DockTables::DEBUGGER_WIDGETS.end())
auto description = DockTables::DEBUGGER_VIEWS.find(type->value.GetString());
if (description == DockTables::DEBUGGER_VIEWS.end())
continue;
std::optional<BreakPointCpu> cpu_override;
@@ -788,12 +794,13 @@ void DockLayout::load(
cpu_override = cpu;
}
DebuggerWidgetParameters parameters;
DebuggerViewParameters parameters;
parameters.unique_name = unique_name->value.GetString();
parameters.id = id->value.GetUint64();
parameters.cpu = &DebugInterface::get(m_cpu);
parameters.cpu_override = cpu_override;
DebuggerWidget* widget = description->second.create_widget(parameters);
DebuggerView* widget = description->second.create_widget(parameters);
JsonValueWrapper wrapper(object, json.GetAllocator());
if (!widget->fromJson(wrapper))
@@ -818,12 +825,12 @@ void DockLayout::load(
m_layout_file_path = path;
validatePrimaryDebuggerWidgets();
validatePrimaryDebuggerViews();
}
void DockLayout::validatePrimaryDebuggerWidgets()
void DockLayout::validatePrimaryDebuggerViews()
{
std::map<std::string, std::vector<DebuggerWidget*>> type_to_widgets;
std::map<std::string, std::vector<DebuggerView*>> type_to_widgets;
for (const auto& [unique_name, widget] : m_widgets)
type_to_widgets[widget->metaObject()->className()].emplace_back(widget.get());
@@ -832,7 +839,7 @@ void DockLayout::validatePrimaryDebuggerWidgets()
u32 primary_widgets = 0;
// Make sure at most one widget is marked as primary.
for (DebuggerWidget* widget : widgets)
for (DebuggerView* widget : widgets)
{
if (widget->isPrimary())
{
@@ -868,7 +875,7 @@ void DockLayout::setupDefaultLayout()
const DockTables::DefaultDockGroupDescription& group =
base_layout->groups[static_cast<u32>(dock_description.group)];
DebuggerWidget* widget = nullptr;
DebuggerView* widget = nullptr;
for (auto& [unique_name, test_widget] : m_widgets)
if (test_widget->metaObject()->className() == dock_description.type)
widget = test_widget;
@@ -900,19 +907,20 @@ void DockLayout::setupDefaultLayout()
group->setCurrentTabIndex(0);
}
QString DockLayout::generateNewUniqueName(const char* type)
std::pair<QString, u64> DockLayout::generateNewUniqueName(const char* type)
{
QString name;
u64 id;
do
{
if (m_next_unique_name == INT_MAX)
return QString();
if (m_next_id == INT_MAX)
return {QString(), 0};
// Produce unique names that will lexicographically sort in the order
// they were allocated. This ensures the #1, #2, etc suffixes for dock
// widgets with conflicting names will be assigned in the correct order.
name = QStringLiteral("%1-%2").arg(m_next_unique_name, 16, 10, QLatin1Char('0')).arg(type);
m_next_unique_name++;
} while (hasDebuggerWidget(name));
return name;
id = m_next_id;
name = QStringLiteral("%1-%2").arg(type).arg(static_cast<qulonglong>(m_next_id));
m_next_id++;
} while (hasDebuggerView(name));
return {name, id};
}

View File

@@ -12,7 +12,7 @@
#include <QtCore/QPointer>
class DebuggerWidget;
class DebuggerView;
class DebuggerWindow;
extern const char* DEBUGGER_LAYOUT_FILE_FORMAT;
@@ -97,13 +97,13 @@ public:
KDDockWidgets::Core::DockWidget* createDockWidget(const QString& name);
void updateDockWidgetTitles();
const std::map<QString, QPointer<DebuggerWidget>>& debuggerWidgets();
bool hasDebuggerWidget(const QString& unique_name);
size_t countDebuggerWidgetsOfType(const char* type);
void createDebuggerWidget(const std::string& type);
void recreateDebuggerWidget(const QString& unique_name);
void destroyDebuggerWidget(const QString& unique_name);
void setPrimaryDebuggerWidget(DebuggerWidget* widget, bool is_primary);
const std::map<QString, QPointer<DebuggerView>>& debuggerViews();
bool hasDebuggerView(const QString& unique_name);
size_t countDebuggerViewsOfType(const char* type);
void createDebuggerView(const std::string& type);
void recreateDebuggerView(const QString& unique_name);
void destroyDebuggerView(const QString& unique_name);
void setPrimaryDebuggerView(DebuggerView* widget, bool is_primary);
void deleteFile();
@@ -115,12 +115,12 @@ private:
DockLayout::LoadResult& result,
DockLayout::Index& index_last_session);
// Make sure there is only a single primary debugger widget of each type.
void validatePrimaryDebuggerWidgets();
// Make sure there is only a single primary debugger view of each type.
void validatePrimaryDebuggerViews();
void setupDefaultLayout();
QString generateNewUniqueName(const char* type);
std::pair<QString, u64> generateNewUniqueName(const char* type);
// The name displayed in the user interface. Also used to determine the
// file name for the layout file.
@@ -134,7 +134,7 @@ private:
bool m_is_default = false;
// A counter used to generate new unique names for dock widgets.
int m_next_unique_name = 0;
u64 m_next_id = 0;
// The name of the default layout which this layout was based on. This will
// be used if the m_geometry variable above is empty.
@@ -147,7 +147,7 @@ private:
// All the dock widgets currently open in this layout. If this is the active
// layout then these will be owned by the docking system, otherwise they
// won't be and will need to be cleaned up separately.
std::map<QString, QPointer<DebuggerWidget>> m_widgets;
std::map<QString, QPointer<DebuggerView>> m_widgets;
// The geometry of all the dock widgets, converted to JSON by the
// LayoutSaver class from KDDockWidgets.

View File

@@ -3,7 +3,7 @@
#include "DockManager.h"
#include "Debugger/DebuggerWidget.h"
#include "Debugger/DebuggerView.h"
#include "Debugger/DebuggerWindow.h"
#include "Debugger/Docking/DockTables.h"
#include "Debugger/Docking/DockViews.h"
@@ -185,7 +185,6 @@ void DockManager::loadLayouts()
&files);
bool needs_reset = false;
bool order_changed = false;
std::vector<DockLayout::Index> indices_last_session;
for (const FILESYSTEM_FIND_DATA& ffd : files)
@@ -234,29 +233,30 @@ void DockManager::loadLayouts()
layout.save(index);
}
if (index_last_session != index)
order_changed = true;
indices_last_session.emplace_back(index_last_session);
}
// Make sure the layouts remain in the same order they were in previously.
std::vector<DockLayout*> layout_pointers;
for (DockLayout& layout : m_layouts)
layout_pointers.emplace_back(&layout);
std::vector<size_t> layout_indices;
for (size_t i = 0; i < m_layouts.size(); i++)
layout_indices.emplace_back(i);
std::sort(layout_pointers.begin(), layout_pointers.end(),
[this, &indices_last_session](const DockLayout* lhs, const DockLayout* rhs) {
size_t lhs_index = lhs - m_layouts.data();
size_t rhs_index = rhs - m_layouts.data();
DockLayout::Index lhs_index_last_session = indices_last_session.at(lhs_index);
DockLayout::Index rhs_index_last_session = indices_last_session.at(rhs_index);
std::sort(layout_indices.begin(), layout_indices.end(),
[&indices_last_session](size_t lhs, size_t rhs) {
DockLayout::Index lhs_index_last_session = indices_last_session.at(lhs);
DockLayout::Index rhs_index_last_session = indices_last_session.at(rhs);
return lhs_index_last_session < rhs_index_last_session;
});
bool order_changed = false;
std::vector<DockLayout> sorted_layouts;
for (size_t i = 0; i < layout_pointers.size(); i++)
sorted_layouts.emplace_back(std::move(*layout_pointers[i]));
for (size_t i = 0; i < layout_indices.size(); i++)
{
if (i != indices_last_session[layout_indices[i]])
order_changed = true;
sorted_layouts.emplace_back(std::move(m_layouts[layout_indices[i]]));
}
m_layouts = std::move(sorted_layouts);
@@ -359,9 +359,9 @@ void DockManager::createWindowsMenu(QMenu* menu)
// be opened.
QMenu* add_another_menu = menu->addMenu(tr("Add Another..."));
std::vector<DebuggerWidget*> add_another_widgets;
std::vector<DebuggerView*> add_another_widgets;
std::set<std::string> add_another_types;
for (const auto& [unique_name, widget] : layout.debuggerWidgets())
for (const auto& [unique_name, widget] : layout.debuggerViews())
{
std::string type = widget->metaObject()->className();
@@ -373,26 +373,26 @@ void DockManager::createWindowsMenu(QMenu* menu)
}
std::sort(add_another_widgets.begin(), add_another_widgets.end(),
[](const DebuggerWidget* lhs, const DebuggerWidget* rhs) {
[](const DebuggerView* lhs, const DebuggerView* rhs) {
if (lhs->displayNameWithoutSuffix() == rhs->displayNameWithoutSuffix())
return lhs->displayNameSuffixNumber() < rhs->displayNameSuffixNumber();
return lhs->displayNameWithoutSuffix() < rhs->displayNameWithoutSuffix();
});
for (DebuggerWidget* widget : add_another_widgets)
for (DebuggerView* widget : add_another_widgets)
{
const char* type = widget->metaObject()->className();
const auto description_iterator = DockTables::DEBUGGER_WIDGETS.find(type);
pxAssert(description_iterator != DockTables::DEBUGGER_WIDGETS.end());
const auto description_iterator = DockTables::DEBUGGER_VIEWS.find(type);
pxAssert(description_iterator != DockTables::DEBUGGER_VIEWS.end());
QAction* action = add_another_menu->addAction(description_iterator->second.display_name);
connect(action, &QAction::triggered, this, [this, type]() {
if (m_current_layout == DockLayout::INVALID_INDEX)
return;
m_layouts.at(m_current_layout).createDebuggerWidget(type);
m_layouts.at(m_current_layout).createDebuggerView(type);
});
}
@@ -401,18 +401,18 @@ void DockManager::createWindowsMenu(QMenu* menu)
menu->addSeparator();
struct DebuggerWidgetToggle
struct DebuggerViewToggle
{
QString display_name;
std::optional<int> suffix_number;
QAction* action;
};
std::vector<DebuggerWidgetToggle> toggles;
std::vector<DebuggerViewToggle> toggles;
std::set<std::string> toggle_types;
// Create a menu item for each open debugger widget.
for (const auto& [unique_name, widget] : layout.debuggerWidgets())
// Create a menu item for each open debugger view.
for (const auto& [unique_name, widget] : layout.debuggerViews())
{
QAction* action = new QAction(menu);
action->setText(widget->displayName());
@@ -422,10 +422,10 @@ void DockManager::createWindowsMenu(QMenu* menu)
if (m_current_layout == DockLayout::INVALID_INDEX)
return;
m_layouts.at(m_current_layout).destroyDebuggerWidget(unique_name);
m_layouts.at(m_current_layout).destroyDebuggerView(unique_name);
});
DebuggerWidgetToggle& toggle = toggles.emplace_back();
DebuggerViewToggle& toggle = toggles.emplace_back();
toggle.display_name = widget->displayNameWithoutSuffix();
toggle.suffix_number = widget->displayNameSuffixNumber();
toggle.action = action;
@@ -433,12 +433,12 @@ void DockManager::createWindowsMenu(QMenu* menu)
toggle_types.emplace(widget->metaObject()->className());
}
// Create menu items to open debugger widgets without any open instances.
for (const auto& [type, desc] : DockTables::DEBUGGER_WIDGETS)
// Create menu items to open debugger views without any open instances.
for (const auto& [type, desc] : DockTables::DEBUGGER_VIEWS)
{
if (!toggle_types.contains(type))
{
QString display_name = QCoreApplication::translate("DebuggerWidget", desc.display_name);
QString display_name = QCoreApplication::translate("DebuggerView", desc.display_name);
QAction* action = new QAction(menu);
action->setText(display_name);
@@ -448,10 +448,10 @@ void DockManager::createWindowsMenu(QMenu* menu)
if (m_current_layout == DockLayout::INVALID_INDEX)
return;
m_layouts.at(m_current_layout).createDebuggerWidget(type);
m_layouts.at(m_current_layout).createDebuggerView(type);
});
DebuggerWidgetToggle& toggle = toggles.emplace_back();
DebuggerViewToggle& toggle = toggles.emplace_back();
toggle.display_name = display_name;
toggle.suffix_number = std::nullopt;
toggle.action = action;
@@ -459,14 +459,14 @@ void DockManager::createWindowsMenu(QMenu* menu)
}
std::sort(toggles.begin(), toggles.end(),
[](const DebuggerWidgetToggle& lhs, const DebuggerWidgetToggle& rhs) {
[](const DebuggerViewToggle& lhs, const DebuggerViewToggle& rhs) {
if (lhs.display_name == rhs.display_name)
return lhs.suffix_number < rhs.suffix_number;
return lhs.display_name < rhs.display_name;
});
for (const DebuggerWidgetToggle& toggle : toggles)
for (const DebuggerViewToggle& toggle : toggles)
menu->addAction(toggle.action);
}
@@ -702,53 +702,53 @@ void DockManager::updateDockWidgetTitles()
m_layouts.at(m_current_layout).updateDockWidgetTitles();
}
const std::map<QString, QPointer<DebuggerWidget>>& DockManager::debuggerWidgets()
const std::map<QString, QPointer<DebuggerView>>& DockManager::debuggerViews()
{
static std::map<QString, QPointer<DebuggerWidget>> dummy;
static std::map<QString, QPointer<DebuggerView>> dummy;
if (m_current_layout == DockLayout::INVALID_INDEX)
return dummy;
return m_layouts.at(m_current_layout).debuggerWidgets();
return m_layouts.at(m_current_layout).debuggerViews();
}
size_t DockManager::countDebuggerWidgetsOfType(const char* type)
size_t DockManager::countDebuggerViewsOfType(const char* type)
{
if (m_current_layout == DockLayout::INVALID_INDEX)
return 0;
return m_layouts.at(m_current_layout).countDebuggerWidgetsOfType(type);
return m_layouts.at(m_current_layout).countDebuggerViewsOfType(type);
}
void DockManager::recreateDebuggerWidget(const QString& unique_name)
void DockManager::recreateDebuggerView(const QString& unique_name)
{
if (m_current_layout == DockLayout::INVALID_INDEX)
return;
m_layouts.at(m_current_layout).recreateDebuggerWidget(unique_name);
m_layouts.at(m_current_layout).recreateDebuggerView(unique_name);
}
void DockManager::destroyDebuggerWidget(const QString& unique_name)
void DockManager::destroyDebuggerView(const QString& unique_name)
{
if (m_current_layout == DockLayout::INVALID_INDEX)
return;
m_layouts.at(m_current_layout).destroyDebuggerWidget(unique_name);
m_layouts.at(m_current_layout).destroyDebuggerView(unique_name);
}
void DockManager::setPrimaryDebuggerWidget(DebuggerWidget* widget, bool is_primary)
void DockManager::setPrimaryDebuggerView(DebuggerView* widget, bool is_primary)
{
if (m_current_layout == DockLayout::INVALID_INDEX)
return;
m_layouts.at(m_current_layout).setPrimaryDebuggerWidget(widget, is_primary);
m_layouts.at(m_current_layout).setPrimaryDebuggerView(widget, is_primary);
}
void DockManager::switchToDebuggerWidget(DebuggerWidget* widget)
void DockManager::switchToDebuggerView(DebuggerView* widget)
{
if (m_current_layout == DockLayout::INVALID_INDEX)
return;
for (const auto& [unique_name, test_widget] : m_layouts.at(m_current_layout).debuggerWidgets())
for (const auto& [unique_name, test_widget] : m_layouts.at(m_current_layout).debuggerViews())
{
if (widget == test_widget)
{
@@ -765,7 +765,7 @@ void DockManager::updateTheme()
m_menu_bar->updateTheme();
for (DockLayout& layout : m_layouts)
for (const auto& [unique_name, widget] : layout.debuggerWidgets())
for (const auto& [unique_name, widget] : layout.debuggerViews())
widget->updateStyleSheet();
// KDDockWidgets::QtWidgets::TabBar sets its own style to a subclass of

View File

@@ -82,12 +82,12 @@ public:
void updateDockWidgetTitles();
const std::map<QString, QPointer<DebuggerWidget>>& debuggerWidgets();
size_t countDebuggerWidgetsOfType(const char* type);
void recreateDebuggerWidget(const QString& unique_name);
void destroyDebuggerWidget(const QString& unique_name);
void setPrimaryDebuggerWidget(DebuggerWidget* widget, bool is_primary);
void switchToDebuggerWidget(DebuggerWidget* widget);
const std::map<QString, QPointer<DebuggerView>>& debuggerViews();
size_t countDebuggerViewsOfType(const char* type);
void recreateDebuggerView(const QString& unique_name);
void destroyDebuggerView(const QString& unique_name);
void setPrimaryDebuggerView(DebuggerView* widget, bool is_primary);
void switchToDebuggerView(DebuggerView* widget);
void updateTheme();

View File

@@ -4,28 +4,30 @@
#include "DockTables.h"
#include "Debugger/DebuggerEvents.h"
#include "Debugger/DisassemblyWidget.h"
#include "Debugger/RegisterWidget.h"
#include "Debugger/StackWidget.h"
#include "Debugger/ThreadWidget.h"
#include "Debugger/Breakpoints/BreakpointWidget.h"
#include "Debugger/Memory/MemorySearchWidget.h"
#include "Debugger/Memory/MemoryViewWidget.h"
#include "Debugger/Memory/SavedAddressesWidget.h"
#include "Debugger/SymbolTree/SymbolTreeWidgets.h"
#include "common/MD5Digest.h"
#include "fmt/format.h"
#include "Debugger/DisassemblyView.h"
#include "Debugger/RegisterView.h"
#include "Debugger/StackView.h"
#include "Debugger/ThreadView.h"
#include "Debugger/Breakpoints/BreakpointView.h"
#include "Debugger/Memory/MemorySearchView.h"
#include "Debugger/Memory/MemoryView.h"
#include "Debugger/Memory/SavedAddressesView.h"
#include "Debugger/SymbolTree/SymbolTreeViews.h"
using namespace DockUtils;
#define DEBUGGER_WIDGET(type, display_name, preferred_location) \
static void hashDefaultLayout(const DockTables::DefaultDockLayout& layout, u32& hash);
static void hashDefaultGroup(const DockTables::DefaultDockGroupDescription& group, u32& hash);
static void hashDefaultDockWidget(const DockTables::DefaultDockWidgetDescription& widget, u32& hash);
static void hashNumber(u32 number, u32& hash);
static void hashString(const char* string, u32& hash);
#define DEBUGGER_VIEW(type, display_name, preferred_location) \
{ \
#type, \
{ \
[](const DebuggerWidgetParameters& parameters) -> DebuggerWidget* { \
DebuggerWidget* widget = new type(parameters); \
[](const DebuggerViewParameters& parameters) -> DebuggerView* { \
DebuggerView* widget = new type(parameters); \
widget->handleEvent(DebuggerEvents::Refresh()); \
return widget; \
}, \
@@ -34,22 +36,22 @@ using namespace DockUtils;
} \
}
const std::map<std::string, DockTables::DebuggerWidgetDescription> DockTables::DEBUGGER_WIDGETS = {
DEBUGGER_WIDGET(BreakpointWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Breakpoints"), BOTTOM_MIDDLE),
DEBUGGER_WIDGET(DisassemblyWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Disassembly"), TOP_RIGHT),
DEBUGGER_WIDGET(FunctionTreeWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Functions"), TOP_LEFT),
DEBUGGER_WIDGET(GlobalVariableTreeWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Globals"), BOTTOM_MIDDLE),
DEBUGGER_WIDGET(LocalVariableTreeWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Locals"), BOTTOM_MIDDLE),
DEBUGGER_WIDGET(MemorySearchWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Memory Search"), TOP_LEFT),
DEBUGGER_WIDGET(MemoryViewWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Memory"), BOTTOM_MIDDLE),
DEBUGGER_WIDGET(ParameterVariableTreeWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Parameters"), BOTTOM_MIDDLE),
DEBUGGER_WIDGET(RegisterWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Registers"), TOP_LEFT),
DEBUGGER_WIDGET(SavedAddressesWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Saved Addresses"), BOTTOM_MIDDLE),
DEBUGGER_WIDGET(StackWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Stack"), BOTTOM_MIDDLE),
DEBUGGER_WIDGET(ThreadWidget, QT_TRANSLATE_NOOP("DebuggerWidget", "Threads"), BOTTOM_MIDDLE),
const std::map<std::string, DockTables::DebuggerViewDescription> DockTables::DEBUGGER_VIEWS = {
DEBUGGER_VIEW(BreakpointView, QT_TRANSLATE_NOOP("DebuggerView", "Breakpoints"), BOTTOM_MIDDLE),
DEBUGGER_VIEW(DisassemblyView, QT_TRANSLATE_NOOP("DebuggerView", "Disassembly"), TOP_RIGHT),
DEBUGGER_VIEW(FunctionTreeView, QT_TRANSLATE_NOOP("DebuggerView", "Functions"), TOP_LEFT),
DEBUGGER_VIEW(GlobalVariableTreeView, QT_TRANSLATE_NOOP("DebuggerView", "Globals"), BOTTOM_MIDDLE),
DEBUGGER_VIEW(LocalVariableTreeView, QT_TRANSLATE_NOOP("DebuggerView", "Locals"), BOTTOM_MIDDLE),
DEBUGGER_VIEW(MemorySearchView, QT_TRANSLATE_NOOP("DebuggerView", "Memory Search"), TOP_LEFT),
DEBUGGER_VIEW(MemoryView, QT_TRANSLATE_NOOP("DebuggerView", "Memory"), BOTTOM_MIDDLE),
DEBUGGER_VIEW(ParameterVariableTreeView, QT_TRANSLATE_NOOP("DebuggerView", "Parameters"), BOTTOM_MIDDLE),
DEBUGGER_VIEW(RegisterView, QT_TRANSLATE_NOOP("DebuggerView", "Registers"), TOP_LEFT),
DEBUGGER_VIEW(SavedAddressesView, QT_TRANSLATE_NOOP("DebuggerView", "Saved Addresses"), BOTTOM_MIDDLE),
DEBUGGER_VIEW(StackView, QT_TRANSLATE_NOOP("DebuggerView", "Stack"), BOTTOM_MIDDLE),
DEBUGGER_VIEW(ThreadView, QT_TRANSLATE_NOOP("DebuggerView", "Threads"), BOTTOM_MIDDLE),
};
#undef DEBUGGER_WIDGET
#undef DEBUGGER_VIEW
const std::vector<DockTables::DefaultDockLayout> DockTables::DEFAULT_DOCK_LAYOUTS = {
{
@@ -62,20 +64,20 @@ const std::vector<DockTables::DefaultDockLayout> DockTables::DEFAULT_DOCK_LAYOUT
},
.widgets = {
/* DefaultDockGroup::TOP_RIGHT */
{"DisassemblyWidget", DefaultDockGroup::TOP_RIGHT},
{"DisassemblyView", DefaultDockGroup::TOP_RIGHT},
/* DefaultDockGroup::BOTTOM */
{"MemoryViewWidget", DefaultDockGroup::BOTTOM},
{"BreakpointWidget", DefaultDockGroup::BOTTOM},
{"ThreadWidget", DefaultDockGroup::BOTTOM},
{"StackWidget", DefaultDockGroup::BOTTOM},
{"SavedAddressesWidget", DefaultDockGroup::BOTTOM},
{"GlobalVariableTreeWidget", DefaultDockGroup::BOTTOM},
{"LocalVariableTreeWidget", DefaultDockGroup::BOTTOM},
{"ParameterVariableTreeWidget", DefaultDockGroup::BOTTOM},
{"MemoryView", DefaultDockGroup::BOTTOM},
{"BreakpointView", DefaultDockGroup::BOTTOM},
{"ThreadView", DefaultDockGroup::BOTTOM},
{"StackView", DefaultDockGroup::BOTTOM},
{"SavedAddressesView", DefaultDockGroup::BOTTOM},
{"GlobalVariableTreeView", DefaultDockGroup::BOTTOM},
{"LocalVariableTreeView", DefaultDockGroup::BOTTOM},
{"ParameterVariableTreeView", DefaultDockGroup::BOTTOM},
/* DefaultDockGroup::TOP_LEFT */
{"RegisterWidget", DefaultDockGroup::TOP_LEFT},
{"FunctionTreeWidget", DefaultDockGroup::TOP_LEFT},
{"MemorySearchWidget", DefaultDockGroup::TOP_LEFT},
{"RegisterView", DefaultDockGroup::TOP_LEFT},
{"FunctionTreeView", DefaultDockGroup::TOP_LEFT},
{"MemorySearchView", DefaultDockGroup::TOP_LEFT},
},
.toolbars = {
"toolBarDebug",
@@ -92,20 +94,20 @@ const std::vector<DockTables::DefaultDockLayout> DockTables::DEFAULT_DOCK_LAYOUT
},
.widgets = {
/* DefaultDockGroup::TOP_RIGHT */
{"DisassemblyWidget", DefaultDockGroup::TOP_RIGHT},
{"DisassemblyView", DefaultDockGroup::TOP_RIGHT},
/* DefaultDockGroup::BOTTOM */
{"MemoryViewWidget", DefaultDockGroup::BOTTOM},
{"BreakpointWidget", DefaultDockGroup::BOTTOM},
{"ThreadWidget", DefaultDockGroup::BOTTOM},
{"StackWidget", DefaultDockGroup::BOTTOM},
{"SavedAddressesWidget", DefaultDockGroup::BOTTOM},
{"GlobalVariableTreeWidget", DefaultDockGroup::BOTTOM},
{"LocalVariableTreeWidget", DefaultDockGroup::BOTTOM},
{"ParameterVariableTreeWidget", DefaultDockGroup::BOTTOM},
{"MemoryView", DefaultDockGroup::BOTTOM},
{"BreakpointView", DefaultDockGroup::BOTTOM},
{"ThreadView", DefaultDockGroup::BOTTOM},
{"StackView", DefaultDockGroup::BOTTOM},
{"SavedAddressesView", DefaultDockGroup::BOTTOM},
{"GlobalVariableTreeView", DefaultDockGroup::BOTTOM},
{"LocalVariableTreeView", DefaultDockGroup::BOTTOM},
{"ParameterVariableTreeView", DefaultDockGroup::BOTTOM},
/* DefaultDockGroup::TOP_LEFT */
{"RegisterWidget", DefaultDockGroup::TOP_LEFT},
{"FunctionTreeWidget", DefaultDockGroup::TOP_LEFT},
{"MemorySearchWidget", DefaultDockGroup::TOP_LEFT},
{"RegisterView", DefaultDockGroup::TOP_LEFT},
{"FunctionTreeView", DefaultDockGroup::TOP_LEFT},
{"MemorySearchView", DefaultDockGroup::TOP_LEFT},
},
.toolbars = {
"toolBarDebug",
@@ -123,67 +125,43 @@ const DockTables::DefaultDockLayout* DockTables::defaultLayout(const std::string
return nullptr;
}
const std::string& DockTables::hashDefaultLayouts()
u32 DockTables::hashDefaultLayouts()
{
static std::string hash;
if (!hash.empty())
return hash;
static std::optional<u32> hash;
if (hash.has_value())
return *hash;
MD5Digest md5;
hash.emplace(0);
u32 hash_version = 1;
md5.Update(&hash_version, sizeof(hash_version));
u32 layout_count = static_cast<u32>(DEFAULT_DOCK_LAYOUTS.size());
md5.Update(&layout_count, sizeof(layout_count));
u32 hash_version = 2;
hashNumber(hash_version, *hash);
hashNumber(static_cast<u32>(DEFAULT_DOCK_LAYOUTS.size()), *hash);
for (const DefaultDockLayout& layout : DEFAULT_DOCK_LAYOUTS)
hashDefaultLayout(layout, md5);
hashDefaultLayout(layout, *hash);
u8 digest[16];
md5.Final(digest);
hash = fmt::format(
"{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}",
digest[0], digest[1], digest[2], digest[3], digest[4], digest[5], digest[6], digest[7],
digest[8], digest[9], digest[10], digest[11], digest[12], digest[13], digest[14], digest[15]);
return hash;
return *hash;
}
void DockTables::hashDefaultLayout(const DefaultDockLayout& layout, MD5Digest& md5)
static void hashDefaultLayout(const DockTables::DefaultDockLayout& layout, u32& hash)
{
u32 layout_name_size = static_cast<u32>(layout.name.size());
md5.Update(&layout_name_size, sizeof(layout_name_size));
md5.Update(layout.name.data(), layout_name_size);
hashString(layout.name.c_str(), hash);
hashString(DebugInterface::cpuName(layout.cpu), hash);
const char* cpu_name = DebugInterface::cpuName(layout.cpu);
u32 cpu_name_size = static_cast<u32>(strlen(cpu_name));
md5.Update(&cpu_name_size, sizeof(cpu_name_size));
md5.Update(cpu_name, cpu_name_size);
hashNumber(static_cast<u32>(layout.groups.size()), hash);
for (const DockTables::DefaultDockGroupDescription& group : layout.groups)
hashDefaultGroup(group, hash);
u32 group_count = static_cast<u32>(layout.groups.size());
md5.Update(&group_count, sizeof(group_count));
hashNumber(static_cast<u32>(layout.widgets.size()), hash);
for (const DockTables::DefaultDockWidgetDescription& widget : layout.widgets)
hashDefaultDockWidget(widget, hash);
for (const DefaultDockGroupDescription& group : layout.groups)
hashDefaultGroup(group, md5);
u32 widget_count = static_cast<u32>(layout.widgets.size());
md5.Update(&widget_count, sizeof(widget_count));
for (const DefaultDockWidgetDescription& widget : layout.widgets)
hashDefaultDockWidget(widget, md5);
u32 toolbar_count = static_cast<u32>(layout.toolbars.size());
md5.Update(&toolbar_count, sizeof(toolbar_count));
hashNumber(static_cast<u32>(layout.toolbars.size()), hash);
for (const std::string& toolbar : layout.toolbars)
{
u32 toolbar_size = toolbar.size();
md5.Update(&toolbar_size, sizeof(toolbar_size));
md5.Update(toolbar.data(), toolbar.size());
}
hashString(toolbar.c_str(), hash);
}
void DockTables::hashDefaultGroup(const DefaultDockGroupDescription& group, MD5Digest& md5)
static void hashDefaultGroup(const DockTables::DefaultDockGroupDescription& group, u32& hash)
{
// This is inline here so that it's obvious that changing it will affect the
// result of the hash.
@@ -207,20 +185,25 @@ void DockTables::hashDefaultGroup(const DefaultDockGroupDescription& group, MD5D
break;
}
u32 location_size = static_cast<u32>(strlen(location));
md5.Update(&location_size, sizeof(location_size));
md5.Update(location, location_size);
u32 parent = static_cast<u32>(group.parent);
md5.Update(&parent, sizeof(parent));
hashString(location, hash);
hashNumber(static_cast<u32>(group.parent), hash);
}
void DockTables::hashDefaultDockWidget(const DefaultDockWidgetDescription& widget, MD5Digest& md5)
static void hashDefaultDockWidget(const DockTables::DefaultDockWidgetDescription& widget, u32& hash)
{
u32 type_size = static_cast<u32>(widget.type.size());
md5.Update(&type_size, sizeof(type_size));
md5.Update(widget.type.data(), type_size);
u32 group = static_cast<u32>(widget.group);
md5.Update(&group, sizeof(group));
hashString(widget.type.c_str(), hash);
hashNumber(static_cast<u32>(widget.group), hash);
}
static void hashNumber(u32 number, u32& hash)
{
hash = hash * 31 + number;
}
static void hashString(const char* string, u32& hash)
{
u32 size = static_cast<u32>(strlen(string));
hash = hash * 31 + size;
for (u32 i = 0; i < size; i++)
hash = hash * 31 + string[i];
}

View File

@@ -11,14 +11,14 @@
class MD5Digest;
class DebuggerWidget;
struct DebuggerWidgetParameters;
class DebuggerView;
struct DebuggerViewParameters;
namespace DockTables
{
struct DebuggerWidgetDescription
struct DebuggerViewDescription
{
DebuggerWidget* (*create_widget)(const DebuggerWidgetParameters& parameters);
DebuggerView* (*create_widget)(const DebuggerViewParameters& parameters);
// The untranslated string displayed as the dock widget tab text.
const char* display_name;
@@ -28,7 +28,7 @@ namespace DockTables
DockUtils::PreferredLocation preferred_location;
};
extern const std::map<std::string, DebuggerWidgetDescription> DEBUGGER_WIDGETS;
extern const std::map<std::string, DebuggerViewDescription> DEBUGGER_VIEWS;
enum class DefaultDockGroup
{
@@ -67,9 +67,5 @@ namespace DockTables
// This is used to determine if the user has updated and we need to recreate
// the default layouts.
const std::string& hashDefaultLayouts();
void hashDefaultLayout(const DefaultDockLayout& layout, MD5Digest& md5);
void hashDefaultGroup(const DefaultDockGroupDescription& group, MD5Digest& md5);
void hashDefaultDockWidget(const DefaultDockWidgetDescription& widget, MD5Digest& md5);
u32 hashDefaultLayouts();
} // namespace DockTables

View File

@@ -4,7 +4,7 @@
#include "DockViews.h"
#include "QtUtils.h"
#include "Debugger/DebuggerWidget.h"
#include "Debugger/DebuggerView.h"
#include "Debugger/DebuggerWindow.h"
#include "Debugger/Docking/DockManager.h"
#include "Debugger/Docking/DropIndicators.h"
@@ -93,7 +93,7 @@ void DockWidget::openStateChanged(bool open)
return;
if (!open && g_debugger_window)
g_debugger_window->dockManager().destroyDebuggerWidget(uniqueName());
g_debugger_window->dockManager().destroyDebuggerView(uniqueName());
}
// *****************************************************************************
@@ -166,7 +166,7 @@ void DockTabBar::openContextMenu(QPoint pos)
if (!widget)
return;
size_t dock_widgets_of_type = g_debugger_window->dockManager().countDebuggerWidgetsOfType(
size_t dock_widgets_of_type = g_debugger_window->dockManager().countDebuggerViewsOfType(
widget->metaObject()->className());
QMenu* menu = new QMenu(this);
@@ -222,7 +222,7 @@ void DockTabBar::openContextMenu(QPoint pos)
if (!widget)
return;
g_debugger_window->dockManager().setPrimaryDebuggerWidget(widget, checked);
g_debugger_window->dockManager().setPrimaryDebuggerView(widget, checked);
});
QMenu* set_target_menu = menu->addMenu(tr("Set Target"));
@@ -263,7 +263,7 @@ void DockTabBar::openContextMenu(QPoint pos)
if (!widget)
return;
g_debugger_window->dockManager().destroyDebuggerWidget(widget->uniqueName());
g_debugger_window->dockManager().destroyDebuggerView(widget->uniqueName());
});
menu->popup(mapToGlobal(pos));
@@ -279,7 +279,7 @@ void DockTabBar::setCpuOverrideForTab(int tab_index, std::optional<BreakPointCpu
return;
if (!widget->setCpuOverride(cpu_override))
g_debugger_window->dockManager().recreateDebuggerWidget(view->uniqueName());
g_debugger_window->dockManager().recreateDebuggerView(view->uniqueName());
g_debugger_window->dockManager().updateDockWidgetTitles();
}
@@ -296,7 +296,7 @@ DockTabBar::WidgetsFromTabIndexResult DockTabBar::widgetsFromTabIndex(int tab_in
auto dock_view = static_cast<KDDockWidgets::QtWidgets::DockWidget*>(dock_controller->view());
DebuggerWidget* widget = qobject_cast<DebuggerWidget*>(dock_view->widget());
DebuggerView* widget = qobject_cast<DebuggerView*>(dock_view->widget());
if (!widget)
return {};

View File

@@ -11,7 +11,7 @@
#include <kddockwidgets/qtwidgets/views/TitleBar.h>
#include <kddockwidgets/qtwidgets/views/TabBar.h>
class DebuggerWidget;
class DebuggerView;
class DockManager;
class DockViewFactory : public KDDockWidgets::QtWidgets::ViewFactory
@@ -101,7 +101,7 @@ protected:
struct WidgetsFromTabIndexResult
{
DebuggerWidget* debugger_widget = nullptr;
DebuggerView* widget = nullptr;
KDDockWidgets::Core::DockWidget* controller = nullptr;
KDDockWidgets::QtWidgets::DockWidget* view = nullptr;
};

View File

@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "MemorySearchWidget.h"
#include "MemorySearchView.h"
#include "DebugTools/DebugInterface.h"
@@ -17,33 +17,33 @@
#include <QtCore/QFutureWatcher>
#include <QtGui/QPainter>
using SearchComparison = MemorySearchWidget::SearchComparison;
using SearchType = MemorySearchWidget::SearchType;
using SearchResult = MemorySearchWidget::SearchResult;
using SearchComparison = MemorySearchView::SearchComparison;
using SearchType = MemorySearchView::SearchType;
using SearchResult = MemorySearchView::SearchResult;
using namespace QtUtils;
MemorySearchWidget::MemorySearchWidget(const DebuggerWidgetParameters& parameters)
: DebuggerWidget(parameters, MONOSPACE_FONT)
MemorySearchView::MemorySearchView(const DebuggerViewParameters& parameters)
: DebuggerView(parameters, MONOSPACE_FONT)
{
m_ui.setupUi(this);
this->repaint();
m_ui.listSearchResults->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_ui.btnSearch, &QPushButton::clicked, this, &MemorySearchWidget::onSearchButtonClicked);
connect(m_ui.btnFilterSearch, &QPushButton::clicked, this, &MemorySearchWidget::onSearchButtonClicked);
connect(m_ui.btnSearch, &QPushButton::clicked, this, &MemorySearchView::onSearchButtonClicked);
connect(m_ui.btnFilterSearch, &QPushButton::clicked, this, &MemorySearchView::onSearchButtonClicked);
connect(m_ui.listSearchResults, &QListWidget::itemDoubleClicked, [](QListWidgetItem* item) {
goToInMemoryView(item->text().toUInt(nullptr, 16), true);
});
connect(m_ui.listSearchResults->verticalScrollBar(), &QScrollBar::valueChanged, this, &MemorySearchWidget::onSearchResultsListScroll);
connect(m_ui.listSearchResults, &QListView::customContextMenuRequested, this, &MemorySearchWidget::onListSearchResultsContextMenu);
connect(m_ui.cmbSearchType, &QComboBox::currentIndexChanged, this, &MemorySearchWidget::onSearchTypeChanged);
connect(m_ui.cmbSearchComparison, &QComboBox::currentIndexChanged, this, &MemorySearchWidget::onSearchComparisonChanged);
connect(m_ui.listSearchResults->verticalScrollBar(), &QScrollBar::valueChanged, this, &MemorySearchView::onSearchResultsListScroll);
connect(m_ui.listSearchResults, &QListView::customContextMenuRequested, this, &MemorySearchView::onListSearchResultsContextMenu);
connect(m_ui.cmbSearchType, &QComboBox::currentIndexChanged, this, &MemorySearchView::onSearchTypeChanged);
connect(m_ui.cmbSearchComparison, &QComboBox::currentIndexChanged, this, &MemorySearchView::onSearchComparisonChanged);
// Ensures we don't retrigger the load results function unintentionally
m_resultsLoadTimer.setInterval(100);
m_resultsLoadTimer.setSingleShot(true);
connect(&m_resultsLoadTimer, &QTimer::timeout, this, &MemorySearchWidget::loadSearchResults);
connect(&m_resultsLoadTimer, &QTimer::timeout, this, &MemorySearchView::loadSearchResults);
receiveEvent<DebuggerEvents::Refresh>([this](const DebuggerEvents::Refresh& event) -> bool {
update();
@@ -51,7 +51,7 @@ MemorySearchWidget::MemorySearchWidget(const DebuggerWidgetParameters& parameter
});
}
void MemorySearchWidget::contextRemoveSearchResult()
void MemorySearchView::contextRemoveSearchResult()
{
const QItemSelectionModel* selModel = m_ui.listSearchResults->selectionModel();
if (!selModel->hasSelection())
@@ -67,7 +67,7 @@ void MemorySearchWidget::contextRemoveSearchResult()
delete rowToRemove;
}
void MemorySearchWidget::contextCopySearchResultAddress()
void MemorySearchView::contextCopySearchResultAddress()
{
if (!m_ui.listSearchResults->selectionModel()->hasSelection())
return;
@@ -78,7 +78,7 @@ void MemorySearchWidget::contextCopySearchResultAddress()
QApplication::clipboard()->setText(addressString);
}
void MemorySearchWidget::onListSearchResultsContextMenu(QPoint pos)
void MemorySearchView::onListSearchResultsContextMenu(QPoint pos)
{
const QItemSelectionModel* selection_model = m_ui.listSearchResults->selectionModel();
const QListWidget* list_search_results = m_ui.listSearchResults;
@@ -89,7 +89,7 @@ void MemorySearchWidget::onListSearchResultsContextMenu(QPoint pos)
if (selection_model->hasSelection())
{
connect(menu->addAction(tr("Copy Address")), &QAction::triggered,
this, &MemorySearchWidget::contextCopySearchResultAddress);
this, &MemorySearchView::contextCopySearchResultAddress);
createEventActions<DebuggerEvents::GoToAddress>(menu, [list_search_results]() {
u32 selected_address = list_search_results->selectedItems().first()->data(Qt::UserRole).toUInt();
@@ -106,7 +106,7 @@ void MemorySearchWidget::onListSearchResultsContextMenu(QPoint pos)
});
connect(menu->addAction(tr("Remove Result")), &QAction::triggered,
this, &MemorySearchWidget::contextRemoveSearchResult);
this, &MemorySearchView::contextRemoveSearchResult);
}
menu->popup(m_ui.listSearchResults->viewport()->mapToGlobal(pos));
@@ -297,7 +297,7 @@ void searchWorker(DebugInterface* cpu, std::vector<SearchResult>& searchResults,
T readValue = readValueAtAddress<T>(cpu, addr);
if (handleSearchComparison(searchComparison, addr, nullptr, searchValue, readValue))
{
searchResults.push_back(MemorySearchWidget::SearchResult(addr, QVariant::fromValue(readValue), searchType));
searchResults.push_back(MemorySearchView::SearchResult(addr, QVariant::fromValue(readValue), searchType));
}
}
}
@@ -312,7 +312,7 @@ void searchWorker(DebugInterface* cpu, std::vector<SearchResult>& searchResults,
const bool doesMatch = handleSearchComparison(searchComparison, addr, &searchResult, searchValue, readValue);
if (!doesMatch)
searchResult = MemorySearchWidget::SearchResult(addr, QVariant::fromValue(readValue), searchType);
searchResult = MemorySearchView::SearchResult(addr, QVariant::fromValue(readValue), searchType);
return !doesMatch;
});
@@ -399,7 +399,7 @@ static void searchWorkerByteArray(DebugInterface* cpu, SearchType searchType, Se
continue;
if (handleArraySearchComparison(cpu, searchComparison, addr, nullptr, searchValue))
{
searchResults.push_back(MemorySearchWidget::SearchResult(addr, searchValue, searchType));
searchResults.push_back(MemorySearchView::SearchResult(addr, searchValue, searchType));
addr += searchValue.length() - 1;
}
}
@@ -421,7 +421,7 @@ static void searchWorkerByteArray(DebugInterface* cpu, SearchType searchType, Se
matchValue = searchResult.getArrayValue();
else
matchValue = readArrayAtAddress(cpu, addr, searchValue.length() - 1);
searchResult = MemorySearchWidget::SearchResult(addr, matchValue, searchType);
searchResult = MemorySearchView::SearchResult(addr, matchValue, searchType);
}
return !doesMatch;
});
@@ -465,7 +465,7 @@ std::vector<SearchResult> startWorker(DebugInterface* cpu, const SearchType type
return searchResults;
}
void MemorySearchWidget::onSearchButtonClicked()
void MemorySearchView::onSearchButtonClicked()
{
if (!cpu().isAlive())
return;
@@ -612,7 +612,7 @@ void MemorySearchWidget::onSearchButtonClicked()
m_ui.resultsCountLabel->setVisible(true);
}
void MemorySearchWidget::onSearchResultsListScroll(u32 value)
void MemorySearchView::onSearchResultsListScroll(u32 value)
{
const bool hasResultsToLoad = static_cast<size_t>(m_ui.listSearchResults->count()) < m_searchResults.size();
const bool scrolledSufficiently = value > (m_ui.listSearchResults->verticalScrollBar()->maximum() * 0.95);
@@ -623,7 +623,7 @@ void MemorySearchWidget::onSearchResultsListScroll(u32 value)
}
}
void MemorySearchWidget::loadSearchResults()
void MemorySearchView::loadSearchResults()
{
const u32 numLoaded = m_ui.listSearchResults->count();
const u32 amountLeftToLoad = m_searchResults.size() - numLoaded;
@@ -643,18 +643,18 @@ void MemorySearchWidget::loadSearchResults()
}
}
SearchType MemorySearchWidget::getCurrentSearchType()
SearchType MemorySearchView::getCurrentSearchType()
{
return static_cast<SearchType>(m_ui.cmbSearchType->currentIndex());
}
SearchComparison MemorySearchWidget::getCurrentSearchComparison()
SearchComparison MemorySearchView::getCurrentSearchComparison()
{
// Note: The index can't be converted directly to the enum value since we change what comparisons are shown.
return m_searchComparisonLabelMap.labelToEnum(m_ui.cmbSearchComparison->currentText());
}
bool MemorySearchWidget::doesSearchComparisonTakeInput(const SearchComparison comparison)
bool MemorySearchView::doesSearchComparisonTakeInput(const SearchComparison comparison)
{
switch (comparison)
{
@@ -672,7 +672,7 @@ bool MemorySearchWidget::doesSearchComparisonTakeInput(const SearchComparison co
}
}
void MemorySearchWidget::onSearchTypeChanged(int newIndex)
void MemorySearchView::onSearchTypeChanged(int newIndex)
{
if (newIndex < 4)
m_ui.chkSearchHex->setEnabled(true);
@@ -689,12 +689,12 @@ void MemorySearchWidget::onSearchTypeChanged(int newIndex)
updateSearchComparisonSelections();
}
void MemorySearchWidget::onSearchComparisonChanged(int newValue)
void MemorySearchView::onSearchComparisonChanged(int newValue)
{
m_ui.txtSearchValue->setEnabled(getCurrentSearchComparison() != SearchComparison::UnknownValue);
}
void MemorySearchWidget::updateSearchComparisonSelections()
void MemorySearchView::updateSearchComparisonSelections()
{
const QString selectedComparisonLabel = m_ui.cmbSearchComparison->currentText();
const SearchComparison selectedComparison = m_searchComparisonLabelMap.labelToEnum(selectedComparisonLabel);
@@ -713,7 +713,7 @@ void MemorySearchWidget::updateSearchComparisonSelections()
m_ui.cmbSearchComparison->setCurrentText(selectedComparisonLabel);
}
std::vector<SearchComparison> MemorySearchWidget::getValidSearchComparisonsForState(SearchType type, std::vector<SearchResult>& existingResults)
std::vector<SearchComparison> MemorySearchView::getValidSearchComparisonsForState(SearchType type, std::vector<SearchResult>& existingResults)
{
const bool hasResults = existingResults.size() > 0;
std::vector<SearchComparison> comparisons = {SearchComparison::Equals};

View File

@@ -3,9 +3,9 @@
#pragma once
#include "ui_MemorySearchWidget.h"
#include "ui_MemorySearchView.h"
#include "Debugger/DebuggerWidget.h"
#include "Debugger/DebuggerView.h"
#include "DebugTools/DebugInterface.h"
@@ -13,13 +13,13 @@
#include <QtCore/QTimer>
#include <QtCore/QMap>
class MemorySearchWidget final : public DebuggerWidget
class MemorySearchView final : public DebuggerView
{
Q_OBJECT
public:
MemorySearchWidget(const DebuggerWidgetParameters& parameters);
~MemorySearchWidget() = default;
MemorySearchView(const DebuggerViewParameters& parameters);
~MemorySearchView() = default;
enum class SearchType
{
@@ -136,7 +136,7 @@ public slots:
private:
std::vector<SearchResult> m_searchResults;
SearchComparisonLabelMap m_searchComparisonLabelMap;
Ui::MemorySearchWidget m_ui;
Ui::MemorySearchView m_ui;
QTimer m_resultsLoadTimer;
u32 m_initialResultsLoadLimit = 20000;

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MemorySearchWidget</class>
<widget class="QWidget" name="MemorySearchWidget">
<class>MemorySearchView</class>
<widget class="QWidget" name="MemorySearchView">
<property name="geometry">
<rect>
<x>0</x>

View File

@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "MemoryViewWidget.h"
#include "MemoryView.h"
#include "Debugger/JsonValueWrapper.h"
@@ -451,10 +451,10 @@ bool MemoryViewTable::KeyPress(int key, QChar keychar, DebugInterface& cpu)
}
/*
MemoryViewWidget
MemoryView
*/
MemoryViewWidget::MemoryViewWidget(const DebuggerWidgetParameters& parameters)
: DebuggerWidget(parameters, MONOSPACE_FONT)
MemoryView::MemoryView(const DebuggerViewParameters& parameters)
: DebuggerView(parameters, MONOSPACE_FONT)
, m_table(this)
{
ui.setupUi(this);
@@ -462,7 +462,7 @@ MemoryViewWidget::MemoryViewWidget(const DebuggerWidgetParameters& parameters)
setFocusPolicy(Qt::FocusPolicy::ClickFocus);
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, &MemoryViewWidget::customContextMenuRequested, this, &MemoryViewWidget::openContextMenu);
connect(this, &MemoryView::customContextMenuRequested, this, &MemoryView::openContextMenu);
m_table.UpdateStartAddress(0x100000);
@@ -485,20 +485,20 @@ MemoryViewWidget::MemoryViewWidget(const DebuggerWidgetParameters& parameters)
});
}
MemoryViewWidget::~MemoryViewWidget() = default;
MemoryView::~MemoryView() = default;
void MemoryViewWidget::toJson(JsonValueWrapper& json)
void MemoryView::toJson(JsonValueWrapper& json)
{
DebuggerWidget::toJson(json);
DebuggerView::toJson(json);
json.value().AddMember("startAddress", m_table.startAddress, json.allocator());
json.value().AddMember("viewType", static_cast<int>(m_table.GetViewType()), json.allocator());
json.value().AddMember("littleEndian", m_table.GetLittleEndian(), json.allocator());
}
bool MemoryViewWidget::fromJson(const JsonValueWrapper& json)
bool MemoryView::fromJson(const JsonValueWrapper& json)
{
if (!DebuggerWidget::fromJson(json))
if (!DebuggerView::fromJson(json))
return false;
auto start_address = json.value().FindMember("startAddress");
@@ -525,7 +525,7 @@ bool MemoryViewWidget::fromJson(const JsonValueWrapper& json)
return true;
}
void MemoryViewWidget::paintEvent(QPaintEvent* event)
void MemoryView::paintEvent(QPaintEvent* event)
{
QPainter painter(this);
@@ -537,7 +537,7 @@ void MemoryViewWidget::paintEvent(QPaintEvent* event)
m_table.DrawTable(painter, this->palette(), this->height(), cpu());
}
void MemoryViewWidget::mousePressEvent(QMouseEvent* event)
void MemoryView::mousePressEvent(QMouseEvent* event)
{
if (!cpu().isAlive())
return;
@@ -546,7 +546,7 @@ void MemoryViewWidget::mousePressEvent(QMouseEvent* event)
repaint();
}
void MemoryViewWidget::openContextMenu(QPoint pos)
void MemoryView::openContextMenu(QPoint pos)
{
if (!cpu().isAlive())
return;
@@ -615,10 +615,10 @@ void MemoryViewWidget::openContextMenu(QPoint pos)
return std::optional(event);
});
connect(menu->addAction(tr("Copy Byte")), &QAction::triggered, this, &MemoryViewWidget::contextCopyByte);
connect(menu->addAction(tr("Copy Segment")), &QAction::triggered, this, &MemoryViewWidget::contextCopySegment);
connect(menu->addAction(tr("Copy Character")), &QAction::triggered, this, &MemoryViewWidget::contextCopyCharacter);
connect(menu->addAction(tr("Paste")), &QAction::triggered, this, &MemoryViewWidget::contextPaste);
connect(menu->addAction(tr("Copy Byte")), &QAction::triggered, this, &MemoryView::contextCopyByte);
connect(menu->addAction(tr("Copy Segment")), &QAction::triggered, this, &MemoryView::contextCopySegment);
connect(menu->addAction(tr("Copy Character")), &QAction::triggered, this, &MemoryView::contextCopyCharacter);
connect(menu->addAction(tr("Paste")), &QAction::triggered, this, &MemoryView::contextPaste);
menu->popup(this->mapToGlobal(pos));
@@ -626,27 +626,27 @@ void MemoryViewWidget::openContextMenu(QPoint pos)
return;
}
void MemoryViewWidget::contextCopyByte()
void MemoryView::contextCopyByte()
{
QApplication::clipboard()->setText(QString::number(cpu().read8(m_table.selectedAddress), 16).toUpper());
}
void MemoryViewWidget::contextCopySegment()
void MemoryView::contextCopySegment()
{
QApplication::clipboard()->setText(QString::number(m_table.GetSelectedSegment(cpu()).lo, 16).toUpper());
}
void MemoryViewWidget::contextCopyCharacter()
void MemoryView::contextCopyCharacter()
{
QApplication::clipboard()->setText(QChar::fromLatin1(cpu().read8(m_table.selectedAddress)).toUpper());
}
void MemoryViewWidget::contextPaste()
void MemoryView::contextPaste()
{
m_table.InsertAtCurrentSelection(QApplication::clipboard()->text(), cpu());
}
void MemoryViewWidget::contextGoToAddress()
void MemoryView::contextGoToAddress()
{
bool ok;
QString targetString = QInputDialog::getText(this, tr("Go To In Memory View"), "",
@@ -666,11 +666,11 @@ void MemoryViewWidget::contextGoToAddress()
gotoAddress(static_cast<u32>(address));
}
void MemoryViewWidget::mouseDoubleClickEvent(QMouseEvent* event)
void MemoryView::mouseDoubleClickEvent(QMouseEvent* event)
{
}
void MemoryViewWidget::wheelEvent(QWheelEvent* event)
void MemoryView::wheelEvent(QWheelEvent* event)
{
if (event->angleDelta().y() < 0)
{
@@ -683,7 +683,7 @@ void MemoryViewWidget::wheelEvent(QWheelEvent* event)
this->repaint();
}
void MemoryViewWidget::keyPressEvent(QKeyEvent* event)
void MemoryView::keyPressEvent(QKeyEvent* event)
{
if (!m_table.KeyPress(event->key(), event->text().size() ? event->text()[0] : '\0', cpu()))
{
@@ -701,10 +701,10 @@ void MemoryViewWidget::keyPressEvent(QKeyEvent* event)
}
}
this->repaint();
DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate());
DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
}
void MemoryViewWidget::gotoAddress(u32 address)
void MemoryView::gotoAddress(u32 address)
{
m_table.UpdateStartAddress(address & ~0xF);
m_table.selectedAddress = address;

View File

@@ -3,9 +3,9 @@
#pragma once
#include "ui_MemoryViewWidget.h"
#include "ui_MemoryView.h"
#include "Debugger/DebuggerWidget.h"
#include "Debugger/DebuggerView.h"
#include "DebugTools/DebugInterface.h"
#include "DebugTools/DisassemblyManager.h"
@@ -104,13 +104,13 @@ public:
}
};
class MemoryViewWidget final : public DebuggerWidget
class MemoryView final : public DebuggerView
{
Q_OBJECT
public:
MemoryViewWidget(const DebuggerWidgetParameters& parameters);
~MemoryViewWidget();
MemoryView(const DebuggerViewParameters& parameters);
~MemoryView();
void toJson(JsonValueWrapper& json) override;
bool fromJson(const JsonValueWrapper& json) override;
@@ -133,7 +133,7 @@ public slots:
void gotoAddress(u32 address);
private:
Ui::MemoryViewWidget ui;
Ui::MemoryView ui;
MemoryViewTable m_table;
};

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MemoryViewWidget</class>
<widget class="QWidget" name="MemoryViewWidget">
<class>MemoryView</class>
<widget class="QWidget" name="MemoryView">
<property name="geometry">
<rect>
<x>0</x>

View File

@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "SavedAddressesWidget.h"
#include "SavedAddressesView.h"
#include "QtUtils.h"
#include "Debugger/DebuggerSettingsManager.h"
@@ -9,8 +9,8 @@
#include <QtGui/QClipboard>
#include <QtWidgets/QMenu>
SavedAddressesWidget::SavedAddressesWidget(const DebuggerWidgetParameters& parameters)
: DebuggerWidget(parameters, DISALLOW_MULTIPLE_INSTANCES)
SavedAddressesView::SavedAddressesView(const DebuggerViewParameters& parameters)
: DebuggerView(parameters, DISALLOW_MULTIPLE_INSTANCES)
, m_model(SavedAddressesModel::getInstance(cpu()))
{
m_ui.setupUi(this);
@@ -19,7 +19,7 @@ SavedAddressesWidget::SavedAddressesWidget(const DebuggerWidgetParameters& param
m_ui.savedAddressesList->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_ui.savedAddressesList, &QTableView::customContextMenuRequested,
this, &SavedAddressesWidget::openContextMenu);
this, &SavedAddressesView::openContextMenu);
connect(g_emu_thread, &EmuThread::onGameChanged, this, [this](const QString& title) {
if (title.isEmpty())
@@ -51,13 +51,13 @@ SavedAddressesWidget::SavedAddressesWidget(const DebuggerWidgetParameters& param
});
}
void SavedAddressesWidget::openContextMenu(QPoint pos)
void SavedAddressesView::openContextMenu(QPoint pos)
{
QMenu* menu = new QMenu(this);
menu->setAttribute(Qt::WA_DeleteOnClose);
QAction* new_action = menu->addAction(tr("New"));
connect(new_action, &QAction::triggered, this, &SavedAddressesWidget::contextNew);
connect(new_action, &QAction::triggered, this, &SavedAddressesView::contextNew);
const QModelIndex index_at_pos = m_ui.savedAddressesList->indexAt(pos);
const bool is_index_valid = index_at_pos.isValid();
@@ -92,7 +92,7 @@ void SavedAddressesWidget::openContextMenu(QPoint pos)
}
QAction* paste_from_csv_action = menu->addAction(tr("Paste from CSV"));
connect(paste_from_csv_action, &QAction::triggered, this, &SavedAddressesWidget::contextPasteCSV);
connect(paste_from_csv_action, &QAction::triggered, this, &SavedAddressesView::contextPasteCSV);
QAction* load_action = menu->addAction(tr("Load from Settings"));
load_action->setEnabled(is_cpu_alive);
@@ -103,7 +103,7 @@ void SavedAddressesWidget::openContextMenu(QPoint pos)
QAction* save_action = menu->addAction(tr("Save to Settings"));
save_action->setEnabled(is_cpu_alive);
connect(save_action, &QAction::triggered, this, &SavedAddressesWidget::saveToDebuggerSettings);
connect(save_action, &QAction::triggered, this, &SavedAddressesView::saveToDebuggerSettings);
QAction* delete_action = menu->addAction(tr("Delete"));
connect(delete_action, &QAction::triggered, this, [this, index_at_pos]() {
@@ -114,7 +114,7 @@ void SavedAddressesWidget::openContextMenu(QPoint pos)
menu->popup(m_ui.savedAddressesList->viewport()->mapToGlobal(pos));
}
void SavedAddressesWidget::contextPasteCSV()
void SavedAddressesView::contextPasteCSV()
{
QString csv = QGuiApplication::clipboard()->text();
// Skip header
@@ -139,14 +139,14 @@ void SavedAddressesWidget::contextPasteCSV()
}
}
void SavedAddressesWidget::contextNew()
void SavedAddressesView::contextNew()
{
m_model->addRow();
const u32 row_count = m_model->rowCount();
m_ui.savedAddressesList->edit(m_model->index(row_count - 1, 0));
}
void SavedAddressesWidget::addAddress(u32 address)
void SavedAddressesView::addAddress(u32 address)
{
m_model->addRow();
@@ -160,7 +160,7 @@ void SavedAddressesWidget::addAddress(u32 address)
m_ui.savedAddressesList->edit(label_index);
}
void SavedAddressesWidget::saveToDebuggerSettings()
void SavedAddressesView::saveToDebuggerSettings()
{
DebuggerSettingsManager::saveGameSettings(m_model);
}

View File

@@ -3,18 +3,18 @@
#pragma once
#include "ui_SavedAddressesWidget.h"
#include "ui_SavedAddressesView.h"
#include "SavedAddressesModel.h"
#include "Debugger/DebuggerWidget.h"
#include "Debugger/DebuggerView.h"
class SavedAddressesWidget : public DebuggerWidget
class SavedAddressesView : public DebuggerView
{
Q_OBJECT
public:
SavedAddressesWidget(const DebuggerWidgetParameters& parameters);
SavedAddressesView(const DebuggerViewParameters& parameters);
void openContextMenu(QPoint pos);
void contextPasteCSV();
@@ -23,7 +23,7 @@ public:
void saveToDebuggerSettings();
private:
Ui::SavedAddressesWidget m_ui;
Ui::SavedAddressesView m_ui;
SavedAddressesModel* m_model;
};

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SavedAddressesWidget</class>
<widget class="QWidget" name="SavedAddressesWidget">
<class>SavedAddressesView</class>
<widget class="QWidget" name="SavedAddressesView">
<property name="geometry">
<rect>
<x>0</x>

View File

@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "RegisterWidget.h"
#include "RegisterView.h"
#include "Debugger/JsonValueWrapper.h"
@@ -21,16 +21,16 @@
using namespace QtUtils;
RegisterWidget::RegisterWidget(const DebuggerWidgetParameters& parameters)
: DebuggerWidget(parameters, MONOSPACE_FONT)
RegisterView::RegisterView(const DebuggerViewParameters& parameters)
: DebuggerView(parameters, MONOSPACE_FONT)
{
this->setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
ui.setupUi(this);
ui.registerTabs->setDrawBase(false);
connect(this, &RegisterWidget::customContextMenuRequested, this, &RegisterWidget::customMenuRequested);
connect(ui.registerTabs, &QTabBar::currentChanged, this, &RegisterWidget::tabCurrentChanged);
connect(this, &RegisterView::customContextMenuRequested, this, &RegisterView::customMenuRequested);
connect(ui.registerTabs, &QTabBar::currentChanged, this, &RegisterView::tabCurrentChanged);
for (int i = 0; i < cpu().getRegisterCategoryCount(); i++)
{
@@ -45,21 +45,21 @@ RegisterWidget::RegisterWidget(const DebuggerWidgetParameters& parameters)
});
}
RegisterWidget::~RegisterWidget()
RegisterView::~RegisterView()
{
}
void RegisterWidget::toJson(JsonValueWrapper& json)
void RegisterView::toJson(JsonValueWrapper& json)
{
DebuggerWidget::toJson(json);
DebuggerView::toJson(json);
json.value().AddMember("showVU0FFloat", m_showVU0FFloat, json.allocator());
json.value().AddMember("showFPRFloat", m_showFPRFloat, json.allocator());
}
bool RegisterWidget::fromJson(const JsonValueWrapper& json)
bool RegisterView::fromJson(const JsonValueWrapper& json)
{
if (!DebuggerWidget::fromJson(json))
if (!DebuggerView::fromJson(json))
return false;
auto show_vu0f_float = json.value().FindMember("showVU0FFloat");
@@ -75,12 +75,12 @@ bool RegisterWidget::fromJson(const JsonValueWrapper& json)
return true;
}
void RegisterWidget::tabCurrentChanged(int cur)
void RegisterView::tabCurrentChanged(int cur)
{
m_rowStart = 0;
}
void RegisterWidget::paintEvent(QPaintEvent* event)
void RegisterView::paintEvent(QPaintEvent* event)
{
QPainter painter(this);
painter.setPen(this->palette().text().color());
@@ -190,7 +190,7 @@ void RegisterWidget::paintEvent(QPaintEvent* event)
painter.end();
}
void RegisterWidget::mousePressEvent(QMouseEvent* event)
void RegisterView::mousePressEvent(QMouseEvent* event)
{
const int categoryIndex = ui.registerTabs->currentIndex();
m_selectedRow = static_cast<int>(((event->position().y() - m_renderStart.y()) / m_rowHeight)) + m_rowStart;
@@ -213,7 +213,7 @@ void RegisterWidget::mousePressEvent(QMouseEvent* event)
this->repaint();
}
void RegisterWidget::wheelEvent(QWheelEvent* event)
void RegisterView::wheelEvent(QWheelEvent* event)
{
if (event->angleDelta().y() < 0 && m_rowEnd < cpu().getRegisterCount(ui.registerTabs->currentIndex()))
{
@@ -227,7 +227,7 @@ void RegisterWidget::wheelEvent(QWheelEvent* event)
this->repaint();
}
void RegisterWidget::mouseDoubleClickEvent(QMouseEvent* event)
void RegisterView::mouseDoubleClickEvent(QMouseEvent* event)
{
if (!cpu().isAlive())
return;
@@ -240,7 +240,7 @@ void RegisterWidget::mouseDoubleClickEvent(QMouseEvent* event)
contextChangeValue();
}
void RegisterWidget::customMenuRequested(QPoint pos)
void RegisterView::customMenuRequested(QPoint pos)
{
if (!cpu().isAlive())
return;
@@ -281,13 +281,13 @@ void RegisterWidget::customMenuRequested(QPoint pos)
if (cpu().getRegisterSize(categoryIndex) == 128)
{
connect(menu->addAction(tr("Copy Top Half")), &QAction::triggered, this, &RegisterWidget::contextCopyTop);
connect(menu->addAction(tr("Copy Bottom Half")), &QAction::triggered, this, &RegisterWidget::contextCopyBottom);
connect(menu->addAction(tr("Copy Segment")), &QAction::triggered, this, &RegisterWidget::contextCopySegment);
connect(menu->addAction(tr("Copy Top Half")), &QAction::triggered, this, &RegisterView::contextCopyTop);
connect(menu->addAction(tr("Copy Bottom Half")), &QAction::triggered, this, &RegisterView::contextCopyBottom);
connect(menu->addAction(tr("Copy Segment")), &QAction::triggered, this, &RegisterView::contextCopySegment);
}
else
{
connect(menu->addAction(tr("Copy Value")), &QAction::triggered, this, &RegisterWidget::contextCopyValue);
connect(menu->addAction(tr("Copy Value")), &QAction::triggered, this, &RegisterView::contextCopyValue);
}
menu->addSeparator();
@@ -295,16 +295,16 @@ void RegisterWidget::customMenuRequested(QPoint pos)
if (cpu().getRegisterSize(categoryIndex) == 128)
{
connect(menu->addAction(tr("Change Top Half")), &QAction::triggered,
this, &RegisterWidget::contextChangeTop);
this, &RegisterView::contextChangeTop);
connect(menu->addAction(tr("Change Bottom Half")), &QAction::triggered,
this, &RegisterWidget::contextChangeBottom);
this, &RegisterView::contextChangeBottom);
connect(menu->addAction(tr("Change Segment")), &QAction::triggered,
this, &RegisterWidget::contextChangeSegment);
this, &RegisterView::contextChangeSegment);
}
else
{
connect(menu->addAction(tr("Change Value")), &QAction::triggered,
this, &RegisterWidget::contextChangeValue);
this, &RegisterView::contextChangeValue);
}
menu->addSeparator();
@@ -317,7 +317,7 @@ void RegisterWidget::customMenuRequested(QPoint pos)
}
void RegisterWidget::contextCopyValue()
void RegisterView::contextCopyValue()
{
const int categoryIndex = ui.registerTabs->currentIndex();
const u128 val = cpu().getRegister(categoryIndex, m_selectedRow);
@@ -327,21 +327,21 @@ void RegisterWidget::contextCopyValue()
QApplication::clipboard()->setText(QString("%1").arg(QString::number(val._u64[0], 16).toUpper(), 16));
}
void RegisterWidget::contextCopyTop()
void RegisterView::contextCopyTop()
{
const int categoryIndex = ui.registerTabs->currentIndex();
const u128 val = cpu().getRegister(categoryIndex, m_selectedRow);
QApplication::clipboard()->setText(FilledQStringFromValue(val.hi, 16));
}
void RegisterWidget::contextCopyBottom()
void RegisterView::contextCopyBottom()
{
const int categoryIndex = ui.registerTabs->currentIndex();
const u128 val = cpu().getRegister(categoryIndex, m_selectedRow);
QApplication::clipboard()->setText(FilledQStringFromValue(val.lo, 16));
}
void RegisterWidget::contextCopySegment()
void RegisterView::contextCopySegment()
{
const int categoryIndex = ui.registerTabs->currentIndex();
const u128 val = cpu().getRegister(categoryIndex, m_selectedRow);
@@ -351,7 +351,7 @@ void RegisterWidget::contextCopySegment()
QApplication::clipboard()->setText(FilledQStringFromValue(val._u32[3 - m_selected128Field], 16));
}
bool RegisterWidget::contextFetchNewValue(u64& out, u64 currentValue, bool segment)
bool RegisterView::contextFetchNewValue(u64& out, u64 currentValue, bool segment)
{
const int categoryIndex = ui.registerTabs->currentIndex();
const bool floatingPoint = CAT_SHOW_FLOAT && segment;
@@ -394,18 +394,18 @@ bool RegisterWidget::contextFetchNewValue(u64& out, u64 currentValue, bool segme
return true;
}
void RegisterWidget::contextChangeValue()
void RegisterView::contextChangeValue()
{
const int categoryIndex = ui.registerTabs->currentIndex();
u64 newVal;
if (contextFetchNewValue(newVal, cpu().getRegister(categoryIndex, m_selectedRow).lo))
{
cpu().setRegister(categoryIndex, m_selectedRow, u128::From64(newVal));
DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate());
DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
}
}
void RegisterWidget::contextChangeTop()
void RegisterView::contextChangeTop()
{
u64 newVal;
u128 oldVal = cpu().getRegister(ui.registerTabs->currentIndex(), m_selectedRow);
@@ -413,11 +413,11 @@ void RegisterWidget::contextChangeTop()
{
oldVal.hi = newVal;
cpu().setRegister(ui.registerTabs->currentIndex(), m_selectedRow, oldVal);
DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate());
DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
}
}
void RegisterWidget::contextChangeBottom()
void RegisterView::contextChangeBottom()
{
u64 newVal;
u128 oldVal = cpu().getRegister(ui.registerTabs->currentIndex(), m_selectedRow);
@@ -425,11 +425,11 @@ void RegisterWidget::contextChangeBottom()
{
oldVal.lo = newVal;
cpu().setRegister(ui.registerTabs->currentIndex(), m_selectedRow, oldVal);
DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate());
DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
}
}
void RegisterWidget::contextChangeSegment()
void RegisterView::contextChangeSegment()
{
u64 newVal;
u128 oldVal = cpu().getRegister(ui.registerTabs->currentIndex(), m_selectedRow);
@@ -437,11 +437,11 @@ void RegisterWidget::contextChangeSegment()
{
oldVal._u32[3 - m_selected128Field] = (u32)newVal;
cpu().setRegister(ui.registerTabs->currentIndex(), m_selectedRow, oldVal);
DebuggerWidget::broadcastEvent(DebuggerEvents::VMUpdate());
DebuggerView::broadcastEvent(DebuggerEvents::VMUpdate());
}
}
std::optional<DebuggerEvents::GoToAddress> RegisterWidget::contextCreateGotoEvent()
std::optional<DebuggerEvents::GoToAddress> RegisterView::contextCreateGotoEvent()
{
const int categoryIndex = ui.registerTabs->currentIndex();
u128 regVal = cpu().getRegister(categoryIndex, m_selectedRow);

View File

@@ -3,9 +3,9 @@
#pragma once
#include "ui_RegisterWidget.h"
#include "ui_RegisterView.h"
#include "DebuggerWidget.h"
#include "DebuggerView.h"
#include "DebugTools/DebugInterface.h"
#include "DebugTools/DisassemblyManager.h"
@@ -14,13 +14,13 @@
#include <QtWidgets/QTabBar>
#include <QtGui/QPainter>
class RegisterWidget final : public DebuggerWidget
class RegisterView final : public DebuggerView
{
Q_OBJECT
public:
RegisterWidget(const DebuggerWidgetParameters& parameters);
~RegisterWidget();
RegisterView(const DebuggerViewParameters& parameters);
~RegisterView();
void toJson(JsonValueWrapper& json) override;
bool fromJson(const JsonValueWrapper& json) override;
@@ -47,7 +47,7 @@ public slots:
void tabCurrentChanged(int cur);
private:
Ui::RegisterWidget ui;
Ui::RegisterView ui;
// Returns true on success
bool contextFetchNewValue(u64& out, u64 currentValue, bool segment = false);

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RegisterWidget</class>
<widget class="QWidget" name="RegisterWidget">
<class>RegisterView</class>
<widget class="QWidget" name="RegisterView">
<property name="geometry">
<rect>
<x>0</x>

View File

@@ -1,22 +1,22 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "StackWidget.h"
#include "StackView.h"
#include "QtUtils.h"
#include <QtGui/QClipboard>
#include <QtWidgets/QMenu>
StackWidget::StackWidget(const DebuggerWidgetParameters& parameters)
: DebuggerWidget(parameters, NO_DEBUGGER_FLAGS)
StackView::StackView(const DebuggerViewParameters& parameters)
: DebuggerView(parameters, NO_DEBUGGER_FLAGS)
, m_model(new StackModel(cpu()))
{
m_ui.setupUi(this);
m_ui.stackList->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_ui.stackList, &QTableView::customContextMenuRequested, this, &StackWidget::openContextMenu);
connect(m_ui.stackList, &QTableView::doubleClicked, this, &StackWidget::onDoubleClick);
connect(m_ui.stackList, &QTableView::customContextMenuRequested, this, &StackView::openContextMenu);
connect(m_ui.stackList, &QTableView::doubleClicked, this, &StackView::onDoubleClick);
m_ui.stackList->setModel(m_model);
for (std::size_t i = 0; auto mode : StackModel::HeaderResizeModes)
@@ -31,7 +31,7 @@ StackWidget::StackWidget(const DebuggerWidgetParameters& parameters)
});
}
void StackWidget::openContextMenu(QPoint pos)
void StackView::openContextMenu(QPoint pos)
{
if (!m_ui.stackList->selectionModel()->hasSelection())
return;
@@ -58,7 +58,7 @@ void StackWidget::openContextMenu(QPoint pos)
menu->popup(m_ui.stackList->viewport()->mapToGlobal(pos));
}
void StackWidget::onDoubleClick(const QModelIndex& index)
void StackView::onDoubleClick(const QModelIndex& index)
{
switch (index.column())
{

View File

@@ -3,24 +3,24 @@
#pragma once
#include "ui_StackWidget.h"
#include "ui_StackView.h"
#include "StackModel.h"
#include "DebuggerWidget.h"
#include "DebuggerView.h"
class StackWidget final : public DebuggerWidget
class StackView final : public DebuggerView
{
Q_OBJECT
public:
StackWidget(const DebuggerWidgetParameters& parameters);
StackView(const DebuggerViewParameters& parameters);
void openContextMenu(QPoint pos);
void onDoubleClick(const QModelIndex& index);
private:
Ui::StackWidget m_ui;
Ui::StackView m_ui;
StackModel* m_model;
};

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>StackWidget</class>
<widget class="QWidget" name="StackWidget">
<class>StackView</class>
<widget class="QWidget" name="StackView">
<property name="geometry">
<rect>
<x>0</x>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SymbolTreeWidget</class>
<widget class="QWidget" name="SymbolTreeWidget">
<class>SymbolTreeView</class>
<widget class="QWidget" name="SymbolTreeView">
<property name="geometry">
<rect>
<x>0</x>

View File

@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "SymbolTreeWidgets.h"
#include "SymbolTreeViews.h"
#include "Debugger/JsonValueWrapper.h"
#include "Debugger/SymbolTree/NewSymbolDialogs.h"
@@ -15,11 +15,11 @@
static bool testName(const QString& name, const QString& filter);
SymbolTreeWidget::SymbolTreeWidget(
SymbolTreeView::SymbolTreeView(
u32 flags,
s32 symbol_address_alignment,
const DebuggerWidgetParameters& parameters)
: DebuggerWidget(parameters, MONOSPACE_FONT)
const DebuggerViewParameters& parameters)
: DebuggerView(parameters, MONOSPACE_FONT)
, m_flags(flags)
, m_symbol_address_alignment(symbol_address_alignment)
, m_group_by_module(cpu().getCpuType() == BREAKPOINT_IOP)
@@ -34,17 +34,17 @@ SymbolTreeWidget::SymbolTreeWidget(
reset();
});
connect(m_ui.filterBox, &QLineEdit::textEdited, this, &SymbolTreeWidget::reset);
connect(m_ui.filterBox, &QLineEdit::textEdited, this, &SymbolTreeView::reset);
connect(m_ui.newButton, &QPushButton::clicked, this, &SymbolTreeWidget::onNewButtonPressed);
connect(m_ui.deleteButton, &QPushButton::clicked, this, &SymbolTreeWidget::onDeleteButtonPressed);
connect(m_ui.newButton, &QPushButton::clicked, this, &SymbolTreeView::onNewButtonPressed);
connect(m_ui.deleteButton, &QPushButton::clicked, this, &SymbolTreeView::onDeleteButtonPressed);
connect(m_ui.treeView->verticalScrollBar(), &QScrollBar::valueChanged, this, [&]() {
updateVisibleNodes(false);
});
m_ui.treeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_ui.treeView, &QTreeView::customContextMenuRequested, this, &SymbolTreeWidget::openContextMenu);
connect(m_ui.treeView, &QTreeView::customContextMenuRequested, this, &SymbolTreeView::openContextMenu);
connect(m_ui.treeView, &QTreeView::expanded, this, [&]() {
updateVisibleNodes(true);
@@ -56,18 +56,18 @@ SymbolTreeWidget::SymbolTreeWidget(
});
}
SymbolTreeWidget::~SymbolTreeWidget() = default;
SymbolTreeView::~SymbolTreeView() = default;
void SymbolTreeWidget::resizeEvent(QResizeEvent* event)
void SymbolTreeView::resizeEvent(QResizeEvent* event)
{
QWidget::resizeEvent(event);
updateVisibleNodes(false);
}
void SymbolTreeWidget::toJson(JsonValueWrapper& json)
void SymbolTreeView::toJson(JsonValueWrapper& json)
{
DebuggerWidget::toJson(json);
DebuggerView::toJson(json);
json.value().AddMember("showSizeColumn", m_show_size_column, json.allocator());
if (m_flags & ALLOW_GROUPING)
@@ -83,9 +83,9 @@ void SymbolTreeWidget::toJson(JsonValueWrapper& json)
}
}
bool SymbolTreeWidget::fromJson(const JsonValueWrapper& json)
bool SymbolTreeView::fromJson(const JsonValueWrapper& json)
{
if (!DebuggerWidget::fromJson(json))
if (!DebuggerView::fromJson(json))
return false;
bool needs_reset = false;
@@ -137,7 +137,7 @@ bool SymbolTreeWidget::fromJson(const JsonValueWrapper& json)
return true;
}
void SymbolTreeWidget::updateModel()
void SymbolTreeView::updateModel()
{
if (needsReset())
reset();
@@ -145,7 +145,7 @@ void SymbolTreeWidget::updateModel()
updateVisibleNodes(true);
}
void SymbolTreeWidget::reset()
void SymbolTreeView::reset()
{
if (!m_model)
setupTree();
@@ -170,7 +170,7 @@ void SymbolTreeWidget::reset()
}
}
void SymbolTreeWidget::updateVisibleNodes(bool update_hashes)
void SymbolTreeView::updateVisibleNodes(bool update_hashes)
{
if (!m_model)
return;
@@ -199,7 +199,7 @@ void SymbolTreeWidget::updateVisibleNodes(bool update_hashes)
m_ui.treeView->update();
}
void SymbolTreeWidget::expandGroups(QModelIndex index)
void SymbolTreeView::expandGroups(QModelIndex index)
{
if (!m_model)
return;
@@ -218,7 +218,7 @@ void SymbolTreeWidget::expandGroups(QModelIndex index)
}
}
void SymbolTreeWidget::setupTree()
void SymbolTreeView::setupTree()
{
m_model = new SymbolTreeModel(cpu(), this);
m_ui.treeView->setModel(m_model);
@@ -237,10 +237,10 @@ void SymbolTreeWidget::setupTree()
configureColumns();
connect(m_ui.treeView, &QTreeView::pressed, this, &SymbolTreeWidget::onTreeViewClicked);
connect(m_ui.treeView, &QTreeView::pressed, this, &SymbolTreeView::onTreeViewClicked);
}
std::unique_ptr<SymbolTreeNode> SymbolTreeWidget::buildTree(const ccc::SymbolDatabase& database)
std::unique_ptr<SymbolTreeNode> SymbolTreeView::buildTree(const ccc::SymbolDatabase& database)
{
std::vector<SymbolWork> symbols = getSymbols(m_ui.filterBox->text(), database);
@@ -321,7 +321,7 @@ std::unique_ptr<SymbolTreeNode> SymbolTreeWidget::buildTree(const ccc::SymbolDat
return root;
}
std::unique_ptr<SymbolTreeNode> SymbolTreeWidget::groupBySourceFile(
std::unique_ptr<SymbolTreeNode> SymbolTreeView::groupBySourceFile(
std::unique_ptr<SymbolTreeNode> child,
const SymbolWork& child_work,
SymbolTreeNode*& prev_group,
@@ -364,7 +364,7 @@ std::unique_ptr<SymbolTreeNode> SymbolTreeWidget::groupBySourceFile(
return child;
}
std::unique_ptr<SymbolTreeNode> SymbolTreeWidget::groupBySection(
std::unique_ptr<SymbolTreeNode> SymbolTreeView::groupBySection(
std::unique_ptr<SymbolTreeNode> child,
const SymbolWork& child_work,
SymbolTreeNode*& prev_group,
@@ -403,7 +403,7 @@ std::unique_ptr<SymbolTreeNode> SymbolTreeWidget::groupBySection(
return child;
}
std::unique_ptr<SymbolTreeNode> SymbolTreeWidget::groupByModule(
std::unique_ptr<SymbolTreeNode> SymbolTreeView::groupByModule(
std::unique_ptr<SymbolTreeNode> child,
const SymbolWork& child_work,
SymbolTreeNode*& prev_group,
@@ -448,7 +448,7 @@ std::unique_ptr<SymbolTreeNode> SymbolTreeWidget::groupByModule(
return child;
}
void SymbolTreeWidget::openContextMenu(QPoint pos)
void SymbolTreeView::openContextMenu(QPoint pos)
{
SymbolTreeNode* node = currentNode();
if (!node)
@@ -462,22 +462,22 @@ void SymbolTreeWidget::openContextMenu(QPoint pos)
menu->setAttribute(Qt::WA_DeleteOnClose);
QAction* copy_name = menu->addAction(tr("Copy Name"));
connect(copy_name, &QAction::triggered, this, &SymbolTreeWidget::onCopyName);
connect(copy_name, &QAction::triggered, this, &SymbolTreeView::onCopyName);
if (m_flags & ALLOW_MANGLED_NAME_ACTIONS)
{
QAction* copy_mangled_name = menu->addAction(tr("Copy Mangled Name"));
connect(copy_mangled_name, &QAction::triggered, this, &SymbolTreeWidget::onCopyMangledName);
connect(copy_mangled_name, &QAction::triggered, this, &SymbolTreeView::onCopyMangledName);
}
QAction* copy_location = menu->addAction(tr("Copy Location"));
connect(copy_location, &QAction::triggered, this, &SymbolTreeWidget::onCopyLocation);
connect(copy_location, &QAction::triggered, this, &SymbolTreeView::onCopyLocation);
menu->addSeparator();
QAction* rename_symbol = menu->addAction(tr("Rename Symbol"));
rename_symbol->setEnabled(node_is_symbol);
connect(rename_symbol, &QAction::triggered, this, &SymbolTreeWidget::onRenameSymbol);
connect(rename_symbol, &QAction::triggered, this, &SymbolTreeView::onRenameSymbol);
menu->addSeparator();
@@ -551,22 +551,22 @@ void SymbolTreeWidget::openContextMenu(QPoint pos)
QAction* reset_children = menu->addAction(tr("Reset Children"));
reset_children->setEnabled(node_is_object);
connect(reset_children, &QAction::triggered, this, &SymbolTreeWidget::onResetChildren);
connect(reset_children, &QAction::triggered, this, &SymbolTreeView::onResetChildren);
QAction* change_type_temporarily = menu->addAction(tr("Change Type Temporarily"));
change_type_temporarily->setEnabled(node_is_object);
connect(change_type_temporarily, &QAction::triggered, this, &SymbolTreeWidget::onChangeTypeTemporarily);
connect(change_type_temporarily, &QAction::triggered, this, &SymbolTreeView::onChangeTypeTemporarily);
}
menu->popup(m_ui.treeView->viewport()->mapToGlobal(pos));
}
bool SymbolTreeWidget::needsReset() const
bool SymbolTreeView::needsReset() const
{
return !m_model || m_model->needsReset();
}
void SymbolTreeWidget::onDeleteButtonPressed()
void SymbolTreeView::onDeleteButtonPressed()
{
SymbolTreeNode* node = currentNode();
if (!node)
@@ -585,7 +585,7 @@ void SymbolTreeWidget::onDeleteButtonPressed()
reset();
}
void SymbolTreeWidget::onCopyName()
void SymbolTreeView::onCopyName()
{
SymbolTreeNode* node = currentNode();
if (!node)
@@ -594,7 +594,7 @@ void SymbolTreeWidget::onCopyName()
QApplication::clipboard()->setText(node->name);
}
void SymbolTreeWidget::onCopyMangledName()
void SymbolTreeView::onCopyMangledName()
{
SymbolTreeNode* node = currentNode();
if (!node)
@@ -606,7 +606,7 @@ void SymbolTreeWidget::onCopyMangledName()
QApplication::clipboard()->setText(node->name);
}
void SymbolTreeWidget::onCopyLocation()
void SymbolTreeView::onCopyLocation()
{
SymbolTreeNode* node = currentNode();
if (!node)
@@ -615,7 +615,7 @@ void SymbolTreeWidget::onCopyLocation()
QApplication::clipboard()->setText(node->location.toString(cpu()));
}
void SymbolTreeWidget::onRenameSymbol()
void SymbolTreeView::onRenameSymbol()
{
SymbolTreeNode* node = currentNode();
if (!node || !node->symbol.valid())
@@ -643,7 +643,7 @@ void SymbolTreeWidget::onRenameSymbol()
});
}
void SymbolTreeWidget::onResetChildren()
void SymbolTreeView::onResetChildren()
{
if (!m_model)
return;
@@ -655,7 +655,7 @@ void SymbolTreeWidget::onResetChildren()
m_model->resetChildren(index);
}
void SymbolTreeWidget::onChangeTypeTemporarily()
void SymbolTreeView::onChangeTypeTemporarily()
{
if (!m_model)
return;
@@ -683,7 +683,7 @@ void SymbolTreeWidget::onChangeTypeTemporarily()
QMessageBox::warning(this, tr("Cannot Change Type"), *error_message);
}
void SymbolTreeWidget::onTreeViewClicked(const QModelIndex& index)
void SymbolTreeView::onTreeViewClicked(const QModelIndex& index)
{
if (!index.isValid())
return;
@@ -701,7 +701,7 @@ void SymbolTreeWidget::onTreeViewClicked(const QModelIndex& index)
goToInDisassembler(node->location.address, false);
}
SymbolTreeNode* SymbolTreeWidget::currentNode()
SymbolTreeNode* SymbolTreeView::currentNode()
{
if (!m_model)
return nullptr;
@@ -712,20 +712,20 @@ SymbolTreeNode* SymbolTreeWidget::currentNode()
// *****************************************************************************
FunctionTreeWidget::FunctionTreeWidget(const DebuggerWidgetParameters& parameters)
: SymbolTreeWidget(
FunctionTreeView::FunctionTreeView(const DebuggerViewParameters& parameters)
: SymbolTreeView(
ALLOW_GROUPING | ALLOW_MANGLED_NAME_ACTIONS | CLICK_TO_GO_TO_IN_DISASSEMBLER,
4,
parameters)
{
}
FunctionTreeWidget::~FunctionTreeWidget() = default;
FunctionTreeView::~FunctionTreeView() = default;
std::vector<SymbolTreeWidget::SymbolWork> FunctionTreeWidget::getSymbols(
std::vector<SymbolTreeView::SymbolWork> FunctionTreeView::getSymbols(
const QString& filter, const ccc::SymbolDatabase& database)
{
std::vector<SymbolTreeWidget::SymbolWork> symbols;
std::vector<SymbolTreeView::SymbolWork> symbols;
for (const ccc::Function& function : database.functions)
{
@@ -750,7 +750,7 @@ std::vector<SymbolTreeWidget::SymbolWork> FunctionTreeWidget::getSymbols(
return symbols;
}
std::unique_ptr<SymbolTreeNode> FunctionTreeWidget::buildNode(
std::unique_ptr<SymbolTreeNode> FunctionTreeView::buildNode(
SymbolWork& work, const ccc::SymbolDatabase& database) const
{
const ccc::Function& function = static_cast<const ccc::Function&>(*work.symbol);
@@ -777,7 +777,7 @@ std::unique_ptr<SymbolTreeNode> FunctionTreeWidget::buildNode(
return node;
}
void FunctionTreeWidget::configureColumns()
void FunctionTreeView::configureColumns()
{
m_ui.treeView->setColumnHidden(SymbolTreeModel::NAME, false);
m_ui.treeView->setColumnHidden(SymbolTreeModel::LOCATION, false);
@@ -790,7 +790,7 @@ void FunctionTreeWidget::configureColumns()
m_ui.treeView->header()->setStretchLastSection(false);
}
void FunctionTreeWidget::onNewButtonPressed()
void FunctionTreeView::onNewButtonPressed()
{
NewFunctionDialog* dialog = new NewFunctionDialog(cpu(), this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -800,20 +800,20 @@ void FunctionTreeWidget::onNewButtonPressed()
// *****************************************************************************
GlobalVariableTreeWidget::GlobalVariableTreeWidget(const DebuggerWidgetParameters& parameters)
: SymbolTreeWidget(
GlobalVariableTreeView::GlobalVariableTreeView(const DebuggerViewParameters& parameters)
: SymbolTreeView(
ALLOW_GROUPING | ALLOW_SORTING_BY_IF_TYPE_IS_KNOWN | ALLOW_TYPE_ACTIONS | ALLOW_MANGLED_NAME_ACTIONS,
1,
parameters)
{
}
GlobalVariableTreeWidget::~GlobalVariableTreeWidget() = default;
GlobalVariableTreeView::~GlobalVariableTreeView() = default;
std::vector<SymbolTreeWidget::SymbolWork> GlobalVariableTreeWidget::getSymbols(
std::vector<SymbolTreeView::SymbolWork> GlobalVariableTreeView::getSymbols(
const QString& filter, const ccc::SymbolDatabase& database)
{
std::vector<SymbolTreeWidget::SymbolWork> symbols;
std::vector<SymbolTreeView::SymbolWork> symbols;
for (const ccc::GlobalVariable& global_variable : database.global_variables)
{
@@ -875,7 +875,7 @@ std::vector<SymbolTreeWidget::SymbolWork> GlobalVariableTreeWidget::getSymbols(
return symbols;
}
std::unique_ptr<SymbolTreeNode> GlobalVariableTreeWidget::buildNode(
std::unique_ptr<SymbolTreeNode> GlobalVariableTreeView::buildNode(
SymbolWork& work, const ccc::SymbolDatabase& database) const
{
std::unique_ptr<SymbolTreeNode> node = std::make_unique<SymbolTreeNode>();
@@ -918,7 +918,7 @@ std::unique_ptr<SymbolTreeNode> GlobalVariableTreeWidget::buildNode(
return node;
}
void GlobalVariableTreeWidget::configureColumns()
void GlobalVariableTreeView::configureColumns()
{
m_ui.treeView->setColumnHidden(SymbolTreeModel::NAME, false);
m_ui.treeView->setColumnHidden(SymbolTreeModel::LOCATION, false);
@@ -933,7 +933,7 @@ void GlobalVariableTreeWidget::configureColumns()
m_ui.treeView->header()->setStretchLastSection(false);
}
void GlobalVariableTreeWidget::onNewButtonPressed()
void GlobalVariableTreeView::onNewButtonPressed()
{
NewGlobalVariableDialog* dialog = new NewGlobalVariableDialog(cpu(), this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -943,17 +943,17 @@ void GlobalVariableTreeWidget::onNewButtonPressed()
// *****************************************************************************
LocalVariableTreeWidget::LocalVariableTreeWidget(const DebuggerWidgetParameters& parameters)
: SymbolTreeWidget(
LocalVariableTreeView::LocalVariableTreeView(const DebuggerViewParameters& parameters)
: SymbolTreeView(
ALLOW_TYPE_ACTIONS,
1,
parameters)
{
}
LocalVariableTreeWidget::~LocalVariableTreeWidget() = default;
LocalVariableTreeView::~LocalVariableTreeView() = default;
bool LocalVariableTreeWidget::needsReset() const
bool LocalVariableTreeView::needsReset() const
{
if (!m_function.valid())
return true;
@@ -975,10 +975,10 @@ bool LocalVariableTreeWidget::needsReset() const
if (left_function)
return true;
return SymbolTreeWidget::needsReset();
return SymbolTreeView::needsReset();
}
std::vector<SymbolTreeWidget::SymbolWork> LocalVariableTreeWidget::getSymbols(
std::vector<SymbolTreeView::SymbolWork> LocalVariableTreeView::getSymbols(
const QString& filter, const ccc::SymbolDatabase& database)
{
u32 program_counter = cpu().getPC();
@@ -992,7 +992,7 @@ std::vector<SymbolTreeWidget::SymbolWork> LocalVariableTreeWidget::getSymbols(
m_function = function->handle();
m_caller_stack_pointer = cpu().getCallerStackPointer(*function);
std::vector<SymbolTreeWidget::SymbolWork> symbols;
std::vector<SymbolTreeView::SymbolWork> symbols;
for (const ccc::LocalVariableHandle local_variable_handle : *function->local_variables())
{
@@ -1024,7 +1024,7 @@ std::vector<SymbolTreeWidget::SymbolWork> LocalVariableTreeWidget::getSymbols(
return symbols;
}
std::unique_ptr<SymbolTreeNode> LocalVariableTreeWidget::buildNode(
std::unique_ptr<SymbolTreeNode> LocalVariableTreeView::buildNode(
SymbolWork& work, const ccc::SymbolDatabase& database) const
{
const ccc::LocalVariable& local_variable = static_cast<const ccc::LocalVariable&>(*work.symbol);
@@ -1047,7 +1047,7 @@ std::unique_ptr<SymbolTreeNode> LocalVariableTreeWidget::buildNode(
return node;
}
void LocalVariableTreeWidget::configureColumns()
void LocalVariableTreeView::configureColumns()
{
m_ui.treeView->setColumnHidden(SymbolTreeModel::NAME, false);
m_ui.treeView->setColumnHidden(SymbolTreeModel::LOCATION, false);
@@ -1062,7 +1062,7 @@ void LocalVariableTreeWidget::configureColumns()
m_ui.treeView->header()->setStretchLastSection(false);
}
void LocalVariableTreeWidget::onNewButtonPressed()
void LocalVariableTreeView::onNewButtonPressed()
{
NewLocalVariableDialog* dialog = new NewLocalVariableDialog(cpu(), this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
@@ -1072,17 +1072,17 @@ void LocalVariableTreeWidget::onNewButtonPressed()
// *****************************************************************************
ParameterVariableTreeWidget::ParameterVariableTreeWidget(const DebuggerWidgetParameters& parameters)
: SymbolTreeWidget(
ParameterVariableTreeView::ParameterVariableTreeView(const DebuggerViewParameters& parameters)
: SymbolTreeView(
ALLOW_TYPE_ACTIONS,
1,
parameters)
{
}
ParameterVariableTreeWidget::~ParameterVariableTreeWidget() = default;
ParameterVariableTreeView::~ParameterVariableTreeView() = default;
bool ParameterVariableTreeWidget::needsReset() const
bool ParameterVariableTreeView::needsReset() const
{
if (!m_function.valid())
return true;
@@ -1104,13 +1104,13 @@ bool ParameterVariableTreeWidget::needsReset() const
if (left_function)
return true;
return SymbolTreeWidget::needsReset();
return SymbolTreeView::needsReset();
}
std::vector<SymbolTreeWidget::SymbolWork> ParameterVariableTreeWidget::getSymbols(
std::vector<SymbolTreeView::SymbolWork> ParameterVariableTreeView::getSymbols(
const QString& filter, const ccc::SymbolDatabase& database)
{
std::vector<SymbolTreeWidget::SymbolWork> symbols;
std::vector<SymbolTreeView::SymbolWork> symbols;
u32 program_counter = cpu().getPC();
const ccc::Function* function = database.functions.symbol_overlapping_address(program_counter);
@@ -1154,7 +1154,7 @@ std::vector<SymbolTreeWidget::SymbolWork> ParameterVariableTreeWidget::getSymbol
return symbols;
}
std::unique_ptr<SymbolTreeNode> ParameterVariableTreeWidget::buildNode(
std::unique_ptr<SymbolTreeNode> ParameterVariableTreeView::buildNode(
SymbolWork& work, const ccc::SymbolDatabase& database) const
{
const ccc::ParameterVariable& parameter_variable = static_cast<const ccc::ParameterVariable&>(*work.symbol);
@@ -1174,7 +1174,7 @@ std::unique_ptr<SymbolTreeNode> ParameterVariableTreeWidget::buildNode(
return node;
}
void ParameterVariableTreeWidget::configureColumns()
void ParameterVariableTreeView::configureColumns()
{
m_ui.treeView->setColumnHidden(SymbolTreeModel::NAME, false);
m_ui.treeView->setColumnHidden(SymbolTreeModel::LOCATION, false);
@@ -1189,7 +1189,7 @@ void ParameterVariableTreeWidget::configureColumns()
m_ui.treeView->header()->setStretchLastSection(false);
}
void ParameterVariableTreeWidget::onNewButtonPressed()
void ParameterVariableTreeView::onNewButtonPressed()
{
NewParameterVariableDialog* dialog = new NewParameterVariableDialog(cpu(), this);
dialog->setAttribute(Qt::WA_DeleteOnClose);

View File

@@ -3,19 +3,19 @@
#pragma once
#include "ui_SymbolTreeWidget.h"
#include "ui_SymbolTreeView.h"
#include "Debugger/DebuggerWidget.h"
#include "Debugger/DebuggerView.h"
#include "Debugger/SymbolTree/SymbolTreeModel.h"
// A symbol tree widget with its associated refresh button, filter box and
// A symbol tree view with its associated refresh button, filter box and
// right-click menu. Supports grouping, sorting and various other settings.
class SymbolTreeWidget : public DebuggerWidget
class SymbolTreeView : public DebuggerView
{
Q_OBJECT
public:
virtual ~SymbolTreeWidget();
virtual ~SymbolTreeView();
void updateModel();
void reset();
@@ -33,10 +33,10 @@ protected:
const ccc::SourceFile* source_file = nullptr;
};
SymbolTreeWidget(
SymbolTreeView(
u32 flags,
s32 symbol_address_alignment,
const DebuggerWidgetParameters& parameters);
const DebuggerViewParameters& parameters);
void resizeEvent(QResizeEvent* event) override;
@@ -90,7 +90,7 @@ protected:
SymbolTreeNode* currentNode();
Ui::SymbolTreeWidget m_ui;
Ui::SymbolTreeView m_ui;
SymbolTreeModel* m_model = nullptr;
@@ -114,12 +114,12 @@ protected:
bool m_sort_by_if_type_is_known = false;
};
class FunctionTreeWidget : public SymbolTreeWidget
class FunctionTreeView : public SymbolTreeView
{
Q_OBJECT
public:
explicit FunctionTreeWidget(const DebuggerWidgetParameters& parameters);
virtual ~FunctionTreeWidget();
explicit FunctionTreeView(const DebuggerViewParameters& parameters);
virtual ~FunctionTreeView();
protected:
std::vector<SymbolWork> getSymbols(
@@ -133,12 +133,12 @@ protected:
void onNewButtonPressed() override;
};
class GlobalVariableTreeWidget : public SymbolTreeWidget
class GlobalVariableTreeView : public SymbolTreeView
{
Q_OBJECT
public:
explicit GlobalVariableTreeWidget(const DebuggerWidgetParameters& parameters);
virtual ~GlobalVariableTreeWidget();
explicit GlobalVariableTreeView(const DebuggerViewParameters& parameters);
virtual ~GlobalVariableTreeView();
protected:
std::vector<SymbolWork> getSymbols(
@@ -152,12 +152,12 @@ protected:
void onNewButtonPressed() override;
};
class LocalVariableTreeWidget : public SymbolTreeWidget
class LocalVariableTreeView : public SymbolTreeView
{
Q_OBJECT
public:
explicit LocalVariableTreeWidget(const DebuggerWidgetParameters& parameters);
virtual ~LocalVariableTreeWidget();
explicit LocalVariableTreeView(const DebuggerViewParameters& parameters);
virtual ~LocalVariableTreeView();
protected:
bool needsReset() const override;
@@ -176,12 +176,12 @@ protected:
std::optional<u32> m_caller_stack_pointer;
};
class ParameterVariableTreeWidget : public SymbolTreeWidget
class ParameterVariableTreeView : public SymbolTreeView
{
Q_OBJECT
public:
explicit ParameterVariableTreeWidget(const DebuggerWidgetParameters& parameters);
virtual ~ParameterVariableTreeWidget();
explicit ParameterVariableTreeView(const DebuggerViewParameters& parameters);
virtual ~ParameterVariableTreeView();
protected:
bool needsReset() const override;

View File

@@ -1,23 +1,23 @@
// SPDX-FileCopyrightText: 2002-2025 PCSX2 Dev Team
// SPDX-License-Identifier: GPL-3.0+
#include "ThreadWidget.h"
#include "ThreadView.h"
#include "QtUtils.h"
#include <QtGui/QClipboard>
#include <QtWidgets/QMenu>
ThreadWidget::ThreadWidget(const DebuggerWidgetParameters& parameters)
: DebuggerWidget(parameters, NO_DEBUGGER_FLAGS)
ThreadView::ThreadView(const DebuggerViewParameters& parameters)
: DebuggerView(parameters, NO_DEBUGGER_FLAGS)
, m_model(new ThreadModel(cpu()))
, m_proxy_model(new QSortFilterProxyModel())
{
m_ui.setupUi(this);
m_ui.threadList->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_ui.threadList, &QTableView::customContextMenuRequested, this, &ThreadWidget::openContextMenu);
connect(m_ui.threadList, &QTableView::doubleClicked, this, &ThreadWidget::onDoubleClick);
connect(m_ui.threadList, &QTableView::customContextMenuRequested, this, &ThreadView::openContextMenu);
connect(m_ui.threadList, &QTableView::doubleClicked, this, &ThreadView::onDoubleClick);
m_proxy_model->setSourceModel(m_model);
m_proxy_model->setSortRole(Qt::UserRole);
@@ -36,7 +36,7 @@ ThreadWidget::ThreadWidget(const DebuggerWidgetParameters& parameters)
});
}
void ThreadWidget::openContextMenu(QPoint pos)
void ThreadView::openContextMenu(QPoint pos)
{
if (!m_ui.threadList->selectionModel()->hasSelection())
return;
@@ -63,7 +63,7 @@ void ThreadWidget::openContextMenu(QPoint pos)
menu->popup(m_ui.threadList->viewport()->mapToGlobal(pos));
}
void ThreadWidget::onDoubleClick(const QModelIndex& index)
void ThreadView::onDoubleClick(const QModelIndex& index)
{
switch (index.column())
{

View File

@@ -3,25 +3,25 @@
#pragma once
#include "ui_ThreadWidget.h"
#include "ui_ThreadView.h"
#include "DebuggerWidget.h"
#include "DebuggerView.h"
#include "ThreadModel.h"
#include <QtCore/QSortFilterProxyModel>
class ThreadWidget final : public DebuggerWidget
class ThreadView final : public DebuggerView
{
Q_OBJECT
public:
ThreadWidget(const DebuggerWidgetParameters& parameters);
ThreadView(const DebuggerViewParameters& parameters);
void openContextMenu(QPoint pos);
void onDoubleClick(const QModelIndex& index);
private:
Ui::ThreadWidget m_ui;
Ui::ThreadView m_ui;
ThreadModel* m_model;
QSortFilterProxyModel* m_proxy_model;

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ThreadWidget</class>
<widget class="QWidget" name="ThreadWidget">
<class>ThreadView</class>
<widget class="QWidget" name="ThreadView">
<property name="geometry">
<rect>
<x>0</x>

File diff suppressed because it is too large Load Diff

View File

@@ -95,7 +95,7 @@
<ClCompile Include="Debugger\SymbolTree\SymbolTreeLocation.cpp" />
<ClCompile Include="Debugger\SymbolTree\SymbolTreeModel.cpp" />
<ClCompile Include="Debugger\SymbolTree\SymbolTreeNode.cpp" />
<ClCompile Include="Debugger\SymbolTree\SymbolTreeWidgets.cpp" />
<ClCompile Include="Debugger\SymbolTree\SymbolTreeViews.cpp" />
<ClCompile Include="Debugger\SymbolTree\TypeString.cpp" />
<ClCompile Include="EarlyHardwareCheck.cpp" />
<ClCompile Include="LogWindow.cpp" />
@@ -112,18 +112,18 @@
<ClCompile Include="Tools\InputRecording\InputRecordingViewer.cpp" />
<ClCompile Include="Tools\InputRecording\NewInputRecordingDlg.cpp" />
<ClCompile Include="Debugger\AnalysisOptionsDialog.cpp" />
<ClCompile Include="Debugger\DebuggerWidget.cpp" />
<ClCompile Include="Debugger\DebuggerView.cpp" />
<ClCompile Include="Debugger\DebuggerWindow.cpp" />
<ClCompile Include="Debugger\DisassemblyWidget.cpp" />
<ClCompile Include="Debugger\RegisterWidget.cpp" />
<ClCompile Include="Debugger\DisassemblyView.cpp" />
<ClCompile Include="Debugger\RegisterView.cpp" />
<ClCompile Include="Debugger\DebuggerSettingsManager.cpp" />
<ClCompile Include="Debugger\StackModel.cpp" />
<ClCompile Include="Debugger\StackWidget.cpp" />
<ClCompile Include="Debugger\StackView.cpp" />
<ClCompile Include="Debugger\ThreadModel.cpp" />
<ClCompile Include="Debugger\ThreadWidget.cpp" />
<ClCompile Include="Debugger\ThreadView.cpp" />
<ClCompile Include="Debugger\Breakpoints\BreakpointDialog.cpp" />
<ClCompile Include="Debugger\Breakpoints\BreakpointModel.cpp" />
<ClCompile Include="Debugger\Breakpoints\BreakpointWidget.cpp" />
<ClCompile Include="Debugger\Breakpoints\BreakpointView.cpp" />
<ClCompile Include="Debugger\Docking\DockLayout.cpp" />
<ClCompile Include="Debugger\Docking\DockManager.cpp" />
<ClCompile Include="Debugger\Docking\DockMenuBar.cpp" />
@@ -133,10 +133,10 @@
<ClCompile Include="Debugger\Docking\DropIndicators.cpp" />
<ClCompile Include="Debugger\Docking\LayoutEditorDialog.cpp" />
<ClCompile Include="Debugger\Docking\NoLayoutsWidget.cpp" />
<ClCompile Include="Debugger\Memory\MemorySearchWidget.cpp" />
<ClCompile Include="Debugger\Memory\MemoryViewWidget.cpp" />
<ClCompile Include="Debugger\Memory\MemorySearchView.cpp" />
<ClCompile Include="Debugger\Memory\MemoryView.cpp" />
<ClCompile Include="Debugger\Memory\SavedAddressesModel.cpp" />
<ClCompile Include="Debugger\Memory\SavedAddressesWidget.cpp" />
<ClCompile Include="Debugger\Memory\SavedAddressesView.cpp" />
<ClCompile Include="Settings\BIOSSettingsWidget.cpp" />
<ClCompile Include="Settings\ControllerBindingWidget.cpp" />
<ClCompile Include="Settings\ControllerGlobalSettingsWidget.cpp" />
@@ -207,7 +207,7 @@
<QtMoc Include="Debugger\SymbolTree\SymbolTreeLocation.h" />
<QtMoc Include="Debugger\SymbolTree\SymbolTreeModel.h" />
<QtMoc Include="Debugger\SymbolTree\SymbolTreeNode.h" />
<QtMoc Include="Debugger\SymbolTree\SymbolTreeWidgets.h" />
<QtMoc Include="Debugger\SymbolTree\SymbolTreeViews.h" />
<QtMoc Include="Debugger\SymbolTree\TypeString.h" />
<ClInclude Include="Settings\ControllerSettingWidgetBinder.h" />
<QtMoc Include="Settings\FolderSettingsWidget.h" />
@@ -229,18 +229,18 @@
<ClInclude Include="QtUtils.h" />
<QtMoc Include="Debugger\AnalysisOptionsDialog.h" />
<QtMoc Include="Debugger\DebuggerEvents.h" />
<QtMoc Include="Debugger\DebuggerWidget.h" />
<QtMoc Include="Debugger\DebuggerView.h" />
<QtMoc Include="Debugger\DebuggerWindow.h" />
<QtMoc Include="Debugger\DisassemblyWidget.h" />
<QtMoc Include="Debugger\RegisterWidget.h" />
<QtMoc Include="Debugger\DisassemblyView.h" />
<QtMoc Include="Debugger\RegisterView.h" />
<QtMoc Include="Debugger\StackModel.h" />
<QtMoc Include="Debugger\StackWidget.h" />
<QtMoc Include="Debugger\StackView.h" />
<QtMoc Include="Debugger\ThreadModel.h" />
<QtMoc Include="Debugger\ThreadWidget.h" />
<QtMoc Include="Debugger\ThreadView.h" />
<ClInclude Include="Debugger\DebuggerSettingsManager.h" />
<QtMoc Include="Debugger\Breakpoints\BreakpointDialog.h" />
<QtMoc Include="Debugger\Breakpoints\BreakpointModel.h" />
<QtMoc Include="Debugger\Breakpoints\BreakpointWidget.h" />
<QtMoc Include="Debugger\Breakpoints\BreakpointView.h" />
<QtMoc Include="Debugger\Docking\DockLayout.h" />
<QtMoc Include="Debugger\Docking\DockManager.h" />
<QtMoc Include="Debugger\Docking\DockMenuBar.h" />
@@ -250,10 +250,10 @@
<QtMoc Include="Debugger\Docking\DropIndicators.h" />
<QtMoc Include="Debugger\Docking\LayoutEditorDialog.h" />
<QtMoc Include="Debugger\Docking\NoLayoutsWidget.h" />
<QtMoc Include="Debugger\Memory\MemorySearchWidget.h" />
<QtMoc Include="Debugger\Memory\MemoryViewWidget.h" />
<QtMoc Include="Debugger\Memory\MemorySearchView.h" />
<QtMoc Include="Debugger\Memory\MemoryView.h" />
<QtMoc Include="Debugger\Memory\SavedAddressesModel.h" />
<QtMoc Include="Debugger\Memory\SavedAddressesWidget.h" />
<QtMoc Include="Debugger\Memory\SavedAddressesView.h" />
<QtMoc Include="Settings\ControllerBindingWidget.h" />
<QtMoc Include="Settings\ControllerGlobalSettingsWidget.h" />
<ClInclude Include="Settings\MemoryCardConvertWorker.h" />
@@ -303,33 +303,33 @@
<ClCompile Include="$(IntDir)Settings\moc_DebugUserInterfaceSettingsWidget.cpp" />
<ClCompile Include="$(IntDir)Settings\moc_DebugSettingsWidget.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_AnalysisOptionsDialog.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_DebuggerWidget.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_DebuggerView.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_DebuggerWindow.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_DisassemblyWidget.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_RegisterWidget.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_DisassemblyView.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_RegisterView.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_StackModel.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_StackWidget.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_StackView.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_ThreadModel.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_ThreadWidget.cpp" />
<ClCompile Include="$(IntDir)Debugger\moc_ThreadView.cpp" />
<ClCompile Include="$(IntDir)Debugger\Breakpoints\moc_BreakpointDialog.cpp" />
<ClCompile Include="$(IntDir)Debugger\Breakpoints\moc_BreakpointModel.cpp" />
<ClCompile Include="$(IntDir)Debugger\Breakpoints\moc_BreakpointWidget.cpp" />
<ClCompile Include="$(IntDir)Debugger\Breakpoints\moc_BreakpointView.cpp" />
<ClCompile Include="$(IntDir)Debugger\Docking\moc_DockManager.cpp" />
<ClCompile Include="$(IntDir)Debugger\Docking\moc_DockMenuBar.cpp" />
<ClCompile Include="$(IntDir)Debugger\Docking\moc_DockViews.cpp" />
<ClCompile Include="$(IntDir)Debugger\Docking\moc_DropIndicators.cpp" />
<ClCompile Include="$(IntDir)Debugger\Docking\moc_LayoutEditorDialog.cpp" />
<ClCompile Include="$(IntDir)Debugger\Docking\moc_NoLayoutsWidget.cpp" />
<ClCompile Include="$(IntDir)Debugger\Memory\moc_MemorySearchWidget.cpp" />
<ClCompile Include="$(IntDir)Debugger\Memory\moc_MemoryViewWidget.cpp" />
<ClCompile Include="$(IntDir)Debugger\Memory\moc_MemorySearchView.cpp" />
<ClCompile Include="$(IntDir)Debugger\Memory\moc_MemoryView.cpp" />
<ClCompile Include="$(IntDir)Debugger\Memory\moc_SavedAddressesModel.cpp" />
<ClCompile Include="$(IntDir)Debugger\Memory\moc_SavedAddressesWidget.cpp" />
<ClCompile Include="$(IntDir)Debugger\Memory\moc_SavedAddressesView.cpp" />
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_NewSymbolDialogs.cpp" />
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_SymbolTreeDelegates.cpp" />
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_SymbolTreeLocation.cpp" />
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_SymbolTreeModel.cpp" />
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_SymbolTreeNode.cpp" />
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_SymbolTreeWidgets.cpp" />
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_SymbolTreeViews.cpp" />
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_TypeString.cpp" />
<ClCompile Include="$(IntDir)GameList\moc_GameListModel.cpp" />
<ClCompile Include="$(IntDir)GameList\moc_GameListRefreshThread.cpp" />
@@ -356,19 +356,19 @@
<QtUi Include="CoverDownloadDialog.ui" />
<QtUi Include="Debugger\AnalysisOptionsDialog.ui" />
<QtUi Include="Debugger\Breakpoints\BreakpointDialog.ui" />
<QtUi Include="Debugger\Breakpoints\BreakpointWidget.ui" />
<QtUi Include="Debugger\Breakpoints\BreakpointView.ui" />
<QtUi Include="Debugger\DebuggerWindow.ui" />
<QtUi Include="Debugger\DisassemblyWidget.ui" />
<QtUi Include="Debugger\DisassemblyView.ui" />
<QtUi Include="Debugger\Docking\LayoutEditorDialog.ui" />
<QtUi Include="Debugger\Docking\NoLayoutsWidget.ui" />
<QtUi Include="Debugger\Memory\MemorySearchWidget.ui" />
<QtUi Include="Debugger\Memory\MemoryViewWidget.ui" />
<QtUi Include="Debugger\Memory\SavedAddressesWidget.ui" />
<QtUi Include="Debugger\RegisterWidget.ui" />
<QtUi Include="Debugger\StackWidget.ui" />
<QtUi Include="Debugger\Memory\MemorySearchView.ui" />
<QtUi Include="Debugger\Memory\MemoryView.ui" />
<QtUi Include="Debugger\Memory\SavedAddressesView.ui" />
<QtUi Include="Debugger\RegisterView.ui" />
<QtUi Include="Debugger\StackView.ui" />
<QtUi Include="Debugger\SymbolTree\NewSymbolDialog.ui" />
<QtUi Include="Debugger\SymbolTree\SymbolTreeWidget.ui" />
<QtUi Include="Debugger\ThreadWidget.ui" />
<QtUi Include="Debugger\SymbolTree\SymbolTreeView.ui" />
<QtUi Include="Debugger\ThreadView.ui" />
<QtUi Include="GameList\EmptyGameListWidget.ui" />
<QtUi Include="GameList\GameListWidget.ui" />
<QtUi Include="MainWindow.ui" />

View File

@@ -284,64 +284,40 @@
<ClCompile Include="Debugger\AnalysisOptionsDialog.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="Debugger\DebuggerWidget.cpp">
<ClCompile Include="Debugger\DebuggerView.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="Debugger\DebuggerWindow.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="Debugger\DisassemblyWidget.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="Debugger\RegisterWidget.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="Debugger\StackModel.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="Debugger\StackWidget.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="Debugger\ThreadModel.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="Debugger\ThreadWidget.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_AnalysisOptionsDialog.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_DebuggerWidget.cpp">
<ClCompile Include="$(IntDir)Debugger\moc_DebuggerView.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_DebuggerWindow.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_DisassemblyWidget.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_RegisterWidget.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_StackModel.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_StackWidget.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_ThreadModel.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_ThreadWidget.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\Breakpoints\moc_BreakpointDialog.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\Breakpoints\moc_BreakpointModel.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\Breakpoints\moc_BreakpointWidget.cpp">
<ClCompile Include="$(IntDir)Debugger\Breakpoints\moc_BreakpointView.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\Docking\moc_DockManager.cpp">
@@ -359,16 +335,16 @@
<ClCompile Include="$(IntDir)Debugger\Docking\moc_NoLayoutsWidget.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\Memory\moc_MemorySearchWidget.cpp">
<ClCompile Include="$(IntDir)Debugger\Memory\moc_MemorySearchView.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\Memory\moc_MemoryViewWidget.cpp">
<ClCompile Include="$(IntDir)Debugger\Memory\moc_MemoryView.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\Memory\moc_SavedAddressesModel.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\Memory\moc_SavedAddressesWidget.cpp">
<ClCompile Include="$(IntDir)Debugger\Memory\moc_SavedAddressesView.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="ColorPickerButton.cpp" />
@@ -415,9 +391,6 @@
<ClCompile Include="Debugger\SymbolTree\SymbolTreeNode.cpp">
<Filter>Debugger\SymbolTree</Filter>
</ClCompile>
<ClCompile Include="Debugger\SymbolTree\SymbolTreeWidgets.cpp">
<Filter>Debugger\SymbolTree</Filter>
</ClCompile>
<ClCompile Include="Debugger\SymbolTree\TypeString.cpp">
<Filter>Debugger\SymbolTree</Filter>
</ClCompile>
@@ -428,7 +401,7 @@
<ClCompile Include="Debugger\Breakpoints\BreakpointModel.cpp">
<Filter>Debugger\Breakpoints</Filter>
</ClCompile>
<ClCompile Include="Debugger\Breakpoints\BreakpointWidget.cpp">
<ClCompile Include="Debugger\Breakpoints\BreakpointView.cpp">
<Filter>Debugger\Breakpoints</Filter>
</ClCompile>
<ClCompile Include="Debugger\Docking\DockLayout.cpp">
@@ -452,13 +425,13 @@
<ClCompile Include="Debugger\Memory\SavedAddressesModel.cpp">
<Filter>Debugger\Memory</Filter>
</ClCompile>
<ClCompile Include="Debugger\Memory\SavedAddressesWidget.cpp">
<ClCompile Include="Debugger\Memory\SavedAddressesView.cpp">
<Filter>Debugger\Memory</Filter>
</ClCompile>
<ClCompile Include="Debugger\Memory\MemorySearchWidget.cpp">
<ClCompile Include="Debugger\Memory\MemorySearchView.cpp">
<Filter>Debugger\Memory</Filter>
</ClCompile>
<ClCompile Include="Debugger\Memory\MemoryViewWidget.cpp">
<ClCompile Include="Debugger\Memory\MemoryView.cpp">
<Filter>Debugger\Memory</Filter>
</ClCompile>
<ClCompile Include="Debugger\Docking\LayoutEditorDialog.cpp">
@@ -482,9 +455,6 @@
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_SymbolTreeNode.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_SymbolTreeWidgets.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_TypeString.cpp">
<Filter>moc</Filter>
</ClCompile>
@@ -494,6 +464,36 @@
<ClCompile Include="Debugger\Docking\DockMenuBar.cpp">
<Filter>Debugger\Docking</Filter>
</ClCompile>
<ClCompile Include="Debugger\StackView.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="Debugger\SymbolTree\SymbolTreeViews.cpp">
<Filter>Debugger\SymbolTree</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_DisassemblyView.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_RegisterView.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_StackView.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\SymbolTree\moc_SymbolTreeViews.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="$(IntDir)Debugger\moc_ThreadView.cpp">
<Filter>moc</Filter>
</ClCompile>
<ClCompile Include="Debugger\DisassemblyView.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="Debugger\RegisterView.cpp">
<Filter>Debugger</Filter>
</ClCompile>
<ClCompile Include="Debugger\ThreadView.cpp">
<Filter>Debugger</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Manifest Include="..\pcsx2\windows\PCSX2.manifest">
@@ -628,30 +628,18 @@
<QtMoc Include="Debugger\DebuggerEvents.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="Debugger\DebuggerWidget.h">
<QtMoc Include="Debugger\DebuggerView.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="Debugger\DebuggerWindow.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="Debugger\DisassemblyWidget.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="Debugger\RegisterWidget.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="Debugger\StackModel.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="Debugger\StackWidget.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="Debugger\ThreadModel.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="Debugger\ThreadWidget.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="ColorPickerButton.h" />
<QtMoc Include="SetupWizardDialog.h" />
<QtMoc Include="Settings\GameCheatSettingsWidget.h">
@@ -668,7 +656,7 @@
<QtMoc Include="Debugger\Breakpoints\BreakpointModel.h">
<Filter>Debugger\Breakpoints</Filter>
</QtMoc>
<QtMoc Include="Debugger\Breakpoints\BreakpointWidget.h">
<QtMoc Include="Debugger\Breakpoints\BreakpointView.h">
<Filter>Debugger\Breakpoints</Filter>
</QtMoc>
<QtMoc Include="Debugger\Docking\DockLayout.h">
@@ -689,9 +677,6 @@
<QtMoc Include="Debugger\Docking\DropIndicators.h">
<Filter>Debugger\Docking</Filter>
</QtMoc>
<QtMoc Include="Debugger\SymbolTree\SymbolTreeWidgets.h">
<Filter>Debugger\SymbolTree</Filter>
</QtMoc>
<QtMoc Include="Debugger\SymbolTree\SymbolTreeDelegates.h">
<Filter>Debugger\SymbolTree</Filter>
</QtMoc>
@@ -707,13 +692,13 @@
<QtMoc Include="Debugger\Memory\SavedAddressesModel.h">
<Filter>Debugger\Memory</Filter>
</QtMoc>
<QtMoc Include="Debugger\Memory\SavedAddressesWidget.h">
<QtMoc Include="Debugger\Memory\SavedAddressesView.h">
<Filter>Debugger\Memory</Filter>
</QtMoc>
<QtMoc Include="Debugger\Memory\MemorySearchWidget.h">
<QtMoc Include="Debugger\Memory\MemorySearchView.h">
<Filter>Debugger\Memory</Filter>
</QtMoc>
<QtMoc Include="Debugger\Memory\MemoryViewWidget.h">
<QtMoc Include="Debugger\Memory\MemoryView.h">
<Filter>Debugger\Memory</Filter>
</QtMoc>
<QtMoc Include="Debugger\Docking\LayoutEditorDialog.h">
@@ -728,6 +713,21 @@
<QtMoc Include="Debugger\Docking\DockMenuBar.h">
<Filter>Debugger\Docking</Filter>
</QtMoc>
<QtMoc Include="Debugger\StackView.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="Debugger\SymbolTree\SymbolTreeViews.h">
<Filter>Debugger\SymbolTree</Filter>
</QtMoc>
<QtMoc Include="Debugger\DisassemblyView.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="Debugger\RegisterView.h">
<Filter>Debugger</Filter>
</QtMoc>
<QtMoc Include="Debugger\ThreadView.h">
<Filter>Debugger</Filter>
</QtMoc>
</ItemGroup>
<ItemGroup>
<QtResource Include="resources\resources.qrc">
@@ -738,7 +738,7 @@
<QtUi Include="Debugger\Breakpoints\BreakpointDialog.ui">
<Filter>Debugger\Breakpoints</Filter>
</QtUi>
<QtUi Include="Debugger\Breakpoints\BreakpointWidget.ui">
<QtUi Include="Debugger\Breakpoints\BreakpointView.ui">
<Filter>Debugger\Breakpoints</Filter>
</QtUi>
<QtUi Include="Debugger\Docking\LayoutEditorDialog.ui">
@@ -747,39 +747,24 @@
<QtUi Include="Debugger\Docking\NoLayoutsWidget.ui">
<Filter>Debugger\Docking</Filter>
</QtUi>
<QtUi Include="Debugger\Memory\MemorySearchWidget.ui">
<QtUi Include="Debugger\Memory\MemorySearchView.ui">
<Filter>Debugger\Memory</Filter>
</QtUi>
<QtUi Include="Debugger\Memory\MemoryViewWidget.ui">
<QtUi Include="Debugger\Memory\MemoryView.ui">
<Filter>Debugger\Memory</Filter>
</QtUi>
<QtUi Include="Debugger\Memory\SavedAddressesWidget.ui">
<QtUi Include="Debugger\Memory\SavedAddressesView.ui">
<Filter>Debugger\Memory</Filter>
</QtUi>
<QtUi Include="Debugger\SymbolTree\NewSymbolDialog.ui">
<Filter>Debugger\SymbolTree</Filter>
</QtUi>
<QtUi Include="Debugger\SymbolTree\SymbolTreeWidget.ui">
<Filter>Debugger\SymbolTree</Filter>
</QtUi>
<QtUi Include="Debugger\AnalysisOptionsDialog.ui">
<Filter>Debugger</Filter>
</QtUi>
<QtUi Include="Debugger\DebuggerWindow.ui">
<Filter>Debugger</Filter>
</QtUi>
<QtUi Include="Debugger\DisassemblyWidget.ui">
<Filter>Debugger</Filter>
</QtUi>
<QtUi Include="Debugger\RegisterWidget.ui">
<Filter>Debugger</Filter>
</QtUi>
<QtUi Include="Debugger\StackWidget.ui">
<Filter>Debugger</Filter>
</QtUi>
<QtUi Include="Debugger\ThreadWidget.ui">
<Filter>Debugger</Filter>
</QtUi>
<QtUi Include="GameList\EmptyGameListWidget.ui">
<Filter>GameList</Filter>
</QtUi>
@@ -953,6 +938,21 @@
<QtUi Include="CoverDownloadDialog.ui" />
<QtUi Include="MainWindow.ui" />
<QtUi Include="SetupWizardDialog.ui" />
<QtUi Include="Debugger\StackView.ui">
<Filter>Debugger</Filter>
</QtUi>
<QtUi Include="Debugger\SymbolTree\SymbolTreeView.ui">
<Filter>Debugger\SymbolTree</Filter>
</QtUi>
<QtUi Include="Debugger\DisassemblyView.ui">
<Filter>Debugger</Filter>
</QtUi>
<QtUi Include="Debugger\RegisterView.ui">
<Filter>Debugger</Filter>
</QtUi>
<QtUi Include="Debugger\ThreadView.ui">
<Filter>Debugger</Filter>
</QtUi>
</ItemGroup>
<ItemGroup>
<QtTs Include="Translations\pcsx2-qt_en.ts">