Ejemplo n.º 1
0
static void _printStatus(struct CLIDebugger* debugger, struct CLIDebugVector* dv) {
	UNUSED(dv);
	int r;
	for (r = 0; r < 4; ++r) {
		printf("%08X %08X %08X %08X\n",
		    debugger->d.cpu->gprs[r << 2],
		    debugger->d.cpu->gprs[(r << 2) + 1],
		    debugger->d.cpu->gprs[(r << 2) + 2],
		    debugger->d.cpu->gprs[(r << 2) + 3]);
	}
	_printPSR(debugger->d.cpu->cpsr);
	int instructionLength;
	enum ExecutionMode mode = debugger->d.cpu->cpsr.t;
	if (mode == MODE_ARM) {
		instructionLength = WORD_SIZE_ARM;
	} else {
		instructionLength = WORD_SIZE_THUMB;
	}
	_printLine(debugger, debugger->d.cpu->gprs[ARM_PC] - instructionLength, mode);
}
Ejemplo n.º 2
0
static void _printStatus(struct CLIDebuggerSystem* debugger) {
	struct CLIDebuggerBackend* be = debugger->p->backend;
	struct ARMCore* cpu = debugger->p->d.core->cpu;
	int r;
	for (r = 0; r < 4; ++r) {
		be->printf(be, "%08X %08X %08X %08X\n",
		    cpu->gprs[r << 2],
		    cpu->gprs[(r << 2) + 1],
		    cpu->gprs[(r << 2) + 2],
		    cpu->gprs[(r << 2) + 3]);
	}
	_printPSR(be, cpu->cpsr);
	int instructionLength;
	enum ExecutionMode mode = cpu->cpsr.t;
	if (mode == MODE_ARM) {
		instructionLength = WORD_SIZE_ARM;
	} else {
		instructionLength = WORD_SIZE_THUMB;
	}
	_printLine(debugger->p, cpu->gprs[ARM_PC] - instructionLength, mode);
}