Vector35 / Vector35/binaryninja-api
Relax SVD file parsing to allow for loading of more files
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 298
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 19
Description
SVD files are just xml files that follow a spec defined here, as such many vendors do not actually follow the spec 🥹. Right now our parser we use for SVD import (https://github.com/rust-embedded/svd) expects the parsed file to not have empty children for certain fields:
[SVD] Failed to parse SVD file: In device `MT7697`
[SVD]
[SVD] Caused by:
[SVD] 0: Parsing unknown addressUnitBits at 18:3
[SVD] 1: Expected content in <addressUnitBits> tag, found none
We will need to fork the svd parser and then try and get the relaxations upstreamed, as I am sure there are some other people who would like to parse these malformed svd files.
Some interesting places to look (specifically for the error above):
I don't think this is very high priority because you can usually just get away with fixing up the svd file, but it would be nice if we just let them be loaded, with maybe some warning about it being invalid.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading svd-parser/src/device.rs around lines 40-42 and svd-parser/src/lib.rs around lines 95-111, then reproduce the empty addressUnitBits failure with a malformed SVD file. Determine how to fork the parser so these empty fields can load, with an optional invalid-file warning, and verify that the affected SVD imports complete successfully. Upstream the relaxation when the behavior is confirmed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- reverse-engineering, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100