This comes from https://sourceware.org/bugzilla/show_bug.cgi?id=30678#c1. gdb does not send the DAP "terminated" event. Apparently VSCode needs this to know that debugging is done. The DAP spec seems a little unclear on this point, as it seems to me that the exited event should have been enough...
Created attachment 15011 [details] patch It isn't super clear to me exactly when this ought to be sent. This should work for ordinary cases at least.
I've tested this patch. Seems to work correctly! Thanks!
Thank you for this and your other testing. It's very helpful. https://sourceware.org/pipermail/gdb-patches/2023-July/201133.html
The master branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=21db866dc69c481cd79b4d739c2170a7ef9b98fd commit 21db866dc69c481cd79b4d739c2170a7ef9b98fd Author: Tom Tromey <tromey@adacore.com> Date: Tue Jul 25 09:16:35 2023 -0600 Implement DAP 'terminated' event This implements the DAP 'terminated' event. Vladimir Makaev noticed that VSCode will not report the debug session as over unless this is sent. It's not completely clear when exactly this event ought to be sent. Here I've done it when the inferior exits. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30681
Fixed.