Closed agarciadom closed 1 week ago
Thanks for this good patch. I'd like to merge it ASAP. Can you please just add a commit that bumps the version by +0.0.1 for the modified bundle? As it's the first change since it's last released, this is required to bump the version before creating a new build.
Sure! I have pushed another commit that bumps up lsp4e.debug from 0.15.8 to 0.15.9.
thanks
We have started to experiment with replacing our custom debuggers in the Eclipse Epsilon project with LSP4E-based debuggers, and we've noticed one odd issue when we stop at a breakpoint and then resume and let the program stop. This pull request proposes a workaround for the issue for the time being - the deeper issue seems to be how to handle the case where a
continue
request resumes all threads.Scenario
In one of our test programs, we have a main thread T1 start, then another thread T2 starts and stops at a breakpoint. In the Epsilon debug adapter, we stop all threads when we hit a breakpoint, so our
stopped
event provides both the specific thread that hit the breakpoint, and also callssetAllThreadsStopped(true)
. Our program stops as expected, like this:I press F8 to continue (which continues all threads: we indicate this in our response to the
continue
request by callingsetAllThreadsContinued(true)
), and hit the next breakpoint as usual:I press F8 once more, and the program finishes successfully, but I'm left with this odd state:
From what I gathered by debugging, it looks like resuming the thread did not clear the
isSuspended
flag from the other thread, despite the response from the debug adapter that all threads had been continued. I saw that we got to this part of DSPThread just fine, and the resume event was fired:However, I did not notice the
continued()
method being called for the other thread, despite this response. We send outthread
start and exit events, so if those events are processed in time before theterminated
event then the threads are removed by the time the program exits, but it's not always the case.Workaround
I propose changing the
isSuspended()
method inDSPThread
so it won't returntrue
if the program is terminated. This fixes the issues around showing terminated threads in a program as paused or as available to be resumed. This small change results in the desired output: