luser / rust-gdb-remote-protocol

A Rust crate implementing the GDB Remote Serial Protocol
Apache License 2.0
33 stars 13 forks source link

rework commands to not use tuples where appropriate #50

Closed froydnj closed 6 years ago

froydnj commented 6 years ago

This is a follow-on to #49; for most Command variants, instead of implementing them with Variant(x, y, z), we implement them with Variant(s), where s is some struct with actual fields and documentation.

I didn't rework WriteRegister and WriteMemory, because the semantics there seem pretty obvious. But maybe it's worth doing them for consistency?

I'm not super-happy with remove_*_breakpoint needing a full Breakpoint structure, even though we won't bother with the condition and command lists.

One additional thing that's worth doing is wiring up the comments to link to the appropriate struct types, so it's easy to get to the appropriate documentation.

luser commented 6 years ago

I'm not super-happy with remove_*_breakpoint needing a full Breakpoint structure, even though we won't bother with the condition and command lists.

If this really bothers you you could break the relevant bits into like a BreakpointLocation struct and use that as a field in Breakpoint, but we can always see how we feel about it when we get to the point of actually using it. :)