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

parsing error on complete instruction #9

Open
p8nut opened this issue Apr 30, 2020 · 1 comment
Open

parsing error on complete instruction #9

p8nut opened this issue Apr 30, 2020 · 1 comment

Comments

@p8nut
Copy link

p8nut commented Apr 30, 2020

when b3 try to parse this instruction i get this error

arch_prctl(0x3001 /* ARCH_??? */, 0x7ffe4887f480) = -1 EINVAL (Invalid argument)
[PARSE ERROR] SyntaxError: Expected [0-9] but "A" found.

the full command here

strace -f ./a.out |& b3  -s
{"syscall":"execve","args":["./a.out",["./a.out"],140724292233112,"..."],"result":0,"timing":null,"pid":null,"type":"SYSCALL"}
{"syscall":"brk","args":[],"result":32165888,"timing":null,"pid":null,"type":"SYSCALL"}
[PARSE ERROR] SyntaxError: Expected [0-9] but "A" found.

it seem odd, because the instruction look complete (maybe the comment in the first parameter is the reason).

@p8nut
Copy link
Author

p8nut commented Apr 30, 2020

i'm no expert un peg but it seem that this could do the job

_ = space comment { return undefined }
space = [ \t\n\r]* 

comment = space p:(single / multi)*
single = '//' p:([^\n]*) {return p.join('')}
multi = "/*" inner:(!"*/" i:. {return i})* "*/" {return inner.join('')}

thanks to:
https://stackoverflow.com/questions/26556586/peg-js-how-to-parse-c-style-comments

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

1 participant