yangsong8-a1 opened a new pull request, #21715:
URL: https://github.com/apache/nuttx/pull/21715

   ## Summary
   - In the panic "Press Y/y" loop, read a character only when the UART
     reports rx data available. Before, `ch` could stay uninitialized (or come
     from a blocking receive()), so the stub could enter gdb mode without a
     key press. The duplicated org_ops/console branches are merged.
   - Put the SERIAL_GDBSTUB sub-options in an `if SERIAL_GDBSTUB` block. No
     functional change.
   - Add SERIAL_GDBSTUB_WAIT_CONNECT (depends on SERIAL_GDBSTUB_AUTO_ATTACH).
     When it is enabled, boot stops in uart_gdbstub_register() until gdb
     connects, so code that runs later during boot can be debugged.
   ## Impact
   Only boards with SERIAL_GDBSTUB. The new option is off by default. Kconfig
   symbol names are unchanged, and the existing gdbstub defconfigs stay the
   same after savedefconfig.
   ## Testing
   Ubuntu 22.04, gcc 13.1, aarch64-none-elf-gcc, arm-none-eabi-gcc 10.3.
   - sim:nsh with LIB_GDBSTUB + SERIAL_GDBSTUB on /dev/ttySIM0 (host PTY),
     with AUTO_ATTACH=y (WAIT_CONNECT n/y), and AUTO_ATTACH=n with
     PANIC_TIMEOUT 3 and 0; each commit builds. No warnings.
   - qemu-armv8a:gdbstub (WAIT_CONNECT n/y), qemu-armv7a:gdbstub,
     mps3-an547:gdbstub, stm32f429i-disco:gdbstub: no new warnings.
   - sim runtime test. A host script talks GDB remote protocol on the PTY:
   ```
   auto:    boot reached nsh: True
   auto:    ctrl-c -> stop packet b'T05thread:1;'  '?' -> b'S00'
   auto:    nsh alive after detach: True                      PASS
   wait:    nsh before gdb connected: False
   wait:    stop packet on connect b'T05thread:1;'
   wait:    nsh after gdb released boot: True                 PASS
   panic:   Press Y/y key in 3 seconds -> timeout message after 3.0s  PASS
   panic-y: entered gdbstub mode after 'y': True              PASS
   ```
   


-- 
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]

Reply via email to