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

Commit

Permalink
adapt to upstream changes
Browse files Browse the repository at this point in the history
  • Loading branch information
japaric committed Aug 28, 2020
1 parent 96489ef commit b547eea
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
9 changes: 0 additions & 9 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ probe-rs-rtt = "0.3.0"
rustc-demangle = "0.1.16"
structopt = "0.3.15"
xmas-elf = "0.7.0"
object = "0.21.1"

[features]
defmt = ["elf2table", "decoder"]
5 changes: 2 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,10 @@ fn notmain() -> Result<i32, anyhow::Error> {
let bytes = fs::read(elf_path)?;
// TODO switch this line from xmas-elf to object
let elf = ElfFile::new(&bytes).map_err(|s| anyhow!("{}", s))?;
let obj = object::File::parse(&bytes)?;

#[cfg(feature = "defmt")]
let (table, locs) = {
let table = elf2table::parse(&obj)?;
let table = elf2table::parse(&bytes)?;

if table.is_none() && opts.defmt {
bail!(".`.defmt` section not found")
Expand All @@ -81,7 +80,7 @@ fn notmain() -> Result<i32, anyhow::Error> {
}

let locs = if opts.defmt {
let locs = elf2table::get_locations(&obj)?;
let locs = elf2table::get_locations(&bytes)?;

if !table.as_ref().unwrap().is_empty() && locs.is_empty() {
bail!("DWARF file location info not found; compile your program with `debug = 2`")
Expand Down

0 comments on commit b547eea

Please sign in to comment.