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

85 lines
1.7 KiB
C
Raw Normal View History

2018-02-14 22:25:01 +00:00
// Copyright 2018 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <vector>
#include <QTableWidget>
#include "Common/CommonTypes.h"
class QKeyEvent;
class QMouseEvent;
class QResizeEvent;
class CodeViewWidget : public QTableWidget
{
Q_OBJECT
public:
enum class SetAddressUpdate
{
WithUpdate,
WithoutUpdate
};
2018-02-14 22:25:01 +00:00
explicit CodeViewWidget();
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 ToggleBreakpoint();
void AddBreakpoint();
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();
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 OnContextMenu();
void OnFollowBranch();
void OnCopyAddress();
void OnShowInMemory();
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
bool m_updating = false;
u32 m_address = 0;
u32 m_context_address = 0;
};