anjiahao1 opened a new pull request, #17894:
URL: https://github.com/apache/nuttx/pull/17894
## Summary
* Why change is necessary (fix, update, new feature)?
These changes enhance gdbserver tool for improved debugging capabilities:
- Fix unexpected thread values (fix)
- Improve performance by using LIEF for symbol loading (update)
- Add x86_64 architecture support (new feature)
- Improve debugging with additional log information (update)
- Fix compatibility with VSCode (fix)
* What functional part of code is being changed?
tools/gdbserver/gdbserver.py
* How does the change exactly work (what will change and how)?
- Fixed thread ID handling to ensure thread < 0 is set to 0
- Replaced symbol loading mechanism to use LIEF inside pyelftools,
significantly reducing load time for large ELF files
- Added x86_64 architecture support to enable crash analysis for x86_64
targets
- Added unpack_data logging for better debugging visibility
- Fixed command parsing to work correctly with VSCode's debugger (c
command should cut from [2:)
* Related [NuttX Issue](https://github.com/apache/nuttx/issues) reference
if applicable.
N/A
* Related NuttX Apps [Issue](https://github.com/apache/nuttx-apps/issues)
/ [Pull Request](https://github.com/apache/nuttx-apps/pulls) reference if
applicable.
N/A
## Impact
* Is new feature added? Is existing feature changed? YES
- Added x86_64 architecture support
- Improved symbol loading performance
- Enhanced debugging capabilities with additional logging
* Impact on user (will user need to adapt to change)? NO
These are improvements to the gdbserver tool with backward compatibility
maintained.
* Impact on build (will build process change)? NO
No changes to the build process.
* Impact on hardware (will arch(s) / board(s) / driver(s) change)? NO
This is a host-side debugging tool enhancement.
* Impact on documentation (is update required / provided)? NO
Tool documentation update not required for these internal improvements.
* Impact on security (any sort of implications)? NO
* Impact on compatibility (backward/forward/interoperability)? YES
Improved VSCode compatibility through command parsing fix.
* Anything else to consider or add?
The performance improvement is significant: symbol loading time reduced
from 32s to 2s for a 273MB ELF file.
## Testing
I confirm that changes are verified on local setup and works as intended:
* Build Host(s): Linux, x86_64
* Target(s): N/A (host-side debugging tool)
* Tested x86_64 symbol loading on a 273MB ELF file with significant
performance improvement (32s → 2s)
* Verified thread ID handling fix prevents unexpected values
* Verified VSCode compatibility improvements
Testing logs after change:
```
Example test with 273MB ELF file:
Before: Symbol loading took 32 seconds
After: Symbol loading took 2 seconds using LIEF
Thread ID handling:
Confirmed thread < 0 is properly set to 0
VSCode compatibility:
Confirmed c command parsing works correctly with VSCode debugger
```
## PR verification Self-Check
* [x] This PR introduces only one functional change.
* [x] I have updated all required description fields above.
* [x] My PR adheres to Contributing
[Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md) and
[Documentation](https://nuttx.apache.org/docs/latest/contributing/index.html)
(git commit title and message, coding standard, etc).
* [ ] 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]