emu-rs / rustual-boy

Rustual Boy - A Virtual Boy emulator.
https://rustualboy.com/
Apache License 2.0
232 stars 30 forks source link

debugger command parsing issue #11

Closed jwestfall69 closed 7 years ago

jwestfall69 commented 7 years ago

I noticed this when adding the showcpucache debugger command.

(vb-rs 0xfff40184) > showmem
Unable to parse command: Error(Position(Eof, [104, 111, 119, 109, 101, 109]))

That should have shown memory, but instead threw the above error. Those numbers end up being "howmem". The nom stuff is a bit confusing to me, but I assume whats happening is the tag!("s") is marking the input as complete even though there are more letters after it.

yupferris commented 7 years ago

Yeah, the current parser has tons of corner cases like this, and I even had issues getting it to work properly without using a slightly older version of nom than the current one. I'm considering using another package for this; hopefully one that's not macro-based.

yupferris commented 7 years ago

I believe all the shorthands work though, so at least you should be able to use those in the interim.

jwestfall69 commented 7 years ago

yeah they do. It threw me for a bit of a loop trying to get the showcpucache command working until I put it at the top for parsing.

yupferris commented 7 years ago

Assigning this to myself as I'm currently working on it. Basically switching parser package from nom to combine; it appears to act a lot more predictably, and with a couple exceptions actually writing the parsers is a lot more straightforward. Also, we shouldn't be order-dependent anymore (as in moving around which parser is tried first).