Skip to content
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

some InvalidXML and StreamTooLong errors #1

Open
markfirmware opened this issue Feb 29, 2020 · 3 comments
Open

some InvalidXML and StreamTooLong errors #1

markfirmware opened this issue Feb 29, 2020 · 3 comments

Comments

@markfirmware
Copy link
Contributor

markfirmware commented Feb 29, 2020

I'd like to add a mission to my microbit repo that uses svd2zig on nrf51.svd. There was a sentinel error on a previous svd2zig and zig/master combo but that has since been eliminated. However, before I discovered that the problem was eliminated I wrote this script and discovered a lot of the posborne svd files had either InvalidXML or StreamTooLong errors.

  1. I ran xmllint on all of the invalid ones and it did not report any issues.

  2. Do you have any immediate insight into the StreamTooLong errors?

Regards,
Mark

#!/bin/bash

for f in $(find cmsis-svd -iname '*.svd' | sort)
do
    zig-cache/bin/svd2zig $f 2> errors > /dev/null
    if [[ $? != 0 ]]
    then
        error=$(grep -i error: errors)
        if [[ $? != 0 ]]
        then
            echo $f
            cat errors
        else
            echo $f $error
        fi
    fi
done
@justinbalexander
Copy link
Owner

Hey Mark, as stated in the readme, I wrote only enough to translate the specific svd file I needed so I know there are plenty of valid svd fields that are not parsed currently.

Can you link me to one that generates the StreamTooLong error? That comes from within the std lib so I'm not sure.

@markfirmware
Copy link
Contributor Author

I found that the StreamTooLong is fixed by increasing the line buffer from 1024 to 1024 * 1024. I’ll send a pr for that next week. Cheers, Mark.

@markfirmware
Copy link
Contributor Author

#5

Moved from stack to global because of size. Of 658 .svd files, 159 report invalid xml and the stream too long errors are eliminated. Next week will see if the invalid xml errors can be replaced with a more specific message of which tag is not recognized.

FYI ziglang/zig#4593 is what happens if 10MB is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants