debug: add scripts to help debug FW crashes on HW and on qemu#10583
debug: add scripts to help debug FW crashes on HW and on qemu#10583lgirdwood wants to merge 4 commits intothesofproject:mainfrom
Conversation
lgirdwood
commented
Feb 27, 2026
This allows CI to unblock and proceed to check results. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add a helper to assist in debugging FW crashes. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Utility to help with developer, CI, AI usage. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
There was a problem hiding this comment.
Pull request overview
This pull request adds debugging tools to help analyze firmware crashes on hardware and QEMU environments. The PR introduces automated scripts that run QEMU tests, monitor for crashes, and decode crash dumps into human-readable format with source code context.
Changes:
- Added automated QEMU test runner (
sof-qemu-run.py) that monitors test execution, detects crashes, and automatically invokes crash analysis - Added crash dump decoder (
sof-crash-decode.py) that parses Xtensa/Zephyr crash dumps, correlates register values and backtraces to source code using objdump - Added QEMU exit mechanism to cleanly terminate tests after completion in CI environments
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/sof-qemu-run.sh | Bash wrapper script that sets up the virtual environment and invokes the Python QEMU runner |
| scripts/sof-qemu-run.py | Python script that spawns QEMU via west, monitors output for crashes, and triggers crash decoding |
| scripts/sof-crash-decode.py | Python script that parses crash dumps, decodes registers/backtraces, and maps addresses to source code |
| app/src/main.c | Added inline assembly function to cleanly exit QEMU using simcall after boot tests complete |
| app/boards/qemu_xtensa_dc233c_mmu.conf | Enabled CONFIG_REBOOT for QEMU shutdown support |
| app/boards/qemu_xtensa_dc233c.conf | Enabled CONFIG_REBOOT for QEMU shutdown support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| print(f"Starting QEMU test runner. Monitoring for crashes (Build Dir: {args.build_dir})...") | ||
|
|
||
| # We will use pexpect to spawn the west command to get PTY features | ||
| import shutil |
There was a problem hiding this comment.
The shutil module is imported inside the main() function on line 87, but it's only used once. For better readability and consistency with other imports, consider moving it to the top of the file with the other imports.
| # SPDX-License-Identifier: BSD-3-Clause | ||
| # Copyright(c) 2024 Intel Corporation. All rights reserved. | ||
| """ | ||
| decode_crash.py - Zephyr Xtensa Crash Dump Decoder |
There was a problem hiding this comment.
The docstring on line 5 refers to the script as "decode_crash.py", but the actual filename is "sof-crash-decode.py". Update the docstring to match the actual filename.
Apply changes from review. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Liam Girdwood <lgirdwood@gmail.com>