Ensure 'interrupt' and 'disconnect' signals are sent before '-gdb-exit' #338
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previous PRs (i.e #292 and #289) do not include an
await
when sending interrupt/disconnect signals if the debugger is running. This causes the-gdb-exit
command to be written and queued before the interrupt/disconnect signals.An alternate, equivalent solution would look like:
I did read over #292 (comment) and #292 (comment). I'm not encountering any issues with using
await
instead of.then
. I manually tested this on our IDE withyield
operators, and it worked fine. After looking atGDBBackend::sendCommand
, there doesn't seem to be any reasonawait
doesn't work. The returnedPromise
does not resolve until the MI parser receives a response, which guarantees that the command was sent already (that tracks right?):cdt-gdb-adapter/src/gdb/GDBBackend.ts
Lines 163 to 196 in 44fda62
If we decide to keep
.then
, there is still a missingawait
(as noted above in the equivalent solution).As you noted in https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter/pull/292/files#r1330234785, this does not fix #295, but that issue is causing us some problems too, so I'll spend some time on that as well.