1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-02-04 14:30:19 +00:00

Reduce debugging heft.

This commit is contained in:
Thomas Harte 2024-04-04 22:16:11 -04:00
parent 002e235d90
commit 3f40e409c5

View File

@ -76,14 +76,14 @@ struct HackyDebugger {
// last_r1 = executor_.registers()[1]; // last_r1 = executor_.registers()[1];
// } // }
if(instruction == 0xe8fd7fff) {//0x5f706f74) { // if(instruction == 0xe8fd7fff) {
printf("At %08x [%d]; after last PC %08x and %zu ago was %08x\n", // printf("At %08x [%d]; after last PC %08x and %zu ago was %08x\n",
address, // address,
instr_count, // instr_count,
pc_history[(pc_history_ptr - 2 + pc_history.size()) % pc_history.size()], // pc_history[(pc_history_ptr - 2 + pc_history.size()) % pc_history.size()],
pc_history.size(), // pc_history.size(),
pc_history[pc_history_ptr]); // pc_history[pc_history_ptr]);
} // }
// last_r9 = executor_.registers()[9]; // last_r9 = executor_.registers()[9];
// log |= address == 0x038031c4; // log |= address == 0x038031c4;
@ -93,8 +93,8 @@ struct HackyDebugger {
// log = (executor_.pc() == 0x038162afc) || (executor_.pc() == 0x03824b00); // log = (executor_.pc() == 0x038162afc) || (executor_.pc() == 0x03824b00);
// log |= instruction & ; // log |= instruction & ;
// The following has the effect of logging all taken SWIs and their return codes. // The following has the effect of logging all taken SWIs and their return codes.
if( /* if(
(instruction & 0x0f00'0000) == 0x0f00'0000 && (instruction & 0x0f00'0000) == 0x0f00'0000 &&
executor.registers().test(InstructionSet::ARM::Condition(instruction >> 28)) executor.registers().test(InstructionSet::ARM::Condition(instruction >> 28))
) { ) {
@ -257,7 +257,7 @@ struct HackyDebugger {
} }
swis.pop_back(); swis.pop_back();
} }*/
if(log) { if(log) {
InstructionSet::ARM::Disassembler<model> disassembler; InstructionSet::ARM::Disassembler<model> disassembler;
@ -274,16 +274,16 @@ struct HackyDebugger {
} }
info.append("]"); info.append("]");
} }
opcodes.insert(instruction); // opcodes.insert(instruction);
if(accumulate) { // if(accumulate) {
int c = 0; // int c = 0;
for(auto instr : opcodes) { // for(auto instr : opcodes) {
printf("0x%08x, ", instr); // printf("0x%08x, ", instr);
++c; // ++c;
if(!(c&15)) printf("\n"); // if(!(c&15)) printf("\n");
} // }
accumulate = false; // accumulate = false;
} // }
++instr_count; ++instr_count;
} }