LR->RA rename, fixes

This commit is contained in:
Henrik Rydgård
2024-12-12 12:58:59 +01:00
parent 11e858f0f1
commit 39ffe92e0a
11 changed files with 27 additions and 23 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ public:
virtual u32 GetPC() = 0;
virtual void SetPC(u32 _pc) = 0;
virtual u32 GetLR() = 0;
virtual u32 GetRA() = 0;
virtual void DisAsm(u32 pc, char *out, size_t outSize) = 0;
+1 -1
View File
@@ -200,7 +200,7 @@ public:
void clear();
void setCpu(DebugInterface* _cpu) { cpu = _cpu; };
static void setCpu(DebugInterface* _cpu) { cpu = _cpu; };
void setMaxParamChars(int num) { maxParamChars = num; clear(); };
void getLine(u32 address, bool insertSymbols, DisassemblyLineInfo &dest, DebugInterface *cpuDebug = nullptr);
void analyze(u32 address, u32 size);
+1 -1
View File
@@ -28,7 +28,7 @@ public:
u32 GetGPR32Value(int reg) override { return ctx.r[reg]; }
u32 GetPC() override { return ctx.pc; }
u32 GetLR() override { return ctx.r[MIPS_REG_RA]; }
u32 GetRA() override { return ctx.r[MIPS_REG_RA]; }
void SetPC(u32 _pc) override { ctx.pc = _pc; }
void PrintRegValue(int cat, int index, char *out, size_t outSize) override {
+1 -1
View File
@@ -50,7 +50,7 @@ public:
void SetGPR32Value(int reg, u32 value) override { cpu->r[reg] = value; }
u32 GetPC() override { return cpu->pc; }
u32 GetLR() override { return cpu->r[MIPS_REG_RA]; }
u32 GetRA() override { return cpu->r[MIPS_REG_RA]; }
u32 GetFPCond() override { return cpu->fpcond; }
void DisAsm(u32 pc, char *out, size_t outSize) override;
void SetPC(u32 _pc) override { cpu->pc = _pc; }
+11 -7
View File
@@ -880,6 +880,10 @@ void ImDebugger::Frame(MIPSDebugInterface *mipsDebug, GPUDebugInterface *gpuDebu
return;
}
// TODO: Pass mipsDebug in where needed instead.
DisassemblyManager::setCpu(mipsDebug);
disasm_.View().setDebugger(mipsDebug);
// Watch the step counters to figure out when to update things.
if (lastCpuStepCount_ != Core_GetSteppingCounter()) {
@@ -970,7 +974,7 @@ void ImDebugger::Frame(MIPSDebugInterface *mipsDebug, GPUDebugInterface *gpuDebu
for (int i = 0; i < 4; i++) {
char title[64];
snprintf(title, sizeof(title), "Memory %d", i + 1);
ImGui::MenuItem("Memory", nullptr, &cfg_.memViewOpen[i]);
ImGui::MenuItem(title, nullptr, &cfg_.memViewOpen[i]);
}
ImGui::EndMenu();
}
@@ -1096,7 +1100,7 @@ void ImDebugger::Frame(MIPSDebugInterface *mipsDebug, GPUDebugInterface *gpuDebu
}
for (int i = 0; i < 4; i++) {
mem_[i].Draw(mipsDebug, &cfg_.memViewOpen[i], i);
mem_[i].Draw(mipsDebug, cfg_, control, i);
}
// Process UI commands
@@ -1114,11 +1118,11 @@ void ImDebugger::Snapshot() {
}
void ImMemWindow::Draw(MIPSDebugInterface *mipsDebug, bool *open, int index) {
void ImMemWindow::Draw(MIPSDebugInterface *mipsDebug, ImConfig &cfg, ImControl &control, int index) {
char title[256];
snprintf(title, sizeof(title), "Memory %d", index);
ImGui::SetNextWindowSize(ImVec2(520, 600), ImGuiCond_FirstUseEver);
if (!ImGui::Begin(title, open, ImGuiWindowFlags_NoNavInputs)) {
if (!ImGui::Begin(title, &cfg.memViewOpen[index])) {
ImGui::End();
return;
}
@@ -1225,11 +1229,11 @@ void ImDisasmWindow::Draw(MIPSDebugInterface *mipsDebug, ImConfig &cfg, CoreStat
ImGui::SameLine();
if (ImGui::SmallButton("Goto PC")) {
disasmView_.gotoPC();
disasmView_.GotoPC();
}
ImGui::SameLine();
if (ImGui::SmallButton("Goto LR")) {
disasmView_.gotoLR();
if (ImGui::SmallButton("Goto RA")) {
disasmView_.GotoRA();
}
if (ImGui::BeginPopup("disSearch")) {
+1 -1
View File
@@ -62,7 +62,7 @@ private:
// Corresponds to the CMemView dialog
class ImMemWindow {
public:
void Draw(MIPSDebugInterface *mipsDebug, bool *open, int index);
void Draw(MIPSDebugInterface *mipsDebug, ImConfig &cfg, ImControl &control, int index);
ImMemView &View() {
return memView_;
}
+2 -2
View File
@@ -472,7 +472,7 @@ void ImDisasmView::Draw(ImDrawList *drawList) {
void ImDisasmView::NotifyStep() {
if (followPC_) {
gotoPC();
GotoPC();
}
}
@@ -618,7 +618,7 @@ void ImDisasmView::ProcessKeyboardShortcuts(bool focused) {
}
if (ImGui::IsKeyPressed(ImGuiKey_LeftArrow)) {
if (jumpStack_.empty()) {
gotoPC();
GotoPC();
} else {
u32 addr = jumpStack_[jumpStack_.size() - 1];
jumpStack_.pop_back();
+3 -3
View File
@@ -71,11 +71,11 @@ public:
setCurAddress(newAddress);
ScanVisibleFunctions();
}
void gotoPC() {
void GotoPC() {
gotoAddr(debugger_->GetPC());
}
void gotoLR() {
gotoAddr(debugger_->GetLR());
void GotoRA() {
gotoAddr(debugger_->GetRA());
}
u32 getSelection() {
return curAddress_;
+4 -4
View File
@@ -444,9 +444,9 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam) {
UpdateDialog();
}
break;
case IDC_GOTOLR:
case IDC_GOTORA:
{
ptr->gotoAddr(cpu->GetLR());
ptr->gotoAddr(cpu->GetRA());
SetFocus(GetDlgItem(m_hDlg, IDC_DISASMVIEW));
}
break;
@@ -696,7 +696,7 @@ void CDisasm::SetDebugMode(bool _bDebug, bool switchPC)
EnableWindow(GetDlgItem(hDlg, IDC_STEPHLE), TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_STEPOUT), TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_GOTOPC), TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_GOTOLR), TRUE);
EnableWindow(GetDlgItem(hDlg, IDC_GOTORA), TRUE);
CtrlDisAsmView *ptr = DisAsmView();
ptr->setDontRedraw(false);
if (switchPC)
@@ -715,7 +715,7 @@ void CDisasm::SetDebugMode(bool _bDebug, bool switchPC)
EnableWindow(GetDlgItem(hDlg, IDC_STEPHLE), FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_STEPOUT), FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_GOTOPC), FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_GOTOLR), FALSE);
EnableWindow(GetDlgItem(hDlg, IDC_GOTORA), FALSE);
CtrlRegisterList *reglist = CtrlRegisterList::getFrom(GetDlgItem(m_hDlg,IDC_REGLIST));
reglist->redraw();
}
+1 -1
View File
@@ -180,7 +180,7 @@ BEGIN
EDITTEXT IDC_THREADNAME,370,3,150,10,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
EDITTEXT IDC_ADDRESS,11,24,91,13,ES_AUTOHSCROLL | ES_WANTRETURN
PUSHBUTTON "PC",IDC_GOTOPC,11,40,15,13
PUSHBUTTON "RA",IDC_GOTOLR,28,40,14,13
PUSHBUTTON "RA",IDC_GOTORA,28,40,14,13
COMBOBOX IDC_GOTOINT,43,40,60,76,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Custom1",IDC_DISASMVIEW,"CtrlDisAsmView",WS_BORDER | WS_TABSTOP,111,16,397,304
GROUPBOX "Go to",IDC_STATIC,5,12,102,47
+1 -1
View File
@@ -70,7 +70,7 @@
#define IDC_STEP 1009
#define IDC_VERSION 1010
#define IDC_MEMVIEW 1069
#define IDC_GOTOLR 1070
#define IDC_GOTORA 1070
#define IDC_GOTOINT 1071
#define IDC_MEMSORT 1073
#define IDC_SYMBOLS 1097