aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <japaricious@gmail.com> 2017-03-12 11:46:33 -0500
committerGravatar Jorge Aparicio <japaricious@gmail.com> 2017-03-12 11:47:15 -0500
commit83945819af5a724ba9175fdc5e22b7c854a0fc14 (patch)
tree468db2846c873d880a870162a2c46abd1e340b47
parent8fd028a8d68975d801ce01bfde5f76733c5be7a0 (diff)
downloadcortex-m-83945819af5a724ba9175fdc5e22b7c854a0fc14.tar.gz
cortex-m-83945819af5a724ba9175fdc5e22b7c854a0fc14.tar.zst
cortex-m-83945819af5a724ba9175fdc5e22b7c854a0fc14.zip
default exception handler: identify the exception that's being serviced
-rw-r--r--CHANGELOG.md5
-rw-r--r--src/exception.rs5
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ab28447..8f95aba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
+### Changed
+
+- The default exception handler now identifies the exception that's being
+ serviced.
+
## [v0.2.0] - 2017-03-11
### Added
diff --git a/src/exception.rs b/src/exception.rs
index f5c8c28..f5b52f6 100644
--- a/src/exception.rs
+++ b/src/exception.rs
@@ -156,10 +156,13 @@ pub extern "C" fn default_handler<T>(_token: T)
where
T: Context,
{
- // This is the actual exception handler. `_sf` is a pointer to the previous
+ // This is the actual exception handler. `_sr` is a pointer to the previous
// stack frame
#[cfg(target_arch = "arm")]
extern "C" fn handler(_sr: &StackedRegisters) -> ! {
+ // What exception is currently being serviced
+ let _e = Exception::current();
+
::asm::bkpt();
loop {}