Try to be more helpful (#2044)

This commit is contained in:
Dániel Buga 2024-08-30 13:46:25 +02:00 committed by GitHub
parent aacc001e5d
commit 897c92e389
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -33,7 +33,7 @@ pub use context::Context;
/// general exceptions, which vector to the user, kernel, or double-exception
/// vectors).
#[allow(unused)]
#[derive(Debug)]
#[derive(Debug, PartialEq)]
#[repr(C)]
pub enum ExceptionCause {
/// Illegal Instruction

View File

@ -134,6 +134,14 @@ unsafe extern "C" fn __default_exception(cause: ExceptionCause, save_frame: &mut
#[no_mangle]
#[link_section = ".rwtext"]
extern "C" fn __default_user_exception(cause: ExceptionCause, save_frame: &Context) {
#[cfg(any(feature = "esp32", feature = "esp32s3"))]
if cause == ExceptionCause::Cp0Disabled {
panic!(
"Access to the floating point coprocessor is not allowed. You may want to enable the `float-save-restore` feature of the `xtensa-lx-rt` crate. {:08x?}",
save_frame
)
}
panic!("Exception: {:?}, {:08x?}", cause, save_frame)
}