From e084fc8fb401d30b7798bbeafd2128ed85e758b4 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sat, 1 Aug 2020 16:11:56 -0700 Subject: [PATCH] Add synthetic IntegerDivideByZero exception The ROM routine __divsi3 is called by code whenever a division is needed, because there is no divide unit on the ESP8266 core. When the divide routine in ROM hits a div-by-zero case, it jumpt to an ILL(egal instruction) at a fixed address which causes a HW exception 0 (IllegalInsnException). In the postmortem dump, when an ILL exception is detected at this address in ROM, convert it to a DivByZeroException for printout (6). Divde by zero errors now print as follows: ```` --------------- CUT HERE FOR EXCEPTION DECODER --------------- Exception (6): epc1=0x4000dce5 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000 >>>stack>>> ... <<