Using detach command for disconnection#522
Using detach command for disconnection#522jreineckearm merged 1 commit intoeclipse-cdt-cloud:mainfrom
Conversation
b59727b to
8a6510f
Compare
|
Hi @jonahgraham , @asimgunes , |
jonahgraham
left a comment
There was a problem hiding this comment.
I feel out of my depth reviewing terminate/disconnect code. Can you see my review comments which are mostly just trying to understand the state of play.
In addition @thorstendb-ARM and @cwalther have done some work in this area too and I think both of them should review this if they are interested.
|
I have tried it and found that it does not affect Indel: we don’t reach this part of the code because Like in #496, this seems like a case of not clearly distinguishing between connection (which is between GDB and stub) and attachment (which is between stub and debuggee). How do we map these to DAP concepts? Probably these two issues should be looked at together. I am not sure whether making the choice between Also, if we are repurposing the I concur with Jonah on Edit 3: Having |
8a6510f to
00f2d12
Compare
|
Hi @cwalther , |
|
As you can see I don’t have much helpful guidance for you (I hope someone else does – if nothing else, it would be good to have confirmation from the Arm guys (@thorstendb-ARM? @jreineckearm?) that this isn’t breaking anything for them), but I am just wondering (and don’t have time right now to test it for myself): By the line And yes, we can discuss the |
|
Let me give it a try when I have time. We currently use two GDB servers. pyOCD should not be affected, behaves the same for detach and disconnect. I need to check J-Link GDB server. The new usage makes somewhat sense since if you consider gdb server + target hardware as the "target" in GDB world. And if you consider gdb server + target hardware as the "debugee" in DAP world. There will always be a bit of gray-area here given we are combining things which aren't all designed for embedded debug and/or have simple 1-2-1 mapping. Hence, would recommend to get guided by real-world usage. Which may become a bit of a trial-and-error exercise. Yes, I skipped that part: GDB disconnect: "It will wait for GDB (this instance or another one) to connect and continue debugging. After the disconnect command, GDB is again free to connect to another target." But then you often also have CLI args to a gdb server to steer the behavior after all connections are gone.... |
|
@datphan9798 , the one thing I'd like you to double-check is the unconditional setting of Also, there are |
Just a quick note that that’s not what I do when I have used the word debugge above and elsewhere. By debuggee I mean only the process or target hardware. The server/stub is not part of that, but part of the debugger. |
00f2d12 to
d4d0f4f
Compare
Hi @cwalther ,
Hi @jreineckearm , |
|
Thanks for updating the capability, @datphan9798 . I am afraid I have to delay this PR a little further. I just made as series tests and it does change in the states the CPUs are left in. In my case a dual-core system, where first CPU is connected by a What's more problematic is that closing the VS Code connection leaves GDB clients behind if target was "attached" and while the CPU is running. What happens is
So, in our case we can't detach while in non-paused state. Other connection parameters are at their defaults, effectively meaning
Let me see if keeping I have created #525 to cover the overall review of connection-close (and possibly connection) strategies. I don't think any of us has bandwidth to sort this right away, and it has potential to go on for a bit. Let's get this PR here to a point that it can be safely merged. And address #525 separately. I think we have more topics like this in the backlog. We should discuss during next monthly meeting how and in which order to address (also based on individuals availability for such work). |
d4d0f4f to
90c5115
Compare
|
Hi @jreineckearm , |
Yes. The exact condition for that error message can be seen here. See also #441 (comment). |
jreineckearm
left a comment
There was a problem hiding this comment.
Apologies it took that long.
No more leftover GDB processes with your latest update.
Also, no regressions in disconnect behavior seen on our end yet.
Going to merge based on no other open feedback except the general desire to review today's situation/
In remote debugging, both terminate and disconnect actions currently result in the target being halted.
This change proposes using the detach command on disconnect, allowing the target to continue running after disconnection by properly handling the detach message in the GDB server.