aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2015-01-28 17:08:29 +0000
committerBart Polot <bart@net.in.tum.de>2015-01-28 17:08:29 +0000
commitefd795756b2106dd595a7124cb505e2c531c1380 (patch)
tree5ab2502aa3505d60e2f73546975fd8696745c758
parentfe5beb35e711881e1e8466105584c749a3ed2b69 (diff)
downloadgnunet-efd795756b2106dd595a7124cb505e2c531c1380.tar.gz
gnunet-efd795756b2106dd595a7124cb505e2c531c1380.zip
- debug script to all gdb with the correct core file and executable path
-rwxr-xr-xcontrib/debug36
1 files changed, 36 insertions, 0 deletions
diff --git a/contrib/debug b/contrib/debug
new file mode 100755
index 000000000..6b34eccf3
--- /dev/null
+++ b/contrib/debug
@@ -0,0 +1,36 @@
1#!/bin/bash
2
3COREPID=$1
4
5COREFILES=`ls -1 *core.$COREPID* 2>/dev/null | wc -l`
6COREFILE=`ls -1 *core.$COREPID* 2>/dev/null | head -n 1`
7
8if [ $COREFILES -gt 1 ]; then
9 echo "Multiple files, using $COREFILE"
10fi
11
12
13if [ $COREFILES -eq 0 ]; then
14 SERVICENAME=$1
15 COREFILES=`ls -1 core.*.*$SERVICENAME 2>/dev/null | wc -l`
16 COREFILE=`ls -1 core.*.*$SERVICENAME 2>/dev/null | head -n 1`
17
18 if [ $COREFILES -gt 1 ]; then
19 echo "Multiple files, using $COREFILE"
20 fi
21fi
22
23if [ $COREFILES -eq 0 ]; then
24 echo "Core file for $1 not found"
25 exit 1
26fi
27
28echo "Using $COREFILE"
29
30EXECPATH=${COREFILE#*!}
31EXECPATH=`echo $EXECPATH | sed -e 's/!/\//g'`
32echo $EXECPATH
33echo ""
34echo ""
35
36gdb --core $COREFILE /$EXECPATH