Skip to content

Commit

Permalink
Merge #389
Browse files Browse the repository at this point in the history
389: Update decoder dependencies r=japaric a=jonas-schievink

This deduplicates `object` and `gimli`, once probe-run has been
updated after this

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
  • Loading branch information
bors[bot] and jonas-schievink authored Feb 15, 2021
2 parents c0773af + 499473e commit d457217
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ log = { version = "0.4.13", features = ["std"] }

# elf2table
anyhow = "1.0.32"
gimli = "0.22.0"
gimli = "0.23.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1"

# elf2table
[dependencies.object]
version = "0.21.0"
version = "0.22.0"
default-features = false
features = ["read_core", "elf", "std"]

Expand Down
12 changes: 6 additions & 6 deletions decoder/src/elf2table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::{

use crate::{StringEntry, Table, TableEntry, Tag};
use anyhow::{anyhow, bail, ensure};
use object::{Object, ObjectSection};
use object::{Object, ObjectSection, ObjectSymbol};

/// Parses an ELF file and returns the decoded `defmt` table.
///
Expand All @@ -38,10 +38,10 @@ fn parse_impl(elf: &[u8], check_version: bool) -> Result<Option<Table>, anyhow::
let is_defmt_version = |name: &str| {
name.starts_with("\"_defmt_version_ = ") || name.starts_with("_defmt_version_ = ")
};
for (_, entry) in elf.symbols() {
for entry in elf.symbols() {
let name = match entry.name() {
Some(name) => name,
None => continue,
Ok(name) => name,
Err(_) => continue,
};

// Not in the `.defmt` section because it's not tied to the address of any symbol
Expand Down Expand Up @@ -89,11 +89,11 @@ fn parse_impl(elf: &[u8], check_version: bool) -> Result<Option<Table>, anyhow::
// second pass to demangle symbols
let mut map = BTreeMap::new();
let mut timestamp = None;
for (_, entry) in elf.symbols() {
for entry in elf.symbols() {
// Skipping symbols with empty string names, as they may be added by
// `objcopy`, and breaks JSON demangling
let name = match entry.name() {
Some(name) if !name.is_empty() => name,
Ok(name) if !name.is_empty() => name,
_ => continue,
};

Expand Down

0 comments on commit d457217

Please sign in to comment.