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

Commit

Permalink
Merge #153
Browse files Browse the repository at this point in the history
153: Update to 0.2.0 r=jonas-schievink a=jonas-schievink



Co-authored-by: Jonas Schievink <[email protected]>
  • Loading branch information
bors[bot] and jonas-schievink authored Feb 22, 2021
2 parents ec2a5da + 15df936 commit 4431841
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ license = "MIT OR Apache-2.0"
name = "probe-run"
readme = "README.md"
repository = "https://github.com/knurling-rs/probe-run"
# TODO(on 0.2.0) remove the "defmt" Cargo feature
version = "0.1.9"
version = "0.2.0"

[dependencies]
addr2line = "0.14.1"
ansi_term = "0.12.1"
anyhow = "1.0.32"
arrayref = "0.3.6"
colored = "2.0.0"
defmt-decoder = { git = "https://github.com/knurling-rs/defmt", rev = "42be5f6", version = "=0.1.4", features = ['unstable'] }
defmt-decoder = { git = "https://github.com/knurling-rs/defmt", tag = "defmt-decoder-v0.2.0", version = "=0.2.0", features = ['unstable'] }
difference = "2.0.0"
gimli = "0.23.0"
log = { version = "0.4.11", features = ["std"] }
Expand All @@ -29,7 +28,3 @@ rustc-demangle = "0.1.16"
signal-hook = "0.3.4"
structopt = "0.3.15"
hidapi = "1.2.5"

[features]
# this feature does nothing and it's kept for backwards compatibility; it will be removed in the next semver bump
defmt = []
11 changes: 3 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ struct Opts {
#[structopt(long)]
list_probes: bool,

/// [DEPRECATED] This flag does nothing.
#[structopt(long, hidden(true), conflicts_with = "no_flash")]
#[allow(dead_code)]
defmt: bool,

/// The chip to program.
#[structopt(long, required_unless_one(&["list-chips", "list-probes", "version"]), env = "PROBE_RUN_CHIP")]
chip: Option<String>,
Expand Down Expand Up @@ -182,10 +177,10 @@ fn notmain() -> Result<i32, anyhow::Error> {
})?;

let (mut table, locs) = {
let table = defmt_decoder::elf2table::parse(&bytes)?;
let table = defmt_decoder::Table::parse(&bytes)?;

let locs = if let Some(table) = table.as_ref() {
let locs = defmt_decoder::elf2table::get_locations(&bytes, table)?;
let locs = table.get_locations(&bytes)?;

if !table.is_empty() && locs.is_empty() {
log::warn!("insufficient DWARF info; compile your program with `debug = 2` to enable location info");
Expand Down Expand Up @@ -450,7 +445,7 @@ fn notmain() -> Result<i32, anyhow::Error> {
frames.extend_from_slice(&read_buf[..num_bytes_read]);

loop {
match defmt_decoder::decode(&frames, table) {
match table.decode(&frames) {
Ok((frame, consumed)) => {
// NOTE(`[]` indexing) all indices in `table` have already been
// verified to exist in the `locs` map
Expand Down

0 comments on commit 4431841

Please sign in to comment.