changeset 141:a237afb2f8a0

Also print the instruction address on failure
author Jonathan Pevarnek <pevarnj@gmail.com>
date Thu, 22 Sep 2011 14:22:55 -0400
parents 6179de7276a0
children ce04ebdd00e2
files src/os/except.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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...
 	}