static void DPKG_ATTR_NORET run_error_handler(void) { if (onerr_abort) { /* We arrived here due to a fatal error from which we cannot recover, * and trying to do so would most probably get us here again. That's * why we will not try to do any error unwinding either. We'll just * abort. Hopefully the user can fix the situation (out of disk, out * of memory, etc). */ print_abort_error(_("unrecoverable fatal error, aborting"), econtext->errmsg); exit(2); } if (econtext == NULL) { print_abort_error(_("outside error context, aborting"), econtext->errmsg); exit(2); } else if (econtext->handler_type == HANDLER_TYPE_FUNC) { econtext->handler.func(); internerr("error handler returned unexpectedly!"); } else if (econtext->handler_type == HANDLER_TYPE_JUMP) { longjmp(*econtext->handler.jump, 1); } else { internerr("unknown error handler type %d!", econtext->handler_type); } }
void c_abort_data_handler(unsigned int address, unsigned int errorType, unsigned int accessedAddr, unsigned int fault_reg) { bool doubleFault = in_fault == true; in_fault = true; // NOTE: fault_reg isn't used (yet), we should just use that and extract the Fault status from // it here as opposed to doing it in asm and pass it in as a separate argument printf("Instruction in %s at 0x%h caused a data abort accessing memory at 0x%h (", Debug_GetClosestPreviousFunction(address), address, accessedAddr); print_abort_error(errorType); printf(")\n"); //Debug_PrintCallstack(2); wait(INTERRUPT_HANDLER_DELAY); in_fault = false; // Temporarily allow double faults due to bug with the translation tables // when switching tasks /* if (doubleFault) double_fault();*/ }
void c_abort_instruction_handler(unsigned int address, unsigned int errorType) { bool doubleFault = in_fault == true; in_fault = true; if (*(unsigned int*)address == 0xE1200070) { printf("* * Breakpoint! * * \n"); } else { printf("Instruction at 0x%h (value: %d) caused instruction abort ", address, *(unsigned int*)address); print_abort_error(errorType); } wait(INTERRUPT_HANDLER_DELAY); in_fault = false; if (doubleFault) double_fault(); }
static void print_cleanup_error(const char *emsg, const void *data) { print_abort_error(_("error while cleaning up"), emsg); }