blackmagic-debug / blackmagic

In application debugger for ARM Cortex microcontrollers.
GNU General Public License v3.0
3.13k stars 759 forks source link

Fix: Ensure F-packet replies from gdb are reliably detected #1848

Closed TechnoMancer closed 1 week ago

TechnoMancer commented 1 week ago

Detailed description

Collaborative inspection of debug logs from #1845 and provided by others pointed to inconsistent behaviour dealing with remote file i/o completion, which was narrowed down to the F-packet reply check being done after the packet had been processed and the packet buffer possibly clobbered.

This is corrected by checking if the received packet is an F-packet first then processing it and using the result of the check to exit the loop after the processing.

Your checklist for this pull request

Closing issues

Fixes #1845.