Support more stop reasons#170
Conversation
|
Ahhh, you gotta love the GDB RSP, eh? Every time I think we've made a reasonable choice around representing some part of the protocol, there's always gotta be a feature that makes things more complicated than needed... Looking through the docs and the code, it does appear to be the case that adding a lifetime to ...that said, this is quite an intrusive change, and would be API breaking, requiring a 0.8 release. This isn't necessarily a bad thing (0.7 has been out for quite a while at this point, it seems fine to cut a new major version), but if we're doing 0.8, there are other breaking changes I'd want to get around to implementing alongside that release as well. As such, maybe there's a stop-gap solution that would allow you to add this variant in a non breaking way, so we can release it via a 0.7.x release? Namely: lets use the fact that BaseStopReason is marked If we do that, then later one, when I get around to release 0.8, I can go and do all the proper lifetime plumbing myself, and make the breaking change alongside various other breaking changes. What do you think? Would that work? |
I will get this error: |
|
Well shoot. That's unfortunate. I didn't realize the type was Copy... I've gone ahead and spun up a new Since we're making a breaking change after all, lets go with the lifetime-based approach for the |
|
So are there any other things I can do? 😅 |
|
Apologies for the late response. I'm currently in the process of moving from Seattle to NYC, so I may be a bit slow to respond. I'm open to hearing other ideas that don't require breaking changes... but I'm afraid I don't have any clever suggestions for you. I think your best bet is to submit the PR with the necessary breaking changes over to the If you'd like to land these fork-related stop reasons into the |
|
First of all, congratulations on starting a new chapter in life! I don't really need these fork-related stop reasons, so I'll just leave them here. Also, I think the |
|
Thank you for the kind words! Moving to NYC is something I've wanted to do for a long time, so I'm excited its finally happened, hah. As for the PR - no worries, I totally understand. I've got a few weeks of "unpaid vacation" before I start my new job, and finding some time to re-invest in If you want to land this PR as is (i.e: without the |
|
@bet4it thanks for the update here (and sorry for letting this PR languish for so long!). Any chance you could update the PR description to more accurately reflect the stop reasons being added here? I can also fix that up for you if you want, up to you. I'll make sure we land these new stop reasons before the end of this weekend. Also, as for the |
Updated.
Yeah, implementing |
daniel5151
left a comment
There was a problem hiding this comment.
Figured it'd be easier to push a commit on this branch to fix up a few minor nits (wrt. naming, adding docs).
Also, I took this chance to make sure the size guards are doing the right thing, and they do indeed seem to work correctly (on my local machine).
Thank you for sending this in!
Description
This PR extends the
BaseStopReasonenum to support reporting dynamic library changes and process forking events to the GDB client.New Stop Reasons
Library(Tid)Tidof the thread reporting the event.Fork { cur_tid, new_tid }forksystem call, creating a new child process.cur_tid: The thread ID of the parent (current thread).new_tid: The thread ID/Process ID of the newly created child.VFork { cur_tid, new_tid }vforkevent. Similar tofork, but implies the parent is suspended and shares address space with the child untilexecor exit.Fork(cur_tid,new_tid).VForkDone(Tid)vforkhas completed its initialization (calledexecor exited), allowing the parent process to resume.Tidof the parent thread.Based on GDB documentation: Stop Reply Packets.
API Stability
Checklist
rustdocformatting looks good (viacargo doc)examples/armv4twithRUST_LOG=trace+ any relevant GDB output under the "Validation" section below./example_no_std/check_size.shbefore/after changes under the "Validation" section belowexamples/armv4t./example_no_std/check_size.sh)Archimplementation