GDB Debugging
Kernel Debugging
Debug the Redox kernel using GDB with QEMU’s remote debugging protocol.Start QEMU with GDB support
-d cpu_reset -s -S, which:- Logs CPU resets
- Opens a GDB server on port 1234
- Waits for GDB to connect before starting
Connect GDB
Debug
Userspace Debugging
- GDB Direct (Not Recommended)
- GDB with gdbserver (Recommended)
Set the application file
Start QEMU with GDB
Connect userspace GDB
Advanced GDB Debugging
Debug with gdbgui (Interactive Web Interface)
Debug with gdbgui (Interactive Web Interface)
Build with debug symbols
Start QEMU with GDB
Launch gdbgui
Multi-arch Debugging
Multi-arch Debugging
QEMU Debugging Options
Serial Output and Debugging Console
- Serial Console (Default)
- Debug Console Only
- Serial with Logfile
Graphics and Display Options
CPU and Performance Options
- KVM Acceleration
- CPU Configuration
- IOMMU
-enable-kvm -cpu host.
On macOS with ARM, this uses -accel hvf -cpu max.Disk and Storage Options
Network Debugging
- Network Packet Capture
- Port Forwarding
- Network Adapters
- Bridge Networking
build/<arch>/<config>/network.pcap.View with Wireshark:Logging and Error Collection
Capture All Output
Capture both stdout and stderr to a log file:Build System Logging
Enable verbose logging during builds:Architecture-Specific Debugging
- x86_64
- i586
- aarch64
- riscv64gc
-device isa-debug-exit (exit code: 51 = success, 53 = failure).Common Debugging Scenarios
Debugging Boot Issues
Debugging Boot Issues
Use serial console
Check bootloader
Try different boot methods
Debugging Network Issues
Debugging Network Issues
Enable packet capture
build/network.pcap.Analyze with Wireshark
Test connectivity
Debugging Driver Issues
Debugging Driver Issues
Build driver with debug symbols
Update initfs
Run with serial logging
Debug with GDB
Debugging Filesystem Issues
Debugging Filesystem Issues
Mount the filesystem
build/<arch>/<config>/filesystem/.Check disk image
Unmount when done
Performance Profiling
QEMU Performance Options
Benchmarking
Run benchmarks on Redox:tests.toml configuration includes:
redox-testspackagebenchmarkspackage
Troubleshooting
GDB Won't Connect
GDB Won't Connect
Check QEMU is waiting
Verify port availability
Try manual connection
Serial Output Not Showing
Serial Output Not Showing
- Try
serial=yesexplicitly - Check if output is going to a logfile
- Verify QEMU version compatibility
QEMU Performance Issues
QEMU Performance Issues
- Enable KVM:
make qemu kvm=yes - Reduce SMP:
make qemu QEMU_SMP=1 - Use lighter GPU:
make qemu gpu=no - Disable audio:
make qemu audio=no