-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add mips stub #1
Conversation
Thanks for pulling these changes in - now I can properly examine and understand the behavior on MIPS. And after playing around with it, I finally understand the point you were trying to get through in daniel5151/gdbstub#92. Namely: MIPS is an interesting case where the mainline GDB client never uses the Fascinating. Presumably, the rationale was "well, MIPS hardware doesn't have hardware assisted single step, so why even consider that code path in the GDB client? Keep the code simple, and just always use the breakpoint + continue approach!". Of course, as it turns out, not all remote targets need abide by the rules of "real" hardware. e.g: GDB stubs can be very useful in emulated contexts as well, where you can easily support hardware-level single step (even on a MIPS platform). Arguably, this is something the upstream GDB client might want to look into fixing / adding support for. While not strictly a bug, I'd argue that if a MIPS target does support single-step via Now, as to how this related back to the various questions / concerns you had regarding And to address your concern in daniel5151/gdbstub#92 (comment):
I finally understand what you meant by this. And in this case, the guard rail that covers this is That said, I think there is merit to making this point more obvious, so I'll update the docs of
Now, an interesting follow-up question is whether it makes sense to extend /// Describes how the mainline GDB client handles single-step support (or lack thereof) on a particular architecture.
enum SingleStepGdbBehavior {
/// GDB will use single-stepping if available.
///
/// e.g: ARM
Optional,
/// GDB will unconditionally send single-step packets, and the target is _required_ to handle these requests.
///
/// e.g: x86/x64
Required,
/// GDB never uses single-stepping, regardless if it's supported by the stub.
///
/// e.g: MIPS
Ignored,
} If we do this, then we can add some other guard-rail code to warn users that've implemented the single-step IDET while using a platform where it will never be invoked. i.e: compliment the existing |
I've updated this PR with some cleanup + README updates. Please let me know if things look good, and I'll merge ASAP. |
Yeah! That's what I want. And the name
It's better than now, but the thing gets to be a bit too complicated, so I suggested that we can just remove all the guard rails and let the user choose what they want (Oh, I know you won't accept this, so just ignore me!)
LGTM😃 |
These changes are guided by discussion in: - daniel5151/gdb-optional-step-bug#1 - #92 And in addition, address this minor nit: - 5bc5831#commitcomment-63859961
Alrighty, I've updated I've also tweaked the method names + docs to be very clear about their purposes (i.e: including the term Note that one thing included in these changes that I didn't mention in the comment above is the addition of Ideally, we want all Thanks again for putting in the legwork to provide a working example of this behavior. English is a messy way to exchange ideas and concepts - code seems to work much better 😄 |
Why you can't test all the existing arches by yourself? All you need is just copy & paste |
Yeah... I admit, compared to the last time something like this happened (i.e: the introduction of That said, i'm back on the 9-5 grind after a nice long weekend, which means I'm back to being busy. My plan now is to find an hour to squeeze in some last minute fixes (I discovered that watchpoints have been kinda broken in multithreaded contexts for a while now...), and finally push 0.6 out the door. It's loooong overdue for a release, and I hate having it on my backlog. That said, given that these changes would all be non-breaking and land in |
You don't want to do this, let me help you🙂