# HG changeset patch # User Jonathan Pevarnek # Date 1316715775 14400 # Node ID a237afb2f8a01a07d69f6ab74f044914085488c1 # Parent 6179de7276a0e53525710e1774d032e7e6f802d7 Also print the instruction address on failure diff -r 6179de7276a0 -r a237afb2f8a0 src/os/except.c --- a/src/os/except.c Thu Sep 22 14:18:19 2011 -0400 +++ b/src/os/except.c Thu Sep 22 14:22:55 2011 -0400 @@ -20,15 +20,18 @@ void prog_int_handler() { size_t i; char buffer[512]; + Psw *oldPsw = (void*)PROGINT_PSW_OLD; u64 *regStore = (u64*)PROGINT_REG_LOC; + u64 regLoc[NUM_REGS]; memcpy((void*)regLoc, regStore, NUM_REGS*sizeof(u64)); for(i = 0; i < NUM_REGS; i++) { sprintf(buffer, "REG %x: %x\n", i, regLoc[i]); sPrint(buffer); } + sprintf(buffer, "INSTR ADDR: %x\n", oldPsw->ptr); + sPrint(buffer); - Psw *oldPsw = (void*)PROGINT_PSW_OLD; if(oldPsw->p) { //was running in the program mode, switch back to shell exit(); //not sure if this is the best way to do it... }