From f38117774f14758888268ba36f867567a18a127f Mon Sep 17 00:00:00 2001 From: pca006132 Date: Mon, 28 Feb 2022 21:15:07 +0800 Subject: [PATCH] runtime/eh_artiq: updated exception IDs Fixes #166 --- src/runtime/src/eh_artiq.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/runtime/src/eh_artiq.rs b/src/runtime/src/eh_artiq.rs index 281a60c..797b838 100644 --- a/src/runtime/src/eh_artiq.rs +++ b/src/runtime/src/eh_artiq.rs @@ -273,7 +273,7 @@ pub unsafe extern fn raise(exception: *const Exception) -> ! { error!("too many nested exceptions"); // TODO: better reporting? let exception = Exception { - id: get_exception_id("runtimeerror"), + id: get_exception_id("RuntimeError"), file: file!().as_c_slice(), line: line!(), column: column!(), @@ -405,13 +405,17 @@ extern fn stop_fn(_version: c_int, } } -static EXCEPTION_ID_LOOKUP: [(&str, u32); 6] = [ - ("runtimeerror", 0), +static EXCEPTION_ID_LOOKUP: [(&str, u32); 10] = [ + ("RuntimeError", 0), ("RTIOUnderflow", 1), ("RTIOOverflow", 2), ("RTIODestinationUnreachable", 3), ("DMAError", 4), ("I2CError", 5), + ("CacheError", 6), + ("SPIError", 7), + ("ZeroDivisionError", 8), + ("IndexError", 9) ]; pub fn get_exception_id(name: &str) -> u32 {