Skip to content
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

add panic-probe #49

Merged
merged 1 commit into from
Aug 4, 2020
Merged

add panic-probe #49

merged 1 commit into from
Aug 4, 2020

Conversation

japaric
Copy link
Member

@japaric japaric commented Aug 4, 2020

this panic handler makes probe-run exit with exit-code=134 (SIGABRT)
closes #41

$ cd nrf52
$ cargo rb panic
0.000000 INFO main
stack backtrace:
   0: 0x000002be - __bkpt
   1: 0x000002bc - panic_probe::__cortex_m_rt_HardFault
   2: 0x0000036a - HardFault
      <exception entry>
   3: 0x000002d0 - __udf
   4: 0x000002b2 - cortex_m::asm::udf
   5: 0x000002a8 - rust_begin_unwind
   6: 0x0000025a - core::panicking::panic_fmt
   7: 0x00000250 - core::panicking::panic
   8: 0x00000162 - panic::__cortex_m_rt_main
   9: 0x00000108 - main
  10: 0x00000286 - Reset
$ echo $?
134

this panic handler makes `probe-run` exit with exit-code=134 (SIGABRT)
Copy link
Contributor

@jonas-schievink jonas-schievink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Would be good to test this behavior though.

@japaric
Copy link
Member Author

japaric commented Aug 4, 2020

"Why 134/SIGABRT?" -> no particular reason. I see that std::panic! yields a 101 exit code so we might as well use that value.

@japaric japaric merged commit 36e5280 into main Aug 4, 2020
@japaric japaric deleted the panic-probe branch August 4, 2020 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

probe-run: device emitted non-zero exit code
2 participants