-
Notifications
You must be signed in to change notification settings - Fork 158
Fix crash on missing register description in SVD file #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @therealprof (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I haven't looked in detail but maybe we could add the no description text earlier than when generating the output. Oh, and would be great if the no-description description was a bit shorter; no need to be verbose here... |
@therealprof That |
@Disasm It's a bit unfortunate that we're using the parsed SVD, patch it up and turn it into code all in the same place. Instead it'd be great if we had a pass which used the parsed SVD, checks whether it makes sense, cleans up the odds bits and fills in missing bits so we finally just dump the consistent information into code. |
@therealprof how about an empty String ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@therealprof A slight hint would be nice, so ""
is not ideal. I'll leave it up to you to figure out what that is, surprise me with a short and descriptive comment. 😉
Well that was my version of Slight hint ;) I'll just put "Dummy description" ? Or maybe "Bad SVD" ? |
Well, descriptions are optional so "Bad SVD" would be technically wrong. It should be something which hints to the "problem" at hand, so "Nothing" or just "No description" would work for me. While you are at it, please add a line to the CHANGELOG and rebase the commit. |
Hm, coming to thing of it an empty String would also be acceptable (if Rust accepts that). |
Continue with a dummy description and print name of the problematic register instead of just bailing out. Signed-off-by: Aurabindo Jayamohanan <mail@aurabindo.in>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
bors r+ |
369: Fix crash on missing register description in SVD file r=therealprof a=aurabindo SVDs available for DA1469x from https://www.keil.com/dd2/pack have few registers with missing `<description>` and this causes svd2rust to crash. This PR enables to continue with a dummy description and print name of the problematic register instead of just bailing out. Co-authored-by: Aurabindo Jayamohanan <mail@aurabindo.in>
Build succeeded |
SVDs available for DA1469x from https://www.keil.com/dd2/pack have few registers with missing
<description>
and this causes svd2rust to crash.This PR enables to continue with a dummy description and print name of the
problematic register instead of just bailing out.