-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Multiprocess debugging #124
Comments
I think the only thing that needs to be implemented is
This would then be followed by
Since |
Unfortunately, I don't think it's quite that simple. While implementing The big feature in A great example of this is something like this: gdbstub/src/stub/core_impl/base.rs Lines 345 to 351 in 85ff370
See how That means if you tried to Similarly, there's code like this as well: Lines 125 to 126 in 85ff370
Namely: ...things like that are why the correct solution here would be to plumb through a whole new |
I see -- I thought "multiprocess" meant "inferior support", which seems to be mostly managed by the GDB client itself. That is, when debugging multiple concurrent processes, it's the job of the GDB client to launch multiple processes or initiate connections via the bridge, and it's not the job of the bridge to make those connections. Accordingly, there is no way to get a list of running processes with I suppose |
Unless I'm misunderstanding something, I don't believe there's much distinction at the GDB RSP layer between "managed" inferiors vs. "attached" inferiors, aside from some client-side book-keeping regarding whether the process should be terminated on disconnect, vs. automatically resumed, among other similar trivialities. A process is a process, regardless if the GDB client has told the remote stub to spin it up itself vs. asking the remote host for a list of processes + attaching to some existing one.
I think a better way to think about it is in the sense that |
With #129 I'm able to switch processes. The hardest part is that When attaching to a new process, GDB sends |
Oh, interesting! After doing a bit of reading, it might be the case that unless you specifically spin up a new "inferior" prior to doing a vAttach, GDB assumes you're all done with the last process and detaches from it... I've never actually played around with the semantics of multi-process debugging in GDB myself, but now you've got me interested to poke around and see what the different behaviors are (i.e: get a little Of course, that's neither here nor there wrt. how The changes in #129 will likely unblock your use-case of "debug a single process at a time, with the ability to jump between which process is being debugged", but it's not tenable for the sort of true "multiple attached processes" type debugging that this tracking issue encompasses. |
With the recent merge, I've created betrusted-io/xous-core#360 which implements full support for GDB with Xous, including debugging processes in a live device. Switching processes is now possible, though without As you note, it's not true multiprocess support, but I think it's still pretty neat regardless! |
Yep, it's a huge first step towards getting "true" multiprocess support in Of course, it'd be great to land support for |
gdbstub
already implements protocol-level multiprocess extensions "under-the-hood", and simply hard-codes a fake PID in single/multi-threaded mode (much the same way it hard-codes a fake TID in single-threaded mode).Adding true multiprocess debugging will most likely involve adding a new
target::ext::base::multiprocess
API set, along with doing the requisite plumbing to track and report the current PID.In addition, we'd want to add a new in-tree
armv4t_multiprocess
example, which wouldn't actually spin up multiple processes, but would instead spin up multiple multi-corearmv4t
emulator instances, just so there's an in-tree example of this stuff working.Why API-breaking? Unfortunately, I neglected to mark the
BaseOps
enum asnon_exhaustive
, which means implementing this will be a breaking change. Aside from that, this likely could've been entirely non-breaking...The text was updated successfully, but these errors were encountered: