anjiahao1 opened a new pull request, #22533:
URL: https://github.com/apache/nuttx/pull/22533
## Summary
Add CFI directives to the ARMv7-R and ARMv8-R exception vectors.
The exception entry points set fp to zero and have no debug frame at
all, so an unwinder stops at the first handler frame. Set fp to the
xcptcontext pointer that is passed to the handler, and annotate the
vector bodies with .cfi_startproc / .cfi_def_cfa / .cfi_offset /
.cfi_endproc. The .cfi_offset records tell the unwinder where PC, SP
and LR are stored inside the exception frame, so gdb and the software
backtrace can unwind through the exception context.
Applied to the data abort, prefetch abort, undefined instruction and
FIQ vectors in both arch/arm/src/armv7-r/arm_vectors.S and
arch/arm/src/armv8-r/arm_vectors.S.
## Impact
* Is new feature added? NO - debug information for existing code.
* Impact on user: NO
* Impact on build: NO - the directives only emit .debug_frame;
the instruction stream is unchanged apart from fp now holding the
xcptcontext pointer instead of zero while the handler runs.
* 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 13.3.
```
tools/configure.sh -a <apps> qemu-armv7r:nsh
make -j$(nproc)
tools/configure.sh -E -a <apps> qemu-armv8r-aarch32:nsh
make -j$(nproc)
```
Both builds complete (nuttx + nuttx.hex/nuttx.bin generated). The
assembler accepts the CFI directives on both architectures; the FIQ
vector in armv8-r, whose HIPRI-disabled branch does not return, is
assembled the same way.
## 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]