Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Adds new backtrace options to readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
BriocheBerlin committed Aug 26, 2021
1 parent 92bf783 commit d118e29
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,35 @@ $ echo $?

⚠️ **NOTE** when you run your application with `probe-run`, the `HardFault` handler (default or user-defined) will *NOT* be executed.

### Forcing backtraces
### Backtrace options
#### --backtrace

If you'd like to see a backtrace at the end of successful program runs as well, you can enable this by setting the `--force-backtrace` flag:
The `--backtrace` flag is optional and can get passed the following values:

* `--backtrace=always` - forced backtrace (if you'd like to see a backtrace at the end of successful program run)
* `--backtrace=never` - suppresed backtrace
* `--backtrace=auto` - default, shows a backtrace if the program panics or the stack overflows

Run it like this (example for a forced backtrace):

``` console
$ cargo run --bin hello --backtrace=always
```

#### --backtrace-limit

The `--backtrace-limit` flag is optional and defaults to 50. It is possible to set any number.

`--backtrace-limit=0` is accepted and means "no limit".

To show a shortened backtrace showing 5 frames, run:

``` console
$ cargo run --bin hello --force-backtrace
$ cargo run --bin panic --backtrace-limit=5
```

Note: if `--backtrace=never` is set, setting `--backtrace-limit` has no effect.

## Troubleshooting

### `probe-run --list-probes` says "No devices were found."
Expand Down

0 comments on commit d118e29

Please sign in to comment.