anjiahao1 opened a new pull request, #22415: URL: https://github.com/apache/nuttx/pull/22415
## Summary Return the actual byte count from uart_gdbstub_receive(). The receive loop kept calling rxavailable() when the port had no data, so a request larger than the available data would spin there forever. The function also returned len unconditionally, even when fewer bytes were read, which feeds the stub uninitialized data. Stop the loop when the port has nothing to read and return the number of bytes actually received. ## Impact * Is new feature added? NO - receive path fix. * Impact on user: NO * Impact on build: NO * Impact on hardware: NO * Impact on documentation: NO * Impact on security: NO * Impact on compatibility: NO ## Testing Build host: Linux x86_64, arm-none-eabi-gcc 12.2. ``` tools/configure.sh -a <apps> qemu-armv7a:gdbstub make -j10 ``` The build completes with the changed receive path compiled in. ## PR verification * [x] This PR introduces only one functional change. * [x] I have updated all required description fields above. * [x] My PR adheres to Contributing Guidelines and Documentation. * [ ] My PR is still work in progress (not ready for review). * [x] My PR is ready for review and can be safely merged into a codebase. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
