-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signature of bkpt() function #119
Comments
After the breakpoint is triggered, the debugger can just |
Or something completely different can happen because the debugger could completely rewrite the state, or the MCU could go into a Fault state because no debugger is attached. I thought that is exactly what the |
But the code after the |
I thought the Do you have any other idea how to produce a |
This related issue just in: rust-embedded/cortex-m-rt#139 |
The never type Re that c-m-rt issue, that's sort of correct behaviour as far as "It seems that all divergent functions (fn(..) -> !) are given the noreturn attribute" goes. Annoying that trashing LR screws with debugging of course... |
I'm still not convinced However reading the book about the never type I actually found a good, cheap and clippy happy solution to my problem:
|
119: make all exception handlers extern "C" r=adamgreig a=japaric They'll be called by the hardware and must comply to the stable C ABI. Using the Rust ABI in this case was an oversight. r? @rust-embedded/cortex-m (anyone) Co-authored-by: Jorge Aparicio <[email protected]>
I was just looking at ways to cheaply and clippy happy "terminate" an
#[entry]
function and was looking at thecortex_m::asm:bkpt()
function noticing that it has a signature ofpub fn bkpt()
. My expectation would have been that this function has a signature ofpub fn bkpt() -> !
instead which would qualify it as a terminating statement in#[entry]
.Is there a reason for
bkpt()
not returningnever
?The text was updated successfully, but these errors were encountered: