2.0 KiB
2.0 KiB
Example: Complete Debugging Session
Problem: Test fails with "Symbol not found: OBJC_CLASS$_WKWebView"
Phase 1: Investigation
-
Read error: Symbol not found, linking issue
-
Internet research:
Dispatch hyperpowers:internet-researcher: "Search for 'dyld Symbol not found _OBJC_CLASS_$_WKWebView' Focus on: Xcode linking, framework configuration, iOS deployment" Results: Need to link WebKit framework in Xcode project -
Debugger: Not needed, linking happens before runtime
-
Codebase investigation:
Dispatch hyperpowers:codebase-investigator: "Find other code using WKWebView - how is WebKit linked?" Results: Main app target has WebKit in frameworks, test target doesn't
Phase 2: Analysis
Root cause: Test target doesn't link WebKit framework Evidence: Main target works, test target fails, Stack Overflow confirms
Phase 3: Testing
Hypothesis: Adding WebKit to test target will fix it
Minimal test:
- Add WebKit.framework to test target
- Clean build
- Run tests
Dispatch hyperpowers:test-runner: "Run: swift test"
Result: ✓ All tests pass
Phase 4: Implementation
- Test already exists (the failing test)
- Fix: Framework linked
- Verification: Tests pass
- Update bd:
bd close bd-123
Time: 15 minutes systematic vs. 2+ hours guessing
Remember
- Tools make debugging faster, not slower
- hyperpowers:internet-researcher can find solutions in seconds
- Automated debugging works - lldb batch mode, strace, instrumentation
- hyperpowers:codebase-investigator finds patterns you'd miss
- hyperpowers:test-runner agent keeps context clean
- Evidence before fixes, always
Prefer automated tools:
- lldb batch mode - non-interactive variable inspection
- strace/dtrace - system call tracing
- Instrumentation - logging Claude can add
- Interactive debugger - only when automated tools insufficient
95% faster to investigate systematically than to guess-and-check.