Skip to content

Commit

Permalink
Support bitflags 2.x, fixing humility dump (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter authored Feb 5, 2024
1 parent 94ed14a commit 0e6aa42
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name = "humility"
#
# Be sure to check in and push all of the files that change. Happy versioning!
#
version = "0.10.37"
version = "0.10.38"
authors = ["Bryan Cantrill <bryan@oxide.computer>"]
edition = "2018"
license = "MPL-2.0"
Expand Down
7 changes: 6 additions & 1 deletion humility-core/src/hubris.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,12 @@ impl HubrisArchive {

let base_offs = self.member_offset(desc, "base")?;
let size_offs = self.member_offset(desc, "size")?;
let attr_offs = self.member_offset(desc, "attributes.bits")?;

// bitflags 1.x versus 2.x encode bitfields differently
let attr_offs = self
.member_offset(desc, "attributes.bits")
.or_else(|_| self.member_offset(desc, "attributes.__0"))
.context("could not find attributes.bits")?;

//
// Regrettably copied out of Hubris -- there isn't DWARF for this.
Expand Down
4 changes: 2 additions & 2 deletions tests/cmd/chip.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For more information try --help

```
$ humility --chip this-can-be-anything -V
humility 0.10.37
humility 0.10.38

```

Expand All @@ -28,7 +28,7 @@ For more information try --help

```
$ humility -c apx432 -V
humility 0.10.37
humility 0.10.38

```

4 changes: 2 additions & 2 deletions tests/cmd/version.trycmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Long version flag:

```
$ humility --version
humility 0.10.37
humility 0.10.38

```

Short version flag:

```
$ humility -V
humility 0.10.37
humility 0.10.38

```

0 comments on commit 0e6aa42

Please sign in to comment.