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

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

113 lines
2.3 KiB
C
Raw Normal View History

2018-02-14 22:25:01 +00:00
// Copyright 2018 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2018-02-14 22:25:01 +00:00
#pragma once
#include <vector>
#include <QTableWidget>
#include "Common/CommonTypes.h"
#include "Core/Debugger/CodeTrace.h"
2018-02-14 22:25:01 +00:00
class QKeyEvent;
class QMouseEvent;
class QResizeEvent;
class QShowEvent;
2018-02-14 22:25:01 +00:00
namespace Core
{
class CPUThreadGuard;
2023-03-28 21:52:36 +00:00
class System;
} // namespace Core
struct CodeViewBranch;
class BranchDisplayDelegate;
2018-02-14 22:25:01 +00:00
class CodeViewWidget : public QTableWidget
{
Q_OBJECT
public:
enum class SetAddressUpdate
{
WithUpdate,
WithoutUpdate,
WithDetailedUpdate
};
2018-02-14 22:25:01 +00:00
explicit CodeViewWidget();
~CodeViewWidget() override;
2018-02-14 22:25:01 +00:00
u32 GetAddress() const;
u32 GetContextAddress() const;
void SetAddress(u32 address, SetAddressUpdate update);
2018-02-14 22:25:01 +00:00
// Set tighter row height. Set BP column sizing. This needs to run when font type changes.
void FontBasedSizing();
2018-02-14 22:25:01 +00:00
void Update();
void Update(const Core::CPUThreadGuard* guard);
2018-02-14 22:25:01 +00:00
void ToggleBreakpoint();
void AddBreakpoint();
u32 AddressForRow(int row) const;
2018-02-14 22:25:01 +00:00
signals:
void RequestPPCComparison(u32 addr);
void ShowMemory(u32 address);
2018-02-14 22:25:01 +00:00
void SymbolsChanged();
void BreakpointsChanged();
void UpdateCodeWidget();
2018-02-14 22:25:01 +00:00
private:
enum class ReplaceWith
{
BLR,
NOP
};
void ReplaceAddress(u32 address, ReplaceWith replace);
2018-02-14 22:25:01 +00:00
void resizeEvent(QResizeEvent*) override;
void keyPressEvent(QKeyEvent* event) override;
void mousePressEvent(QMouseEvent* event) override;
void wheelEvent(QWheelEvent* event) override;
void showEvent(QShowEvent* event) override;
2018-02-14 22:25:01 +00:00
void OnContextMenu();
void AutoStep(CodeTrace::AutoStop option = CodeTrace::AutoStop::Always);
2018-02-14 22:25:01 +00:00
void OnFollowBranch();
void OnCopyAddress();
void OnCopyTargetAddress();
void OnShowInMemory();
void OnShowTargetInMemory();
2018-02-14 22:25:01 +00:00
void OnCopyFunction();
void OnCopyCode();
void OnCopyHex();
void OnRenameSymbol();
void OnSelectionChanged();
2018-02-14 22:25:01 +00:00
void OnSetSymbolSize();
void OnSetSymbolEndAddress();
void OnRunToHere();
void OnAddFunction();
void OnPPCComparison();
void OnInsertBLR();
void OnInsertNOP();
void OnReplaceInstruction();
void OnRestoreInstruction();
2018-02-14 22:25:01 +00:00
void CalculateBranchIndentation();
2023-03-28 21:52:36 +00:00
Core::System& m_system;
2018-02-14 22:25:01 +00:00
bool m_updating = false;
u32 m_address = 0;
u32 m_context_address = 0;
std::vector<CodeViewBranch> m_branches;
friend class BranchDisplayDelegate;
2018-02-14 22:25:01 +00:00
};