anjiahao1 opened a new pull request, #22320:
URL: https://github.com/apache/nuttx/pull/22320

   ## Summary
   
   Add an rv-virt:gdbstub configuration. The rv-virt machine has a single
   16550 UART, so the console and the GDB stub share /dev/ttyS0. Enable
   CONFIG_SERIAL_GDBSTUB with AUTO_ATTACH and WAIT_CONNECT so that the
   serial driver registers the stub transport with the uart_dev_s
   operations.
   
   This is the transport that works for hardware breakpoints and
   watchpoints: their stop is reported from the breakpoint exception
   context, where the descriptor based transport of apps/system/gdbstub is
   not usable (the descriptor is looked up in the interrupted task's file
   table, which typically fails with -EBADF).
   
   Describe the configuration and the QEMU/GDB invocation in the rv-virt
   board documentation.
   
   ## Impact
   
   * Is new feature added? YES - new rv-virt board configuration.
   * Impact on user: NO
   * Impact on build: NO - adds a configuration, no code changes.
   * Impact on hardware: NO
   * Impact on documentation: YES - new section in the rv-virt board
     documentation.
   * Impact on security: NO
   * Impact on compatibility: NO
   
   ## Testing
   
   Build host: Linux x86_64, NuttX CI Docker image
   (ghcr.io/apache/nuttx/apache-nuttx-ci-linux).
   
   Target: rv-virt:gdbstub (RV64)
   
   ```
   tools/configure.sh -a <apps> rv-virt:gdbstub
   make -j10
   ```
   
   The configuration builds. The GDB stub waits for the debugger on
   /dev/ttyS0. Runtime check with the UART exported over TCP:
   
   ```
   qemu-system-riscv64 -M virt -bios none -kernel nuttx -display none \
     -monitor none -serial tcp:127.0.0.1:12345,server=on,wait=off
   gdb-multiarch nuttx -ex 'target remote 127.0.0.1:12345' \
     -ex 'info registers pc'
   ```
   
   GDB stops inside the stub (PC 0x80005a9e, gdb_update_regcache) and
   reads the register set, confirming that the serial GDB transport is
   reachable on the console UART.
   
   ## 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]

Reply via email to