Initial commit
This commit is contained in:
45
srcs/RobotNet10/RobotApp/Communication/CeresSharp.Test/debug_with_gdb.sh
Executable file
45
srcs/RobotNet10/RobotApp/Communication/CeresSharp.Test/debug_with_gdb.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
# Script to debug crash with gdb
|
||||
# Usage: ./debug_with_gdb.sh
|
||||
|
||||
set -e
|
||||
|
||||
export LD_LIBRARY_PATH=/usr/local/lib:/home/robotics/anhnv/RobotNet10/ipc/CeresWrapper/install/lib:$LD_LIBRARY_PATH
|
||||
|
||||
echo "=== Starting GDB Debug Session ==="
|
||||
echo "This will run tests under gdb and capture crash information"
|
||||
echo ""
|
||||
|
||||
# Create gdb script
|
||||
cat > /tmp/gdb_script.txt << 'EOF'
|
||||
set confirm off
|
||||
set pagination off
|
||||
handle SIGSEGV stop print
|
||||
handle SIGABRT stop print
|
||||
run
|
||||
bt
|
||||
info registers
|
||||
info threads
|
||||
thread apply all bt
|
||||
x/20i $pc
|
||||
info proc mappings
|
||||
quit
|
||||
EOF
|
||||
|
||||
# Run with gdb
|
||||
gdb --batch -x /tmp/gdb_script.txt --args dotnet test 2>&1 | tee /tmp/gdb_output.txt
|
||||
|
||||
echo ""
|
||||
echo "=== GDB Output saved to /tmp/gdb_output.txt ==="
|
||||
echo "=== Analyzing crash location ==="
|
||||
|
||||
# Extract crash information
|
||||
if grep -q "Program received signal" /tmp/gdb_output.txt; then
|
||||
echo "Crash detected! Analyzing..."
|
||||
grep -A 20 "Program received signal" /tmp/gdb_output.txt
|
||||
echo ""
|
||||
echo "=== Backtrace ==="
|
||||
grep -A 30 "#0" /tmp/gdb_output.txt | head -40
|
||||
else
|
||||
echo "No crash detected in this run"
|
||||
fi
|
||||
Reference in New Issue
Block a user