hujun260 opened a new pull request, #21631:
URL: https://github.com/apache/nuttx/pull/21631
# NuttX PR Description
## Title
arm64: add CFI debug frames and use generic high-priority interrupts
## Description
This PR improves ARM64 interrupt debugging and replaces an ARM64-specific
Kconfig symbol with the generic high-priority interrupt configuration.
## Changes
1. **arch/arm64: Add CFI information to the exception vector code**
- Add Call Frame Information (CFI) directives to the ARM64 vector and
vector
table assembly code.
- Generate `.debug_frame` information for exception and interrupt
handlers.
- Enable GDB to unwind the stack and backtrace from IRQ and SVC handlers
to
the interrupted user thread.
- Reuse the saved `r19` value and use `r19` to preserve the stack pointer
during handler processing.
2. **arm64: Replace `CONFIG_ARM64_DECODEFIQ` with
`CONFIG_ARCH_HIPRI_INTERRUPT`**
- Replace the ARM64-private Kconfig symbol with the generic
`CONFIG_ARCH_HIPRI_INTERRUPT` symbol.
- Update all affected ARM64 interrupt, startup, initialization, and vector
code.
- Update the i.MX9 Kconfig configuration.
- Remove the redundant `CONFIG_ARM64_DECODEFIQ` Kconfig entry.
- Update the QEMU ARM64 `nsh_fiq` defconfig.
## Motivation
Provide reliable GDB backtraces through ARM64 interrupt and supervisor-call
handlers, while eliminating a redundant architecture-specific Kconfig symbol
in favor of the generic high-priority interrupt configuration.
## Testing
- [ ] Compile-tested
- [ ] Runtime-tested
- [ ] GDB backtrace tested from IRQ/SVC handler to user thread
### Example expected output
The following is an example of the expected GDB output after the changes. It
is illustrative only and must be replaced with actual captured output before
marking the GDB test as complete:
```text
(gdb) target remote :7775
Remote debugging using :7775
(gdb) continue
Program received signal SIGTRAP, Trace/breakpoint trap.
0x0000000040xxxxxx in arm64_irq_handler ()
(gdb) bt
#0 arm64_irq_handler () at arch/arm64/src/common/arm64_vectors.S:xxx
#1 0x0000000040xxxxxx in arm64_irq_dispatch ()
#2 0x0000000040xxxxxx in up_doirq ()
#3 0x0000000040xxxxxx in user_thread_entry ()
(gdb) info frame
Stack level 0, frame at 0x00000000xxxxxxxx:
rip = 0x0000000040xxxxxx in arm64_irq_handler;
saved registers: x19, x29, x30
(gdb) continue
Continuing.
```
The expected result is that GDB can unwind from the IRQ or SVC exception
vector
through the interrupt handler and recover the interrupted user-thread frame.
--
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]