Duckstation/src/duckstation-qt/debuggerwindow.h

95 lines
2.6 KiB
C
Raw Normal View History

2024-02-10 13:29:58 +00:00
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
2020-12-16 15:18:13 +00:00
#pragma once
2024-02-10 13:29:58 +00:00
2020-12-16 15:18:13 +00:00
#include "ui_debuggerwindow.h"
2024-02-10 13:29:58 +00:00
2024-02-10 14:18:49 +00:00
#include "core/cpu_core.h"
2024-02-10 13:29:58 +00:00
#include "core/types.h"
2020-12-16 15:18:13 +00:00
#include <QtWidgets/QMainWindow>
#include <memory>
#include <optional>
namespace Bus {
enum class MemoryRegion;
}
class DebuggerCodeModel;
class DebuggerRegistersModel;
class DebuggerStackModel;
class DebuggerWindow : public QMainWindow
{
Q_OBJECT
public:
explicit DebuggerWindow(QWidget* parent = nullptr);
~DebuggerWindow();
Q_SIGNALS:
void closed();
protected:
void closeEvent(QCloseEvent* event);
private Q_SLOTS:
2024-02-10 13:29:58 +00:00
void onSystemStarted();
void onSystemDestroyed();
void onSystemPaused();
void onSystemResumed();
2020-12-16 15:18:13 +00:00
void onDebuggerMessageReported(const QString& message);
void refreshAll();
void scrollToPC();
void onPauseActionToggled(bool paused);
void onRunToCursorTriggered();
void onGoToPCTriggered();
void onGoToAddressTriggered();
void onDumpAddressTriggered();
void onFollowAddressTriggered();
2024-02-10 13:29:58 +00:00
void onTraceTriggered();
2020-12-16 15:18:13 +00:00
void onAddBreakpointTriggered();
void onToggleBreakpointTriggered();
void onClearBreakpointsTriggered();
void onBreakpointListContextMenuRequested();
2020-12-16 15:18:13 +00:00
void onStepIntoActionTriggered();
void onStepOverActionTriggered();
void onStepOutActionTriggered();
void onCodeViewItemActivated(QModelIndex index);
void onCodeViewContextMenuRequested(const QPoint& pt);
2020-12-16 15:18:13 +00:00
void onMemorySearchTriggered();
void onMemorySearchStringChanged(const QString&);
private:
void setupAdditionalUi();
void connectSignals();
void disconnectSignals();
void createModels();
2024-02-10 13:29:58 +00:00
void setUIEnabled(bool enabled, bool allow_pause);
2020-12-16 15:18:13 +00:00
void setMemoryViewRegion(Bus::MemoryRegion region);
void toggleBreakpoint(VirtualMemoryAddress address);
void clearBreakpoints();
std::optional<VirtualMemoryAddress> getSelectedCodeAddress();
bool tryFollowLoadStore(VirtualMemoryAddress address);
void scrollToCodeAddress(VirtualMemoryAddress address);
bool scrollToMemoryAddress(VirtualMemoryAddress address);
void refreshBreakpointList();
2024-02-10 14:18:49 +00:00
void refreshBreakpointList(const CPU::BreakpointList& bps);
void addBreakpoint(CPU::BreakpointType type, u32 address);
void removeBreakpoint(CPU::BreakpointType type, u32 address);
2020-12-16 15:18:13 +00:00
Ui::DebuggerWindow m_ui;
std::unique_ptr<DebuggerCodeModel> m_code_model;
std::unique_ptr<DebuggerRegistersModel> m_registers_model;
std::unique_ptr<DebuggerStackModel> m_stack_model;
Bus::MemoryRegion m_active_memory_region;
PhysicalMemoryAddress m_next_memory_search_address = 0;
};