-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.sh
More file actions
executable file
·66 lines (63 loc) · 1.84 KB
/
debug.sh
File metadata and controls
executable file
·66 lines (63 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# Requiem Debug Script
echo "🔍 Requiem Debug Tool"
echo "===================="
case "$1" in
"run")
echo "Running in debug mode with logging..."
RUST_LOG=debug RUST_BACKTRACE=1 cargo run
;;
"check")
echo "Checking for errors..."
cargo check --all-targets
;;
"test")
echo "Running tests..."
cargo test -- --nocapture
;;
"clean")
echo "Cleaning build artifacts..."
cargo clean
;;
"build")
echo "Building debug version..."
cargo build
;;
"trace")
echo "Running with full trace logging..."
RUST_LOG=trace RUST_BACKTRACE=full cargo run
;;
"mem")
echo "Checking memory usage..."
if command -v heaptrack &> /dev/null; then
cargo build
heaptrack ./target/debug/requiem
else
echo "heaptrack not found. Install with: sudo pacman -S heaptrack"
fi
;;
"perf")
echo "Running performance profiler..."
if command -v perf &> /dev/null; then
cargo build --release
perf record -g ./target/release/requiem
perf report
else
echo "perf not found. Install with: sudo pacman -S perf"
fi
;;
*)
echo "Usage: $0 {run|check|test|clean|build|trace|mem|perf}"
echo ""
echo "Commands:"
echo " run - Run with debug logging"
echo " check - Check code for errors"
echo " test - Run tests"
echo " clean - Clean build artifacts"
echo " build - Build debug version"
echo " trace - Run with trace-level logging"
echo " mem - Memory profiling (requires heaptrack)"
echo " perf - Performance profiling (requires perf)"
exit 1
;;
esac