Print hex

This commit is contained in:
Jeffrey Pfau 2013-04-13 01:25:21 -07:00
parent f715534083
commit 0180ee090e
1 changed files with 11 additions and 0 deletions

View File

@ -27,6 +27,7 @@ typedef void (DebuggerComamnd)(struct ARMDebugger*, struct DebugVector*);
static void _breakInto(struct ARMDebugger*, struct DebugVector*); static void _breakInto(struct ARMDebugger*, struct DebugVector*);
static void _print(struct ARMDebugger*, struct DebugVector*); static void _print(struct ARMDebugger*, struct DebugVector*);
static void _printHex(struct ARMDebugger*, struct DebugVector*);
static void _printStatus(struct ARMDebugger*, struct DebugVector*); static void _printStatus(struct ARMDebugger*, struct DebugVector*);
static void _quit(struct ARMDebugger*, struct DebugVector*); static void _quit(struct ARMDebugger*, struct DebugVector*);
@ -36,6 +37,8 @@ struct {
} debuggerCommands[] = { } debuggerCommands[] = {
{ "p", _print }, { "p", _print },
{ "print", _print }, { "print", _print },
{ "p/x", _printHex },
{ "print/x", _printHex },
{ "i", _printStatus }, { "i", _printStatus },
{ "info", _printStatus }, { "info", _printStatus },
{ "q", _quit }, { "q", _quit },
@ -77,6 +80,14 @@ static void _print(struct ARMDebugger* debugger, struct DebugVector* dv) {
printf("\n"); printf("\n");
} }
static void _printHex(struct ARMDebugger* debugger, struct DebugVector* dv) {
(void)(debugger);
for ( ; dv; dv = dv->next) {
printf(" 0x%08X", dv->intValue);
}
printf("\n");
}
static inline void _printLine(struct ARMDebugger* debugger, uint32_t address, enum ExecutionMode mode) { static inline void _printLine(struct ARMDebugger* debugger, uint32_t address, enum ExecutionMode mode) {
// TODO: write a disassembler // TODO: write a disassembler
if (mode == MODE_ARM) { if (mode == MODE_ARM) {