Closed bet4it closed 2 years ago
Heyo, I manually went ahead and updated the real-world examples section of the readme, adding udbserver (along with cleaning up some of the other entries, slightly differently than how you did it in this PR)
Some thoughts on udbserver
:
While I likely can't offer a full code review anytime soon, I took a brief skim through the code, and I've got some preliminary thoughts:
unsafe
usage comes from using global mut static
variables to hold on to state. Instead, you should consider using something like a static mut STATE: OnceCell<Mutex<State>> = ...
to synchronize access to this state. Alternatively, you can avoid using global state alltogether, and package your state into a struct
which the resulting caller has to manage the lifetime of.gdbstub
is being integrated into, which I simply don't have. I would suggest looking at some of examples (both in-tree and real-world) for how different folks have done it.
Hi Daniel,
After a long delay, I finally release my project udbserver which heavily bases on
gdbstub
. Thanks a lot, you save me a lot of time and make the implementation very clear!I'm a newbie to Rust and this is my first Rust project. Really hope for your advice on it to help me improve it. For example, how to reduce the use of
unsafe
, and is this possible to implement Ctrl-C in my project.Best wishes!