-
Notifications
You must be signed in to change notification settings - Fork 15
Debugging
Vinod Sathyaseelan edited this page Aug 14, 2025
·
4 revisions
This guide covers debugging techniques for Ripple development, including IDE setup, logging configuration, and troubleshooting strategies.
-
Prerequisites
- Install CodeLLDB extension
- Configure launch.json (if not already present)
-
Basic Debug Configuration
{ "version": "0.2.0", "configurations": [ { "type": "lldb", "request": "launch", "name": "Debug Ripple", "cargo": { "args": ["build"], "filter": { "name": "ripple", "kind": "bin" } }, "args": [], "cwd": "${workspaceFolder}" } ] } -
Starting a Debug Session
- Open
core/main/main.rs - Set breakpoints by clicking the gutter or pressing F9
- Press F5 or click Debug → Start Debugging
- Open
-
Debug Features
- Step Through (F11)
- Step Over (F10)
- Step Out (Shift+F11)
- Continue (F5)
- Variables and Watch windows
- Call Stack view
- Breakpoint conditions
Ripple uses the following log levels:
- ERROR: Failures requiring immediate attention
- WARN: Potential issues or unexpected states
- INFO: Important state changes
- DEBUG: Detailed information for development
- TRACE: Fine-grained execution flow
-
Environment Variables
# Set log level for all components export RUST_LOG=debug # Component-specific logging export RUST_LOG=ripple=debug,broker=trace
-
Log File Output
# Log to file ripple run <device-ip> 2> ripple.log # Log to both console and file ripple run <device-ip> 2>&1 | tee ripple.log
- Check extension paths in manifest
- Verify library file permissions
- Monitor debug logs for loading sequence
- Set breakpoints in extension initialization
- Enable TRACE logging for broker components
- Monitor WebSocket traffic
- Verify message routing in EndpointBroker
- Check Thunder broker connections
- Set log level to DEBUG for rule evaluation
- Inspect JQ rule inputs and outputs
- Use breakpoints in rule application logic
- Verify rule file paths and content
-
Workspace Setup
- Start Ripple from VS Code for consistent paths
- Use workspace-relative paths in configurations
- Keep debug symbols in development builds
-
Efficient Debugging
- Use conditional breakpoints for specific cases
- Leverage watch expressions for complex conditions
- Set function breakpoints for event handlers
- Use logpoints for non-breaking trace output
-
Log Management
- Rotate log files to manage size
- Use structured logging for easier parsing
- Include context in log messages
- Clean up old log files regularly
-
Missing Symbols
- Ensure debug symbols are enabled in Cargo.toml
- Verify correct build profile is used
- Check LLDB path configuration
-
Path-Related Errors
- Launch from workspace root
- Check manifest paths
- Verify extension locations
-
Connection Issues
- Check device network connectivity
- Verify WebSocket endpoints
- Monitor connection logs
-
Build Optimization
- Use debug builds for development
- Enable incremental compilation
- Configure appropriate optimization levels
-
Tool Performance
- Limit breakpoint count
- Use conditional breakpoints judiciously
- Profile debug sessions
- VS Code Debugging Documentation
- LLDB Tutorial
- Architecture for component relationships
- Testing for integration with test frameworks
© 2025 RDK Management, LLC (and contributors). Firebolt® is a registered mark of its owner.