Skip to content

Commit

Permalink
Merge pull request #775 from paulmenage/mapping-symbols
Browse files Browse the repository at this point in the history
decoder: Ignore AArch64 mapping symbols
  • Loading branch information
Urhengulas authored Aug 30, 2023
2 parents ca161bf + 022aca9 commit 82882c8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- [#775]: `defmt-decoder`: Ignore AArch64 mapping symbols
- [#771]: `defmt-macros`: Ignore empty items in DEFMT_LOG

[#775]: https://github.com/knurling-rs/defmt/pull/775
[#771]: https://github.com/knurling-rs/defmt/pull/771

## defmt-decoder v0.3.8, defmt-print v0.3.8 - 2023-08-01
Expand Down
18 changes: 13 additions & 5 deletions decoder/src/elf2table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,21 @@ pub fn parse_impl(elf: &[u8], check_version: bool) -> Result<Option<Table>, anyh
let mut bitflags_map = HashMap::new();
let mut timestamp = None;
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() {
Ok(name) if !name.is_empty() => name,
_ => continue,
let Ok(name) = entry.name() else {
continue;
};

if name.is_empty() {
// Skipping symbols with empty string names, as they may be added by
// `objcopy`, and breaks JSON demangling
continue;
}

if name == "$d" || name.starts_with("$d.") {
// Skip AArch64 mapping symbols
continue;
}

if name.starts_with("_defmt") || name.starts_with("__DEFMT_MARKER") {
// `_defmt_version_` is not a JSON encoded `defmt` symbol / log-message; skip it
// LLD and GNU LD behave differently here. LLD doesn't include `_defmt_version_`
Expand Down
1 change: 1 addition & 0 deletions firmware/qemu/src/bin/bitflags.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![no_std]
#![no_main]
#![allow(clippy::bad_bit_mask)]

use cortex_m_rt::entry;
use cortex_m_semihosting::debug;
Expand Down

0 comments on commit 82882c8

Please sign in to comment.