debugger: Add fregs command.

This commit is contained in:
joevt
2024-10-31 04:59:11 -07:00
committed by dingusdev
parent a9e0cd5c5e
commit ae605157db
3 changed files with 16 additions and 6 deletions
-1
View File
@@ -652,7 +652,6 @@ extern PPCOpcode* ppc_opcode_grabber;
extern void ppc_msr_did_change(uint32_t old_msr_val, uint32_t new_msr_val, bool set_next_instruction_address = true);
/* debugging support API */
void print_fprs(void); /* print content of the floating-point registers */
uint64_t get_reg(std::string reg_name); /* get content of the register reg_name */
void set_reg(std::string reg_name, uint64_t val); /* set reg_name to val */
-5
View File
@@ -871,11 +871,6 @@ void ppc_cpu_init(MemCtrlBase* mem_ctrl, uint32_t cpu_version, bool do_include_6
#endif
}
void print_fprs() {
for (int i = 0; i < 32; i++)
cout << "FPR " << dec << i << " : " << ppc_state.fpr[i].dbl64_r << endl;
}
static map<string, int> SPRName2Num = {
{"XER", SPR::XER}, {"LR", SPR::LR}, {"CTR", SPR::CTR},
{"DEC", SPR::DEC_S}, {"PVR", SPR::PVR}, {"SPRG0", SPR::SPRG0},
+16
View File
@@ -78,6 +78,7 @@ static void show_help() {
cout << " until X -- execute until address X is reached" << endl;
cout << " go -- exit debugger and continue emulator execution" << endl;
cout << " regs -- dump content of the GRPs" << endl;
cout << " fregs -- dump content of the FPRs" << endl;
cout << " mregs -- dump content of the MMU registers" << endl;
cout << " set R=X -- assign value X to register R" << endl;
cout << " if R=loglevel, set the internal" << endl;
@@ -381,6 +382,18 @@ static void print_gprs() {
}
}
static void print_fprs() {
string reg_name;
for (int i = 0; i < 32; i++) {
reg_name = "f" + to_string(i);
cout << right << std::setw(6) << setfill(' ') << reg_name << " : " <<
setw(16) << setfill('0') << right << uppercase << hex << ppc_state.fpr[i].int64_r <<
" = " << left << setfill(' ') << ppc_state.fpr[i].dbl64_r << endl;
}
cout << right << std::setw(6) << setfill(' ') << "fpscr" << " : " <<
setw(8) << setfill('0') << uppercase << hex << ppc_state.fpscr << setfill(' ') << endl;
}
extern bool is_601;
static void print_mmu_regs()
@@ -590,6 +603,9 @@ void DppcDebugger::enter_debugger() {
} else {
print_gprs();
}
} else if (cmd == "fregs") {
cmd = "";
print_fprs();
} else if (cmd == "mregs") {
cmd = "";
print_mmu_regs();