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

   ## Summary
   
   Add tools/minidumpserver.py, a host-side GDB server that reconstructs a
   NuttX crash context from a serial crash log and the matching NuttX ELF,
   so GDB can inspect registers and memory without a live debug probe.
   
   - Parse the register dump and stack dump lines from the crash log, and
     read-only memory from the ELF sections.
   - Optionally load raw memory images (-r) and NuttX coredump files (-c).
   - Serve the subset of the GDB remote protocol needed for inspection:
     registers, memory, and the state GDB needs for backtraces.
   - Support the arm, arm-a, arm-t, riscv, esp32s3 and xtensa register
     layouts.
   - Optionally start GDB automatically (-g) or resolve stack addresses
     with addr2line (-t).
   - Add Documentation/guides/minidumpserver.rst with a worked esp32s3
     example.
   
   ## Impact
   
   * Is new feature added? YES - a host-side debugging tool; no target
     code is changed.
   * Impact on user: NO
   * Impact on build: NO
   * Impact on hardware: NO
   * Impact on documentation: YES - new guide under Documentation/guides.
   * Impact on security: NO
   * Impact on compatibility: NO
   
   ## Testing
   
   Lint: tools/checkpatch.sh -m -g passes, which runs black, flake8 (with
   .github/linters/setup.cfg) and isort on tools/minidumpserver.py.
   
   Functional: ran the server against the crash log shown in the new guide
   and a NuttX ELF:
   
   ```
   tools/minidumpserver.py -e nuttx -l crash.log -a esp32s3 -p 12399
   ```
   
   and connected a GDB remote client. The register reply starts with
   0x42009cd8 and 0x00060820, matching the PC and PS values in the crash
   log.
   
   ## 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